Files
Bubberstation/code/modules/shuttle/spaceship_navigation_beacon.dm
Watermelon914 375a20e49b 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)
2021-06-14 13:03:53 -07:00

60 lines
1.9 KiB
Plaintext

/obj/item/circuitboard/machine/spaceship_navigation_beacon
name = "Bluespace Navigation Gigabeacon (Machine Board)"
build_path = /obj/machinery/spaceship_navigation_beacon
req_components = list()
/obj/machinery/spaceship_navigation_beacon
name = "Bluespace Navigation Gigabeacon"
desc = "A device that creates a bluespace anchor that allow ships jump near to it."
icon = 'icons/obj/abductor.dmi'
icon_state = "core"
base_icon_state = "core"
use_power = IDLE_POWER_USE
idle_power_usage = 0
density = TRUE
circuit = /obj/item/circuitboard/machine/spaceship_navigation_beacon
var/locked = FALSE //Locked beacons don't allow to jump to it.
/obj/machinery/spaceship_navigation_beacon/Initialize()
. = ..()
SSshuttle.beacons |= src
/obj/machinery/spaceship_navigation_beacon/emp_act()
locked = TRUE
/obj/machinery/spaceship_navigation_beacon/Destroy()
SSshuttle.beacons -= src
return ..()
// update the icon_state
/obj/machinery/spaceship_navigation_beacon/update_icon_state()
icon_state = "[base_icon_state][powered() ? null : "-open"]"
return ..()
/obj/machinery/spaceship_navigation_beacon/multitool_act(mob/living/user, obj/item/multitool/I)
..()
if(panel_open)
var/new_name = "Beacon_[stripped_input("Enter the custom name for this beacon", "It be Beacon ..your input..")]"
if(new_name && Adjacent(user))
name = new_name
to_chat(user, span_notice("You change beacon name to [name]."))
else
locked =!locked
to_chat(user, span_notice("You [locked ? "" : "un"]lock [src]."))
return TRUE
/obj/machinery/spaceship_navigation_beacon/examine()
.=..()
. += "<span class='[locked ? "warning" : "nicegreen"]'>Status: [locked ? "LOCKED" : "Stable"] </span>"
/obj/machinery/spaceship_navigation_beacon/attackby(obj/item/W, mob/user, params)
if(default_deconstruction_screwdriver(user, "core-open", "core", W))
return
if(default_deconstruction_crowbar(W))
return
return ..()