Files
Bubberstation/code/modules/wiremod/components/atom/gps.dm
SkyratBot 5ab9aba9d4 [MIRROR] Added circuit component UI details, added multiplexer and allowed inserting components directly into shells. (#6479)
* Added circuit component UI details, added multiplexer and allowed inserting components directly into shells. (#59635)

Adds the multiplexer circuit component - en.wikipedia.org/wiki/Multiplexer
Circuit components can now be directly inserted into shells rather than having to take the integrated circuit out.
Special information can be accessed from components now through the "Info" button besides the eject button on a component.

* Added circuit component UI details, added multiplexer and allowed inserting components directly into shells.

Co-authored-by: Watermelon914 <37270891+Watermelon914@users.noreply.github.com>
2021-06-23 22:50:59 +01:00

41 lines
917 B
Plaintext

/**
* # GPS Component
*
* Return the location of this
*/
/obj/item/circuit_component/gps
display_name = "Internal GPS"
display_desc = "A component that returns the xyz co-ordinates of itself."
/// The result from the output
var/datum/port/output/x_pos
var/datum/port/output/y_pos
var/datum/port/output/z_pos
circuit_flags = CIRCUIT_FLAG_INPUT_SIGNAL|CIRCUIT_FLAG_OUTPUT_SIGNAL
/obj/item/circuit_component/gps/Initialize()
. = ..()
x_pos = add_output_port("X", PORT_TYPE_NUMBER)
y_pos = add_output_port("Y", PORT_TYPE_NUMBER)
z_pos = add_output_port("Z", PORT_TYPE_NUMBER)
/obj/item/circuit_component/gps/Destroy()
x_pos = null
y_pos = null
z_pos = null
return ..()
/obj/item/circuit_component/gps/input_received(datum/port/input/port)
. = ..()
if(.)
return
var/turf/location = get_turf(src)
x_pos.set_output(location?.x)
y_pos.set_output(location?.y)
z_pos.set_output(location?.z)