lizard content
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user