From b2f7fc5a9e95f5c9d08db588767fcd73ce48a890 Mon Sep 17 00:00:00 2001 From: SandPoot Date: Fri, 24 Feb 2023 01:07:27 -0300 Subject: [PATCH] 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)