refactors most spans

This commit is contained in:
Kashargul
2024-10-02 21:10:31 +02:00
parent 5417c7772c
commit a2c673ab7a
1517 changed files with 12436 additions and 12347 deletions
+21 -21
View File
@@ -46,7 +46,7 @@ var/list/mentor_verbs_default = list(
set category = "Special Verbs"
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!
@@ -69,7 +69,7 @@ var/list/mentor_verbs_default = list(
set category = "Special Verbs"
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)
@@ -79,8 +79,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!
@@ -134,7 +134,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))
@@ -143,16 +143,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/mentor_help/MH = C.current_mentorhelp
if(MH)
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, MH)
@@ -185,13 +185,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_mentorhelp)
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
@@ -210,12 +210,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]")
@@ -224,8 +224,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_mentorhelp)
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))
@@ -235,7 +235,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]"))
if (recipient.current_mentorhelp && !has_mentor_powers(recipient))
recipient.current_mentorhelp.AddInteraction(interaction_message)
@@ -249,8 +249,8 @@ var/list/mentor_verbs_default = list(
if (src.current_mentorhelp)
src.current_mentorhelp.AddInteraction(interaction_message)
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]")
+14 -14
View File
@@ -191,7 +191,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))
@@ -204,11 +204,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)
@@ -224,8 +224,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")
@@ -249,9 +249,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]"
@@ -353,12 +353,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
@@ -416,12 +416,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
@@ -462,10 +462,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()
@@ -490,7 +490,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)