[MIRROR] refactors most spans (#9139)

Co-authored-by: Heroman3003 <31296024+Heroman3003@users.noreply.github.com>
Co-authored-by: Kashargul <KashL@t-online.de>
This commit is contained in:
CHOMPStation2
2024-10-04 06:00:17 -07:00
committed by GitHub
parent 43ee646816
commit ab154b48b2
1511 changed files with 12497 additions and 12357 deletions

View File

@@ -46,7 +46,7 @@ var/list/mentor_verbs_default = list(
set category = "Admin.Secrets" //CHOMPEdit
set name = "Make Mentor"
if(!holder)
to_chat(src, "<span class='pm warning'>Error: Only administrators may use this command.</span>")
to_chat(src, span_pm(span_warning("Error: Only administrators may use this command.")))
return
var/list/client/targets[0]
for(var/client/T in GLOB.clients)
@@ -56,12 +56,12 @@ var/list/mentor_verbs_default = list(
return
var/client/C = targets[target]
if(has_mentor_powers(C) || C.deadmin_holder) // If an admin is deadminned you could mentor them and that will cause fuckery if they readmin
to_chat(src, "<span class='pm warning'>Error: They already have mentor powers.</span>")
to_chat(src, span_pm(span_warning("Error: They already have mentor powers.")))
return
var/datum/mentor/M = new /datum/mentor(C.ckey)
M.associate(C)
to_chat(C, "<span class='pm notice'>You have been granted mentorship.</span>")
to_chat(src, "<span class='pm notice'>You have made [C] a mentor.</span>")
to_chat(C, span_pm(span_notice("You have been granted mentorship.")))
to_chat(src, span_pm(span_notice("You have made [C] a mentor.")))
log_admin("[key_name(src)] made [key_name(C)] a mentor.")
feedback_add_details("admin_verb","Make Mentor") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
// CHOMPedit Start - Adding to DB Logic
@@ -76,7 +76,7 @@ var/list/mentor_verbs_default = list(
set category = "Admin.Secrets" //CHOMPEdit
set name = "Unmake Mentor"
if(!holder)
to_chat(src, "<span class='pm warning'>Error: Only administrators may use this command.</span>")
to_chat(src, span_pm(span_warning("Error: Only administrators may use this command.")))
return
var/list/client/targets[0]
for(var/client/T in GLOB.mentors)
@@ -86,8 +86,8 @@ var/list/mentor_verbs_default = list(
return
var/client/C = targets[target]
C.mentorholder.disassociate()
to_chat(C, "<span class='pm warning'>Your mentorship has been revoked.</span>")
to_chat(src, "<span class='pm notice'>You have revoked [C]'s mentorship.</span>")
to_chat(C, span_pm(span_warning("Your mentorship has been revoked.")))
to_chat(src, span_pm(span_notice("You have revoked [C]'s mentorship.")))
log_admin("[key_name(src)] revoked [key_name(C)]'s mentorship.")
feedback_add_details("admin_verb","Unmake Mentor") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
// CHOMPedit Start - Removing from DB Logic
@@ -147,7 +147,7 @@ var/list/mentor_verbs_default = list(
/client/proc/cmd_mhelp_reply(whom)
if(prefs.muted & MUTE_ADMINHELP)
to_chat(src, "<span class='pm warning'>Error: Mentor-PM: You are unable to use admin PM-s (muted).</span>")
to_chat(src, span_pm(span_warning("Error: Mentor-PM: You are unable to use admin PM-s (muted).")))
return
var/client/C
if(istext(whom))
@@ -156,16 +156,16 @@ var/list/mentor_verbs_default = list(
C = whom
if(!C)
if(has_mentor_powers(src))
to_chat(src, "<span class='pm warning'>Error: Mentor-PM: Client not found.</span>")
to_chat(src, span_pm(span_warning("Error: Mentor-PM: Client not found.")))
return
var/datum/ticket/T = C.current_ticket // CHOMPedit - Ticket System
if(T) // CHOMPedit - Ticket System
message_mentors("<span class='mentor_channel'>[src] has started replying to [C]'s mentor help.</span>")
message_mentors(span_mentor_channel("[src] has started replying to [C]'s mentor help."))
var/msg = tgui_input_text(src,"Message:", "Private message to [C]", multiline = TRUE)
if (!msg)
message_mentors("<span class='mentor_channel'>[src] has cancelled their reply to [C]'s mentor help.</span>")
message_mentors(span_mentor_channel("[src] has cancelled their reply to [C]'s mentor help."))
return
cmd_mentor_pm(whom, msg, T) // CHOMPedit - Ticket System
@@ -198,13 +198,13 @@ var/list/mentor_verbs_default = list(
set hidden = 1
if(prefs.muted & MUTE_ADMINHELP)
to_chat(src, "<span class='pm warning'>Error: Mentor-PM: You are unable to use admin PM-s (muted).</span>")
to_chat(src, span_pm(span_warning("Error: Mentor-PM: You are unable to use admin PM-s (muted).")))
return
//Not a mentor and no open ticket
if(!has_mentor_powers(src) && !current_ticket) // CHOMPedit - Ticket System
to_chat(src, "<span class='pm warning'>You can no longer reply to this ticket, please open another one by using the Mentorhelp verb if need be.</span>")
to_chat(src, "<span class='pm notice'>Message: [msg]</span>")
to_chat(src, span_pm(span_warning("You can no longer reply to this ticket, please open another one by using the Mentorhelp verb if need be.")))
to_chat(src, span_pm(span_notice("Message: [msg]")))
return
var/client/recipient
@@ -223,12 +223,12 @@ var/list/mentor_verbs_default = list(
return
if(prefs.muted & MUTE_ADMINHELP)
to_chat(src, "<span class='pm warning'>Error: Mentor-PM: You are unable to use admin PM-s (muted).</span>")
to_chat(src, span_pm(span_warning("Error: Mentor-PM: You are unable to use admin PM-s (muted).")))
return
if(!recipient)
if(has_mentor_powers(src))
to_chat(src, "<span class='pm warning'>Error:Mentor-PM: Client not found.</span>")
to_chat(src, span_pm(span_warning("Error:Mentor-PM: Client not found.")))
to_chat(src, msg)
else
log_admin("Mentorhelp: [key_name(src)]: [msg]")
@@ -237,8 +237,8 @@ var/list/mentor_verbs_default = list(
//Has mentor powers but the recipient no longer has an open ticket
if(has_mentor_powers(src) && !recipient.current_ticket) // CHOMPedit - Ticket System
to_chat(src, "<span class='pm warning'>You can no longer reply to this ticket.</span>")
to_chat(src, "<span class='pm notice'>Message: [msg]</span>")
to_chat(src, span_pm(span_warning("You can no longer reply to this ticket.")))
to_chat(src, span_pm(span_notice("Message: [msg]")))
return
if (src.handle_spam_prevention(msg,MUTE_ADMINHELP))
@@ -248,7 +248,7 @@ var/list/mentor_verbs_default = list(
if(!msg)
return
var/interaction_message = "<span class='pm notice'>Mentor-PM from-<b>[src]</b> to-<b>[recipient]</b>: [msg]</span>"
var/interaction_message = span_pm(span_notice("Mentor-PM from-<b>[src]</b> to-<b>[recipient]</b>: [msg]"))
// CHOMPedit Start - Ticket System
if (recipient.current_ticket && !has_mentor_powers(recipient))
@@ -264,8 +264,8 @@ var/list/mentor_verbs_default = list(
src.current_ticket.AddInteraction(interaction_message)
// CHOMPedit End
to_chat(recipient, "<i><span class='mentor'>Mentor-PM from-<b><a href='?mentorhelp_msg=\ref[src]'>[src]</a></b>: [msg]</span></i>")
to_chat(src, "<i><span class='mentor'>Mentor-PM to-<b>[recipient]</b>: [msg]</span></i>")
to_chat(recipient, span_mentor(span_italics("Mentor-PM from-<b><a href='?mentorhelp_msg=\ref[src]'>[src]</a></b>: [msg]")))
to_chat(src, span_mentor(span_italics("Mentor-PM to-<b>[recipient]</b>: [msg]")))
log_admin("[key_name(src)]->[key_name(recipient)]: [msg]")

View File

@@ -196,7 +196,7 @@ GLOBAL_DATUM_INIT(mhelp_tickets, /datum/mentor_help_tickets, new)
//message from the initiator without a target, all people with mentor powers will see this
/datum/mentor_help/proc/MessageNoRecipient(msg)
var/ref_src = "\ref[src]"
var/chat_msg = "<span class='notice'>(<A HREF='?_src_=mentorholder;mhelp=[ref_src];[HrefToken()];mhelp_action=escalate'>ESCALATE</A>) Ticket [TicketHref("#[id]", ref_src)]<b>: [LinkedReplyName(ref_src)]:</b> [msg]</span>"
var/chat_msg = span_notice("(<A HREF='?_src_=mentorholder;mhelp=[ref_src];[HrefToken()];mhelp_action=escalate'>ESCALATE</A>) Ticket [TicketHref("#[id]", ref_src)]<b>: [LinkedReplyName(ref_src)]:</b> [msg]")
AddInteraction("<font color='red'>[LinkedReplyName(ref_src)]: [msg]</font>")
for (var/client/C in GLOB.mentors)
if (C.prefs?.read_preference(/datum/preference/toggle/play_mentorhelp_ping))
@@ -209,11 +209,11 @@ GLOBAL_DATUM_INIT(mhelp_tickets, /datum/mentor_help_tickets, new)
//Reopen a closed ticket
/datum/mentor_help/proc/Reopen()
if(state == AHELP_ACTIVE)
to_chat(usr, "<span class='warning'>This ticket is already open.</span>")
to_chat(usr, span_warning("This ticket is already open."))
return
if(GLOB.mhelp_tickets.CKey2ActiveTicket(initiator_ckey))
to_chat(usr, "<span class='warning'>This user already has an active ticket, cannot reopen this one.</span>")
to_chat(usr, span_warning("This user already has an active ticket, cannot reopen this one."))
return
statclick = new(null, src)
@@ -229,8 +229,8 @@ GLOBAL_DATUM_INIT(mhelp_tickets, /datum/mentor_help_tickets, new)
AddInteraction("<font color='purple'>Reopened by [usr.ckey]</font>")
if(initiator)
to_chat(initiator, "<span class='filter_adminlog'>[span_purple("Ticket [TicketHref("#[id]")] was reopened by [usr.ckey].")]</span>")
var/msg = "<span class='adminhelp'>Ticket [TicketHref("#[id]")] reopened by [usr.ckey].</span>"
to_chat(initiator, span_filter_adminlog("[span_purple("Ticket [TicketHref("#[id]")] was reopened by [usr.ckey].")]"))
var/msg = span_adminhelp("Ticket [TicketHref("#[id]")] reopened by [usr.ckey].")
message_mentors(msg)
log_admin(msg)
feedback_inc("mhelp_reopen")
@@ -254,9 +254,9 @@ GLOBAL_DATUM_INIT(mhelp_tickets, /datum/mentor_help_tickets, new)
state = AHELP_RESOLVED
GLOB.mhelp_tickets.ListInsert(src)
AddInteraction("<span class='filter_adminlog'>[span_green("Resolved by [usr.ckey].")]</span>")
AddInteraction(span_filter_adminlog("[span_green("Resolved by [usr.ckey].")]"))
if(initiator)
to_chat(initiator, "<span class='filter_adminlog'>[span_green("Ticket [TicketHref("#[id]")] was marked resolved by [usr.ckey].")]</span>")
to_chat(initiator, span_filter_adminlog("[span_green("Ticket [TicketHref("#[id]")] was marked resolved by [usr.ckey].")]"))
if(!silent)
feedback_inc("mhelp_resolve")
var/msg = "Ticket [TicketHref("#[id]")] resolved by [usr.ckey]"
@@ -358,12 +358,12 @@ GLOBAL_DATUM_INIT(mhelp_tickets, /datum/mentor_help_tickets, new)
if(tgui_alert(usr, "Really escalate this ticket to admins? No mentors will ever be able to interact with it again if you do.","Escalate",list("Yes","No")) != "Yes")
return
if (src.initiator == null) // You can't escalate a mentorhelp of someone who's logged out because it won't create the adminhelp properly
to_chat(usr, "<span class='pm warning'>Error: client not found, unable to escalate.</span>")
to_chat(usr, span_pm(span_warning("Error: client not found, unable to escalate.")))
return
var/datum/admin_help/AH = new /datum/admin_help(src.name, src.initiator, FALSE)
message_mentors("[usr.ckey] escalated Ticket [TicketHref("#[id]")]")
log_admin("[key_name(usr)] escalated mentorhelp [src.name]")
to_chat(src.initiator, "<span class='mentor'>[usr.ckey] escalated your mentorhelp to admins.</span>")
to_chat(src.initiator, span_mentor("[usr.ckey] escalated your mentorhelp to admins."))
AH._interactions = src._interactions
GLOB.mhelp_tickets.active_tickets -= src
GLOB.mhelp_tickets.resolved_tickets -= src
@@ -421,12 +421,12 @@ GLOBAL_DATUM_INIT(mhelp_tickets, /datum/mentor_help_tickets, new)
set name = "Mentorhelp"
if(say_disabled) //This is here to try to identify lag problems
to_chat(usr, "<span class='danger'>Speech is currently admin-disabled.</span>")
to_chat(usr, span_danger("Speech is currently admin-disabled."))
return
//handle muting and automuting
if(prefs.muted & MUTE_ADMINHELP)
to_chat(src, "<span class='danger'>Error: Mentor-PM: You cannot send adminhelps (Muted).</span>")
to_chat(src, span_danger("Error: Mentor-PM: You cannot send adminhelps (Muted)."))
return
if(handle_spam_prevention(msg,MUTE_ADMINHELP))
return
@@ -467,10 +467,10 @@ GLOBAL_DATUM_INIT(mhelp_tickets, /datum/mentor_help_tickets, new)
if(current_mentorhelp)
log_admin("Mentorhelp: [key_name(src)]: [msg]")
current_mentorhelp.MessageNoRecipient(msg)
to_chat(usr, "<span class='adminnotice'><span class='mentor'>Mentor-PM to-<b>Mentors</b>: [msg]</span></span>")
to_chat(usr, span_adminnotice(span_mentor("Mentor-PM to-<b>Mentors</b>: [msg]")))
return
else
to_chat(usr, "<span class='warning'>Ticket not found, creating new one...</span>")
to_chat(usr, span_warning("Ticket not found, creating new one..."))
else
current_mentorhelp.AddInteraction("[usr.ckey] opened a new ticket.")
current_mentorhelp.Resolve()
@@ -495,7 +495,7 @@ GLOBAL_DATUM_INIT(mhelp_tickets, /datum/mentor_help_tickets, new)
GLOB.mhelp_tickets.BrowseTickets(browse_to)
/proc/message_mentors(var/msg)
msg = "<span class='mentor_channel'><span class='prefix'>Mentor:</span> <span class=\"message\">[msg]</span></span>"
msg = span_mentor_channel(span_prefix("Mentor: " + span_message(msg)))
for(var/client/C in GLOB.mentors)
to_chat(C, msg)