Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds a GPS PDA program and adds it to the default PDA programs #4604

Merged
merged 1 commit into from May 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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