From 09ebd0fddf04f25f4508775e5f1e92aa222247b9 Mon Sep 17 00:00:00 2001 From: SandPoot Date: Sun, 19 Feb 2023 03:46:36 -0300 Subject: [PATCH 1/5] lizard content --- code/__DEFINES/screentips.dm | 2 +- code/__HELPERS/screentips.dm | 41 +++++++++--------- code/game/atoms.dm | 17 ++++---- code/modules/client/preferences.dm | 6 +++ code/modules/client/preferences_savefile.dm | 2 + icons/UI_Icons/screentips/cursor_hints.dmi | Bin 0 -> 468 bytes .../screentips/cursor_hints_outline.dmi | Bin 0 -> 490 bytes 7 files changed, 38 insertions(+), 30 deletions(-) create mode 100644 icons/UI_Icons/screentips/cursor_hints.dmi create mode 100644 icons/UI_Icons/screentips/cursor_hints_outline.dmi diff --git a/code/__DEFINES/screentips.dm b/code/__DEFINES/screentips.dm index a3b1018352..4918db85ce 100644 --- a/code/__DEFINES/screentips.dm +++ b/code/__DEFINES/screentips.dm @@ -32,4 +32,4 @@ #define SCREENTIP_PREFERENCE_CONTEXT_ONLY "Only with tips" /// Regardless of intent -#define INTENT_ANY "intent_any" +#define INTENT_ANY "any" diff --git a/code/__HELPERS/screentips.dm b/code/__HELPERS/screentips.dm index 967e1c3bb6..fc6673a006 100644 --- a/code/__HELPERS/screentips.dm +++ b/code/__HELPERS/screentips.dm @@ -1,31 +1,30 @@ +#define HINT_ICON_FILE 'icons/UI_Icons/screentips/cursor_hints.dmi' + // Generate intent icons -/// Help intent icon for screentip context -GLOBAL_DATUM_INIT(icon_intent_help, /image, image('icons/emoji.dmi', icon_state = INTENT_HELP)) -/// Disarm intent icon for screentip context -GLOBAL_DATUM_INIT(icon_intent_disarm, /image, image('icons/emoji.dmi', icon_state = INTENT_DISARM)) -/// Grab intent icon for screentip context -GLOBAL_DATUM_INIT(icon_intent_grab, /image, image('icons/emoji.dmi', icon_state = INTENT_GRAB)) -/// Harm intent icon for screentip context -GLOBAL_DATUM_INIT(icon_intent_harm, /image, image('icons/emoji.dmi', icon_state = INTENT_HARM)) +GLOBAL_LIST_INIT_TYPED(screentip_context_icons, /image, prepare_screentip_context_icons()) + +/proc/prepare_screentip_context_icons() + . = list() + for(var/state in icon_states(HINT_ICON_FILE)) + .[state] = image(HINT_ICON_FILE, icon_state = state) /* * # Builds context with each intent for this key * Args: * - context = list (REQUIRED) * - key = string (REQUIRED) + * - allow_image = boolean (not required) */ -/proc/build_context(list/context, key) +/proc/build_context(list/context, key, allow_image) var/list/to_add for(var/intent in context[key]) - switch(intent) - if(INTENT_HELP) - LAZYADD(to_add, "\icon[GLOB.icon_intent_help] [key]: [context[key][INTENT_HELP]]") - if(INTENT_DISARM) - LAZYADD(to_add, "\icon[GLOB.icon_intent_disarm] [key]: [context[key][INTENT_DISARM]]") - if(INTENT_GRAB) - LAZYADD(to_add, "\icon[GLOB.icon_intent_grab] [key]: [context[key][INTENT_GRAB]]") - if(INTENT_HARM) - LAZYADD(to_add, "\icon[GLOB.icon_intent_harm] [key]: [context[key][INTENT_HARM]]") - else // If you're adding intent-less YOU BETTER ADD IT FIRST IN THE LIST - LAZYADD(to_add, "[key]: [context[key][intent]]") - return english_list(to_add, "", " ", " ") + var/key_help = "[length(key) > 3 ? copytext(key, 1, -3) : ""]" + var/icon = "[copytext(key, -3)]-[intent]" + if(allow_image) + icon = "\icon[GLOB.screentip_context_icons[icon]]" + LAZYADD(to_add, "[key_help][icon]: [context[key][intent]]") + + var/separator = "[allow_image ? " " : " | "]" + return english_list(to_add, "", separator, separator) + +#undef HINT_ICON_FILE diff --git a/code/game/atoms.dm b/code/game/atoms.dm index 911a91bea3..ba2d6ad56c 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -1470,6 +1470,7 @@ if (isliving(user) || isovermind(user) || isaicamera(user)) var/obj/item/held_item = user.get_active_held_item() + var/allow_images = user.client.prefs.screentip_allow_images if (flags_1 & HAS_CONTEXTUAL_SCREENTIPS_1 || held_item?.item_flags & ITEM_HAS_CONTEXTUAL_SCREENTIPS) var/list/context = list() @@ -1482,10 +1483,10 @@ // LMB and RMB on one line... var/lmb_text = "" if((SCREENTIP_CONTEXT_LMB in context) && (length(context[SCREENTIP_CONTEXT_LMB]) > 0)) - lmb_text = build_context(context, SCREENTIP_CONTEXT_LMB) + lmb_text = build_context(context, SCREENTIP_CONTEXT_LMB, allow_images) var/rmb_text = "" if((SCREENTIP_CONTEXT_RMB in context) && (length(context[SCREENTIP_CONTEXT_RMB]) > 0)) - rmb_text = build_context(context, SCREENTIP_CONTEXT_RMB) + rmb_text = build_context(context, SCREENTIP_CONTEXT_RMB, allow_images) if (lmb_text) lmb_rmb_line = lmb_text @@ -1499,37 +1500,37 @@ lmb_rmb_line += "
" extra_lines++ if((SCREENTIP_CONTEXT_CTRL_LMB in context) && (length(context[SCREENTIP_CONTEXT_CTRL_LMB]) > 0)) - ctrl_lmb_ctrl_rmb_line = build_context(context, SCREENTIP_CONTEXT_CTRL_LMB) + ctrl_lmb_ctrl_rmb_line = build_context(context, SCREENTIP_CONTEXT_CTRL_LMB, allow_images) if((SCREENTIP_CONTEXT_CTRL_RMB in context) && (length(context[SCREENTIP_CONTEXT_CTRL_RMB]) > 0)) if (ctrl_lmb_ctrl_rmb_line != "") ctrl_lmb_ctrl_rmb_line += " | " ctrl_lmb_ctrl_rmb_line += "[SCREENTIP_CONTEXT_CTRL_RMB]: [context[SCREENTIP_CONTEXT_CTRL_RMB]]" - ctrl_lmb_ctrl_rmb_line = build_context(context, SCREENTIP_CONTEXT_CTRL_RMB) + ctrl_lmb_ctrl_rmb_line = build_context(context, SCREENTIP_CONTEXT_CTRL_RMB, allow_images) // Alt-LMB, Alt-RMB on one line... if (ctrl_lmb_ctrl_rmb_line != "") ctrl_lmb_ctrl_rmb_line += "
" extra_lines++ if((SCREENTIP_CONTEXT_ALT_LMB in context) && (length(context[SCREENTIP_CONTEXT_ALT_LMB]) > 0)) - alt_lmb_alt_rmb_line = build_context(context, SCREENTIP_CONTEXT_ALT_LMB) + alt_lmb_alt_rmb_line = build_context(context, SCREENTIP_CONTEXT_ALT_LMB, allow_images) if((SCREENTIP_CONTEXT_ALT_RMB in context) && (length(context[SCREENTIP_CONTEXT_ALT_RMB]) > 0)) if (alt_lmb_alt_rmb_line != "") alt_lmb_alt_rmb_line += " | " - alt_lmb_alt_rmb_line = build_context(context, SCREENTIP_CONTEXT_ALT_RMB) + alt_lmb_alt_rmb_line = build_context(context, SCREENTIP_CONTEXT_ALT_RMB, allow_images) // Shift-LMB, Ctrl-Shift-LMB on one line... if (alt_lmb_alt_rmb_line != "") alt_lmb_alt_rmb_line += "
" extra_lines++ if((SCREENTIP_CONTEXT_SHIFT_LMB in context) && (length(context[SCREENTIP_CONTEXT_SHIFT_LMB]) > 0)) - shift_lmb_ctrl_shift_lmb_line = build_context(context, SCREENTIP_CONTEXT_SHIFT_LMB) + shift_lmb_ctrl_shift_lmb_line = build_context(context, SCREENTIP_CONTEXT_SHIFT_LMB, allow_images) if((SCREENTIP_CONTEXT_CTRL_SHIFT_LMB in context) && (length(context[SCREENTIP_CONTEXT_CTRL_SHIFT_LMB]) > 0)) if (shift_lmb_ctrl_shift_lmb_line != "") shift_lmb_ctrl_shift_lmb_line += " | " shift_lmb_ctrl_shift_lmb_line += "[SCREENTIP_CONTEXT_CTRL_SHIFT_LMB]: [context[SCREENTIP_CONTEXT_CTRL_SHIFT_LMB]]" - shift_lmb_ctrl_shift_lmb_line = build_context(context, SCREENTIP_CONTEXT_CTRL_SHIFT_LMB) + shift_lmb_ctrl_shift_lmb_line = build_context(context, SCREENTIP_CONTEXT_CTRL_SHIFT_LMB, allow_images) if (shift_lmb_ctrl_shift_lmb_line != "") extra_lines++ diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index 1e83285139..744ab254ae 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -64,6 +64,7 @@ GLOBAL_LIST_EMPTY(preferences_datums) var/outline_color = COLOR_THEME_MIDNIGHT var/screentip_pref = SCREENTIP_PREFERENCE_ENABLED var/screentip_color = "#ffd391" + var/screentip_allow_images = FALSE var/buttons_locked = FALSE var/hotkeys = FALSE @@ -829,6 +830,9 @@ GLOBAL_LIST_EMPTY(preferences_datums) dat += "Outline Color: [outline_color ? "" : "Theme-based (null)"]    Change
" dat += "Screentip: [screentip_pref]
" dat += "Screentip Color:     Change
" + dat += "\ + Screentip context with images: [screentip_allow_images ? "Allowed" : "Disallowed"]
" 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"]
" @@ -2925,6 +2929,8 @@ GLOBAL_LIST_EMPTY(preferences_datums) var/pickedScreentipColor = input(user, "Choose your screentip color.", "General Preference", screentip_color) as color|null if(pickedScreentipColor) screentip_color = pickedScreentipColor + if("screentip_allow_images") + screentip_allow_images = !screentip_allow_images 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 c0386e8f45..cbd35a290c 100644 --- a/code/modules/client/preferences_savefile.dm +++ b/code/modules/client/preferences_savefile.dm @@ -423,6 +423,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car S["outline_enabled"] >> outline_enabled S["screentip_pref"] >> screentip_pref S["screentip_color"] >> screentip_color + S["screentip_allow_images"] >> screentip_allow_images S["hotkeys"] >> hotkeys S["chat_on_map"] >> chat_on_map S["max_chat_length"] >> max_chat_length @@ -611,6 +612,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car WRITE_FILE(S["outline_color"], outline_color) WRITE_FILE(S["screentip_pref"], screentip_pref) WRITE_FILE(S["screentip_color"], screentip_color) + WRITE_FILE(S["screentip_allow_images"], screentip_allow_images) WRITE_FILE(S["hotkeys"], hotkeys) WRITE_FILE(S["chat_on_map"], chat_on_map) WRITE_FILE(S["max_chat_length"], max_chat_length) diff --git a/icons/UI_Icons/screentips/cursor_hints.dmi b/icons/UI_Icons/screentips/cursor_hints.dmi new file mode 100644 index 0000000000000000000000000000000000000000..01c1dfe33e96128ebf7cbe621a45bdd6b8748567 GIT binary patch literal 468 zcmV;_0W1EAP)h(O0RI30z`($Zm&CdN0004WQchCV=-0C=2JR&a84_w-Y6@%7{?OD!tS%+FJ>RWQ*r;NmRLOex6#atzJ5I5Sc+ z(=$pSoZ^zil2jm5DJds0FI$O=GbOXA7$n8TnO2mTn+jpWRr&Zj=_ck?5~VI9HK%|m zg(;cEiAA|YDNQd*Od`&5VoVGo(l(7DOswt%}53PoCVnjG2!x)RO^XhMLstYbx}DV(z3;In^&PoeHJ z7X6=UoO^&VEalqSymksZGFucLjgFfIp(t?3s_uvM@AT@T=fF`;C0000< KMNUMnLSTZN<-%D2 literal 0 HcmV?d00001 diff --git a/icons/UI_Icons/screentips/cursor_hints_outline.dmi b/icons/UI_Icons/screentips/cursor_hints_outline.dmi new file mode 100644 index 0000000000000000000000000000000000000000..32e0b8f67cd949ff155bd2e4d8d91e387b57e1d3 GIT binary patch literal 490 zcmVh(O0RI30z`($+MRoW90004WQchCV=-0C=2JR&a84_w-Y6@%7{?OD!tS%+FJ>RWQ*r;NmRLOex6#atzJ5I5Sc+ z(=$pSoZ^zil2jm5DJds0FI$O=GbOXA7$n8TnO2mTn+jpWRr&Zj=_ck?5~VI9HK%|m zg(;cEiAA|YDNQd*Od`&5VoVGo(lKiix Date: Sun, 19 Feb 2023 14:29:25 -0300 Subject: [PATCH 2/5] new icon with adjustments for it --- code/__HELPERS/screentips.dm | 2 +- code/game/atoms.dm | 8 ++++---- icons/UI_Icons/screentips/cursor_hints.dmi | Bin 468 -> 414 bytes ...{cursor_hints_outline.dmi => full_mouse.dmi} | Bin 4 files changed, 5 insertions(+), 5 deletions(-) rename icons/UI_Icons/screentips/{cursor_hints_outline.dmi => full_mouse.dmi} (100%) diff --git a/code/__HELPERS/screentips.dm b/code/__HELPERS/screentips.dm index fc6673a006..dfd3390ab4 100644 --- a/code/__HELPERS/screentips.dm +++ b/code/__HELPERS/screentips.dm @@ -24,7 +24,7 @@ GLOBAL_LIST_INIT_TYPED(screentip_context_icons, /image, prepare_screentip_contex icon = "\icon[GLOB.screentip_context_icons[icon]]" LAZYADD(to_add, "[key_help][icon]: [context[key][intent]]") - var/separator = "[allow_image ? " " : " | "]" + var/separator = "[allow_image ? " " : " | "]" return english_list(to_add, "", separator, separator) #undef HINT_ICON_FILE diff --git a/code/game/atoms.dm b/code/game/atoms.dm index ba2d6ad56c..896aa8c459 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -1491,7 +1491,7 @@ if (lmb_text) lmb_rmb_line = lmb_text if (rmb_text) - lmb_rmb_line += " | [rmb_text]" + lmb_rmb_line += " | [allow_images ? " " : ""][rmb_text]" else if (rmb_text) lmb_rmb_line = rmb_text @@ -1504,7 +1504,7 @@ if((SCREENTIP_CONTEXT_CTRL_RMB in context) && (length(context[SCREENTIP_CONTEXT_CTRL_RMB]) > 0)) if (ctrl_lmb_ctrl_rmb_line != "") - ctrl_lmb_ctrl_rmb_line += " | " + ctrl_lmb_ctrl_rmb_line += " | [allow_images ? " " : ""]" ctrl_lmb_ctrl_rmb_line += "[SCREENTIP_CONTEXT_CTRL_RMB]: [context[SCREENTIP_CONTEXT_CTRL_RMB]]" ctrl_lmb_ctrl_rmb_line = build_context(context, SCREENTIP_CONTEXT_CTRL_RMB, allow_images) @@ -1516,7 +1516,7 @@ alt_lmb_alt_rmb_line = build_context(context, SCREENTIP_CONTEXT_ALT_LMB, allow_images) if((SCREENTIP_CONTEXT_ALT_RMB in context) && (length(context[SCREENTIP_CONTEXT_ALT_RMB]) > 0)) if (alt_lmb_alt_rmb_line != "") - alt_lmb_alt_rmb_line += " | " + alt_lmb_alt_rmb_line += " | [allow_images ? " " : ""]" alt_lmb_alt_rmb_line = build_context(context, SCREENTIP_CONTEXT_ALT_RMB, allow_images) // Shift-LMB, Ctrl-Shift-LMB on one line... @@ -1528,7 +1528,7 @@ if((SCREENTIP_CONTEXT_CTRL_SHIFT_LMB in context) && (length(context[SCREENTIP_CONTEXT_CTRL_SHIFT_LMB]) > 0)) if (shift_lmb_ctrl_shift_lmb_line != "") - shift_lmb_ctrl_shift_lmb_line += " | " + shift_lmb_ctrl_shift_lmb_line += " | [allow_images ? " " : ""]" shift_lmb_ctrl_shift_lmb_line += "[SCREENTIP_CONTEXT_CTRL_SHIFT_LMB]: [context[SCREENTIP_CONTEXT_CTRL_SHIFT_LMB]]" shift_lmb_ctrl_shift_lmb_line = build_context(context, SCREENTIP_CONTEXT_CTRL_SHIFT_LMB, allow_images) diff --git a/icons/UI_Icons/screentips/cursor_hints.dmi b/icons/UI_Icons/screentips/cursor_hints.dmi index 01c1dfe33e96128ebf7cbe621a45bdd6b8748567..9533d240a59921308927ac79c7eaad268af32cd8 100644 GIT binary patch delta 321 zcmV-H0lxm!1D*pRiBL{Q4GJ0x0000DNk~Le0000O0000K1Oos70A-utu#q7*0iTgs zHGeF)I5Sc+(=$qdY*Vh{lEji!AWJDJCowNuiHkEOv#1!zH{{|>D@x2wg|OkOe0-gB z6Z0yGQkRjMQ$Uo$l+5D9qFkbsrWYk95ob9uCI%7dn;>F+6GXgkf{67^5CPvPE4cc( zfFm3L{ws^R`hv@S0001nNklK=ZFu7nc=uFoK_9wnN}9swyN_j zDi*Q*40tqWkM`oxU3J<-Lz@g;u7rppiCho#H;>`&o-y>rFl>K>DB>mWvho1w01_Qr TL#^hq00000NkvXXu0mjf^caLA delta 375 zcmV--0f_#d1JnZ{iBL{Q4GJ0x0000DNk~Le0000$0000m1Oos708?dQERi8M0iBUq zHGd4vxHvOXGt)ClAe`co#FA7XQzXhD1|AR#fe3^L@7-#N=zcoa$-yjBGNZO#QG+Pc;5sO>zg0~zEM_i^>YD7 zIRM5oj2l?7s*(Tz0KQ2?K~y-6?b1yOgMTm(1>l7KZOz;u{%(u8K#?4v2-z1Gu8SM5 z-`Y3T3XNE3#YJcHZ5~6&JR!a?l626y$>FwuyAldTT6LNn+5)-~&Io8ifVHe+MW`v9 zvftpde}hk Date: Mon, 20 Feb 2023 00:44:40 -0300 Subject: [PATCH 3/5] less weird coloring --- code/__HELPERS/screentips.dm | 2 +- icons/UI_Icons/screentips/cursor_hints.dmi | Bin 414 -> 414 bytes icons/UI_Icons/screentips/full_mouse.dmi | Bin 490 -> 490 bytes 3 files changed, 1 insertion(+), 1 deletion(-) diff --git a/code/__HELPERS/screentips.dm b/code/__HELPERS/screentips.dm index dfd3390ab4..aeceb0d41c 100644 --- a/code/__HELPERS/screentips.dm +++ b/code/__HELPERS/screentips.dm @@ -18,7 +18,7 @@ GLOBAL_LIST_INIT_TYPED(screentip_context_icons, /image, prepare_screentip_contex /proc/build_context(list/context, key, allow_image) var/list/to_add for(var/intent in context[key]) - var/key_help = "[length(key) > 3 ? copytext(key, 1, -3) : ""]" + var/key_help = "[length(key) > 3 ? "[copytext(key, 1, -3)][allow_image ? " " : ""]" : ""]" var/icon = "[copytext(key, -3)]-[intent]" if(allow_image) icon = "\icon[GLOB.screentip_context_icons[icon]]" diff --git a/icons/UI_Icons/screentips/cursor_hints.dmi b/icons/UI_Icons/screentips/cursor_hints.dmi index 9533d240a59921308927ac79c7eaad268af32cd8..f314166d438d8053d70ff3c42b93edc0723434cc 100644 GIT binary patch delta 39 xcmV+?0NDSY1D*qrEF3^UKmY&$|Ns90{~-XB|Nqzk{{R5Mz`!M#V>z)%Rsl4J5J~_5 delta 39 vcmbQoJdb&Tj?Dl6{}~t<92^`N{wp#}`Tze01CW2z>$0RJHXl>h(O0RI30z`(#j(W11mNTLBpp%Od* delta 36 ucmV+<0NelS1L^~iFB$*;|3E-M0RJHXl>h(O0RI30z`($+MRoYGNTLBwIubPi From b2f7fc5a9e95f5c9d08db588767fcd73ce48a890 Mon Sep 17 00:00:00 2001 From: SandPoot Date: Fri, 24 Feb 2023 01:07:27 -0300 Subject: [PATCH 4/5] over action buttons also very cool you guy that hates my fancy hints, hope you know how to do everything --- code/__DEFINES/layers_planes.dm | 3 +++ code/__DEFINES/screentips.dm | 10 ++++++++++ code/_onclick/hud/screentip.dm | 1 + code/game/atoms.dm | 2 +- code/modules/client/preferences.dm | 11 +++-------- 5 files changed, 18 insertions(+), 9 deletions(-) diff --git a/code/__DEFINES/layers_planes.dm b/code/__DEFINES/layers_planes.dm index fd841ba258..b4c616243f 100644 --- a/code/__DEFINES/layers_planes.dm +++ b/code/__DEFINES/layers_planes.dm @@ -193,3 +193,6 @@ #define SPLASHSCREEN_LAYER 90 #define SPLASHSCREEN_PLANE 90 #define SPLASHSCREEN_RENDER_TARGET "SPLASHSCREEN_PLANE" + +///Layer for screentips +#define SCREENTIP_LAYER 40 diff --git a/code/__DEFINES/screentips.dm b/code/__DEFINES/screentips.dm index 4918db85ce..e9615bb4ee 100644 --- a/code/__DEFINES/screentips.dm +++ b/code/__DEFINES/screentips.dm @@ -31,5 +31,15 @@ /// Screentips are only enabled when they have context #define SCREENTIP_PREFERENCE_CONTEXT_ONLY "Only with tips" +/// Screentips enabled, no context +#define SCREENTIP_PREFERENCE_NO_CONTEXT "Enabled without tips" + /// Regardless of intent #define INTENT_ANY "any" + +GLOBAL_LIST_INIT(screentip_pref_options, list( + SCREENTIP_PREFERENCE_DISABLED, + SCREENTIP_PREFERENCE_ENABLED, + SCREENTIP_PREFERENCE_CONTEXT_ONLY, + SCREENTIP_PREFERENCE_NO_CONTEXT +)) diff --git a/code/_onclick/hud/screentip.dm b/code/_onclick/hud/screentip.dm index 43b728ade6..5128448561 100644 --- a/code/_onclick/hud/screentip.dm +++ b/code/_onclick/hud/screentip.dm @@ -6,6 +6,7 @@ maptext_height = 480 maptext_width = 480 maptext = "" + layer = SCREENTIP_LAYER /atom/movable/screen/screentip/Initialize(mapload, _hud) . = ..() diff --git a/code/game/atoms.dm b/code/game/atoms.dm index 896aa8c459..fa3ff72904 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -1468,7 +1468,7 @@ var/extra_lines = 0 var/extra_context = "" - if (isliving(user) || isovermind(user) || isaicamera(user)) + if ((isliving(user) || isovermind(user) || isaicamera(user)) && (user.client.prefs.screentip_pref != SCREENTIP_PREFERENCE_NO_CONTEXT)) var/obj/item/held_item = user.get_active_held_item() var/allow_images = user.client.prefs.screentip_allow_images diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index 744ab254ae..dbf1bfc22c 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -2917,14 +2917,9 @@ GLOBAL_LIST_EMPTY(preferences_datums) if(pickedOutlineColor != pickedOutlineColor) outline_color = pickedOutlineColor // nullable if("screentip_pref") - var/choice = tgalert(user, "Choose your screentip preference", "Screentipping?", "Yes", "Context Only", "No") - switch(choice) - if("Yes") - screentip_pref = SCREENTIP_PREFERENCE_ENABLED - if("Context Only") - screentip_pref = SCREENTIP_PREFERENCE_CONTEXT_ONLY - else - screentip_pref = SCREENTIP_PREFERENCE_DISABLED + var/choice = input(user, "Choose your screentip preference", "Screentipping?", screentip_pref) as null|anything in GLOB.screentip_pref_options + if(choice) + screentip_pref = choice if("screentip_color") var/pickedScreentipColor = input(user, "Choose your screentip color.", "General Preference", screentip_color) as color|null if(pickedScreentipColor) From cc8d385371467a0bd81eba2b868364c699f7a76b Mon Sep 17 00:00:00 2001 From: SandPoot Date: Fri, 24 Feb 2023 01:11:12 -0300 Subject: [PATCH 5/5] sanity --- code/modules/client/preferences_savefile.dm | 1 + 1 file changed, 1 insertion(+) diff --git a/code/modules/client/preferences_savefile.dm b/code/modules/client/preferences_savefile.dm index 55c2ede248..1f29cb4515 100644 --- a/code/modules/client/preferences_savefile.dm +++ b/code/modules/client/preferences_savefile.dm @@ -543,6 +543,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car modless_key_bindings = sanitize_islist(modless_key_bindings, list()) favorite_outfits = SANITIZE_LIST(favorite_outfits) screentip_color = sanitize_hexcolor(screentip_color, 6, 1, initial(screentip_color)) + screentip_pref = sanitize_inlist(screentip_pref, GLOB.screentip_pref_options, SCREENTIP_PREFERENCE_ENABLED) verify_keybindings_valid() // one of these days this will runtime and you'll be glad that i put it in a different proc so no one gets their saves wiped