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
+7 -7
View File
@@ -39,7 +39,7 @@
if(no_den_usage)
var/area/A = get_area(user)
if(istype(A, /area/wizard_station))
to_chat(user, "<span class='warning'>You know better than to violate the security of The Den, best wait until you leave to use [src].</span>")
to_chat(user, span_warning("You know better than to violate the security of The Den, best wait until you leave to use [src]."))
return
else
no_den_usage = 0
@@ -50,7 +50,7 @@
/obj/item/gun/magic/wand/proc/zap_self(mob/living/user)
user.visible_message("<span class='danger'>[user] zaps [user.p_them()]self with [src].</span>")
user.visible_message(span_danger("[user] zaps [user.p_them()]self with [src]."))
playsound(user, fire_sound, 50, TRUE)
user.log_message("zapped [user.p_them()]self with a <b>[src]</b>", LOG_ATTACK)
@@ -73,13 +73,13 @@
..()
charges--
if(user.anti_magic_check())
user.visible_message("<span class='warning'>[src] has no effect on [user]!</span>")
user.visible_message(span_warning("[src] has no effect on [user]!"))
return
if(isliving(user))
var/mob/living/L = user
if(L.mob_biotypes & MOB_UNDEAD) //negative energy heals the undead
user.revive(full_heal = TRUE, admin_revive = TRUE)
to_chat(user, "<span class='notice'>You feel great!</span>")
to_chat(user, span_notice("You feel great!"))
return
to_chat(user, "<span class='warning'>You irradiate yourself with pure negative energy! \
[pick("Do not pass go. Do not collect 200 zorkmids.","You feel more confident in your spell casting skills.","You Die...","Do you want your possessions identified?")]\
@@ -112,7 +112,7 @@
..()
charges--
if(user.anti_magic_check())
user.visible_message("<span class='warning'>[src] has no effect on [user]!</span>")
user.visible_message(span_warning("[src] has no effect on [user]!"))
return
if(isliving(user))
var/mob/living/L = user
@@ -123,7 +123,7 @@
user.death(0)
return
user.revive(full_heal = TRUE, admin_revive = TRUE)
to_chat(user, "<span class='notice'>You feel great!</span>")
to_chat(user, span_notice("You feel great!"))
/obj/item/gun/magic/wand/resurrection/debug //for testing
desc = "Is it possible for something to be even more powerful than regular magic? This wand is."
@@ -221,7 +221,7 @@
no_den_usage = 1
/obj/item/gun/magic/wand/door/zap_self(mob/living/user)
to_chat(user, "<span class='notice'>You feel vaguely more open with your feelings.</span>")
to_chat(user, span_notice("You feel vaguely more open with your feelings."))
charges--
..()