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
+4 -4
View File
@@ -67,7 +67,7 @@
/obj/structure/ladder/singularity_pull()
if (!(resistance_flags & INDESTRUCTIBLE))
visible_message("<span class='danger'>[src] is torn to pieces by the gravitational pull!</span>")
visible_message(span_danger("[src] is torn to pieces by the gravitational pull!"))
qdel(src)
/obj/structure/ladder/proc/travel(going_up, mob/user, is_ghost, obj/structure/ladder/ladder)
@@ -103,7 +103,7 @@
if (down)
tool_list["Down"] = image(icon = 'icons/testing/turf_analysis.dmi', icon_state = "red_arrow", dir = SOUTH)
if (!length(tool_list))
to_chat(user, "<span class='warning'>[src] doesn't seem to lead anywhere!</span>")
to_chat(user, span_warning("[src] doesn't seem to lead anywhere!"))
return
var/result = show_radial_menu(user, src, tool_list, custom_check = CALLBACK(src, .proc/check_menu, user, is_ghost), require_near = !is_ghost, tooltips = TRUE)
@@ -160,9 +160,9 @@
/obj/structure/ladder/proc/show_fluff_message(going_up, mob/user)
if(going_up)
user.visible_message("<span class='notice'>[user] climbs up [src].</span>", "<span class='notice'>You climb up [src].</span>")
user.visible_message(span_notice("[user] climbs up [src]."), span_notice("You climb up [src]."))
else
user.visible_message("<span class='notice'>[user] climbs down [src].</span>", "<span class='notice'>You climb down [src].</span>")
user.visible_message(span_notice("[user] climbs down [src]."), span_notice("You climb down [src]."))
// Indestructible away mission ladders which link based on a mapped ID and height value rather than X/Y/Z.