Resets GPS.dm

This commit is contained in:
Unknown
2021-03-09 17:43:49 -05:00
parent 964714e6ba
commit 620da227bd
+3 -112
View File
@@ -12,7 +12,6 @@ var/list/GPS_list = list()
var/gps_tag = "GEN0"
var/emped = FALSE
var/updating = TRUE // Lets users lock the UI so they don't have to deal with constantly shifting signals
var/tracking = FALSE // Will not show other signals or emit its own signal if false.
var/long_range = FALSE // If true, can see farther, depending on get_map_levels().
var/local_mode = FALSE // If true, only GPS signals of the same Z level are shown.
@@ -174,11 +173,7 @@ var/list/GPS_list = list()
add_overlay("working")
/obj/item/device/gps/attack_self(mob/user)
tgui_interact(user)
/obj/item/device/gps/examine(mob/user)
. = ..()
. += display()
display(user)
// Compiles all the data not available directly from the GPS
// Like the positions and directions to all other GPS units
@@ -223,17 +218,10 @@ var/list/GPS_list = list()
return dat
<<<<<<< HEAD
/obj/item/device/gps/proc/display()
if(!tracking)
. = "The device is off. Alt-click it to turn it on."
return
=======
/obj/item/device/gps/proc/display(mob/user)
>>>>>>> b695657... Merge pull request #7928 from MistakeNot4892/gps
if(emped)
. = "It's busted!"
to_chat(user, "It's busted!")
return
var/list/dat = list()
@@ -243,11 +231,6 @@ var/list/GPS_list = list()
if(!tracking)
dat += "<tr><td colspan = 6></td><a href='?src=\ref[src];toggle_power=1'>\[Switch On]\]</a></tr>"
else
<<<<<<< HEAD
dat += "No other signals detected."
. = dat
=======
dat += "<tr><td colspan = 6></td><a href='?src=\ref[src];toggle_power=1'>\[Switch Off]\]</a></tr>"
dat += "<tr><td colspan = 2><b>Current location</b></td><td colspan = 2>[gps_data["my_area_name"]]</td><td colspan = 2><b>([gps_data["curr_x"]], [gps_data["curr_y"]], [gps_data["curr_z_name"]])</b></td></tr>"
dat += "<tr><td colspan = 4>[hide_signal ? "Tagged" : "Broadcasting"] as '[gps_tag]'.</td>"
@@ -283,7 +266,6 @@ var/list/GPS_list = list()
var/datum/browser/popup = new(user, "gps_\ref[src]", "Global Positioning System", 700, 1000)
popup.set_content(dat.Join(null))
popup.open()
>>>>>>> b695657... Merge pull request #7928 from MistakeNot4892/gps
/obj/item/device/gps/Topic(var/href, var/list/href_list)
if(..())
@@ -357,85 +339,6 @@ var/list/GPS_list = list()
if(. && loc == usr)
display(usr)
/obj/item/device/gps/tgui_interact(mob/user, datum/tgui/ui)
if(emped)
to_chat(user, "<span class='hear'>[src] fizzles weakly.</span>")
return
ui = SStgui.try_update_ui(user, src, ui)
if(!ui)
ui = new(user, src, "Gps", name)
ui.open()
ui.set_autoupdate(updating)
/obj/item/device/gps/tgui_data(mob/user)
var/list/data = list()
data["power"] = tracking
data["tag"] = gps_tag
data["updating"] = updating
data["globalmode"] = !local_mode
if(!tracking || emped) //Do not bother scanning if the GPS is off or EMPed
return data
var/turf/curr = get_turf(src)
data["currentArea"] = "[get_area_name(curr, TRUE)]"
data["currentCoords"] = list(curr.x, curr.y, curr.z)
data["currentCoordsText"] = "[curr.x], [curr.y], [using_map.get_zlevel_name(curr.z)]"
data["zLevelDetection"] = using_map.get_map_levels(curr.z, long_range)
var/list/signals = list()
data["signals"] = list()
for(var/obj/item/device/gps/G in GPS_list - src)
if(!G.tracking || G.emped || G.hide_signal)
continue
var/turf/T = get_turf(G)
if(!T)
continue
if(local_mode && curr.z != T.z)
continue
if(!(T.z in data["zLevelDetection"]))
continue
var/list/signal = list()
signal["entrytag"] = G.gps_tag //Name or 'tag' of the GPS
signal["coords"] = list(T.x, T.y, T.z)
signal["coordsText"] = "[T.x], [T.y], [using_map.get_zlevel_name(T.z)]"
if(T.z == curr.z) //Distance/Direction calculations for same z-level only
signal["dist"] = max(get_dist(curr, T), 0) //Distance between the src and remote GPS turfs
signal["degrees"] = round(Get_Angle(curr, T)) //0-360 degree directional bearing, for more precision.
signals += list(signal) //Add this signal to the list of signals
data["signals"] = signals
return data
/obj/item/device/gps/tgui_act(action, params)
if(..())
return TRUE
switch(action)
if("rename")
var/a = stripped_input(usr, "Please enter desired tag.", name, gps_tag, 20)
if(!a)
return
gps_tag = a
name = "global positioning system ([gps_tag])"
. = TRUE
if("power")
toggletracking(usr)
. = TRUE
if("updating")
updating = !updating
. = TRUE
if("globalmode")
local_mode = !local_mode
. = TRUE
/obj/item/device/gps/on // Defaults to off to avoid polluting the signal list with a bunch of GPSes without owners. If you need to spawn active ones, use these.
tracking = TRUE
@@ -558,15 +461,9 @@ var/list/GPS_list = list()
can_hide_signal = TRUE
/obj/item/device/gps/syndie/display(mob/user)
<<<<<<< HEAD
if(!tracking)
. = "The device is off. Alt-click it to turn it on."
return
=======
>>>>>>> b695657... Merge pull request #7928 from MistakeNot4892/gps
if(emped)
. = "It's busted!"
to_chat(user, "It's busted!")
return
var/list/dat = list()
@@ -576,11 +473,6 @@ var/list/GPS_list = list()
if(!tracking)
dat += "<tr><td colspan = 6></td><a href='?src=\ref[src];toggle_power=1'>\[Switch On]\]</a></tr>"
else
<<<<<<< HEAD
dat += "No other signals detected."
. = dat
=======
dat += "<tr><td colspan = 6></td><a href='?src=\ref[src];toggle_power=1'>\[Switch Off]\]</a></tr>"
dat += "<tr><td colspan = 2><b>Current location</b></td><td colspan = 2>[gps_data["my_area_name"]]</td><td colspan = 2><b>([gps_data["curr_x"]], [gps_data["curr_y"]], [gps_data["curr_z_name"]])</b></td></tr>"
dat += "<tr><td colspan = 4>[hide_signal ? "Tagged" : "Broadcasting"] as '[gps_tag]'.</td>"
@@ -609,4 +501,3 @@ var/list/GPS_list = list()
var/datum/browser/popup = new(user, "gps_\ref[src]", "Global Positioning System", 700, 1000)
popup.set_content(dat.Join(null))
popup.open()
>>>>>>> b695657... Merge pull request #7928 from MistakeNot4892/gps