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
@@ -19,10 +19,10 @@
return FALSE
var/obj/docking_port/mobile/M = SSshuttle.getShuttle("laborcamp")
if(!M)
to_chat(user, "<span class='warning'>Cannot locate shuttle!</span>")
to_chat(user, span_warning("Cannot locate shuttle!"))
return FALSE
var/obj/docking_port/stationary/S = M.get_docked()
if(S?.name == "laborcamp_away")
to_chat(user, "<span class='warning'>Shuttle is already at the outpost!</span>")
to_chat(user, span_warning("Shuttle is already at the outpost!"))
return FALSE
return TRUE
+13 -13
View File
@@ -100,26 +100,26 @@ GLOBAL_LIST(labor_sheet_values)
var/obj/item/card/id/advanced/prisoner/P = I
P.points += stacking_machine.points
stacking_machine.points = 0
to_chat(M, "<span class='notice'>Points transferred.</span>")
to_chat(M, span_notice("Points transferred."))
return TRUE
else
to_chat(M, "<span class='alert'>No valid id for point transfer detected.</span>")
to_chat(M, span_alert("No valid id for point transfer detected."))
if("move_shuttle")
if(!alone_in_area(get_area(src), M))
to_chat(M, "<span class='alert'>Prisoners are only allowed to be released while alone.</span>")
to_chat(M, span_alert("Prisoners are only allowed to be released while alone."))
return
switch(SSshuttle.moveShuttle("laborcamp", "laborcamp_home", TRUE))
if(1)
to_chat(M, "<span class='alert'>Shuttle not found.</span>")
to_chat(M, span_alert("Shuttle not found."))
if(2)
to_chat(M, "<span class='alert'>Shuttle already at station.</span>")
to_chat(M, span_alert("Shuttle already at station."))
if(3)
to_chat(M, "<span class='alert'>No permission to dock could be granted.</span>")
to_chat(M, span_alert("No permission to dock could be granted."))
else
if(!(obj_flags & EMAGGED))
Radio.set_frequency(FREQ_SECURITY)
Radio.talk_into(src, "A prisoner has returned to the station. Minerals and Prisoner ID card ready for retrieval.", FREQ_SECURITY)
to_chat(M, "<span class='notice'>Shuttle received message and will be sent shortly.</span>")
to_chat(M, span_notice("Shuttle received message and will be sent shortly."))
return TRUE
/obj/machinery/mineral/labor_claim_console/proc/locate_stacking_machine()
@@ -130,7 +130,7 @@ GLOBAL_LIST(labor_sheet_values)
/obj/machinery/mineral/labor_claim_console/emag_act(mob/user)
if(!(obj_flags & EMAGGED))
obj_flags |= EMAGGED
to_chat(user, "<span class='warning'>PZZTTPFFFT</span>")
to_chat(user, span_warning("PZZTTPFFFT"))
/**********************Prisoner Collection Unit**************************/
@@ -167,11 +167,11 @@ GLOBAL_LIST(labor_sheet_values)
if(istype(I, /obj/item/card/id))
if(istype(I, /obj/item/card/id/advanced/prisoner))
var/obj/item/card/id/advanced/prisoner/prisoner_id = I
to_chat(user, "<span class='notice'><B>ID: [prisoner_id.registered_name]</B></span>")
to_chat(user, "<span class='notice'>Points Collected:[prisoner_id.points]</span>")
to_chat(user, "<span class='notice'>Point Quota: [prisoner_id.goal]</span>")
to_chat(user, "<span class='notice'>Collect points by bringing smelted minerals to the Labor Shuttle stacking machine. Reach your quota to earn your release.</span>")
to_chat(user, span_notice("<B>ID: [prisoner_id.registered_name]</B>"))
to_chat(user, span_notice("Points Collected:[prisoner_id.points]"))
to_chat(user, span_notice("Point Quota: [prisoner_id.goal]"))
to_chat(user, span_notice("Collect points by bringing smelted minerals to the Labor Shuttle stacking machine. Reach your quota to earn your release."))
else
to_chat(user, "<span class='warning'>Error: Invalid ID</span>")
to_chat(user, span_warning("Error: Invalid ID"))
else
return ..()