Files
Paradise/code/modules/admin/verbs/asays.dm
warriorstar-orion 2a842644d5 port ADMIN_VERB and friends (#30646)
* port ADMIN_VERB and friends

* some renaming

* dumb

* one more rename

* never search and replace this codebase

* fix TM issues, more renaming

* add a static analysis to shore up user verbs

* fix double message on roundstart

* remove macro we're not using yet

* convert remaining playsounds verbs

* convert more verbs i missed somehow

* why is this a completely different signature than everything else

* fix ui_interact arg

* fix logging view and others

* buncha issues caught in TM

* fix mentor tickets ui

* fix bug report viewing

* moron
2025-12-12 19:18:22 +00:00

80 lines
1.9 KiB
Plaintext

GLOBAL_LIST_EMPTY(asays)
GLOBAL_LIST_EMPTY(msays)
GLOBAL_LIST_EMPTY(devsays)
GLOBAL_LIST_EMPTY(staffsays)
/datum/say
var/ckey
var/rank
var/message
var/time
/datum/say/New(ckey = "", rank = "", message = "", time = 0)
src.ckey = ckey
src.rank = rank
src.message = message
src.time = time
USER_VERB(view_msays, R_ADMIN|R_MENTOR, "Msays", "View current round Msays.", VERB_CATEGORY_ADMIN)
client.display_says(GLOB.msays, "msay")
USER_VERB(view_devsays, R_ADMIN|R_DEV_TEAM, "Devsays", "View current round Devsays.", VERB_CATEGORY_ADMIN)
client.display_says(GLOB.devsays, "devsay")
USER_VERB(view_asays, R_ADMIN, "Asays", "View current round Asays.", VERB_CATEGORY_ADMIN)
client.display_says(GLOB.asays, "asay")
USER_VERB(view_staffsays, R_ADMIN|R_DEV_TEAM, "Staffsays", "View current round Staffsays.", VERB_CATEGORY_ADMIN)
client.display_says(GLOB.staffsays, "staffsay")
/client/proc/display_says(list/say_list, title)
var/list/output = list({"
<style>
td, th
{
border: 1px solid #425c6e;
padding: 3px;
}
thead
{
color: #517087;
font-weight: bold;
table-layout: fixed;
}
</style>
<a href='byond://?src=[holder.UID()];[title]s=1'>Refresh</a>
<table style='width: 100%; border-collapse: collapse; table-layout: auto; margin-top: 3px;'>
"})
// Header & body start
output += {"
<thead>
<tr>
<th width="5%">Time</th>
<th width="10%">Ckey</th>
<th width="85%">Message</th>
</tr>
</thead>
<tbody>
"}
for(var/datum/say/A in say_list)
var/timestr = time2text(A.time, "hh:mm:ss")
output += {"
<tr>
<td width="5%">[timestr]</td>
<td width="10%"><b>[A.ckey] ([A.rank])</b></td>
<td width="85%">[A.message]</td>
</tr>
"}
output += {"
</tbody>
</table>"}
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)