Skip to content

Commit

Permalink
Merge pull request #166 from tf-4/loud-asay
Browse files Browse the repository at this point in the history
Loud asay
  • Loading branch information
carpotoxin authored Oct 17, 2024
2 parents deaca9b + 5d23aaf commit c4f78bc
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
21 changes: 21 additions & 0 deletions modular_doppler/loud_asay/code/loud_asay.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
ADMIN_VERB(cmd_loud_admin_say, R_NONE, "loudAsay", "Send a message to other admins (loudly).", ADMIN_CATEGORY_MAIN, message as text)
message = emoji_parse(copytext_char(sanitize(message), 1, MAX_MESSAGE_LEN))
if(!message)
return

user.mob.log_talk(message, LOG_ASAY)
message = keywords_lookup(message)
var/asay_color = user.prefs.read_preference(/datum/preference/color/asay_color)
var/custom_asay_color = (CONFIG_GET(flag/allow_admin_asaycolor) && asay_color) ? "<font color=[asay_color]>" : "<font color='[DEFAULT_ASAY_COLOR]'>"
message = "[span_command_headset("[span_adminsay("[span_prefix("ADMIN:")] <EM>[key_name_admin(user)]</EM> [ADMIN_FLW(user.mob)]: [custom_asay_color]<span class='message linkify'>[message]")]</span>[custom_asay_color ? "</font>":null]")]"
to_chat(GLOB.admins,
type = MESSAGE_TYPE_ADMINCHAT,
html = message,
confidential = TRUE)

for(var/client/admin_client in GLOB.admins)
if(admin_client?.prefs?.toggles & SOUND_ADMINHELP)
SEND_SOUND(admin_client, sound('modular_doppler/loud_asay/sound/duckhonk.ogg')) //Stop using loud mode if you don't need to.
window_flash(admin_client, ignorepref = TRUE)

BLACKBOX_LOG_ADMIN_VERB("Loud Asay")
Binary file added modular_doppler/loud_asay/sound/duckhonk.ogg
Binary file not shown.
1 change: 1 addition & 0 deletions tgstation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -6661,6 +6661,7 @@
#include "modular_doppler\loadout_categories\categories\shoes.dm"
#include "modular_doppler\loadout_categories\categories\toys.dm"
#include "modular_doppler\loadout_categories\categories\undersuit.dm"
#include "modular_doppler\loud_asay\code\loud_asay.dm"
#include "modular_doppler\modular_antagonists\_dynamic_rulesets.dm"
#include "modular_doppler\modular_antagonists\changeling\changeling.dm"
#include "modular_doppler\modular_antagonists\datums\antag_recipes.dm"
Expand Down

0 comments on commit c4f78bc

Please sign in to comment.