Adds Staff-say (#28813)

* staff say

* finally, staffsays

* oops

* deconflict

* yea

* bonk

* build
This commit is contained in:
Contrabang
2025-05-13 13:00:15 -04:00
committed by GitHub
parent dfacf83e18
commit 43439da811
21 changed files with 147 additions and 28 deletions
+13 -2
View File
@@ -43,6 +43,7 @@ GLOBAL_LIST_INIT(admin_verbs_admin, list(
/datum/admins/proc/toggleemoji, /*toggles using emoji in ooc for everyone*/
/client/proc/game_panel, /*game panel, allows to change game-mode etc*/
/client/proc/cmd_admin_say, /*admin-only ooc chat*/
/client/proc/cmd_staff_say,
/datum/admins/proc/PlayerNotes,
/client/proc/cmd_mentor_say,
/client/proc/cmd_dev_say,
@@ -55,6 +56,7 @@ GLOBAL_LIST_INIT(admin_verbs_admin, list(
/client/proc/view_asays,
/client/proc/view_msays,
/client/proc/view_devsays,
/client/proc/view_staffsays,
/client/proc/empty_ai_core_toggle_latejoin,
/client/proc/aooc,
/client/proc/freeze,
@@ -225,8 +227,16 @@ GLOBAL_LIST_INIT(admin_verbs_mentor, list(
/client/proc/admin_observe_target,
/client/proc/cmd_mentor_say, /* mentor say*/
/client/proc/view_msays,
/client/proc/cmd_staff_say,
/client/proc/view_staffsays
// cmd_mentor_say is added/removed by the toggle_mentor_chat verb
))
GLOBAL_LIST_INIT(admin_verbs_dev, list(
/client/proc/cmd_dev_say,
/client/proc/view_devsays,
/client/proc/cmd_staff_say,
/client/proc/view_staffsays
))
GLOBAL_LIST_INIT(admin_verbs_proccall, list(
/client/proc/callproc,
/client/proc/callproc_datum,
@@ -311,7 +321,7 @@ GLOBAL_LIST_INIT(view_runtimes_verbs, list(
spawn(1) // This setting exposes the profiler for people with R_VIEWRUNTIMES. They must still have it set in cfg/admin.txt
control_freak = 0
if(holder.rights & R_DEV_TEAM)
add_verb(src, /client/proc/cmd_dev_say)
add_verb(src, GLOB.admin_verbs_dev)
if(is_connecting_from_localhost())
add_verb(src, /client/proc/export_current_character)
@@ -344,7 +354,8 @@ GLOBAL_LIST_INIT(view_runtimes_verbs, list(
GLOB.admin_verbs_proccall,
GLOB.admin_verbs_show_debug_verbs,
GLOB.admin_verbs_ticket,
GLOB.admin_verbs_maintainer
GLOB.admin_verbs_maintainer,
GLOB.admin_verbs_dev
))
add_verb(src, /client/proc/show_verbs)
+6
View File
@@ -1350,6 +1350,12 @@
usr.client.view_devsays()
else if(href_list["staffsays"])
if(!check_rights(R_ADMIN | R_DEV_TEAM))
return
usr.client.view_staffsays()
else if(href_list["tdome1"])
if(!check_rights(R_SERVER|R_EVENT)) return
+37 -15
View File
@@ -35,21 +35,6 @@
SSblackbox.record_feedback("tally", "admin_verb", 1, "Asay") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/client/proc/get_admin_say()
if(check_rights(R_ADMIN, FALSE))
var/msg = input(src, null, "asay \"text\"") as text|null
cmd_admin_say(msg)
/client/proc/get_mentor_say()
if(check_rights(R_MENTOR | R_ADMIN | R_MOD))
var/msg = input(src, null, "msay \"text\"") as text|null
cmd_mentor_say(msg)
/client/proc/get_dev_team_say()
if(check_rights(R_DEV_TEAM | R_ADMIN | R_MOD))
var/msg = input(src, null, "devsay \"text\"") as text|null
cmd_dev_say(msg)
/client/proc/cmd_dev_say(msg as text)
set name = "Devsay"
set hidden = TRUE
@@ -87,6 +72,43 @@
SSblackbox.record_feedback("tally", "admin_verb", 1, "Devsay") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/client/proc/cmd_staff_say(msg as text)
set name = "Staffsay"
set hidden = TRUE
if(!check_rights(R_DEV_TEAM|R_ADMIN|R_MENTOR))
return
msg = emoji_parse(copytext_char(sanitize(msg), 1, MAX_MESSAGE_LEN))
if(!msg)
return
log_staffsay(msg, src)
var/datum/say/staffsay = new(usr.ckey, usr.client.holder.rank, msg, world.timeofday)
GLOB.staffsays += staffsay
mob.create_log(OOC_LOG, "STAFFSAY: [msg]")
if(SSredis.connected)
var/list/data = list()
data["author"] = usr.ckey
data["source"] = GLOB.configuration.system.instance_id
data["message"] = html_decode(msg)
SSredis.publish("byond.staffsay", json_encode(data))
for(var/client/C in GLOB.admins)
if(check_rights(0, 0, C.mob))
var/display_name = key
if(holder.fakekey)
if(C.holder && C.holder.rights & R_ADMIN)
display_name = "[holder.fakekey]/([key])"
else
display_name = holder.fakekey
msg = "<span class='emoji_enabled'>[msg]</span>"
to_chat(C, "<span class='[check_rights(R_ADMIN, 0) ? "staff_channel_admin" : "staff_channel"]'>STAFF: <span class='name'>[display_name]</span> ([admin_jump_link(mob)]): <span class='message'>[msg]</span></span>", MESSAGE_TYPE_STAFFCHAT, confidential = TRUE)
SSblackbox.record_feedback("tally", "admin_verb", 1, "Staffsay") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/client/proc/cmd_mentor_say(msg as text)
set name = "Msay"
set hidden = 1
+11
View File
@@ -1,6 +1,7 @@
GLOBAL_LIST_EMPTY(asays)
GLOBAL_LIST_EMPTY(msays)
GLOBAL_LIST_EMPTY(devsays)
GLOBAL_LIST_EMPTY(staffsays)
/datum/say
var/ckey
@@ -44,6 +45,16 @@ GLOBAL_LIST_EMPTY(devsays)
display_says(GLOB.asays, "asay")
/client/proc/view_staffsays()
set name = "Staffsays"
set desc = "View Staffsays from the current round."
set category = "Admin"
if(!check_rights(R_DEV_TEAM | R_ADMIN))
return
display_says(GLOB.staffsays, "devsay")
/client/proc/display_says(list/say_list, title)
var/list/output = list({"