From e0623169158030d0ed77b044580aa20f8caf94ab Mon Sep 17 00:00:00 2001 From: SandPoot Date: Wed, 19 Jul 2023 13:48:07 -0300 Subject: [PATCH] sync-ish --- code/{__HELPERS => datums/screentips}/screentips.dm | 11 ++++++----- tgstation.dme | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) rename code/{__HELPERS => datums/screentips}/screentips.dm (77%) diff --git a/code/__HELPERS/screentips.dm b/code/datums/screentips/screentips.dm similarity index 77% rename from code/__HELPERS/screentips.dm rename to code/datums/screentips/screentips.dm index f50f9cbff6..899d0d7f50 100644 --- a/code/__HELPERS/screentips.dm +++ b/code/datums/screentips/screentips.dm @@ -1,12 +1,13 @@ #define HINT_ICON_FILE 'icons/UI_Icons/screentips/cursor_hints.dmi' -// Generate intent icons +/// Stores the cursor hint icons for screentip context. GLOBAL_LIST_INIT_TYPED(screentip_context_icons, /image, prepare_screentip_context_icons()) /proc/prepare_screentip_context_icons() - . = list() + var/list/output = list() for(var/state in icon_states(HINT_ICON_FILE)) - .[state] = image(HINT_ICON_FILE, icon_state = state) + output[state] = image(HINT_ICON_FILE, icon_state = state) + return output /* * # Builds context with each intent for this key @@ -21,7 +22,7 @@ GLOBAL_LIST_INIT_TYPED(screentip_context_icons, /image, prepare_screentip_contex return "" var/list/to_add for(var/intent in context[key]) - // Get everything but the mouse button, may be empty + // Splits key combinations from mouse buttons. e.g. `Ctrl-Shift-LMB` goes in, `Ctrl-Shift-` goes out. Will be empty for single button actions. var/key_combo = length(key) > 3 ? "[copytext(key, 1, -3)]" : "" // Grab the mouse button, LMB/RMB+intent var/button = "[copytext(key, -3)]-[intent]" @@ -34,6 +35,6 @@ GLOBAL_LIST_INIT_TYPED(screentip_context_icons, /image, prepare_screentip_contex var/separator = "[allow_image ? " " : " / "]" // Voilá, final result - return english_list(to_add, "", separator, separator) + return to_add.Join(separator) #undef HINT_ICON_FILE diff --git a/tgstation.dme b/tgstation.dme index 348767bb0d..f5f83e77a0 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -214,7 +214,6 @@ #include "code\__HELPERS\reagents.dm" #include "code\__HELPERS\roundend.dm" #include "code\__HELPERS\sanitize_values.dm" -#include "code\__HELPERS\screentips.dm" #include "code\__HELPERS\shell.dm" #include "code\__HELPERS\stat_tracking.dm" #include "code\__HELPERS\text.dm" @@ -780,6 +779,7 @@ #include "code\datums\ruins\station.dm" #include "code\datums\screentips\atom_context.dm" #include "code\datums\screentips\item_context.dm" +#include "code\datums\screentips\screentips.dm" #include "code\datums\skills\_check_skills.dm" #include "code\datums\skills\_skill.dm" #include "code\datums\skills\_skill_holder.dm"