mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-25 14:08:31 +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:
@@ -35,7 +35,7 @@
|
||||
/obj/item/assembly/Destroy()
|
||||
holder = null
|
||||
return ..()
|
||||
|
||||
|
||||
/obj/item/assembly/get_part_rating()
|
||||
return 1
|
||||
|
||||
@@ -58,7 +58,7 @@
|
||||
|
||||
/obj/item/assembly/proc/is_secured(mob/user)
|
||||
if(!secured)
|
||||
to_chat(user, "<span class='warning'>The [name] is unsecured!</span>")
|
||||
to_chat(user, span_warning("The [name] is unsecured!"))
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
@@ -100,9 +100,9 @@
|
||||
if((!A.secured) && (!secured))
|
||||
holder = new/obj/item/assembly_holder(get_turf(src))
|
||||
holder.assemble(src,A,user)
|
||||
to_chat(user, "<span class='notice'>You attach and secure \the [A] to \the [src]!</span>")
|
||||
to_chat(user, span_notice("You attach and secure \the [A] to \the [src]!"))
|
||||
else
|
||||
to_chat(user, "<span class='warning'>Both devices must be in attachable mode to be attached together.</span>")
|
||||
to_chat(user, span_warning("Both devices must be in attachable mode to be attached together."))
|
||||
return
|
||||
..()
|
||||
|
||||
@@ -110,15 +110,15 @@
|
||||
if(..())
|
||||
return TRUE
|
||||
if(toggle_secure())
|
||||
to_chat(user, "<span class='notice'>\The [src] is ready!</span>")
|
||||
to_chat(user, span_notice("\The [src] is ready!"))
|
||||
else
|
||||
to_chat(user, "<span class='notice'>\The [src] can now be attached!</span>")
|
||||
to_chat(user, span_notice("\The [src] can now be attached!"))
|
||||
add_fingerprint(user)
|
||||
return TRUE
|
||||
|
||||
/obj/item/assembly/examine(mob/user)
|
||||
. = ..()
|
||||
. += "<span class='notice'>\The [src] [secured? "is secured and ready to be used!" : "can be attached to other things."]</span>"
|
||||
. += span_notice("\The [src] [secured? "is secured and ready to be used!" : "can be attached to other things."]")
|
||||
|
||||
/obj/item/assembly/attack_self(mob/user)
|
||||
if(!user)
|
||||
|
||||
Reference in New Issue
Block a user