mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-21 04:57:57 +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:
@@ -38,9 +38,9 @@
|
||||
/obj/machinery/mineral/ore_redemption/examine(mob/user)
|
||||
. = ..()
|
||||
if(in_range(user, src) || isobserver(user))
|
||||
. += "<span class='notice'>The status display reads: Smelting <b>[ore_multiplier]</b> sheet(s) per piece of ore.<br>Reward point generation at <b>[point_upgrade*100]%</b>.</span>"
|
||||
. += span_notice("The status display reads: Smelting <b>[ore_multiplier]</b> sheet(s) per piece of ore.<br>Reward point generation at <b>[point_upgrade*100]%</b>.")
|
||||
if(panel_open)
|
||||
. += "<span class='notice'>Alt-click to rotate the input and output direction.</span>"
|
||||
. += span_notice("Alt-click to rotate the input and output direction.")
|
||||
|
||||
/obj/machinery/mineral/ore_redemption/proc/smelt_ore(obj/item/stack/ore/O)
|
||||
if(QDELETED(O))
|
||||
@@ -180,7 +180,7 @@
|
||||
var/obj/item/stack/ore/O = W
|
||||
if(istype(O))
|
||||
if(O.refined_type == null)
|
||||
to_chat(user, "<span class='warning'>[O] has already been refined!</span>")
|
||||
to_chat(user, span_warning("[O] has already been refined!"))
|
||||
return
|
||||
|
||||
return ..()
|
||||
@@ -192,7 +192,7 @@
|
||||
if(panel_open)
|
||||
input_dir = turn(input_dir, -90)
|
||||
output_dir = turn(output_dir, -90)
|
||||
to_chat(user, "<span class='notice'>You change [src]'s I/O settings, setting the input to [dir2text(input_dir)] and the output to [dir2text(output_dir)].</span>")
|
||||
to_chat(user, span_notice("You change [src]'s I/O settings, setting the input to [dir2text(input_dir)] and the output to [dir2text(output_dir)]."))
|
||||
unregister_input_turf() // someone just rotated the input and output directions, unregister the old turf
|
||||
register_input_turf() // register the new one
|
||||
return TRUE
|
||||
@@ -257,17 +257,17 @@
|
||||
I.mining_points += points
|
||||
points = 0
|
||||
else
|
||||
to_chat(usr, "<span class='warning'>No valid ID detected.</span>")
|
||||
to_chat(usr, span_warning("No valid ID detected."))
|
||||
else
|
||||
to_chat(usr, "<span class='warning'>No points to claim.</span>")
|
||||
to_chat(usr, span_warning("No points to claim."))
|
||||
return TRUE
|
||||
if("Release")
|
||||
if(!mat_container)
|
||||
return
|
||||
if(materials.on_hold())
|
||||
to_chat(usr, "<span class='warning'>Mineral access is on hold, please contact the quartermaster.</span>")
|
||||
to_chat(usr, span_warning("Mineral access is on hold, please contact the quartermaster."))
|
||||
else if(!allowed(usr)) //Check the ID inside, otherwise check the user
|
||||
to_chat(usr, "<span class='warning'>Required access not found.</span>")
|
||||
to_chat(usr, span_warning("Required access not found."))
|
||||
else
|
||||
var/datum/material/mat = locate(params["id"])
|
||||
|
||||
@@ -301,7 +301,7 @@
|
||||
return
|
||||
inserted_disk = disk
|
||||
else
|
||||
to_chat(usr, "<span class='warning'>Not a valid Design Disk!</span>")
|
||||
to_chat(usr, span_warning("Not a valid Design Disk!"))
|
||||
return TRUE
|
||||
if("diskEject")
|
||||
if(inserted_disk)
|
||||
@@ -317,7 +317,7 @@
|
||||
if(!mat_container)
|
||||
return
|
||||
if(materials.on_hold())
|
||||
to_chat(usr, "<span class='warning'>Mineral access is on hold, please contact the quartermaster.</span>")
|
||||
to_chat(usr, span_warning("Mineral access is on hold, please contact the quartermaster."))
|
||||
return
|
||||
var/alloy_id = params["id"]
|
||||
var/datum/design/alloy = stored_research.isDesignResearchedID(alloy_id)
|
||||
@@ -342,7 +342,7 @@
|
||||
output = new alloy.build_path(src)
|
||||
unload_mineral(output)
|
||||
else
|
||||
to_chat(usr, "<span class='warning'>Required access not found.</span>")
|
||||
to_chat(usr, span_warning("Required access not found."))
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/mineral/ore_redemption/ex_act(severity, target)
|
||||
|
||||
Reference in New Issue
Block a user