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
+5 -5
View File
@@ -43,11 +43,11 @@
/obj/machinery/computer/cargo/express/attackby(obj/item/W, mob/living/user, params)
if(W.GetID() && allowed(user))
locked = !locked
to_chat(user, "<span class='notice'>You [locked ? "lock" : "unlock"] the interface.</span>")
to_chat(user, span_notice("You [locked ? "lock" : "unlock"] the interface."))
return
else if(istype(W, /obj/item/disk/cargo/bluespace_pod))
podType = /obj/structure/closet/supplypod/bluespacepod//doesnt effect circuit board, making reversal possible
to_chat(user, "<span class='notice'>You insert the disk into [src], allowing for advanced supply delivery vehicles.</span>")
to_chat(user, span_notice("You insert the disk into [src], allowing for advanced supply delivery vehicles."))
qdel(W)
return TRUE
else if(istype(W, /obj/item/supplypod_beacon))
@@ -56,15 +56,15 @@
sb.link_console(src, user)
return TRUE
else
to_chat(user, "<span class='alert'>[src] is already linked to [sb].</span>")
to_chat(user, span_alert("[src] is already linked to [sb]."))
..()
/obj/machinery/computer/cargo/express/emag_act(mob/living/user)
if(obj_flags & EMAGGED)
return
if(user)
user.visible_message("<span class='warning'>[user] swipes a suspicious card through [src]!</span>",
"<span class='notice'>You change the routing protocols, allowing the Supply Pod to land anywhere on the station.</span>")
user.visible_message(span_warning("[user] swipes a suspicious card through [src]!"),
span_notice("You change the routing protocols, allowing the Supply Pod to land anywhere on the station."))
obj_flags |= EMAGGED
contraband = TRUE
// This also sets this on the circuit board