Skip to content

Commit

Permalink
Adds a GPS PDA program and adds it to the default PDA programs (#4604)
Browse files Browse the repository at this point in the history
  • Loading branch information
112358sam committed May 7, 2021
1 parent bee4f9d commit 34bbaef
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
1 change: 1 addition & 0 deletions code/obj/item/device/pda2/pda2.dm
Expand Up @@ -322,6 +322,7 @@
src.hd.root.add_file(new /datum/computer/file/text/pda2manual)
src.hd.root.add_file(new /datum/computer/file/pda_program/robustris)
src.hd.root.add_file(new /datum/computer/file/pda_program/emergency_alert)
src.hd.root.add_file(new /datum/computer/file/pda_program/gps)
src.hd.root.add_file(new /datum/computer/file/pda_program/cargo_request(src))
if(length(src.default_muted_mailgroups))
src.host_program.muted_mailgroups = src.default_muted_mailgroups
Expand Down
44 changes: 44 additions & 0 deletions code/obj/item/device/pda2/smallprogs.dm
Expand Up @@ -1231,3 +1231,47 @@ Using electronic "Detomatix" BOMB program is perhaps less simple!<br>

src.master.add_fingerprint(usr)
return

/datum/computer/file/pda_program/gps
name = "Space GPS"
size = 2
var/x = -1
var/y = -1
var/z = -1

return_text()
if(..())
return

var/dat = src.return_text_header()
dat += "<h4>Space GPS: Pocket Edition</h4>"

dat += "<a href='byond://?src=\ref[src];getloc=1'>Get Coordinates</a>"
if (x >= 0)

var/landmark = "Unknown"
switch (src.z)
if (1)
landmark = capitalize(station_or_ship())
if (2)
landmark = "Restricted"
if (3)
landmark = "Debris Field"

dat += "<BR>X = [src.x], Y = [src.y], Landmark: [landmark]"

return dat

Topic(href, href_list)
if(..())
return

if (href_list["getloc"])
var/turf/T = get_turf(usr)
src.x = T.x
src.y = T.y
src.z = T.z

src.master.add_fingerprint(usr)
src.master.updateSelfDialog()
return

0 comments on commit 34bbaef

Please sign in to comment.