mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2025-12-24 09:14:17 +00:00
Adds onscreen admin alerts (#20182)
* 1984 * <br> to \n * Apply suggestions from code review Co-authored-by: Ryan <80364400+Sirryan2002@users.noreply.github.com> --------- Co-authored-by: Ryan <80364400+Sirryan2002@users.noreply.github.com>
This commit is contained in:
@@ -1009,3 +1009,36 @@ GLOBAL_LIST_INIT(admin_verbs_maintainer, list(
|
||||
return
|
||||
|
||||
watchlist_show()
|
||||
|
||||
/client/proc/cmd_admin_alert_message(mob/about_to_be_banned)
|
||||
set name = "Send Alert Message"
|
||||
set category = "Admin"
|
||||
|
||||
if(!ismob(about_to_be_banned))
|
||||
return
|
||||
|
||||
if(!check_rights(R_ADMIN))
|
||||
return
|
||||
|
||||
var/alert_type = alert(src, "Do you wish to send an admin alert to [key_name(about_to_be_banned, FALSE)]?",,"Yes", "No", "Custom Message")
|
||||
|
||||
switch(alert_type)
|
||||
if("Yes")
|
||||
var/message = "An admin is trying to talk to you!\nCheck your chat window and click their name to respond or you may be banned!"
|
||||
show_blurb(about_to_be_banned, 15, message, null, "center", "center", COLOR_RED, null, null, 1)
|
||||
log_admin("[key_name(src)] sent a default admin alert to [key_name(about_to_be_banned)].")
|
||||
message_admins("[key_name(src)] sent a default admin alert to [key_name(about_to_be_banned)].")
|
||||
|
||||
if("Custom Message")
|
||||
var/message = input(src, "Input your custom admin alert text:", "Message") as text|null
|
||||
if(!message)
|
||||
return
|
||||
message = strip_html(message, 500)
|
||||
|
||||
var/message_color = input(src, "Input your message color:", "Color Selector") as color|null
|
||||
if(!message_color)
|
||||
return
|
||||
|
||||
show_blurb(about_to_be_banned, 15, message, null, "center", "center", message_color, null, null, 1)
|
||||
log_admin("[key_name(src)] sent an admin alert to [key_name(about_to_be_banned)] with custom message [message].")
|
||||
message_admins("[key_name(src)] sent an admin alert to [key_name(about_to_be_banned)] with custom message [message].")
|
||||
|
||||
@@ -107,8 +107,9 @@ GLOBAL_VAR_INIT(nologevent, 0)
|
||||
body += "<a href='?src=[usr.UID()];priv_msg=[M.client.ckey]'>PM</a> - "
|
||||
body += "[ADMIN_SM(M,"SM")] - "
|
||||
if(ishuman(M) && M.mind)
|
||||
body += "<a href='?_src_=holder;HeadsetMessage=[M.UID()]'>HM</a> -"
|
||||
body += "[admin_jump_link(M)]\] </b><br>"
|
||||
body += "<a href='?_src_=holder;HeadsetMessage=[M.UID()]'>HM</a> - "
|
||||
body += "[admin_jump_link(M)] - "
|
||||
body += "<a href='?_src_=holder;adminalert=[M.UID()]'>SEND ALERT</a>\]</b><br>"
|
||||
body += "<b>Mob type:</b> [M.type]<br>"
|
||||
if(M.client)
|
||||
if(M.client.related_accounts_cid.len)
|
||||
@@ -140,7 +141,7 @@ GLOBAL_VAR_INIT(nologevent, 0)
|
||||
<A href='?_src_=holder;mute=[M.UID()];mute_type=[MUTE_OOC]'><font color='[check_mute(M.client.ckey, MUTE_OOC) ? "red" : "#6685f5"]'>OOC</font></a> |
|
||||
<A href='?_src_=holder;mute=[M.UID()];mute_type=[MUTE_PRAY]'><font color='[check_mute(M.client.ckey, MUTE_PRAY) ? "red" : "#6685f5"]'>PRAY</font></a> |
|
||||
<A href='?_src_=holder;mute=[M.UID()];mute_type=[MUTE_ADMINHELP]'><font color='[check_mute(M.client.ckey, MUTE_ADMINHELP) ? "red" : "#6685f5"]'>ADMINHELP</font></a> |
|
||||
<A href='?_src_=holder;mute=[M.UID()];mute_type=[MUTE_DEADCHAT]'><font color='[check_mute(M.client.ckey, MUTE_DEADCHAT) ?" red" : "#6685f5"]'>DEADCHAT</font></a>]
|
||||
<A href='?_src_=holder;mute=[M.UID()];mute_type=[MUTE_DEADCHAT]'><font color='[check_mute(M.client.ckey, MUTE_DEADCHAT) ?" red" : "#6685f5"]'>DEADCHAT</font></a> |
|
||||
<A href='?_src_=holder;mute=[M.UID()];mute_type=[MUTE_EMOTE]'><font color='[check_mute(M.client.ckey, MUTE_EMOTE) ?" red" : "#6685f5"]'>EMOTE</font></a>]
|
||||
(<A href='?_src_=holder;mute=[M.UID()];mute_type=[MUTE_ALL]'><font color='[check_mute(M.client.ckey, MUTE_ALL) ? "red" : "#6685f5"]'>toggle all</font></a>)
|
||||
"}
|
||||
|
||||
@@ -85,7 +85,8 @@
|
||||
body += "<a href='?src=[UID()];traitor="+mobUID+"'>TP</a> - "
|
||||
body += "<a href='?src=[usr.UID()];priv_msg="+client_ckey+"'>PM</a> - "
|
||||
body += "<a href='?src=[UID()];subtlemessage="+mobUID+"'>SM</a> - "
|
||||
body += "<a href='?src=[UID()];adminplayerobservefollow="+mobUID+"'>FLW</a>"
|
||||
body += "<a href='?src=[UID()];adminplayerobservefollow="+mobUID+"'>FLW</a> - "
|
||||
body += "<a href='?src=[UID()];adminalert="+mobUID+"'>ALERT</a>"
|
||||
if(eyeUID)
|
||||
body += "|<a href='?src=[UID()];adminplayerobservefollow="+eyeUID+"'>EYE</a>"
|
||||
body += "<br>"
|
||||
|
||||
@@ -3374,6 +3374,13 @@
|
||||
else if(href_list["who_advanced"])
|
||||
usr.client.who_advanced()
|
||||
|
||||
else if(href_list["adminalert"])
|
||||
if(!check_rights(R_ADMIN))
|
||||
return
|
||||
|
||||
var/mob/about_to_be_banned = locateUID(href_list["adminalert"])
|
||||
usr.client.cmd_admin_alert_message(about_to_be_banned)
|
||||
|
||||
/client/proc/create_eventmob_for(mob/living/carbon/human/H, killthem = 0)
|
||||
if(!check_rights(R_EVENT))
|
||||
return
|
||||
|
||||
@@ -160,7 +160,8 @@
|
||||
to_chat(C, recieve_message)
|
||||
var/ping_link = check_rights(R_ADMIN, 0, mob) ? "(<a href='?src=[pm_tracker.UID()];ping=[C.key]'>PING</a>)" : ""
|
||||
var/window_link = "(<a href='?src=[pm_tracker.UID()];newtitle=[C.key]'>WINDOW</a>)"
|
||||
to_chat(src, "<span class='pmsend'>[send_pm_type][type] to-<b>[holder ? key_name(C, TRUE, type) : key_name_hidden(C, TRUE, type)]</b>: [emoji_msg]</span> [ping_link] [window_link]")
|
||||
var/alert_link = "(<a href='?src=[pm_tracker.UID()];adminalert=[C.mob.UID()]'>ALERT</a>)"
|
||||
to_chat(src, "<span class='pmsend'>[send_pm_type][type] to-<b>[holder ? key_name(C, TRUE, type) : key_name_hidden(C, TRUE, type)]</b>: [emoji_msg]</span> [ping_link] [window_link] [alert_link]")
|
||||
|
||||
/*if(holder && !C.holder)
|
||||
C.last_pm_recieved = world.time
|
||||
@@ -363,7 +364,7 @@
|
||||
var/client/C = pms[title].client || update_client(title)
|
||||
if(!C)
|
||||
return "[title] (Disconnected)"
|
||||
return "[key_name(C, FALSE)] ([ADMIN_QUE(C.mob,"?")]) ([ADMIN_PP(C.mob,"PP")]) ([ADMIN_VV(C.mob,"VV")]) ([ADMIN_TP(C.mob,"TP")]) ([ADMIN_SM(C.mob,"SM")]) ([admin_jump_link(C.mob)])"
|
||||
return "[key_name(C, FALSE)] ([ADMIN_QUE(C.mob,"?")]) ([ADMIN_PP(C.mob,"PP")]) ([ADMIN_VV(C.mob,"VV")]) ([ADMIN_TP(C.mob,"TP")]) ([ADMIN_SM(C.mob,"SM")]) ([admin_jump_link(C.mob)]) ([ADMIN_ALERT(C.mob,"SEND ALERT")])"
|
||||
|
||||
/datum/pm_tracker/proc/update_client(title)
|
||||
var/client/C = GLOB.directory[ckey(title)]
|
||||
@@ -394,6 +395,13 @@
|
||||
show_ui(usr)
|
||||
return
|
||||
|
||||
if(href_list["adminalert"])
|
||||
if(!check_rights(R_ADMIN))
|
||||
return
|
||||
|
||||
var/mob/about_to_be_banned = locateUID(href_list["adminalert"])
|
||||
usr.client.cmd_admin_alert_message(about_to_be_banned)
|
||||
|
||||
if(href_list["ping"])
|
||||
var/client/C = pms[href_list["ping"]].client
|
||||
if(C)
|
||||
|
||||
Reference in New Issue
Block a user