Skip to content

Commit

Permalink
tweak: moders can speak in achat (#6099)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dimach authored Oct 29, 2024
1 parent 1e2cb38 commit b76e016
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 14 deletions.
2 changes: 1 addition & 1 deletion code/datums/keybindings/communication_keybinds.dm
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
/datum/keybinding/client/communication/asay
name = ADMIN_CHANNEL
keys = list("F5")
required_rights = R_ADMIN
required_rights = R_ADMIN | R_MOD

/datum/keybinding/client/communication/dsay
name = DSAY_CHANNEL
Expand Down
1 change: 1 addition & 0 deletions code/modules/admin/admin_verbs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ GLOBAL_LIST_INIT(admin_verbs_mod, list(
/datum/admins/proc/PlayerNotes,
/client/proc/admin_ghost, /*allows us to ghost/reenter body at will*/
/client/proc/cmd_mentor_say,
/client/proc/cmd_admin_say, /*admin-only ooc chat*/
/datum/admins/proc/show_player_notes,
/client/proc/player_panel_new,
/client/proc/dsay,
Expand Down
27 changes: 14 additions & 13 deletions code/modules/admin/verbs/adminsay.dm
Original file line number Diff line number Diff line change
@@ -1,33 +1,34 @@
/client/proc/cmd_admin_say(msg as text)
set name = "Asay" //Gave this shit a shorter name so you only have to time out "asay" rather than "admin say" to use it --NeoFite
set hidden = 1
if(!check_rights(R_ADMIN)) return
if(!check_rights(R_ADMIN|R_MOD))
return

msg = sanitize(copytext_char(msg, 1, MAX_MESSAGE_LEN))
if(!msg) return
if(!msg)
return

msg = handleDiscordEmojis(msg)

var/datum/asays/asay = new(usr.ckey, usr.client.holder.rank, msg, world.timeofday)
GLOB.asays += asay
log_adminsay(msg, src)

if(check_rights(R_ADMIN,0))
for(var/client/C in GLOB.admins)
if(R_ADMIN & C.holder.rights)
// Lets see if this admin was pinged in the asay message
if(findtext(msg, "@[C.ckey]") || findtext(msg, "@[C.key]")) // Check ckey and key, so you can type @AffectedArc07 or @affectedarc07
SEND_SOUND(C, 'sound/misc/ping.ogg')
msg = replacetext(msg, "@[C.ckey]", "<font color='red'>@[C.ckey]</font>")
msg = replacetext(msg, "@[C.key]", "<font color='red'>@[C.key]</font>") // Same applies here. key and ckey.
for(var/client/C in GLOB.admins)
if(check_rights(R_ADMIN|R_MOD, 0, C.mob))
// Lets see if this admin was pinged in the asay message
if(findtext(msg, "@[C.ckey]") || findtext(msg, "@[C.key]")) // Check ckey and key, so you can type @AffectedArc07 or @affectedarc07
SEND_SOUND(C, 'sound/misc/ping.ogg')
msg = replacetext(msg, "@[C.ckey]", "<font color='red'>@[C.ckey]</font>")
msg = replacetext(msg, "@[C.key]", "<font color='red'>@[C.key]</font>") // Same applies here. key and ckey.

msg = "<span class='emoji_enabled'>[msg]</span>"
to_chat(C, "<span class='admin_channel'>ADMIN: <span class='name'>[key_name(usr, 1)]</span> ([admin_jump_link(mob)]): <span class='message'>[msg]</span></span>", MESSAGE_TYPE_ADMINCHAT, confidential = TRUE)
msg = "<span class='emoji_enabled'>[msg]</span>"
to_chat(C, "<span class='admin_channel'>ADMIN: <span class='name'>[key_name(usr, 1)]</span> ([admin_jump_link(mob)]): <span class='message'>[msg]</span></span>", MESSAGE_TYPE_ADMINCHAT, confidential = TRUE)

SSblackbox.record_feedback("tally", "admin_verb", 1, "Asay") //If you are copy-pasting this, ensure the 4th parameter is unique to the new proc!

/client/proc/get_admin_say()
if(check_rights(R_ADMIN, FALSE))
if(check_rights(R_ADMIN|R_MOD, FALSE))
var/msg = input(src, null, "asay \"text\"") as text|null
cmd_admin_say(msg)
else if(check_rights(R_MENTOR))
Expand Down

0 comments on commit b76e016

Please sign in to comment.