From b66553619fcc1f118ad8431b1b9eadd72b91b75f Mon Sep 17 00:00:00 2001 From: Charlie Nolan Date: Wed, 8 Jan 2025 14:07:19 -0800 Subject: [PATCH] Buildmode say (#27826) * Implement atom_emote * Buildmode say icon * Buildmode say * Better logging. * Apply suggestions from code review Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com> Signed-off-by: Charlie Nolan --------- Signed-off-by: Charlie Nolan Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com> --- code/datums/emote.dm | 2 +- code/game/atoms.dm | 7 +++++ code/modules/buildmode/submodes/say.dm | 36 +++++++++++++++++++++++++ icons/misc/buildmode.dmi | Bin 2009 -> 2027 bytes paradise.dme | 1 + 5 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 code/modules/buildmode/submodes/say.dm diff --git a/code/datums/emote.dm b/code/datums/emote.dm index 3fd59a10f38d..aedc8524a2b6 100644 --- a/code/datums/emote.dm +++ b/code/datums/emote.dm @@ -288,7 +288,7 @@ * * user - The user of the emote. * * text - The text of the emote. */ -/datum/emote/proc/runechat_emote(mob/user, text) +/proc/runechat_emote(atom/user, text) var/runechat_text = text if(length(text) > 100) runechat_text = "[copytext(text, 1, 101)]..." diff --git a/code/game/atoms.dm b/code/game/atoms.dm index 9d33e71059b7..95735505f540 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -1175,6 +1175,13 @@ GLOBAL_LIST_EMPTY(blood_splatter_icons) I.appearance_flags = APPEARANCE_UI_IGNORE_ALPHA INVOKE_ASYNC(GLOBAL_PROC, GLOBAL_PROC_REF(flick_overlay), I, speech_bubble_hearers, 30) +/atom/proc/atom_emote(emote) + if(!emote) + return + visible_message("[src] [emote]", "You hear how something [emote]") + + runechat_emote(src, emote) + /atom/proc/speech_bubble(bubble_state = "", bubble_loc = src, list/bubble_recipients = list()) return diff --git a/code/modules/buildmode/submodes/say.dm b/code/modules/buildmode/submodes/say.dm new file mode 100644 index 000000000000..62c4456ebc6b --- /dev/null +++ b/code/modules/buildmode/submodes/say.dm @@ -0,0 +1,36 @@ +/datum/buildmode_mode/say + key = "say" + +/datum/buildmode_mode/say/show_help(mob/user) + to_chat(user, "***********************************************************") + to_chat(user, "Left Mouse Button = Say") + to_chat(user, "Right Mouse Button = Emote") + to_chat(user, "***********************************************************") + +/datum/buildmode_mode/say/handle_click(mob/user, params, atom/object) + if(ismob(object)) + var/mob/target = object + if(!isnull(target.ckey)) + alert("This cannot be used on mobs with a ckey. Use Forcesay in player panel instead.") + return + + var/list/pa = params2list(params) + var/left_click = pa.Find("left") + var/right_click = pa.Find("right") + + if(left_click) + var/say = tgui_input_text(user, "What should [object] say?", "Say what?") + if(isnull(say)) + return + log_admin("Build Mode: [key_name(user)] made [object] at ([object.x],[object.y],[object.z] say [say].") + message_admins("Build Mode: [key_name(user)] made [object] at ([object.x],[object.y],[object.z] say [say].") + user.create_log(MISC_LOG, "Made [object] at ([object.x],[object.y],[object.z] say [say].") + object.atom_say(say) + else if(right_click) + var/emote = tgui_input_text(user, "What should [object] do?", "Emote what?") + if(isnull(emote)) + return + log_admin("Build Mode: [key_name(user)] made [object] at ([object.x],[object.y],[object.z] emote *[emote].") + message_admins("Build Mode: [key_name(user)] made [object] at ([object.x],[object.y],[object.z] emote *[emote].") + user.create_log(MISC_LOG, "Made [object] at ([object.x],[object.y],[object.z] emote *[emote].") + object.atom_emote(emote) diff --git a/icons/misc/buildmode.dmi b/icons/misc/buildmode.dmi index 80c9d404a10b2fc712b918d2901352145548a832..fac68ff7981cb9efc8b0881b294e6b49cfb61c77 100644 GIT binary patch delta 1822 zcmV+(2jTeH59<$*TLJiyTtNeu{Qr@lPJb&Zh*U39g6_cAs27P*Q`Xs}Fqy#pBBg`& zjDB96f0u>NtGWH3w_?mNAWTK^MADG81-K>uTYy*0t^kkFVTs-3IF@+jP^06b9Racz zd8a-0>edv@<)*<<6ixOJ)@py;-F}!W)Fx5pDw=Us000JeNklH51|-TrLL`Ae?l=kK!X z`)_jn?Nz#@7BxfhgDp^z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#~G1ot#ZMiNzf-1;NqTbALZK`6Z_Fn%Q|C9PM$T8GsPP z6HVs9MFL3m!xqDMfdl)=9i0FWLF5JPt+n?L4(LC&8t(6H6_Nn%aTRsVzT%@kc%nWy zY~RaY+^xUB`rxyoi}oM&!O&_8`Z`bloqQhjG_AfHddQkn>p@j#2xMN(y5eQYQrPzX zK%uc9>VNDvd-7S{ub+?tFyPQ#juIqi+N^lk3Q7XI93g-uBLKfAAk$%G3;@PsP!PCA zd(+#~*J7{;0#A1we6{@@c>wIZ>*rG*ELZZtD+H7RJvXh#q)$KtNYn!a;}_fPap-Iq zNLW$CQN$y^NdRRO@$$on3wJ^(L2+p3cZZ6owAU|C1Z5W_rM-Ru&EG5S z^?wU!nW(haFQ8?j(tdz|KR`fhzqQ$L-@bdkM!+AL*w#&NC*Y4v*!q6)9R%nt(Hm7) z-|r%jE5HAB42+AW!_b=C5CJ`MM@JEVYJxuAVo&CQA=d*90>>X-L1HsTkoA~Wc9&=( zS_HtW^|UT}ieQdbv`YY7gPkIvf~P|eV|ZW(N6|@w_&K@(0yLhq(*#)z;I>f|Zf0Dr z7|H`dF#k11z*CX0y61iSxW9wjYs<(5IFq^9e{e23KyYp@GFXN^_&mU^$pxNzqV4kF tW`eKYRcQWRX|G@4aqIZB`F+~H{{yxcvyXp*0%`yN002ovPDHLkV1n$Cd07Ae diff --git a/paradise.dme b/paradise.dme index 7370256726e2..695a754571e1 100644 --- a/paradise.dme +++ b/paradise.dme @@ -1718,6 +1718,7 @@ #include "code\modules\buildmode\submodes\mapgen.dm" #include "code\modules\buildmode\submodes\offer.dm" #include "code\modules\buildmode\submodes\save.dm" +#include "code\modules\buildmode\submodes\say.dm" #include "code\modules\buildmode\submodes\throwing.dm" #include "code\modules\buildmode\submodes\tilt.dm" #include "code\modules\buildmode\submodes\variable_edit.dm"