From e792e7f631f1d2b214dbe5be5522eefc67dcddeb Mon Sep 17 00:00:00 2001 From: Andrew Date: Mon, 27 Jun 2022 03:15:21 +0300 Subject: [PATCH] Fullscreen, status bar hiding, chat input following the theme (#67987) * Initial commit * input is colored according to the theme * removed unused setting --- code/__DEFINES/colors.dm | 3 --- code/controllers/subsystem/input.dm | 2 +- code/modules/client/client_defines.dm | 5 ++++ code/modules/client/client_procs.dm | 39 +++++++++++++++++++++++---- code/modules/keybindings/setup.dm | 5 ---- interface/skin.dmf | 10 +++---- tgui/packages/tgui-panel/themes.js | 4 +++ 7 files changed, 48 insertions(+), 20 deletions(-) diff --git a/code/__DEFINES/colors.dm b/code/__DEFINES/colors.dm index 261ff54fee5..98691e99546 100644 --- a/code/__DEFINES/colors.dm +++ b/code/__DEFINES/colors.dm @@ -12,9 +12,6 @@ ///how many colour priority levels there are. #define COLOUR_PRIORITY_AMOUNT 4 -#define COLOR_INPUT_DISABLED "#F0F0F0" -#define COLOR_INPUT_ENABLED "#D3B5B5" - #define COLOR_DARKMODE_BACKGROUND "#202020" #define COLOR_DARKMODE_DARKBACKGROUND "#171717" #define COLOR_DARKMODE_TEXT "#a4bad6" diff --git a/code/controllers/subsystem/input.dm b/code/controllers/subsystem/input.dm index 246ab84768a..0b80692ffbc 100644 --- a/code/controllers/subsystem/input.dm +++ b/code/controllers/subsystem/input.dm @@ -24,7 +24,7 @@ SUBSYSTEM_DEF(input) "Any" = "\"KeyDown \[\[*\]\]\"", "Any+UP" = "\"KeyUp \[\[*\]\]\"", "Back" = "\".winset \\\"input.text=\\\"\\\"\\\"\"", - "Tab" = "\".winset \\\"input.focus=true?map.focus=true input.background-color=[COLOR_INPUT_DISABLED]:input.focus=true input.background-color=[COLOR_INPUT_ENABLED]\\\"\"", + "Tab" = "\".winset \\\"input.focus=true?map.focus=true:input.focus=true\\\"\"", "Escape" = "Reset-Held-Keys", ) diff --git a/code/modules/client/client_defines.dm b/code/modules/client/client_defines.dm index 1edac7e630c..6a9a867a080 100644 --- a/code/modules/client/client_defines.dm +++ b/code/modules/client/client_defines.dm @@ -175,6 +175,11 @@ /// Messages currently seen by this client var/list/seen_messages + //Hide top bars + var/fullscreen = FALSE + //Hide status bar (bottom left) + var/show_status_bar = TRUE + /// datum wrapper for client view var/datum/view_data/view_size diff --git a/code/modules/client/client_procs.dm b/code/modules/client/client_procs.dm index a725fc52360..d7e4a1758d6 100644 --- a/code/modules/client/client_procs.dm +++ b/code/modules/client/client_procs.dm @@ -932,12 +932,10 @@ GLOBAL_LIST_INIT(blacklisted_builds, list( if (hotkeys) // If hotkey mode is enabled, then clicking the map will automatically - // unfocus the text bar. This removes the red color from the text bar - // so that the visual focus indicator matches reality. - winset(src, null, "input.background-color=[COLOR_INPUT_DISABLED]") - + // unfocus the text bar. + winset(src, null, "input.focus=false") else - winset(src, null, "input.focus=true input.background-color=[COLOR_INPUT_ENABLED]") + winset(src, null, "input.focus=true") SEND_SIGNAL(src, COMSIG_CLIENT_CLICK, object, location, control, params, usr) @@ -1220,3 +1218,34 @@ GLOBAL_LIST_INIT(blacklisted_builds, list( SEND_SOUND(usr, sound(null)) tgui_panel?.stop_music() SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Stop Self Sounds")) + +/client/verb/toggle_fullscreen() + set name = "Toggle Fullscreen" + set category = "OOC" + + fullscreen = !fullscreen + + if (fullscreen) + winset(usr, "mainwindow", "on-size=") + winset(usr, "mainwindow", "titlebar=false") + winset(usr, "mainwindow", "can-resize=false") + winset(usr, "mainwindow", "menu=") + winset(usr, "mainwindow", "is-maximized=false") + winset(usr, "mainwindow", "is-maximized=true") + else + winset(usr, "mainwindow", "menu=menu") + winset(usr, "mainwindow", "titlebar=true") + winset(usr, "mainwindow", "can-resize=true") + winset(usr, "mainwindow", "is-maximized=false") + winset(usr, "mainwindow", "on-size=attempt_auto_fit_viewport") + +/client/verb/toggle_status_bar() + set name = "Toggle Status Bar" + set category = "OOC" + + show_status_bar = !show_status_bar + + if (show_status_bar) + winset(usr, "mapwindow.status_bar", "is-visible=true") + else + winset(usr, "mapwindow.status_bar", "is-visible=false") diff --git a/code/modules/keybindings/setup.dm b/code/modules/keybindings/setup.dm index 79baf2e195c..bb2757761e0 100644 --- a/code/modules/keybindings/setup.dm +++ b/code/modules/keybindings/setup.dm @@ -38,9 +38,4 @@ window.mouse_event_macro_set = FALSE window.set_mouse_macro() - if(hotkeys) - winset(src, null, "input.focus=true input.background-color=[COLOR_INPUT_ENABLED]") - else - winset(src, null, "input.focus=true input.background-color=[COLOR_INPUT_DISABLED]") - update_special_keybinds() diff --git a/interface/skin.dmf b/interface/skin.dmf index dd7d8a3e91a..ae43a3c401b 100644 --- a/interface/skin.dmf +++ b/interface/skin.dmf @@ -221,14 +221,13 @@ window "outputwindow" size = 517x20 anchor1 = 0,100 anchor2 = 100,100 - background-color = #d3b5b5 is-default = true - border = sunken + border = line saved-params = "command" elem "oocbutton" type = BUTTON pos = 599,460 - size = 40x19 + size = 40x20 anchor1 = 100,100 anchor2 = -1,-1 background-color = none @@ -241,7 +240,7 @@ window "outputwindow" elem "saybutton" type = BUTTON pos = 519,460 - size = 40x19 + size = 40x20 anchor1 = 100,100 anchor2 = -1,-1 background-color = none @@ -254,7 +253,7 @@ window "outputwindow" elem "mebutton" type = BUTTON pos = 559,460 - size = 40x19 + size = 40x20 anchor1 = 100,100 anchor2 = -1,-1 background-color = none @@ -270,7 +269,6 @@ window "outputwindow" size = 640x456 anchor1 = 0,0 anchor2 = 100,100 - background-color = #ffffff is-visible = false is-disabled = true saved-params = "" diff --git a/tgui/packages/tgui-panel/themes.js b/tgui/packages/tgui-panel/themes.js index 1cf066d81f6..63fb2774849 100644 --- a/tgui/packages/tgui-panel/themes.js +++ b/tgui/packages/tgui-panel/themes.js @@ -79,6 +79,8 @@ export const setClientTheme = (name) => { 'asset_cache_browser.text-color': '#000000', 'tooltip.background-color': 'none', 'tooltip.text-color': '#000000', + 'input.background-color': '#FFFFFF', + 'input.text-color': '#000000', }); } if (name === 'dark') { @@ -129,6 +131,8 @@ export const setClientTheme = (name) => { 'asset_cache_browser.text-color': COLOR_DARK_TEXT, 'tooltip.background-color': COLOR_DARK_BG, 'tooltip.text-color': COLOR_DARK_TEXT, + 'input.background-color': COLOR_DARK_BG_DARKER, + 'input.text-color': COLOR_DARK_TEXT, }); } };