From 47cf74d2afa6a7e7bfd39d48e9fc5aa54404c34e Mon Sep 17 00:00:00 2001 From: Iajret Creature <122297233+AnArgonianLizardThatStealsPRs@users.noreply.github.com> Date: Tue, 7 Nov 2023 01:42:41 +0300 Subject: [PATCH] [MIRROR] Improve emote help text display [MDB IGNORE] (#477) * Improve emote help text display (#79365) --------- Co-authored-by: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Co-authored-by: Tim Co-authored-by: Ghom <42542238+Ghommie@ users.noreply.github.com> --- code/modules/mob/emote.dm | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/code/modules/mob/emote.dm b/code/modules/mob/emote.dm index 0688778b048..1bb8e61ef2b 100644 --- a/code/modules/mob/emote.dm +++ b/code/modules/mob/emote.dm @@ -46,20 +46,28 @@ /datum/emote/help/run_emote(mob/user, params, type_override, intentional) . = ..() var/list/keys = list() - var/list/message = list("Available emotes, you can use them with say \"*emote\": ") + var/list/message = list("Available emotes, you can use them with say [span_bold("\"*emote\"")]: \n") + message += span_smallnoticeital("Note - emotes highlighted in blue play a sound \n\n") for(var/key in GLOB.emote_list) - for(var/datum/emote/P in GLOB.emote_list[key]) - if(P.key in keys) + for(var/datum/emote/emote_action in GLOB.emote_list[key]) + if(emote_action.key in keys) continue - if(P.can_run_emote(user, status_check = FALSE , intentional = TRUE)) - keys += P.key + if(emote_action.can_run_emote(user, status_check = FALSE , intentional = TRUE)) + keys += emote_action.key keys = sort_list(keys) + + // the span formatting will mess up sorting so need to do it afterwards + for(var/i in 1 to keys.len) + for(var/datum/emote/emote_action in GLOB.emote_list[keys[i]]) + if(emote_action.get_sound(user) && emote_action.should_play_sound(user, intentional = TRUE)) + keys[i] = span_boldnotice(keys[i]) + message += keys.Join(", ") message += "." message = message.Join("") - to_chat(user, message) + to_chat(user, examine_block(message)) /datum/emote/flip key = "flip"