From bc91442dc4441c4489a45db9d0d5a1c6e1972fde Mon Sep 17 00:00:00 2001 From: MrMelbert <51863163+MrMelbert@users.noreply.github.com> Date: Fri, 26 Sep 2025 15:04:19 -0500 Subject: [PATCH] Adds hotkey to close all UIs (#93049) --- code/__DEFINES/keybinding.dm | 1 + code/datums/keybinding/client.dm | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/code/__DEFINES/keybinding.dm b/code/__DEFINES/keybinding.dm index 643485b9b32..fde4dbdf268 100644 --- a/code/__DEFINES/keybinding.dm +++ b/code/__DEFINES/keybinding.dm @@ -28,6 +28,7 @@ #define COMSIG_KB_CLIENT_SCREENSHOT_DOWN "keybinding_client_screenshot_down" #define COMSIG_KB_CLIENT_FULLSCREEN_DOWN "keybinding_client_fullscreen_down" #define COMSIG_KB_CLIENT_MINIMALHUD_DOWN "keybinding_client_minimalhud_down" +#define COMSIG_KB_CLIENT_CLOSEUI_DOWN "keybinding_client_closeui_down" //Communication diff --git a/code/datums/keybinding/client.dm b/code/datums/keybinding/client.dm index 49133f2f51c..85d10add309 100644 --- a/code/datums/keybinding/client.dm +++ b/code/datums/keybinding/client.dm @@ -59,3 +59,17 @@ return user.mob.button_pressed_F12() return TRUE + +/datum/keybinding/client/close_every_ui + hotkey_keys = list("Northwest") // HOME key + name = "close_every_ui" + full_name = "Close Open UIs" + description = "Closes all UI windows you have open." + keybind_signal = COMSIG_KB_CLIENT_CLOSEUI_DOWN + +/datum/keybinding/client/close_every_ui/down(client/user, turf/target) + . = ..() + if(.) + return + SStgui.close_user_uis(user.mob) + return TRUE