[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

@@ -227,7 +227,7 @@
if(law == zeroth_law_borg)
continue
if(law == zeroth_law)
to_chat(who, "<span class='danger'>[law.get_index()]. [law.law]</span>")
to_chat(who, span_danger("[law.get_index()]. [law.law]"))
else
to_chat(who, "[law.get_index()]. [law.law]")

View File

@@ -113,7 +113,7 @@
/datum/browser/proc/open(var/use_onclose = 1)
if(isnull(window_id)) //null check because this can potentially nuke goonchat
WARNING("Browser [title] tried to open with a null ID")
to_chat(user, "<span class='userdanger'>The [title] browser you tried to open failed a sanity check! Please report this on github!</span>")
to_chat(user, span_userdanger("The [title] browser you tried to open failed a sanity check! Please report this on github!"))
return
var/window_size = ""
if (width && height)

View File

@@ -468,10 +468,10 @@
user.put_in_hands(result)
else
result.forceMove(user.drop_location())
to_chat(user, "<span class='notice'>[TR.name] constructed.</span>")
to_chat(user, span_notice("[TR.name] constructed."))
TR.on_craft_completion(user, result)
else
to_chat(user, "<span class='warning'>Construction failed[result]</span>")
to_chat(user, span_warning("Construction failed[result]"))
busy = FALSE
if("toggle_recipes")
display_craftable_only = !display_craftable_only

View File

@@ -102,7 +102,7 @@
for(var/datum/material/M as anything in materials)
var/amt = materials[M]
if(amt)
examine_texts += "<span class='notice'>It has [amt] units of [lowertext(M.name)] stored.</span>"
examine_texts += span_notice("It has [amt] units of [lowertext(M.name)] stored.")
/// Proc that allows players to fill the parent with mats
/datum/component/material_container/proc/on_attackby(datum/source, obj/item/I, mob/living/user)
@@ -113,7 +113,7 @@
return
if(tc && !is_type_in_typecache(I, tc))
if(!(mat_container_flags & MATCONTAINER_SILENT))
to_chat(user, "<span class='warning'>[parent] won't accept [I]!</span>")
to_chat(user, span_warning("[parent] won't accept [I]!"))
return
. = COMPONENT_CANCEL_ATTACK_CHAIN
var/datum/callback/pc = precondition
@@ -125,10 +125,10 @@
return
var/material_amount = get_item_material_amount(I, mat_container_flags)
if(!material_amount)
to_chat(user, "<span class='warning'>[I] does not contain sufficient materials to be accepted by [parent].</span>")
to_chat(user, span_warning("[I] does not contain sufficient materials to be accepted by [parent]."))
return
if(!has_space(material_amount))
to_chat(user, "<span class='warning'>[parent] is full. Please remove materials from [parent] in order to insert more.</span>")
to_chat(user, span_warning("[parent] is full. Please remove materials from [parent] in order to insert more."))
return
user_insert(I, user, mat_container_flags)
@@ -136,7 +136,7 @@
/datum/component/material_container/proc/user_insert_stack(obj/item/stack/S, mob/living/user, breakdown_flags = mat_container_flags)
var/sheets = S.get_amount()
if(sheets < 1)
to_chat(user, "<span class='warning'>[S] does not contain sufficient materials to be accepted by [parent].</span>")
to_chat(user, span_warning("[S] does not contain sufficient materials to be accepted by [parent]."))
return
// Cache this since S may go away after use()
@@ -149,23 +149,23 @@
// If any part of a sheet can't go in us, the whole sheet is invalid
if(!can_hold_material(GET_MATERIAL_REF(material)))
to_chat(user, "<span class='warning'>[parent] cannot contain [material].</span>")
to_chat(user, span_warning("[parent] cannot contain [material]."))
return
// Our sheet had no material. Whoops.
if(!matter_per_sheet)
to_chat(user, "<span class='warning'>[S] does not contain any matter acceptable by [parent].</span>")
to_chat(user, span_warning("[S] does not contain any matter acceptable by [parent]."))
return
// If we can't fit the material for one sheet, we're full.
if(!has_space(matter_per_sheet))
to_chat(user, "<span class='warning'>[parent] is full. Please remove materials from [parent] in order to insert more.</span>")
to_chat(user, span_warning("[parent] is full. Please remove materials from [parent] in order to insert more."))
return
// Calculate the maximum amount of sheets we could possibly accept.
var/max_sheets = round((max_amount - total_amount) / matter_per_sheet)
if(max_sheets <= 0)
to_chat(user, "<span class='warning'>[parent] is full. Please remove materials from [parent] in order to insert more.</span>")
to_chat(user, span_warning("[parent] is full. Please remove materials from [parent] in order to insert more."))
return
// Calculate the amount of sheets we're actually going to use.
@@ -176,7 +176,7 @@
// Use the amount of sheets from the stack
if(!S.use(sheets_to_use))
to_chat(user, "<span class='warning'>Something went wrong with your stack. Split it manually and try again.</span>")
to_chat(user, span_warning("Something went wrong with your stack. Split it manually and try again."))
return
// We're going to blindly insert all of the materials, our assertion above says it shouldn't be possible to overflow
@@ -187,7 +187,7 @@
last_inserted_id = matter
// Tell the user and wrap up.
to_chat(user, "<span class='notice'>You insert a material total of [inserted] into [parent].</span>")
to_chat(user, span_notice("You insert a material total of [inserted] into [parent]."))
if(after_insert)
after_insert.Invoke(S, last_inserted_id, inserted)
@@ -196,11 +196,11 @@
set waitfor = FALSE
var/active_held = user.get_active_hand() // differs from I when using TK
if(!user.unEquip(I))
to_chat(user, "<span class='warning'>[I] is stuck to you and cannot be placed into [parent].</span>")
to_chat(user, span_warning("[I] is stuck to you and cannot be placed into [parent]."))
return
var/inserted = insert_item(I, breakdown_flags = mat_container_flags)
if(inserted)
to_chat(user, "<span class='notice'>You insert a material total of [inserted] into [parent].</span>")
to_chat(user, span_notice("You insert a material total of [inserted] into [parent]."))
qdel(I)
if(after_insert)
after_insert.Invoke(I, last_inserted_id, inserted)

View File

@@ -86,7 +86,7 @@
datumname = "element"
_AddElement(lst)
log_admin("[key_name(usr)] has added [result] [datumname] to [key_name(src)].")
message_admins("<span class='notice'>[key_name_admin(usr)] has added [result] [datumname] to [key_name_admin(src)].</span>")
message_admins(span_notice("[key_name_admin(usr)] has added [result] [datumname] to [key_name_admin(src)]."))
/datum/proc/vv_get_header()
. = list()

View File

@@ -78,22 +78,22 @@
if("Never for this round")
if(be_special_flag)
D.client.prefs.be_special ^= be_special_flag
to_chat(D, "<span class='notice'>You will not be prompted to join similar roles to [role_name] for the rest of this round. Note: If you save your character now, it will save this permanently.</span>")
to_chat(D, span_notice("You will not be prompted to join similar roles to [role_name] for the rest of this round. Note: If you save your character now, it will save this permanently."))
else
to_chat(D, "<span class='warning'>This type of ghost-joinable role doesn't have a role type flag associated with it, so I can't prevent future requests, sorry. Bug a dev!</span>")
to_chat(D, span_warning("This type of ghost-joinable role doesn't have a role type flag associated with it, so I can't prevent future requests, sorry. Bug a dev!"))
if("Yes")
if(!evaluate_candidate(D)) // Failed revalidation
to_chat(D, "<span class='warning'>Unfortunately, you no longer qualify for this role. Sorry.</span>")
to_chat(D, span_warning("Unfortunately, you no longer qualify for this role. Sorry."))
else if(finished) // Already finished candidate list
to_chat(D, "<span class='warning'>Unfortunately, you were not fast enough, and there are no more available roles. Sorry.</span>")
to_chat(D, span_warning("Unfortunately, you were not fast enough, and there are no more available roles. Sorry."))
else // Prompt a second time
tgui_alert_async(D, "Are you sure you want to play as a [role_name]?", "[role_name] request", list("I'm Sure", "Nevermind"), CALLBACK(src, PROC_REF(get_reply)), wait_time SECONDS)
if("I'm Sure")
if(!evaluate_candidate(D)) // Failed revalidation
to_chat(D, "<span class='warning'>Unfortunately, you no longer qualify for this role. Sorry.</span>")
to_chat(D, span_warning("Unfortunately, you no longer qualify for this role. Sorry."))
else if(finished) // Already finished candidate list
to_chat(D, "<span class='warning'>Unfortunately, you were not fast enough, and there are no more available roles. Sorry.</span>")
to_chat(D, span_warning("Unfortunately, you were not fast enough, and there are no more available roles. Sorry."))
else // Accept their nomination
candidates.Add(D)
if(cutoff_number && candidates.len >= cutoff_number)

View File

@@ -58,7 +58,7 @@
set desc = "Check the current server code revision"
if(!GLOB.revdata)
to_chat(src, "<span class='warning'>Please wait until server initializations are complete.</span>")
to_chat(src, span_warning("Please wait until server initializations are complete."))
return
var/list/msg = list()

View File

@@ -187,29 +187,29 @@ var/bluespace_item_types = newlist(/obj/item/storage/backpack/holding,
precision = max(rand(1,100)*bluespace_things.len,100)
if(istype(teleatom, /mob/living))
var/mob/living/MM = teleatom
to_chat(MM, "<span class='danger'>The Bluespace interface on your [teleatom] interferes with the teleport!</span>")
to_chat(MM, span_danger("The Bluespace interface on your [teleatom] interferes with the teleport!"))
return 1
/datum/teleport/instant/science/teleportChecks()
if(istype(teleatom, /obj/item/disk/nuclear)) // Don't let nuke disks get teleported --NeoFite
teleatom.visible_message("<span class='danger'>\The [teleatom] bounces off of the portal!</span>")
teleatom.visible_message(span_danger("\The [teleatom] bounces off of the portal!"))
return 0
if(!isemptylist(teleatom.search_contents_for(/obj/item/disk/nuclear)))
if(istype(teleatom, /mob/living))
var/mob/living/MM = teleatom
MM.visible_message("<span class='danger'>\The [MM] bounces off of the portal!</span>","<span class='warning'>Something you are carrying seems to be unable to pass through the portal. Better drop it if you want to go through.</span>")
MM.visible_message(span_danger("\The [MM] bounces off of the portal!"),span_warning("Something you are carrying seems to be unable to pass through the portal. Better drop it if you want to go through."))
else
teleatom.visible_message("<span class='danger'>\The [teleatom] bounces off of the portal!</span>")
teleatom.visible_message(span_danger("\The [teleatom] bounces off of the portal!"))
return 0
/* VOREStation Removal
if(destination.z in using_map.admin_levels) //CentCom z-level
if(istype(teleatom, /obj/mecha))
var/obj/mecha/MM = teleatom
to_chat(MM.occupant, "<span class='danger'>\The [MM] would not survive the jump to a location so far away!</span>")
to_chat(MM.occupant, span_danger("\The [MM] would not survive the jump to a location so far away!"))
return 0
if(!isemptylist(teleatom.search_contents_for(/obj/item/storage/backpack/holding)))
teleatom.visible_message("<span class='danger'>\The [teleatom] bounces off of the portal!</span>")
teleatom.visible_message(span_danger("\The [teleatom] bounces off of the portal!"))
return 0
*/ //VOREStation Removal End
//VOREStation Edit Start
@@ -217,7 +217,7 @@ var/bluespace_item_types = newlist(/obj/item/storage/backpack/holding,
var/turf/dest_turf = get_turf(destination)
if(local && !(dest_turf.z in using_map.player_levels))
if(istype(teleatom, /mob/living))
to_chat(teleatom, "<span class='warning'>The portal refuses to carry you that far away!</span>")
to_chat(teleatom, span_warning("The portal refuses to carry you that far away!"))
return 0
else if(istype(destination.loc, /obj/belly))
var/obj/belly/destination_belly = destination.loc
@@ -234,7 +234,7 @@ var/bluespace_item_types = newlist(/obj/item/storage/backpack/holding,
obstructed = 1
else if(!((isturf(destination) && !destination.density) || (isturf(destination.loc) && !destination.loc.density)) || !destination.x || !destination.y || !destination.z) //If we're inside something or outside universe
obstructed = 1
to_chat(teleatom, "<span class='warning'>Something is blocking way on the other side!</span>")
to_chat(teleatom, span_warning("Something is blocking way on the other side!"))
if(obstructed)
return 0
else

View File

@@ -159,7 +159,7 @@
if(antag.add_antagonist(src, 1, 1, 0, 1, 1)) // Ignore equipment and role type for this.
log_admin("[key_name_admin(usr)] made [key_name(src)] into a [antag.role_text].")
else
to_chat(usr, "<span class='warning'>[src] could not be made into a [antag.role_text]!</span>")
to_chat(usr, span_warning("[src] could not be made into a [antag.role_text]!"))
else if(href_list["remove_antagonist"])
var/datum/antagonist/antag = all_antag_types[href_list["remove_antagonist"]]
@@ -196,7 +196,7 @@
return
if(mind)
mind.ambitions = sanitize(new_ambition)
to_chat(mind.current, "<span class='warning'>Your ambitions have been changed by higher powers, they are now: [mind.ambitions]</span>")
to_chat(mind.current, span_warning("Your ambitions have been changed by higher powers, they are now: [mind.ambitions]"))
log_and_message_admins("made [key_name(mind.current)]'s ambitions be '[mind.ambitions]'.")
else if (href_list["obj_edit"] || href_list["obj_add"])
@@ -346,10 +346,10 @@
if(I in organs.implants)
qdel(I)
break
to_chat(H, "<span class='notice'><font size =3><B>Your loyalty implant has been deactivated.</B></font></span>")
to_chat(H, span_notice("<font size =3><B>Your loyalty implant has been deactivated.</B></font>"))
log_admin("[key_name_admin(usr)] has de-loyalty implanted [current].")
if("add")
to_chat(H, "<span class='danger'><font size =3>You somehow have become the recepient of a loyalty transplant, and it just activated!</font></span>")
to_chat(H, span_danger("<font size =3>You somehow have become the recepient of a loyalty transplant, and it just activated!</font>"))
H.implant_loyalty(override = TRUE)
log_admin("[key_name_admin(usr)] has loyalty implanted [current].")
else

View File

@@ -30,6 +30,6 @@ stat_set_event, /decl/observ/stat_set, new)
if(!ourbelly.owner.client)
return
if(stat == CONSCIOUS)
to_chat(ourbelly.owner, "<span class='notice'>\The [src.name] is awake.</span>")
to_chat(ourbelly.owner, span_notice("\The [src.name] is awake."))
else if(stat == UNCONSCIOUS)
to_chat(ourbelly.owner, "<span class='red'>\The [src.name] has fallen unconscious!</span>")
to_chat(ourbelly.owner, span_red("\The [src.name] has fallen unconscious!"))

View File

@@ -93,7 +93,7 @@
if(only_one_driver && ridden.buckled_mobs.len)
var/mob/living/driver = ridden.buckled_mobs[1]
if(driver != user)
to_chat(user, "<span class='warning'>\The [ridden] can only be controlled by one person at a time, and is currently being controlled by \the [driver].</span>")
to_chat(user, span_warning("\The [ridden] can only be controlled by one person at a time, and is currently being controlled by \the [driver]."))
return
if(world.time < next_vehicle_move)
@@ -109,7 +109,7 @@
handle_vehicle_layer()
handle_vehicle_offsets()
else
to_chat(user, "<span class='warning'>You'll need [key_name] in one of your hands to move \the [ridden].</span>")
to_chat(user, span_warning("You'll need [key_name] in one of your hands to move \the [ridden]."))
/datum/riding/proc/Unbuckle(atom/movable/M)
// addtimer(CALLBACK(ridden, TYPE_PROC_REF(/atom/movable, unbuckle_mob), M), 0, TIMER_UNIQUE)
@@ -143,12 +143,12 @@
var/turf/current = get_turf(ridden)
if(istype(current, /turf/simulated/floor/water/underwater)) //don't work at the bottom of the ocean!
to_chat(user, "<span class='warning'>The boat has sunk!</span>")
to_chat(user, span_warning("The boat has sunk!"))
return FALSE
else if(istype(next, /turf/simulated/floor/water) || istype(current, /turf/simulated/floor/water)) //We can move from land to water, or water to land, but not from land to land
..()
else
to_chat(user, "<span class='warning'>Boats don't go on land!</span>")
to_chat(user, span_warning("Boats don't go on land!"))
return FALSE
/datum/riding/boat/small // 'Small' boats can hold up to two people.

View File

@@ -41,16 +41,16 @@ GLOBAL_LIST(active_department_goals)
for(var/category in GLOB.active_department_goals)
var/list/cat_goals = GLOB.active_department_goals[category]
to_world("<span class='filter_system'><b>[category]</b></span>")
to_world(span_filter_system("<b>[category]</b>"))
if(!LAZYLEN(cat_goals))
to_world("<span class='filter_system'>There were no assigned goals!</span>")
to_world(span_filter_system("There were no assigned goals!"))
else
for(var/datum/goal/G in cat_goals)
var/success = G.check_completion()
to_world("<span class='filter_system'>[success ? "<span class='notice'>[G.name]</span>" : "<span class='warning'>[G.name]</span>"]</span>")
to_world("<span class='filter_system'>[G.goal_text]</span>")
to_world(span_filter_system("[success ? span_notice("[G.name]") : span_warning("[G.name]")]"))
to_world(span_filter_system("[G.goal_text]"))
return 1
/datum/goal

View File

@@ -31,16 +31,16 @@
var/obj/machinery/media/jukebox/A = holder
switch(wire)
if(WIRE_MAIN_POWER1)
holder.visible_message("<span class='notice'>[icon2html(A,viewers(holder))] The power light flickers.</span>")
holder.visible_message(span_notice("[icon2html(A,viewers(holder))] The power light flickers."))
A.shock(usr, 90)
if(WIRE_JUKEBOX_HACK)
holder.visible_message("<span class='notice'>[icon2html(A,viewers(holder))] The parental guidance light flickers.</span>")
holder.visible_message(span_notice("[icon2html(A,viewers(holder))] The parental guidance light flickers."))
if(WIRE_REVERSE)
holder.visible_message("<span class='notice'>[icon2html(A,viewers(holder))] The data light blinks ominously.</span>")
holder.visible_message(span_notice("[icon2html(A,viewers(holder))] The data light blinks ominously."))
if(WIRE_SPEEDUP)
holder.visible_message("<span class='notice'>[icon2html(A,viewers(holder))] The speakers squeaks.</span>")
holder.visible_message(span_notice("[icon2html(A,viewers(holder))] The speakers squeaks."))
if(WIRE_SPEEDDOWN)
holder.visible_message("<span class='notice'>[icon2html(A,viewers(holder))] The speakers rumble.</span>")
holder.visible_message(span_notice("[icon2html(A,viewers(holder))] The speakers rumble."))
if(WIRE_START)
A.StartPlaying()
if(WIRE_STOP)

View File

@@ -170,7 +170,7 @@
if("cut")
// if(!I.has_tool_quality(TOOL_WIRECUTTER) && !user.can_admin_interact())
if(!istype(I) || !I.has_tool_quality(TOOL_WIRECUTTER))
to_chat(user, "<span class='error'>You need wirecutters!</span>")
to_chat(user, span_warning("You need wirecutters!"))
return
playsound(holder, I.usesound, 20, 1)
@@ -181,7 +181,7 @@
if("pulse")
// if(!I.has_tool_quality(TOOL_MULTITOOL) && !user.can_admin_interact())
if(!istype(I) || !I.has_tool_quality(TOOL_MULTITOOL))
to_chat(user, "<span class='error'>You need a multitool!</span>")
to_chat(user, span_warning("You need a multitool!"))
return
playsound(holder, 'sound/weapons/empty.ogg', 20, 1)
@@ -202,14 +202,14 @@
return TRUE
if(!istype(I, /obj/item/assembly/signaler))
to_chat(user, "<span class='error'>You need a remote signaller!</span>")
to_chat(user, span_warning("You need a remote signaller!"))
return
if(user.unEquip(I))
attach_assembly(color, I)
return TRUE
else
to_chat(user, "<span class='warning'>[I] is stuck to your hand!</span>")
to_chat(user, span_warning("[I] is stuck to your hand!"))
/**
* Proc called to determine if the user can see wire define information, such as "Contraband", "Door Bolts", etc.