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
+9 -9
View File
@@ -36,12 +36,12 @@ LINEN BINS
return
if(layer == initial(layer))
layer = ABOVE_MOB_LAYER
to_chat(user, "<span class='notice'>You cover yourself with [src].</span>")
to_chat(user, span_notice("You cover yourself with [src]."))
pixel_x = 0
pixel_y = 0
else
layer = initial(layer)
to_chat(user, "<span class='notice'>You smooth [src] out beneath you.</span>")
to_chat(user, span_notice("You smooth [src] out beneath you."))
add_fingerprint(user)
return
@@ -53,7 +53,7 @@ LINEN BINS
transfer_fingerprints_to(shreds)
shreds.add_fingerprint(user)
qdel(src)
to_chat(user, "<span class='notice'>You tear [src] up.</span>")
to_chat(user, span_notice("You tear [src] up."))
else
return ..()
@@ -340,7 +340,7 @@ LINEN BINS
return
sheets.Add(I)
amount++
to_chat(user, "<span class='notice'>You put [I] in [src].</span>")
to_chat(user, span_notice("You put [I] in [src]."))
update_appearance()
else if(default_unfasten_wrench(user, I, 5))
@@ -359,10 +359,10 @@ LINEN BINS
else if(amount && !hidden && I.w_class < WEIGHT_CLASS_BULKY) //make sure there's sheets to hide it among, make sure nothing else is hidden in there.
if(!user.transferItemToLoc(I, src))
to_chat(user, "<span class='warning'>\The [I] is stuck to your hand, you cannot hide it among the sheets!</span>")
to_chat(user, span_warning("\The [I] is stuck to your hand, you cannot hide it among the sheets!"))
return
hidden = I
to_chat(user, "<span class='notice'>You hide [I] among the sheets.</span>")
to_chat(user, span_notice("You hide [I] among the sheets."))
/obj/structure/bedsheetbin/attack_paw(mob/user, list/modifiers)
@@ -389,12 +389,12 @@ LINEN BINS
B.forceMove(drop_location())
user.put_in_hands(B)
to_chat(user, "<span class='notice'>You take [B] out of [src].</span>")
to_chat(user, span_notice("You take [B] out of [src]."))
update_appearance()
if(hidden)
hidden.forceMove(drop_location())
to_chat(user, "<span class='notice'>[hidden] falls out of [B]!</span>")
to_chat(user, span_notice("[hidden] falls out of [B]!"))
hidden = null
add_fingerprint(user)
@@ -413,7 +413,7 @@ LINEN BINS
B = new /obj/item/bedsheet(loc)
B.forceMove(drop_location())
to_chat(user, "<span class='notice'>You telekinetically remove [B] from [src].</span>")
to_chat(user, span_notice("You telekinetically remove [B] from [src]."))
update_appearance()
if(hidden)