mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-27 07:08:00 +01:00
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:
@@ -50,7 +50,7 @@
|
||||
return
|
||||
|
||||
if(copytext("[map_file]", -4) != ".dmm")//4 == length(".dmm")
|
||||
to_chat(src, "<span class='warning'>Filename must end in '.dmm': [map_file]</span>")
|
||||
to_chat(src, span_warning("Filename must end in '.dmm': [map_file]"))
|
||||
return
|
||||
|
||||
if(!fcopy(map_file, "_maps/custom/[map_file]"))
|
||||
@@ -59,11 +59,11 @@
|
||||
// This is to make sure the map works so the server does not start without a map.
|
||||
var/datum/parsed_map/M = new (map_file)
|
||||
if(!M)
|
||||
to_chat(src, "<span class='warning'>Map '[map_file]' failed to parse properly.</span>")
|
||||
to_chat(src, span_warning("Map '[map_file]' failed to parse properly."))
|
||||
return
|
||||
|
||||
if(!M.bounds)
|
||||
to_chat(src, "<span class='warning'>Map '[map_file]' has non-existant bounds.</span>")
|
||||
to_chat(src, span_warning("Map '[map_file]' has non-existant bounds."))
|
||||
qdel(M)
|
||||
return
|
||||
|
||||
@@ -76,7 +76,7 @@
|
||||
if(!shuttle)
|
||||
continue
|
||||
if(!SSmapping.shuttle_templates[shuttle])
|
||||
to_chat(usr, "<span class='warning'>No such shuttle as '[shuttle]' exists, using default.</span>")
|
||||
to_chat(usr, span_warning("No such shuttle as '[shuttle]' exists, using default."))
|
||||
continue
|
||||
VM.shuttles[s] = shuttle
|
||||
|
||||
|
||||
Reference in New Issue
Block a user