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 13:03:53 -07:00
committed by GitHub
parent b9982f6970
commit 375a20e49b
1676 changed files with 15455 additions and 15226 deletions
+8 -8
View File
@@ -47,7 +47,7 @@
/obj/machinery/shower/examine(mob/user)
. = ..()
. += "<span class='notice'>[reagents.total_volume]/[reagents.maximum_volume] liquids remaining.</span>"
. += span_notice("[reagents.total_volume]/[reagents.maximum_volume] liquids remaining.")
/obj/machinery/shower/Destroy()
QDEL_NULL(soundloop)
@@ -56,7 +56,7 @@
/obj/machinery/shower/interact(mob/M)
if(reagents.total_volume < 5)
to_chat(M,"<span class='notice'>\The [src] is dry.</span>")
to_chat(M,span_notice("\The [src] is dry."))
return FALSE
on = !on
update_appearance()
@@ -74,7 +74,7 @@
/obj/machinery/shower/attackby(obj/item/I, mob/user, params)
if(I.tool_behaviour == TOOL_ANALYZER)
to_chat(user, "<span class='notice'>The water temperature seems to be [current_temperature].</span>")
to_chat(user, span_notice("The water temperature seems to be [current_temperature]."))
else
return ..()
@@ -91,7 +91,7 @@
/obj/machinery/shower/wrench_act(mob/living/user, obj/item/I)
..()
to_chat(user, "<span class='notice'>You begin to adjust the temperature valve with \the [I]...</span>")
to_chat(user, span_notice("You begin to adjust the temperature valve with \the [I]..."))
if(I.use_tool(src, user, 50))
switch(current_temperature)
if(SHOWER_NORMAL)
@@ -100,7 +100,7 @@
current_temperature = SHOWER_BOILING
if(SHOWER_BOILING)
current_temperature = SHOWER_NORMAL
user.visible_message("<span class='notice'>[user] adjusts the shower with \the [I].</span>", "<span class='notice'>You adjust the shower with \the [I] to [current_temperature] temperature.</span>")
user.visible_message(span_notice("[user] adjusts the shower with \the [I]."), span_notice("You adjust the shower with \the [I] to [current_temperature] temperature."))
user.log_message("has wrenched a shower at [AREACOORD(src)] to [current_temperature].", LOG_ATTACK)
add_hiddenprint(user)
handle_mist()
@@ -179,12 +179,12 @@
if(current_temperature == SHOWER_FREEZING)
if(iscarbon(L))
C.adjust_bodytemperature(-80, 80)
to_chat(L, "<span class='warning'>[src] is freezing!</span>")
to_chat(L, span_warning("[src] is freezing!"))
else if(current_temperature == SHOWER_BOILING)
if(iscarbon(L))
C.adjust_bodytemperature(35, 0, 500)
L.adjustFireLoss(5)
to_chat(L, "<span class='danger'>[src] is searing!</span>")
to_chat(L, span_danger("[src] is searing!"))
/obj/structure/showerframe
@@ -209,7 +209,7 @@
/obj/structure/showerframe/proc/can_be_rotated(mob/user, rotation_type)
if(anchored)
to_chat(user, "<span class='warning'>It is fastened to the floor!</span>")
to_chat(user, span_warning("It is fastened to the floor!"))
return !anchored
/obj/effect/mist