Adds a verb to show mentor say history, similar to admin say history (#25749)

* adds a verb to show mentor say history, similar to admin say history

* Update code/modules/admin/player_panel.dm

Co-authored-by: Ryan <80364400+Sirryan2002@users.noreply.github.com>
Signed-off-by: DGamerL <108773801+DGamerL@users.noreply.github.com>

* Update code/modules/admin/verbs/asays.dm

Signed-off-by: DGamerL <108773801+DGamerL@users.noreply.github.com>

---------

Signed-off-by: DGamerL <108773801+DGamerL@users.noreply.github.com>
Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com>
Co-authored-by: Ryan <80364400+Sirryan2002@users.noreply.github.com>
This commit is contained in:
Luc
2024-06-12 14:39:44 -07:00
committed by GitHub
parent 1b0aac3065
commit 1122ca5adb
6 changed files with 34 additions and 9 deletions
+3 -1
View File
@@ -50,6 +50,7 @@ GLOBAL_LIST_INIT(admin_verbs_admin, list(
/client/proc/global_man_up,
/client/proc/library_manager,
/client/proc/view_asays,
/client/proc/view_msays,
/client/proc/empty_ai_core_toggle_latejoin,
/client/proc/aooc,
/client/proc/freeze,
@@ -212,7 +213,8 @@ GLOBAL_LIST_INIT(admin_verbs_mentor, list(
/client/proc/openMentorTicketUI,
/client/proc/admin_observe, /* Allow mentors to observe as well, though they face some limitations */
/client/proc/admin_observe_target,
/client/proc/cmd_mentor_say /* mentor say*/
/client/proc/cmd_mentor_say, /* mentor say*/
/client/proc/view_msays,
// cmd_mentor_say is added/removed by the toggle_mentor_chat verb
))
GLOBAL_LIST_INIT(admin_verbs_proccall, list(
+1 -1
View File
@@ -347,7 +347,7 @@
dname = M
return {"<tr><td><a href='byond://?src=[UID()];adminplayeropts=[M.UID()]'>[dname]</a><b>[caption]</b>[logout_status][istype(A, /area/station/security/permabrig) ? "<b><font color=red> (PERMA) </b></font>" : ""][M.stat == 2 ? " <b><font color=red>(DEAD)</font></b>" : ""]</td>
<td><A href='byond://?src=[usr.UID()];priv_msg=[M.client?.ckey]'>PM</A> [ADMIN_FLW(M, "FLW")] </td>[close ? "</tr>" : ""]"}
<td><a href='byond://?src=[usr.UID()];priv_msg=[M.client?.ckey]'>PM</a> [ADMIN_FLW(M, "FLW")] [ADMIN_OBS(M, "OBS")] </td>[close ? "</tr>" : ""]"}
/datum/admins/proc/check_antagonists()
if(!check_rights(R_ADMIN))
+6
View File
@@ -1269,6 +1269,12 @@
usr.client.view_asays()
else if(href_list["msays"])
if(!check_rights(R_ADMIN | R_MENTOR))
return
usr.client.view_msays()
else if(href_list["tdome1"])
if(!check_rights(R_SERVER|R_EVENT)) return
+3 -1
View File
@@ -8,7 +8,7 @@
if(!msg)
return
var/datum/asays/asay = new(usr.ckey, usr.client.holder.rank, msg, world.timeofday)
var/datum/say/asay = new(usr.ckey, usr.client.holder.rank, msg, world.timeofday)
GLOB.asays += asay
log_adminsay(msg, src)
@@ -64,6 +64,8 @@
msg = emoji_parse(copytext_char(sanitize(msg), 1, MAX_MESSAGE_LEN))
log_mentorsay(msg, src)
var/datum/say/msay = new(usr.ckey, usr.client.holder.rank, msg, world.timeofday)
GLOB.msays += msay
mob.create_log(OOC_LOG, "MSAY: [msg]")
if(!msg)
+20 -5
View File
@@ -1,17 +1,28 @@
GLOBAL_LIST_EMPTY(asays)
GLOBAL_LIST_EMPTY(msays)
/datum/asays
/datum/say
var/ckey
var/rank
var/message
var/time
/datum/asays/New(ckey = "", rank = "", message = "", time = 0)
/datum/say/New(ckey = "", rank = "", message = "", time = 0)
src.ckey = ckey
src.rank = rank
src.message = message
src.time = time
/client/proc/view_msays()
set name = "Msays"
set desc = "View Msays from the current round."
set category = "Admin"
if(!check_rights(R_MENTOR | R_ADMIN))
return
display_says(GLOB.msays, "msay")
/client/proc/view_asays()
set name = "Asays"
set desc = "View Asays from the current round."
@@ -20,6 +31,10 @@ GLOBAL_LIST_EMPTY(asays)
if(!check_rights(R_ADMIN))
return
display_says(GLOB.asays, "asay")
/client/proc/display_says(list/say_list, title)
var/list/output = list({"
<style>
td, th
@@ -35,7 +50,7 @@ GLOBAL_LIST_EMPTY(asays)
table-layout: fixed;
}
</style>
<a href='byond://?src=[holder.UID()];asays=1'>Refresh</a>
<a href='byond://?src=[holder.UID()];[title]s=1'>Refresh</a>
<table style='width: 100%; border-collapse: collapse; table-layout: auto; margin-top: 3px;'>
"})
@@ -51,7 +66,7 @@ GLOBAL_LIST_EMPTY(asays)
<tbody>
"}
for(var/datum/asays/A in GLOB.asays)
for(var/datum/say/A in say_list)
var/timestr = time2text(A.time, "hh:mm:ss")
output += {"
<tr>
@@ -65,6 +80,6 @@ GLOBAL_LIST_EMPTY(asays)
</tbody>
</table>"}
var/datum/browser/popup = new(src, "asays", "<div align='center'>Current Round Asays</div>", 1200, 825)
var/datum/browser/popup = new(src, title, "<div align='center'>Current Round [capitalize(title)]s</div>", 1200, 825)
popup.set_content(output.Join())
popup.open(0)
+1 -1
View File
@@ -29,7 +29,7 @@
to_chat(usr, "<span class='boldannounceooc'>No other admins online to ping[de_admin_also == "Yes" ? ", including those that have used de-admin" : ""]!</span>")
return
var/datum/asays/asay = new(usr.ckey, usr.client.holder.rank, msg, world.timeofday)
var/datum/say/asay = new(usr.ckey, usr.client.holder.rank, msg, world.timeofday)
GLOB.asays += asay
log_ping_all_admins("[length(admins_to_ping)] clients pinged: [msg]", src)