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
+6 -6
View File
@@ -124,7 +124,7 @@
to_chat(user, "<span class='warning'>You are not the high priest, and therefore cannot select a religious sect.")
return
if(!user.canUseTopic(parent, BE_CLOSE, FALSE, NO_TK))
to_chat(user,"<span class='warning'>You cannot select a sect at this time.</span>")
to_chat(user,span_warning("You cannot select a sect at this time."))
return
if(GLOB.religious_sect)
return
@@ -148,7 +148,7 @@
to_chat(user, "<span class='notice'>There is a rite currently being performed here already.")
return
if(!user.canUseTopic(parent, BE_CLOSE, FALSE, NO_TK))
to_chat(user,"<span class='warning'>You are not close enough to perform the rite.</span>")
to_chat(user,span_warning("You are not close enough to perform the rite."))
return
performing_rite = new path(parent)
if(!performing_rite.perform_rite(user, parent))
@@ -228,12 +228,12 @@
if(!can_i_see)
return
examine_list += "<span class='notice'>Use a bible to interact with this.</span>"
examine_list += span_notice("Use a bible to interact with this.")
if(!easy_access_sect)
if(operation_flags & RELIGION_TOOL_SECTSELECT)
examine_list += "<span class='notice'>This looks like it can be used to select a sect.</span>"
examine_list += span_notice("This looks like it can be used to select a sect.")
return
if(operation_flags & RELIGION_TOOL_SACRIFICE)//this can be moved around if things change but usually no rites == no sacrifice
examine_list += "<span class='notice'>Desired items can be used on this to increase favor.</span>"
examine_list += span_notice("Desired items can be used on this to increase favor.")
if(easy_access_sect.rites_list && operation_flags & RELIGION_TOOL_INVOKE)
examine_list += "<span class='notice'>You can invoke rites from this.</span>"
examine_list += span_notice("You can invoke rites from this.")