Refactors most spans into span procs (#59645)

Converts most spans into span procs. Mostly used regex for this and sorted out any compile time errors afterwards so there could be some bugs.
Was initially going to do defines, but ninja said to make it into a proc, and if there's any overhead, they can easily be changed to defines.

Makes it easier to control the formatting and prevents typos when creating spans as it'll runtime if you misspell instead of silently failing.
Reduces the code you need to write when writing spans, as you don't need to close the span as that's automatically handled by the proc.

(Note from Lemon: This should be converted to defines once we update the minimum version to 514. Didn't do it now because byond pain and such)
This commit is contained in:
Watermelon914
2021-06-14 21:03:53 +01:00
committed by GitHub
parent b9982f6970
commit 375a20e49b
1676 changed files with 15455 additions and 15226 deletions
+28 -28
View File
@@ -61,7 +61,7 @@ GLOBAL_LIST_INIT(blacklisted_builds, list(
msg += " Administrators have been informed."
log_game("[key_name(src)] Has hit the per-minute topic limit of [mtl] topic calls in a given game minute")
message_admins("[ADMIN_LOOKUPFLW(usr)] [ADMIN_KICK(usr)] Has hit the per-minute topic limit of [mtl] topic calls in a given game minute")
to_chat(src, "<span class='danger'>[msg]</span>")
to_chat(src, span_danger("[msg]"))
return
var/stl = CONFIG_GET(number/second_topic_limit)
@@ -74,7 +74,7 @@ GLOBAL_LIST_INIT(blacklisted_builds, list(
topiclimiter[SECOND_COUNT] = 0
topiclimiter[SECOND_COUNT] += 1
if (topiclimiter[SECOND_COUNT] > stl)
to_chat(src, "<span class='danger'>Your previous action was ignored because you've done too many in a second</span>")
to_chat(src, span_danger("Your previous action was ignored because you've done too many in a second"))
return
// Tgui Topic middleware
@@ -89,7 +89,7 @@ GLOBAL_LIST_INIT(blacklisted_builds, list(
//byond bug ID:2256651
if (asset_cache_job && (asset_cache_job in completed_asset_jobs))
to_chat(src, "<span class='danger'>An error has been detected in how your client is receiving resources. Attempting to correct.... (If you keep seeing these messages you might want to close byond and reconnect)</span>")
to_chat(src, span_danger("An error has been detected in how your client is receiving resources. Attempting to correct.... (If you keep seeing these messages you might want to close byond and reconnect)"))
src << browse("...", "window=asset_cache_browser")
return
if (href_list["asset_cache_preload_data"])
@@ -171,11 +171,11 @@ GLOBAL_LIST_INIT(blacklisted_builds, list(
if(CONFIG_GET(flag/automute_on) && !holder && last_message == message)
src.last_message_count++
if(src.last_message_count >= SPAM_TRIGGER_AUTOMUTE)
to_chat(src, "<span class='danger'>You have exceeded the spam filter limit for identical messages. An auto-mute was applied.</span>")
to_chat(src, span_danger("You have exceeded the spam filter limit for identical messages. An auto-mute was applied."))
cmd_admin_mute(src, mute_type, 1)
return TRUE
if(src.last_message_count >= SPAM_TRIGGER_WARNING)
to_chat(src, "<span class='danger'>You are nearing the spam filter limit for identical messages.</span>")
to_chat(src, span_danger("You are nearing the spam filter limit for identical messages."))
return FALSE
else
last_message = message
@@ -277,10 +277,10 @@ GLOBAL_LIST_INIT(blacklisted_builds, list(
alert_mob_dupe_login = TRUE
if(matches)
if(C)
message_admins("<span class='danger'><B>Notice: </B></span><span class='notice'>[key_name_admin(src)] has the same [matches] as [key_name_admin(C)].</span>")
message_admins(span_danger("<B>Notice: </B></span><span class='notice'>[key_name_admin(src)] has the same [matches] as [key_name_admin(C)]."))
log_admin_private("Notice: [key_name(src)] has the same [matches] as [key_name(C)].")
else
message_admins("<span class='danger'><B>Notice: </B></span><span class='notice'>[key_name_admin(src)] has the same [matches] as [key_name_admin(C)] (no longer logged in). </span>")
message_admins(span_danger("<B>Notice: </B></span><span class='notice'>[key_name_admin(src)] has the same [matches] as [key_name_admin(C)] (no longer logged in). "))
log_admin_private("Notice: [key_name(src)] has the same [matches] as [key_name(C)] (no longer logged in).")
var/reconnecting = FALSE
if(GLOB.player_details[ckey])
@@ -301,16 +301,16 @@ GLOBAL_LIST_INIT(blacklisted_builds, list(
if (byond_version >= 512)
if (!byond_build || byond_build < 1386)
message_admins("<span class='adminnotice'>[key_name(src)] has been detected as spoofing their byond version. Connection rejected.</span>")
message_admins(span_adminnotice("[key_name(src)] has been detected as spoofing their byond version. Connection rejected."))
add_system_note("Spoofed-Byond-Version", "Detected as using a spoofed byond version.")
log_access("Failed Login: [key] - Spoofed byond version")
qdel(src)
if (num2text(byond_build) in GLOB.blacklisted_builds)
log_access("Failed login: [key] - blacklisted byond version")
to_chat(src, "<span class='userdanger'>Your version of byond is blacklisted.</span>")
to_chat(src, "<span class='danger'>Byond build [byond_build] ([byond_version].[byond_build]) has been blacklisted for the following reason: [GLOB.blacklisted_builds[num2text(byond_build)]].</span>")
to_chat(src, "<span class='danger'>Please download a new version of byond. If [byond_build] is the latest, you can go to <a href=\"https://secure.byond.com/download/build\">BYOND's website</a> to download other versions.</span>")
to_chat(src, span_userdanger("Your version of byond is blacklisted."))
to_chat(src, span_danger("Byond build [byond_build] ([byond_version].[byond_build]) has been blacklisted for the following reason: [GLOB.blacklisted_builds[num2text(byond_build)]]."))
to_chat(src, span_danger("Please download a new version of byond. If [byond_build] is the latest, you can go to <a href=\"https://secure.byond.com/download/build\">BYOND's website</a> to download other versions."))
if(connecting_admin)
to_chat(src, "As an admin, you are being allowed to continue using this version, but please consider changing byond versions")
else
@@ -337,7 +337,7 @@ GLOBAL_LIST_INIT(blacklisted_builds, list(
var/ceb = CONFIG_GET(number/client_error_build)
var/cwv = CONFIG_GET(number/client_warn_version)
if (byond_version < cev || (byond_version == cev && byond_build < ceb)) //Out of date client.
to_chat(src, "<span class='danger'><b>Your version of BYOND is too old:</b></span>")
to_chat(src, span_danger("<b>Your version of BYOND is too old:</b>"))
to_chat(src, CONFIG_GET(string/client_error_message))
to_chat(src, "Your version: [byond_version].[byond_build]")
to_chat(src, "Required version: [cev].[ceb] or later")
@@ -356,7 +356,7 @@ GLOBAL_LIST_INIT(blacklisted_builds, list(
msg += "Visit <a href=\"https://secure.byond.com/download\">BYOND's website</a> to get the latest version of BYOND.<br>"
src << browse(msg, "window=warning_popup")
else
to_chat(src, "<span class='danger'><b>Your version of byond may be getting out of date:</b></span>")
to_chat(src, span_danger("<b>Your version of byond may be getting out of date:</b>"))
to_chat(src, CONFIG_GET(string/client_warn_message))
to_chat(src, "Your version: [byond_version]")
to_chat(src, "Required version to remove this message: [cwv] or later")
@@ -413,7 +413,7 @@ GLOBAL_LIST_INIT(blacklisted_builds, list(
apply_clickcatcher()
if(prefs.lastchangelog != GLOB.changelog_hash) //bolds the changelog button on the interface so we know there are updates.
to_chat(src, "<span class='info'>You have unread updates in the changelog.</span>")
to_chat(src, span_info("You have unread updates in the changelog."))
if(CONFIG_GET(flag/aggressive_changelog))
changelog()
else
@@ -428,7 +428,7 @@ GLOBAL_LIST_INIT(blacklisted_builds, list(
convert_notes_sql(ckey)
to_chat(src, get_message_output("message", ckey))
if(!winexists(src, "asset_cache_browser")) // The client is using a custom skin, tell them.
to_chat(src, "<span class='warning'>Unable to access asset cache browser, if you are using a custom skin file, please allow DS to download the updated version, if you are not, then make a bug report. This is not a critical issue but can cause issues with resource downloading, as it is impossible to know when extra resources arrived to you.</span>")
to_chat(src, span_warning("Unable to access asset cache browser, if you are using a custom skin file, please allow DS to download the updated version, if you are not, then make a bug report. This is not a critical issue but can cause issues with resource downloading, as it is impossible to know when extra resources arrived to you."))
update_ambience_pref()
@@ -555,7 +555,7 @@ GLOBAL_LIST_INIT(blacklisted_builds, list(
if(minutes <= living_recs && !CONFIG_GET(flag/panic_bunker_interview))
var/reject_message = "Failed Login: [key] - Account attempting to connect during panic bunker, but they do not have the required living time [minutes]/[living_recs]"
log_access(reject_message)
message_admins("<span class='adminnotice'>[reject_message]</span>")
message_admins(span_adminnotice("[reject_message]"))
var/message = CONFIG_GET(string/panic_bunker_message)
message = replacetext(message, "%minutes%", living_recs)
to_chat(src, message)
@@ -563,7 +563,7 @@ GLOBAL_LIST_INIT(blacklisted_builds, list(
var/list/panic_addr = CONFIG_GET(string/panic_server_address)
if(panic_addr && !connectiontopic_a["redirect"])
var/panic_name = CONFIG_GET(string/panic_server_name)
to_chat(src, "<span class='notice'>Sending you to [panic_name ? panic_name : panic_addr].</span>")
to_chat(src, span_notice("Sending you to [panic_name ? panic_name : panic_addr]."))
winset(src, null, "command=.options")
src << link("[panic_addr]?redirect=1")
qdel(query_client_in_db)
@@ -710,7 +710,7 @@ GLOBAL_LIST_INIT(blacklisted_builds, list(
if (oldcid)
if (!topic || !topic["token"] || !tokens[ckey] || topic["token"] != tokens[ckey])
if (!cidcheck_spoofckeys[ckey])
message_admins("<span class='adminnotice'>[key_name(src)] appears to have attempted to spoof a cid randomizer check.</span>")
message_admins(span_adminnotice("[key_name(src)] appears to have attempted to spoof a cid randomizer check."))
cidcheck_spoofckeys[ckey] = TRUE
cidcheck[ckey] = computer_id
tokens[ckey] = cid_check_reconnect()
@@ -726,11 +726,11 @@ GLOBAL_LIST_INIT(blacklisted_builds, list(
if (oldcid != computer_id && computer_id != lastcid) //IT CHANGED!!!
cidcheck -= ckey //so they can try again after removing the cid randomizer.
to_chat(src, "<span class='userdanger'>Connection Error:</span>")
to_chat(src, "<span class='danger'>Invalid ComputerID(spoofed). Please remove the ComputerID spoofer from your byond installation and try again.</span>")
to_chat(src, span_userdanger("Connection Error:"))
to_chat(src, span_danger("Invalid ComputerID(spoofed). Please remove the ComputerID spoofer from your byond installation and try again."))
if (!cidcheck_failedckeys[ckey])
message_admins("<span class='adminnotice'>[key_name(src)] has been detected as using a cid randomizer. Connection rejected.</span>")
message_admins(span_adminnotice("[key_name(src)] has been detected as using a cid randomizer. Connection rejected."))
send2tgs_adminless_only("CidRandomizer", "[key_name(src)] has been detected as using a cid randomizer. Connection rejected.")
cidcheck_failedckeys[ckey] = TRUE
note_randomizer_user()
@@ -741,11 +741,11 @@ GLOBAL_LIST_INIT(blacklisted_builds, list(
return TRUE
else
if (cidcheck_failedckeys[ckey])
message_admins("<span class='adminnotice'>[key_name_admin(src)] has been allowed to connect after showing they removed their cid randomizer</span>")
message_admins(span_adminnotice("[key_name_admin(src)] has been allowed to connect after showing they removed their cid randomizer"))
send2tgs_adminless_only("CidRandomizer", "[key_name(src)] has been allowed to connect after showing they removed their cid randomizer.")
cidcheck_failedckeys -= ckey
if (cidcheck_spoofckeys[ckey])
message_admins("<span class='adminnotice'>[key_name_admin(src)] has been allowed to connect after appearing to have attempted to spoof a cid randomizer check because it <i>appears</i> they aren't spoofing one this time</span>")
message_admins(span_adminnotice("[key_name_admin(src)] has been allowed to connect after appearing to have attempted to spoof a cid randomizer check because it <i>appears</i> they aren't spoofing one this time"))
cidcheck_spoofckeys -= ckey
cidcheck -= ckey
else if (computer_id != lastcid)
@@ -806,7 +806,7 @@ GLOBAL_LIST_INIT(blacklisted_builds, list(
if (CONFIG_GET(string/ipintel_email))
var/datum/ipintel/res = get_ip_intel(address)
if (res.intel >= CONFIG_GET(number/ipintel_rating_bad))
message_admins("<span class='adminnotice'>Proxy Detection: [key_name_admin(src)] IP intel rated [res.intel*100]% likely to be a Proxy/VPN.</span>")
message_admins(span_adminnotice("Proxy Detection: [key_name_admin(src)] IP intel rated [res.intel*100]% likely to be a Proxy/VPN."))
ip_intel = res.intel
/client/Click(atom/object, atom/location, control, params)
@@ -846,7 +846,7 @@ GLOBAL_LIST_INIT(blacklisted_builds, list(
add_system_note("aimbot", "Is using the middle click aimbot exploit")
log_game("[key_name(src)] Has hit the per-minute click limit of [mcl] clicks in a given game minute")
message_admins("[ADMIN_LOOKUPFLW(usr)] [ADMIN_KICK(usr)] Has hit the per-minute click limit of [mcl] clicks in a given game minute")
to_chat(src, "<span class='danger'>[msg]</span>")
to_chat(src, span_danger("[msg]"))
return
var/scl = CONFIG_GET(number/second_click_limit)
@@ -859,7 +859,7 @@ GLOBAL_LIST_INIT(blacklisted_builds, list(
clicklimiter[SECOND_COUNT] = 0
clicklimiter[SECOND_COUNT] += 1+(!!ab)
if (clicklimiter[SECOND_COUNT] > scl)
to_chat(src, "<span class='danger'>Your previous click was ignored because you've done too many in a second</span>")
to_chat(src, span_danger("Your previous click was ignored because you've done too many in a second"))
return
if (prefs.hotkeys)
@@ -1042,7 +1042,7 @@ GLOBAL_LIST_INIT(blacklisted_builds, list(
var/new_duration = world.realtime + duration
if(prefs.hearted_until > new_duration)
return
to_chat(src, "<span class='nicegreen'>Someone awarded you a heart!</span>")
to_chat(src, span_nicegreen("Someone awarded you a heart!"))
prefs.hearted_until = new_duration
prefs.hearted = TRUE
prefs.save_preferences()
@@ -1074,7 +1074,7 @@ GLOBAL_LIST_INIT(blacklisted_builds, list(
/client/proc/check_panel_loaded()
if(statbrowser_ready)
return
to_chat(src, "<span class='userdanger'>Statpanel failed to load, click <a href='?src=[REF(src)];reload_statbrowser=1'>here</a> to reload the panel </span>")
to_chat(src, span_userdanger("Statpanel failed to load, click <a href='?src=[REF(src)];reload_statbrowser=1'>here</a> to reload the panel "))
/**
* Initializes dropdown menus on client
+10 -10
View File
@@ -1019,7 +1019,7 @@ GLOBAL_LIST_EMPTY(preferences_datums)
return
if (!isnum(desiredLvl))
to_chat(user, "<span class='danger'>UpdateJobPreference - desired level was not a number. Please notify coders!</span>")
to_chat(user, span_danger("UpdateJobPreference - desired level was not a number. Please notify coders!"))
ShowChoices(user)
return
@@ -1049,7 +1049,7 @@ GLOBAL_LIST_EMPTY(preferences_datums)
/datum/preferences/proc/SetQuirks(mob/user)
if(!SSquirks)
to_chat(user, "<span class='danger'>The quirk subsystem is still initializing! Try again in a minute.</span>")
to_chat(user, span_danger("The quirk subsystem is still initializing! Try again in a minute."))
return
var/list/dat = list()
@@ -1145,7 +1145,7 @@ GLOBAL_LIST_EMPTY(preferences_datums)
var/expires = "This is a permanent ban."
if(ban_details["expiration_time"])
expires = " The ban is for [DisplayTimeText(text2num(ban_details["duration"]) MINUTES)] and expires on [ban_details["expiration_time"]] (server time)."
to_chat(user, "<span class='danger'>You, or another user of this computer or connection ([ban_details["key"]]) is banned from playing [href_list["bancheck"]].<br>The ban reason is: [ban_details["reason"]]<br>This ban (BanID #[ban_details["id"]]) was applied by [ban_details["admin_key"]] on [ban_details["bantime"]] during round ID [ban_details["round_id"]].<br>[expires]</span>")
to_chat(user, span_danger("You, or another user of this computer or connection ([ban_details["key"]]) is banned from playing [href_list["bancheck"]].<br>The ban reason is: [ban_details["reason"]]<br>This ban (BanID #[ban_details["id"]]) was applied by [ban_details["admin_key"]] on [ban_details["bantime"]] during round ID [ban_details["round_id"]].<br>[expires]"))
return
if(href_list["preference"] == "job")
switch(href_list["task"])
@@ -1188,22 +1188,22 @@ GLOBAL_LIST_EMPTY(preferences_datums)
continue
for(var/Q in all_quirks)
if((Q in L) && !(Q == quirk)) //two quirks have lined up in the list of the list of quirks that conflict with each other, so return (see quirks.dm for more details)
to_chat(user, "<span class='danger'>[quirk] is incompatible with [Q].</span>")
to_chat(user, span_danger("[quirk] is incompatible with [Q]."))
return
var/value = SSquirks.quirk_points[quirk]
var/balance = GetQuirkBalance()
if(quirk in all_quirks)
if(balance + value < 0)
to_chat(user, "<span class='warning'>Refunding this would cause you to go below your balance!</span>")
to_chat(user, span_warning("Refunding this would cause you to go below your balance!"))
return
all_quirks -= quirk
else
var/is_positive_quirk = SSquirks.quirk_points[quirk] > 0
if(is_positive_quirk && GetPositiveQuirkCount() >= MAX_QUIRKS)
to_chat(user, "<span class='warning'>You can't have more than [MAX_QUIRKS] positive quirks!</span>")
to_chat(user, span_warning("You can't have more than [MAX_QUIRKS] positive quirks!"))
return
if(balance - value < 0)
to_chat(user, "<span class='warning'>You don't have enough balance to gain this quirk!</span>")
to_chat(user, span_warning("You don't have enough balance to gain this quirk!"))
return
all_quirks += quirk
SetQuirks(user)
@@ -1383,7 +1383,7 @@ GLOBAL_LIST_EMPTY(preferences_datums)
else if((MUTCOLORS_PARTSONLY in pref_species.species_traits) || ReadHSV(temp_hsv)[3] >= ReadHSV("#7F7F7F")[3]) // mutantcolors must be bright, but only if they affect the skin
features["mcolor"] = sanitize_hexcolor(new_mutantcolor)
else
to_chat(user, "<span class='danger'>Invalid color. Your color is not bright enough.</span>")
to_chat(user, span_danger("Invalid color. Your color is not bright enough."))
if("color_ethereal")
var/new_etherealcolor = input(user, "Choose your ethereal color", "Character Preference") as null|anything in GLOB.color_list_ethereal
@@ -1735,7 +1735,7 @@ GLOBAL_LIST_EMPTY(preferences_datums)
if("clear_scars")
var/path = "data/player_saves/[user.ckey[1]]/[user.ckey]/scars.sav"
fdel(path)
to_chat(user, "<span class='notice'>All scar slots cleared.</span>")
to_chat(user, span_notice("All scar slots cleared."))
if("hear_midis")
toggles ^= SOUND_MIDI
@@ -1867,7 +1867,7 @@ GLOBAL_LIST_EMPTY(preferences_datums)
if("clear_heart")
hearted = FALSE
hearted_until = null
to_chat(user, "<span class='notice'>OOC Commendation Heart disabled</span>")
to_chat(user, span_notice("OOC Commendation Heart disabled"))
save_preferences()
ShowChoices(user)
+1 -1
View File
@@ -131,7 +131,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
<span class='warningplain'><b>There are new <a href='?_src_=prefs;preference=tab;tab=3'>keybindings</a> that default to keys you've already bound. The new ones will be unbound.</b></span>")
for(var/item in notadded)
var/datum/keybinding/conflicted = item
to_chat(parent, "<span class='danger'>[conflicted.category]: [conflicted.full_name] needs updating</span>")
to_chat(parent, span_danger("[conflicted.category]: [conflicted.full_name] needs updating"))
LAZYADD(key_bindings["Unbound"], conflicted.name) // set it to unbound to prevent this from opening up again in the future
save_preferences()
+2 -2
View File
@@ -404,9 +404,9 @@ GLOBAL_LIST_INIT(ghost_orbits, list(GHOST_ORBIT_CIRCLE,GHOST_ORBIT_TRIANGLE,GHOS
prefs.inquisitive_ghost = !prefs.inquisitive_ghost
prefs.save_preferences()
if(prefs.inquisitive_ghost)
to_chat(src, "<span class='notice'>You will now examine everything you click on.</span>")
to_chat(src, span_notice("You will now examine everything you click on."))
else
to_chat(src, "<span class='notice'>You will no longer examine things you click on.</span>")
to_chat(src, span_notice("You will no longer examine things you click on."))
SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle Ghost Inquisitiveness", "[prefs.inquisitive_ghost ? "Enabled" : "Disabled"]"))
//Admin Preferences
+2 -2
View File
@@ -5,7 +5,7 @@
prefs.enable_tips = !prefs.enable_tips
prefs.save_preferences()
to_chat(usr, "<span class='danger'>Examine tooltips [prefs.enable_tips ? "en" : "dis"]abled.</span>")
to_chat(usr, span_danger("Examine tooltips [prefs.enable_tips ? "en" : "dis"]abled."))
/client/verb/change_tip_delay()
set name = "Set Examine Tooltip Delay"
@@ -17,4 +17,4 @@
if(usr)//is this what you mean?
prefs.tip_delay = indelay
prefs.save_preferences()
to_chat(usr, "<span class='danger'>Tooltip delay set to [indelay] milliseconds.</span>")
to_chat(usr, span_danger("Tooltip delay set to [indelay] milliseconds."))
+18 -18
View File
@@ -6,7 +6,7 @@ GLOBAL_VAR_INIT(normal_ooc_colour, "#002eb8")
set category = "OOC"
if(GLOB.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
if(!mob)
@@ -14,16 +14,16 @@ GLOBAL_VAR_INIT(normal_ooc_colour, "#002eb8")
if(!holder)
if(!GLOB.ooc_allowed)
to_chat(src, "<span class='danger'>OOC is globally muted.</span>")
to_chat(src, span_danger("OOC is globally muted."))
return
if(!GLOB.dooc_allowed && (mob.stat == DEAD))
to_chat(usr, "<span class='danger'>OOC for dead mobs has been turned off.</span>")
to_chat(usr, span_danger("OOC for dead mobs has been turned off."))
return
if(prefs.muted & MUTE_OOC)
to_chat(src, "<span class='danger'>You cannot use OOC (muted).</span>")
to_chat(src, span_danger("You cannot use OOC (muted)."))
return
if(is_banned_from(ckey, "OOC"))
to_chat(src, "<span class='danger'>You have been banned from OOC.</span>")
to_chat(src, span_danger("You have been banned from OOC."))
return
if(QDELETED(src))
return
@@ -44,13 +44,13 @@ GLOBAL_VAR_INIT(normal_ooc_colour, "#002eb8")
if(handle_spam_prevention(msg,MUTE_OOC))
return
if(findtext(msg, "byond://"))
to_chat(src, "<span class='boldannounce'><B>Advertising other servers is not allowed.</B></span>")
to_chat(src, span_boldannounce("<B>Advertising other servers is not allowed.</B>"))
log_admin("[key_name(src)] has attempted to advertise in OOC: [msg]")
message_admins("[key_name_admin(src)] has attempted to advertise in OOC: [msg]")
return
if(!(prefs.chat_toggles & CHAT_OOC))
to_chat(src, "<span class='danger'>You have OOC muted.</span>")
to_chat(src, span_danger("You have OOC muted."))
return
mob.log_talk(raw_msg, LOG_OOC)
@@ -70,20 +70,20 @@ GLOBAL_VAR_INIT(normal_ooc_colour, "#002eb8")
if(holder)
if(!holder.fakekey || C.holder)
if(check_rights_for(src, R_ADMIN))
to_chat(C, "<span class='adminooc'>[CONFIG_GET(flag/allow_admin_ooccolor) && prefs.ooccolor ? "<font color=[prefs.ooccolor]>" :"" ]<span class='prefix'>OOC:</span> <EM>[keyname][holder.fakekey ? "/([holder.fakekey])" : ""]:</EM> <span class='message linkify'>[msg]</span></span>")
to_chat(C, span_adminooc("[CONFIG_GET(flag/allow_admin_ooccolor) && prefs.ooccolor ? "<font color=[prefs.ooccolor]>" :"" ][span_prefix("OOC:")] <EM>[keyname][holder.fakekey ? "/([holder.fakekey])" : ""]:</EM> <span class='message linkify'>[msg]</span>"))
else
to_chat(C, "<span class='adminobserverooc'><span class='prefix'>OOC:</span> <EM>[keyname][holder.fakekey ? "/([holder.fakekey])" : ""]:</EM> <span class='message linkify'>[msg]</span></span>")
to_chat(C, span_adminobserverooc(span_prefix("OOC:</span> <EM>[keyname][holder.fakekey ? "/([holder.fakekey])" : ""]:</EM> <span class='message linkify'>[msg]")))
else
if(GLOB.OOC_COLOR)
to_chat(C, "<span class='oocplain'><font color='[GLOB.OOC_COLOR]'><b><span class='prefix'>OOC:</span> <EM>[holder.fakekey ? holder.fakekey : key]:</EM> <span class='message linkify'>[msg]</span></b></font></span>")
to_chat(C, "<span class='oocplain'><font color='[GLOB.OOC_COLOR]'><b>[span_prefix("OOC:")] <EM>[holder.fakekey ? holder.fakekey : key]:</EM> <span class='message linkify'>[msg]</span></b></font></span>")
else
to_chat(C, "<span class='ooc'><span class='prefix'>OOC:</span> <EM>[holder.fakekey ? holder.fakekey : key]:</EM> <span class='message linkify'>[msg]</span></span>")
to_chat(C, span_ooc(span_prefix("OOC:</span> <EM>[holder.fakekey ? holder.fakekey : key]:</EM> <span class='message linkify'>[msg]")))
else if(!(key in C.prefs.ignoring))
if(GLOB.OOC_COLOR)
to_chat(C, "<span class='oocplain'><font color='[GLOB.OOC_COLOR]'><b><span class='prefix'>OOC:</span> <EM>[keyname]:</EM> <span class='message linkify'>[msg]</span></b></font></span>")
to_chat(C, "<span class='oocplain'><font color='[GLOB.OOC_COLOR]'><b>[span_prefix("OOC:")] <EM>[keyname]:</EM> <span class='message linkify'>[msg]</span></b></font></span>")
else
to_chat(C, "<span class='ooc'><span class='prefix'>OOC:</span> <EM>[keyname]:</EM> <span class='message linkify'>[msg]</span></span>")
to_chat(C, span_ooc(span_prefix("OOC:</span> <EM>[keyname]:</EM> <span class='message linkify'>[msg]")))
/proc/toggle_ooc(toggle = null)
if(toggle != null) //if we're specifically en/disabling ooc
@@ -177,9 +177,9 @@ GLOBAL_VAR_INIT(normal_ooc_colour, "#002eb8")
set desc ="Check the admin notice if it has been set"
if(GLOB.admin_notice)
to_chat(src, "<span class='boldnotice'>Admin Notice:</span>\n \t [GLOB.admin_notice]")
to_chat(src, "[span_boldnotice("Admin Notice:")]\n \t [GLOB.admin_notice]")
else
to_chat(src, "<span class='notice'>There are no admin notices at the moment.</span>")
to_chat(src, span_notice("There are no admin notices at the moment."))
/client/verb/motd()
set name = "MOTD"
@@ -190,7 +190,7 @@ GLOBAL_VAR_INIT(normal_ooc_colour, "#002eb8")
if(motd)
to_chat(src, "<span class='infoplain'><div class=\"motd\">[motd]</div></span>", handle_whitespace=FALSE)
else
to_chat(src, "<span class='notice'>The Message of the Day has not been set.</span>")
to_chat(src, span_notice("The Message of the Day has not been set."))
/client/proc/self_notes()
set name = "View Admin Remarks"
@@ -198,7 +198,7 @@ GLOBAL_VAR_INIT(normal_ooc_colour, "#002eb8")
set desc = "View the notes that admins have written about you"
if(!CONFIG_GET(flag/see_own_notes))
to_chat(usr, "<span class='notice'>Sorry, that function is not enabled on this server.</span>")
to_chat(usr, span_notice("Sorry, that function is not enabled on this server."))
return
browse_messages(null, usr.ckey, null, TRUE)
@@ -209,7 +209,7 @@ GLOBAL_VAR_INIT(normal_ooc_colour, "#002eb8")
set desc = "View the amount of playtime for roles the server has tracked."
if(!CONFIG_GET(flag/use_exp_tracking))
to_chat(usr, "<span class='notice'>Sorry, tracking is currently disabled.</span>")
to_chat(usr, span_notice("Sorry, tracking is currently disabled."))
return
new /datum/job_report_menu(src, usr)
+1 -1
View File
@@ -14,7 +14,7 @@
/client/verb/display_ping(time as num)
set instant = TRUE
set name = ".display_ping"
to_chat(src, "<span class='notice'>Round trip ping took [round(pingfromtime(time),1)]ms</span>")
to_chat(src, span_notice("Round trip ping took [round(pingfromtime(time),1)]ms"))
/client/verb/ping()
set name = "Ping"
+20 -20
View File
@@ -33,7 +33,7 @@
return
if(confirm == "Yes")
if(suiciding)
to_chat(src, "<span class='warning'>You're already trying to commit suicide!</span>")
to_chat(src, span_warning("You're already trying to commit suicide!"))
return
set_suicide(TRUE) //need to be called before calling suicide_act as fuck knows what suicide_act will do with your suicider
var/obj/item/held_item = get_active_held_item()
@@ -103,7 +103,7 @@
"[src] is twisting [p_their()] own neck! It looks like [p_theyre()] trying to commit suicide.", \
"[src] is holding [p_their()] breath! It looks like [p_theyre()] trying to commit suicide.")
visible_message("<span class='danger'>[suicide_message]</span>", "<span class='userdanger'>[suicide_message]</span>")
visible_message(span_danger("[suicide_message]"), span_userdanger("[suicide_message]"))
suicide_log()
@@ -120,8 +120,8 @@
return
if(confirm == "Yes")
set_suicide(TRUE)
visible_message("<span class='danger'>[src]'s brain is growing dull and lifeless. [p_they(TRUE)] look[p_s()] like [p_theyve()] lost the will to live.</span>", \
"<span class='userdanger'>[src]'s brain is growing dull and lifeless. [p_they(TRUE)] look[p_s()] like [p_theyve()] lost the will to live.</span>")
visible_message(span_danger("[src]'s brain is growing dull and lifeless. [p_they(TRUE)] look[p_s()] like [p_theyve()] lost the will to live."), \
span_userdanger("[src]'s brain is growing dull and lifeless. [p_they(TRUE)] look[p_s()] like [p_theyve()] lost the will to live."))
suicide_log()
@@ -137,8 +137,8 @@
return
if(confirm == "Yes")
set_suicide(TRUE)
visible_message("<span class='danger'>[src] is powering down. It looks like [p_theyre()] trying to commit suicide.</span>", \
"<span class='userdanger'>[src] is powering down. It looks like [p_theyre()] trying to commit suicide.</span>")
visible_message(span_danger("[src] is powering down. It looks like [p_theyre()] trying to commit suicide."), \
span_userdanger("[src] is powering down. It looks like [p_theyre()] trying to commit suicide."))
suicide_log()
@@ -156,8 +156,8 @@
return
if(confirm == "Yes")
set_suicide(TRUE)
visible_message("<span class='danger'>[src] is powering down. It looks like [p_theyre()] trying to commit suicide.</span>", \
"<span class='userdanger'>[src] is powering down. It looks like [p_theyre()] trying to commit suicide.</span>")
visible_message(span_danger("[src] is powering down. It looks like [p_theyre()] trying to commit suicide."), \
span_userdanger("[src] is powering down. It looks like [p_theyre()] trying to commit suicide."))
suicide_log()
@@ -171,8 +171,8 @@
var/confirm = tgui_alert(usr,"Are you sure you want to commit suicide?", "Confirm Suicide", list("Yes", "No"))
if(confirm == "Yes")
var/turf/T = get_turf(src.loc)
T.visible_message("<span class='notice'>[src] flashes a message across its screen, \"Wiping core files. Please acquire a new personality to continue using pAI device functions.\"</span>", null, \
"<span class='notice'>[src] bleeps electronically.</span>")
T.visible_message(span_notice("[src] flashes a message across its screen, \"Wiping core files. Please acquire a new personality to continue using pAI device functions.\""), null, \
span_notice("[src] bleeps electronically."))
suicide_log()
@@ -190,9 +190,9 @@
return
if(confirm == "Yes")
set_suicide(TRUE)
visible_message("<span class='danger'>[src] is thrashing wildly! It looks like [p_theyre()] trying to commit suicide.</span>", \
"<span class='userdanger'>[src] is thrashing wildly! It looks like [p_theyre()] trying to commit suicide.</span>", \
"<span class='hear'>You hear thrashing.</span>")
visible_message(span_danger("[src] is thrashing wildly! It looks like [p_theyre()] trying to commit suicide."), \
span_userdanger("[src] is thrashing wildly! It looks like [p_theyre()] trying to commit suicide."), \
span_hear("You hear thrashing."))
suicide_log()
@@ -210,8 +210,8 @@
return
if(confirm == "Yes")
set_suicide(TRUE)
visible_message("<span class='danger'>[src] begins to fall down. It looks like [p_theyve()] lost the will to live.</span>", \
"<span class='userdanger'>[src] begins to fall down. It looks like [p_theyve()] lost the will to live.</span>")
visible_message(span_danger("[src] begins to fall down. It looks like [p_theyve()] lost the will to live."), \
span_userdanger("[src] begins to fall down. It looks like [p_theyve()] lost the will to live."))
suicide_log()
@@ -227,23 +227,23 @@
/mob/living/proc/canSuicide()
var/area/A = get_area(src)
if(A.area_flags & BLOCK_SUICIDE)
to_chat(src, "<span class='warning'>You can't commit suicide here! You can ghost if you'd like.</span>")
to_chat(src, span_warning("You can't commit suicide here! You can ghost if you'd like."))
return
switch(stat)
if(CONSCIOUS)
return TRUE
if(SOFT_CRIT)
to_chat(src, "<span class='warning'>You can't commit suicide while in a critical condition!</span>")
to_chat(src, span_warning("You can't commit suicide while in a critical condition!"))
if(UNCONSCIOUS, HARD_CRIT)
to_chat(src, "<span class='warning'>You need to be conscious to commit suicide!</span>")
to_chat(src, span_warning("You need to be conscious to commit suicide!"))
if(DEAD)
to_chat(src, "<span class='warning'>You're already dead!</span>")
to_chat(src, span_warning("You're already dead!"))
return
/mob/living/carbon/canSuicide()
if(!..())
return
if(!(mobility_flags & MOBILITY_USE)) //just while I finish up the new 'fun' suiciding verb. This is to prevent metagaming via suicide
to_chat(src, "<span class='warning'>You can't commit suicide whilst immobile! ((You can type Ghost instead however.))</span>")
to_chat(src, span_warning("You can't commit suicide whilst immobile! ((You can type Ghost instead however.))"))
return
return TRUE
+1 -1
View File
@@ -96,7 +96,7 @@
continue //Don't show afk admins to adminwho
if(!C.holder.fakekey)
msg += "\t[C] is a [C.holder.rank]\n"
msg += "<span class='info'>Adminhelps are also sent through TGS to services like IRC and Discord. If no admins are available in game adminhelp anyways and an admin will see it and respond.</span>"
msg += span_info("Adminhelps are also sent through TGS to services like IRC and Discord. If no admins are available in game adminhelp anyways and an admin will see it and respond.")
to_chat(src, msg)
#undef DEFAULT_WHO_CELLS_PER_ROW