From eb98848a9f00668f9d0f0f7f83cb6d7b52f0890e Mon Sep 17 00:00:00 2001 From: LetterN <24603524+LetterN@users.noreply.github.com> Date: Sun, 14 Nov 2021 09:23:08 +0800 Subject: [PATCH] wires this code to the PROPER prefs --- code/game/objects/items.dm | 4 ++-- code/modules/client/preferences.dm | 9 ++++----- code/modules/client/preferences_savefile.dm | 4 +--- code/modules/client/verbs/etips.dm | 2 +- 4 files changed, 8 insertions(+), 11 deletions(-) diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index 855553c6e3..e25b4e7eb6 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -910,11 +910,11 @@ GLOBAL_VAR_INIT(embedpocalypse, FALSE) // if true, all items will be able to emb if(usr.client.prefs.enable_tips) var/timedelay = usr.client.prefs.tip_delay/100 usr.client.tip_timer = addtimer(CALLBACK(src, .proc/openTip, location, control, params, usr), timedelay, TIMER_STOPPABLE)//timer takes delay in deciseconds, but the pref is in milliseconds. dividing by 100 converts it. - if(usr.client.prefs.itemoutline_pref) + if(usr.client.prefs.outline_enabled) if(istype(L) && L.incapacitated()) apply_outline(COLOR_RED_GRAY) //if they're dead or handcuffed, let's show the outline as red to indicate that they can't interact with that right now else - apply_outline() //if the player's alive and well we send the command with no color set, so it uses the theme's color + apply_outline(usr.client.prefs.outline_color) //if the player's alive and well we send the command with no color set, so it uses the theme's color /obj/item/MouseDrop(atom/over, src_location, over_location, src_control, over_control, params) . = ..() diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index 7454b815a0..effbaae28f 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -51,7 +51,6 @@ GLOBAL_LIST_EMPTY(preferences_datums) var/ooccolor = "#c43b23" var/aooccolor = "#ce254f" var/enable_tips = TRUE - var/itemoutline_pref = TRUE var/tip_delay = 500 //tip delay in milliseconds //Antag preferences @@ -62,7 +61,7 @@ GLOBAL_LIST_EMPTY(preferences_datums) var/UI_style = null var/outline_enabled = TRUE - var/outline_color = COLOR_BLUE_GRAY + var/outline_color = COLOR_THEME_MIDNIGHT var/buttons_locked = FALSE var/hotkeys = FALSE @@ -786,7 +785,7 @@ GLOBAL_LIST_EMPTY(preferences_datums) dat += "

General Settings

" dat += "UI Style: [UI_style]
" dat += "Outline: [outline_enabled ? "Enabled" : "Disabled"]
" - dat += "Outline Color:     Change
" + dat += "Outline Color: [outline_color ? "" : "Theme-based (null)"]    Change
" dat += "tgui Monitors: [(tgui_lock) ? "Primary" : "All"]
" dat += "tgui Style: [(tgui_fancy) ? "Fancy" : "No Frills"]
" dat += "Show Runechat Chat Bubbles: [chat_on_map ? "Enabled" : "Disabled"]
" @@ -2740,8 +2739,8 @@ GLOBAL_LIST_EMPTY(preferences_datums) outline_enabled = !outline_enabled if("outline_color") var/pickedOutlineColor = input(user, "Choose your outline color.", "General Preference", outline_color) as color|null - if(pickedOutlineColor) - outline_color = pickedOutlineColor + if(pickedOutlineColor != pickedOutlineColor) + outline_color = pickedOutlineColor // nullable if("tgui_lock") tgui_lock = !tgui_lock if("winflash") diff --git a/code/modules/client/preferences_savefile.dm b/code/modules/client/preferences_savefile.dm index d4a96639df..141775de16 100644 --- a/code/modules/client/preferences_savefile.dm +++ b/code/modules/client/preferences_savefile.dm @@ -47,7 +47,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car addtimer(CALLBACK(src, .proc/force_reset_keybindings), 30) //No mob available when this is run, timer allows user choice. if(current_version < 30) outline_enabled = TRUE - outline_color = COLOR_BLUE_GRAY + outline_color = COLOR_THEME_MIDNIGHT /datum/preferences/proc/update_character(current_version, savefile/S) if(current_version < 19) @@ -416,7 +416,6 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car S["hud_toggle_color"] >> hud_toggle_color S["menuoptions"] >> menuoptions S["enable_tips"] >> enable_tips - S["itemoutline_pref"] >> itemoutline_pref S["tip_delay"] >> tip_delay S["pda_style"] >> pda_style S["pda_color"] >> pda_color @@ -592,7 +591,6 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car WRITE_FILE(S["hud_toggle_color"], hud_toggle_color) WRITE_FILE(S["menuoptions"], menuoptions) WRITE_FILE(S["enable_tips"], enable_tips) - WRITE_FILE(S["itemoutline_pref"], itemoutline_pref) WRITE_FILE(S["tip_delay"], tip_delay) WRITE_FILE(S["pda_style"], pda_style) WRITE_FILE(S["pda_color"], pda_color) diff --git a/code/modules/client/verbs/etips.dm b/code/modules/client/verbs/etips.dm index ce14bfdc6a..0d4437a4af 100644 --- a/code/modules/client/verbs/etips.dm +++ b/code/modules/client/verbs/etips.dm @@ -24,6 +24,6 @@ set desc = "Toggles hover-over item outline" set category = "Preferences" - prefs.itemoutline_pref = !prefs.itemoutline_pref + prefs.outline_enabled = !prefs.outline_enabled prefs.save_preferences() to_chat(usr, "Item outline [prefs.itemoutline_pref ? "en" : "dis"]abled.")