Skip to content

Commit

Permalink
[MIRROR] Improve emote help text display [MDB IGNORE] (#477)
Browse files Browse the repository at this point in the history
* Improve emote help text display (#79365)

---------

Co-authored-by: SkyratBot <[email protected]>
Co-authored-by: Tim <[email protected]>
Co-authored-by: Ghom <42542238+Ghommie@ users.noreply.github.com>
  • Loading branch information
4 people authored Nov 6, 2023
1 parent d94288f commit 47cf74d
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions code/modules/mob/emote.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 47cf74d

Please sign in to comment.