mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-17 19:14:15 +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:
@@ -23,7 +23,7 @@
|
||||
|
||||
|
||||
/obj/structure/table_frame/wrench_act(mob/living/user, obj/item/I)
|
||||
to_chat(user, "<span class='notice'>You start disassembling [src]...</span>")
|
||||
to_chat(user, span_notice("You start disassembling [src]..."))
|
||||
I.play_tool_sound(src)
|
||||
if(!I.use_tool(src, user, 3 SECONDS))
|
||||
return TRUE
|
||||
@@ -37,23 +37,23 @@
|
||||
var/obj/item/stack/material = I
|
||||
if(material.tableVariant)
|
||||
if(material.get_amount() < 1)
|
||||
to_chat(user, "<span class='warning'>You need one [material.name] sheet to do this!</span>")
|
||||
to_chat(user, span_warning("You need one [material.name] sheet to do this!"))
|
||||
return
|
||||
if(locate(/obj/structure/table) in loc)
|
||||
to_chat(user, "<span class='warning'>There's already a table built here!</span>")
|
||||
to_chat(user, span_warning("There's already a table built here!"))
|
||||
return
|
||||
to_chat(user, "<span class='notice'>You start adding [material] to [src]...</span>")
|
||||
to_chat(user, span_notice("You start adding [material] to [src]..."))
|
||||
if(!do_after(user, 2 SECONDS, target = src) || !material.use(1) || (locate(/obj/structure/table) in loc))
|
||||
return
|
||||
make_new_table(material.tableVariant)
|
||||
else if(istype(material, /obj/item/stack/sheet))
|
||||
if(material.get_amount() < 1)
|
||||
to_chat(user, "<span class='warning'>You need one sheet to do this!</span>")
|
||||
to_chat(user, span_warning("You need one sheet to do this!"))
|
||||
return
|
||||
if(locate(/obj/structure/table) in loc)
|
||||
to_chat(user, "<span class='warning'>There's already a table built here!</span>")
|
||||
to_chat(user, span_warning("There's already a table built here!"))
|
||||
return
|
||||
to_chat(user, "<span class='notice'>You start adding [material] to [src]...</span>")
|
||||
to_chat(user, span_notice("You start adding [material] to [src]..."))
|
||||
if(!do_after(user, 2 SECONDS, target = src) || !material.use(1) || (locate(/obj/structure/table) in loc))
|
||||
return
|
||||
var/list/material_list = list()
|
||||
@@ -107,9 +107,9 @@
|
||||
carpet_type = I.type
|
||||
if (toConstruct)
|
||||
if(material.get_amount() < 1)
|
||||
to_chat(user, "<span class='warning'>You need one [material.name] sheet to do this!</span>")
|
||||
to_chat(user, span_warning("You need one [material.name] sheet to do this!"))
|
||||
return
|
||||
to_chat(user, "<span class='notice'>You start adding [material] to [src]...</span>")
|
||||
to_chat(user, span_notice("You start adding [material] to [src]..."))
|
||||
if(do_after(user, 20, target = src) && material.use(1))
|
||||
make_new_table(toConstruct, null, carpet_type)
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user