diff --git a/code/modules/client/preference_setup/global/01_ui.dm b/code/modules/client/preference_setup/global/01_ui.dm index a40155d2d5..4bb05121e1 100644 --- a/code/modules/client/preference_setup/global/01_ui.dm +++ b/code/modules/client/preference_setup/global/01_ui.dm @@ -9,6 +9,8 @@ S["ooccolor"] >> pref.ooccolor S["tooltipstyle"] >> pref.tooltipstyle S["client_fps"] >> pref.client_fps + S["tgui_fancy"] >> pref.tgui_fancy + S["tgui_lock"] >> pref.tgui_lock /datum/category_item/player_setup_item/player_global/ui/save_preferences(var/savefile/S) S["UI_style"] << pref.UI_style @@ -17,6 +19,8 @@ S["ooccolor"] << pref.ooccolor S["tooltipstyle"] << pref.tooltipstyle S["client_fps"] << pref.client_fps + S["tgui_fancy"] << pref.tgui_fancy + S["tgui_lock"] << pref.tgui_lock /datum/category_item/player_setup_item/player_global/ui/sanitize_preferences() pref.UI_style = sanitize_inlist(pref.UI_style, all_ui_styles, initial(pref.UI_style)) @@ -25,20 +29,24 @@ pref.ooccolor = sanitize_hexcolor(pref.ooccolor, initial(pref.ooccolor)) pref.tooltipstyle = sanitize_inlist(pref.tooltipstyle, all_tooltip_styles, initial(pref.tooltipstyle)) pref.client_fps = sanitize_integer(pref.client_fps, 0, MAX_CLIENT_FPS, initial(pref.client_fps)) + pref.tgui_fancy = sanitize_integer(pref.tgui_fancy, 0, 1, initial(pref.tgui_fancy)) + pref.tgui_lock = sanitize_integer(pref.tgui_lock, 0, 1, initial(pref.tgui_lock)) /datum/category_item/player_setup_item/player_global/ui/content(var/mob/user) . = "UI Style: [pref.UI_style]
" . += "Custom UI (recommended for White UI):
" - . += "-Color: [pref.UI_style_color] [color_square(hex = pref.UI_style_color)] reset
" - . += "-Alpha(transparency): [pref.UI_style_alpha] reset
" + . += "-Color: [pref.UI_style_color]�[color_square(hex = pref.UI_style_color)]�reset
" + . += "-Alpha(transparency): [pref.UI_style_alpha]�reset
" . += "Tooltip Style: [pref.tooltipstyle]
" . += "Client FPS: [pref.client_fps]
" + . += "tgui Window Mode: [(pref.tgui_fancy) ? "Fancy (default)" : "Compatible (slower)"]
" + . += "tgui Window Placement: [(pref.tgui_lock) ? "Primary Monitor" : "Free (default)"]
" if(can_select_ooc_color(user)) - . += "OOC Color: " + . += "OOC Color:�" if(pref.ooccolor == initial(pref.ooccolor)) . += "Using Default
" else - . += "[pref.ooccolor] [color_square(hex = pref.ooccolor)] reset
" + . += "[pref.ooccolor] [color_square(hex = pref.ooccolor)]�reset
" /datum/category_item/player_setup_item/player_global/ui/OnTopic(var/href,var/list/href_list, var/mob/user) if(href_list["select_style"]) @@ -80,6 +88,14 @@ pref.client.fps = fps_new return TOPIC_REFRESH + else if(href_list["tgui_fancy"]) + pref.tgui_fancy = !pref.tgui_fancy + return TOPIC_REFRESH + + else if(href_list["tgui_lock"]) + pref.tgui_lock = !pref.tgui_lock + return TOPIC_REFRESH + else if(href_list["reset"]) switch(href_list["reset"]) if("ui") diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index 1c1e1fc44b..9032771739 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -24,6 +24,9 @@ datum/preferences var/tooltipstyle = "Midnight" //Style for popup tooltips var/client_fps = 0 + var/tgui_fancy = TRUE + var/tgui_lock = FALSE + //character preferences var/real_name //our character's name var/be_random_name = 0 //whether we are a random name every round diff --git a/code/modules/tgui/tgui.dm b/code/modules/tgui/tgui.dm index ee256287cb..3bcb548e77 100644 --- a/code/modules/tgui/tgui.dm +++ b/code/modules/tgui/tgui.dm @@ -203,8 +203,8 @@ "window" = list( "key" = window_key, "size" = window_size, - "fancy" = FALSE, // user.client.prefs.tgui_fancy, - "locked" = FALSE, // user.client.prefs.tgui_lock, + "fancy" = user.client.prefs.tgui_fancy, + "locked" = user.client.prefs.tgui_lock, ), "user" = list( "name" = "[user]", @@ -290,8 +290,14 @@ SStgui.update_uis(src_object) return FALSE switch(type) - if("ready", "pingReady") + if("ready") initialized = TRUE + if("pingReply") + initialized = TRUE + if("suspend") + close(can_be_suspended = TRUE) + if("close") + close(can_be_suspended = FALSE) if("log") if(href_list["fatal"]) close(can_be_suspended = FALSE) diff --git a/code/modules/tgui/tgui_window.dm b/code/modules/tgui/tgui_window.dm index 4d3265ae29..d5db1793f9 100644 --- a/code/modules/tgui/tgui_window.dm +++ b/code/modules/tgui/tgui_window.dm @@ -47,10 +47,10 @@ // Build window options var/options = "file=[id].html;can_minimize=0;auto_format=0;" // Remove titlebar and resize handles for a fancy window - // if(client.prefs.tgui_fancy) - // options += "titlebar=0;can_resize=0;" - // else - options += "titlebar=1;can_resize=1;" + if(client.prefs.tgui_fancy) + options += "titlebar=0;can_resize=0;" + else + options += "titlebar=1;can_resize=1;" // Generate page html // TODO: Make this static var/html = SStgui.basehtml