From 876d9ebc6c5c97dac3cc86948ad960a2a1b8b2fe Mon Sep 17 00:00:00 2001 From: Timothy Teakettle <59849408+timothyteakettle@users.noreply.github.com> Date: Thu, 12 Jun 2025 03:58:01 +0100 Subject: [PATCH] add a way for admins to allow objects to emote (#7188) ## About The Pull Request in terms of implementation this is just a crude edit of atom_say because i am not taking on refactoring say code to be unified for this if you have R_FUN you get access to atom emote on the right click menu using it shows this menu ![image](https://github.com/user-attachments/assets/462c2229-0842-4630-92ac-eb9c4ad27712) audible shows to people who can hear it visible shows to people who can see it all shows to everyone within range regardless ## Why It's Good For The Game useful for EMs ## Changelog :cl: add: add a way for admins to allow objects to emote /:cl: --- citadel.dme | 17 +++++++++-------- code/game/atoms/say.dm | 18 ++++++++++++++++++ code/modules/admin/admin_verbs.dm | 6 ++++-- code/modules/admin/verbs/atom_emote.dm | 22 ++++++++++++++++++++++ 4 files changed, 53 insertions(+), 10 deletions(-) create mode 100644 code/modules/admin/verbs/atom_emote.dm diff --git a/citadel.dme b/citadel.dme index f8573937d27..1eb26432974 100644 --- a/citadel.dme +++ b/citadel.dme @@ -2328,6 +2328,7 @@ #include "code\modules\admin\verbs\adminsay.dm" #include "code\modules\admin\verbs\antag-ooc.dm" #include "code\modules\admin\verbs\atmosdebug.dm" +#include "code\modules\admin\verbs\atom_emote.dm" #include "code\modules\admin\verbs\BrokenInhands.dm" #include "code\modules\admin\verbs\buildmode.dm" #include "code\modules\admin\verbs\check_customitem_activity.dm" @@ -5663,14 +5664,6 @@ #include "maps\sectors\nebula_tradeport\nebula_tradeport.dm" #include "maps\sectors\piratebase_192\piratebase_192.dm" #include "maps\sectors\roguemining_192\roguemining_192.dm" -#include "maps\strelka\strelka-areas.dm" -#include "maps\strelka\strelka-overmap.dm" -#include "maps\strelka\strelka-sectors.dm" -#include "maps\strelka\strelka-shuttles.dm" -#include "maps\strelka\strelka-papers.dm" -#include "maps\strelka\strelka-misc.dm" -#include "maps\strelka\strelka.dm" -#include "maps\strelka\telecomms.dm" #include "maps\sectors\sky_planet\sky_planet-areas.dm" #include "maps\sectors\sky_planet\sky_planet-misc.dm" #include "maps\sectors\sky_planet\sky_planet-shuttles.dm" @@ -5683,6 +5676,14 @@ #include "maps\shuttles\factions\corporations\nanotrasen\drone_prototype.dm" #include "maps\shuttles\factions\corporations\nanotrasen\sci_vector.dm" #include "maps\shuttles\factions\generic\outlaw\reaver.dm" +#include "maps\strelka\strelka-areas.dm" +#include "maps\strelka\strelka-misc.dm" +#include "maps\strelka\strelka-overmap.dm" +#include "maps\strelka\strelka-papers.dm" +#include "maps\strelka\strelka-sectors.dm" +#include "maps\strelka\strelka-shuttles.dm" +#include "maps\strelka\strelka.dm" +#include "maps\strelka\telecomms.dm" #include "maps\submaps\_helpers.dm" #include "maps\submaps\_readme.dm" #include "maps\submaps\level_specific\debrisfield_vr\debrisfield_things.dm" diff --git a/code/game/atoms/say.dm b/code/game/atoms/say.dm index 0cdb6b7babe..30b795e62cf 100644 --- a/code/game/atoms/say.dm +++ b/code/game/atoms/say.dm @@ -41,3 +41,21 @@ /atom/proc/speech_bubble(bubble_state = "", bubble_loc = src, list/bubble_recipients = list()) return + +// atom emote +/atom/proc/atom_emote(message, saycode_type) + if(!message) + return + var/list/speech_bubble_hearers = list() + for(var/mob/M in get_hearers_in_view(MESSAGE_RANGE_COMBAT_LOUD, src)) + var/processed = message + M.show_message("[src] [processed]", saycode_type, null, 1) + if(M.client) + speech_bubble_hearers += M.client + + if(length(speech_bubble_hearers)) + var/image/I = generate_speech_bubble(src, "[bubble_icon][say_test(message)]", FLY_LAYER) + I.appearance_flags = APPEARANCE_UI_IGNORE_ALPHA + ASYNC + flick_overlay_global(I, speech_bubble_hearers, 3 SECONDS) + INVOKE_ASYNC(src, TYPE_PROC_REF(/atom/movable, animate_chat), message, null, FALSE, speech_bubble_hearers, 3 SECONDS) diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index 2b0c7a4e4fb..b6b9e109f3c 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -141,7 +141,8 @@ var/list/admin_verbs_fun = list( /datum/admins/proc/call_supply_drop, /datum/admins/proc/call_drop_pod, /client/proc/smite, - /client/proc/admin_lightning_strike + /client/proc/admin_lightning_strike, + /proc/atom_emote, ) var/list/admin_verbs_spawn = list( @@ -341,7 +342,8 @@ var/list/admin_verbs_hideable = list( /client/proc/roll_dices, /proc/possess, /proc/release, - /datum/admins/proc/set_tcrystals + /datum/admins/proc/set_tcrystals, + /proc/atom_emote, ) var/list/admin_verbs_mod = list( /client/proc/cmd_admin_pm_context, //right-click adminPM interface, diff --git a/code/modules/admin/verbs/atom_emote.dm b/code/modules/admin/verbs/atom_emote.dm new file mode 100644 index 00000000000..2634f8c00cd --- /dev/null +++ b/code/modules/admin/verbs/atom_emote.dm @@ -0,0 +1,22 @@ +/proc/atom_emote(atom/A as atom in world) + set name = "Atom Emote" + set category = VERB_CATEGORY_OBJECT + + var/message_type_input = tgui_input_list(usr, "Choose Message Type", "Message Type", list("Audible","Visible","All")) + if(!message_type_input) + return + + var/message_input = tgui_input_text(usr, "Atom Emote") + if(!message_input) + return + + var/message_type + switch(message_type_input) + if("Audible") + message_type = SAYCODE_TYPE_AUDIBLE + if("Visible") + message_type = SAYCODE_TYPE_VISIBLE + if("All") + message_type = SAYCODE_TYPE_ALWAYS + + A.atom_emote(message_input, message_type)