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
@@ -88,7 +88,7 @@
return
obj_flags |= EMAGGED
playsound(src, "sparks", 75, TRUE, SILENCED_SOUND_EXTRARANGE)
to_chat(user, "<span class='notice'>You disable the safety sensor BIOS on [src].</span>")
to_chat(user, span_notice("You disable the safety sensor BIOS on [src]."))
/obj/machinery/destructive_scanner/update_icon_state()
. = ..()
@@ -101,7 +101,7 @@
if (!proximity_flag || (selected_experiment == null && !(config_flags & EXPERIMENT_CONFIG_ALWAYS_ACTIVE)))
return
playsound(user, 'sound/machines/buzz-sigh.ogg', 25)
to_chat(user, "<span class='notice'>[target] is not related to your currently selected experiment.</span>")
to_chat(user, span_notice("[target] is not related to your currently selected experiment."))
/**
* Checks that an experiment can be run using the provided target, used for preventing the cancellation of the attack chain inappropriately
@@ -126,16 +126,16 @@
*/
/datum/component/experiment_handler/proc/try_run_handheld_experiment_async(datum/source, atom/target, mob/user, params)
if (selected_experiment == null && !(config_flags & EXPERIMENT_CONFIG_ALWAYS_ACTIVE))
to_chat(user, "<span class='notice'>You do not have an experiment selected!</span>")
to_chat(user, span_notice("You do not have an experiment selected!"))
return
if(!do_after(user, 1 SECONDS, target = target))
return
if(action_experiment(source, target))
playsound(user, 'sound/machines/ping.ogg', 25)
to_chat(user, "<span class='notice'>You scan [target].</span>")
to_chat(user, span_notice("You scan [target]."))
else
playsound(user, 'sound/machines/buzz-sigh.ogg', 25)
to_chat(user, "<span class='notice'>[target] is not related to your currently selected experiment.</span>")
to_chat(user, span_notice("[target] is not related to your currently selected experiment."))
/**
@@ -146,7 +146,7 @@
var/atom/movable/our_scanner = parent
if (selected_experiment == null)
playsound(our_scanner, 'sound/machines/buzz-sigh.ogg', 25)
to_chat(our_scanner, "<span class='notice'>No experiment selected!</span>")
to_chat(our_scanner, span_notice("No experiment selected!"))
return
var/successful_scan
for(var/scan_target in scanned_atoms)
@@ -155,7 +155,7 @@
break
if(successful_scan)
playsound(our_scanner, 'sound/machines/ping.ogg', 25)
to_chat(our_scanner, "<span class='notice'>The scan succeeds.</span>")
to_chat(our_scanner, span_notice("The scan succeeds."))
else
playsound(src, 'sound/machines/buzz-sigh.ogg', 25)
our_scanner.say("The scan did not result in anything.")