GPS now working :)

This commit is contained in:
Jerry Wester
2023-01-06 01:02:36 -07:00
committed by KrissKr0ss
parent 908ac03b6d
commit d170da0bba

View File

@@ -20,14 +20,22 @@ GLOBAL_LIST_EMPTY(GPS_list)
/datum/component/gps/item
var/updating = TRUE //Automatic updating of GPS list. Can be set to manual by user.
var/global_mode = TRUE //If disabled, only GPS signals of the same Z level are shown
/// UI state of GPS, altering when it can be used.
var/datum/ui_state/state = null
/datum/component/gps/item/Initialize(_gpstag = "COM0", emp_proof = FALSE, starton = TRUE)
/datum/component/gps/item/Initialize(_gpstag = "COM0", emp_proof = FALSE, starton = TRUE, state = null, overlay_state = "working")
. = ..()
if(. == COMPONENT_INCOMPATIBLE || !isitem(parent))
return COMPONENT_INCOMPATIBLE
if(isnull(state))
state = GLOB.default_state
src.state = state
var/atom/A = parent
if(starton)
A.add_overlay("working")
if(overlay_state)
A.add_overlay(overlay_state)
else
tracking = FALSE
A.name = "[initial(A.name)] ([gpstag])"
@@ -93,6 +101,9 @@ GLOBAL_LIST_EMPTY(GPS_list)
ui.open()
ui.set_autoupdate(updating)
/datum/component/gps/item/ui_state(mob/user)
return state
/datum/component/gps/item/ui_data(mob/user)
var/list/data = list()
data["power"] = tracking