mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 18:53:06 +00:00
TGUI PDAs, legacy code to-be-removed
This commit is contained in:
@@ -17,18 +17,21 @@
|
||||
notifying["\ref[P]"] = 1
|
||||
data["notifying"] = notifying
|
||||
|
||||
/datum/data/pda/app/main_menu/Topic(href, list/href_list)
|
||||
switch(href_list["choice"])
|
||||
/datum/data/pda/app/main_menu/tgui_act(action, list/params, datum/tgui/ui, datum/tgui_state/state)
|
||||
if(..())
|
||||
return TRUE
|
||||
switch(action)
|
||||
if("UpdateInfo")
|
||||
pda.ownjob = pda.id.assignment
|
||||
pda.ownrank = pda.id.rank
|
||||
pda.name = "PDA-[pda.owner] ([pda.ownjob])"
|
||||
return TRUE
|
||||
if("pai")
|
||||
if(pda.pai)
|
||||
if(pda.pai.loc != pda)
|
||||
pda.pai = null
|
||||
else
|
||||
switch(href_list["option"])
|
||||
switch(params["option"])
|
||||
if("1") // Configure pAI device
|
||||
pda.pai.attack_self(usr)
|
||||
if("2") // Eject pAI device
|
||||
@@ -36,6 +39,7 @@
|
||||
if(T)
|
||||
pda.pai.loc = T
|
||||
pda.pai = null
|
||||
return TRUE
|
||||
|
||||
/datum/data/pda/app/notekeeper
|
||||
name = "Notekeeper"
|
||||
@@ -53,8 +57,10 @@
|
||||
/datum/data/pda/app/notekeeper/update_ui(mob/user as mob, list/data)
|
||||
data["note"] = note // current pda notes
|
||||
|
||||
/datum/data/pda/app/notekeeper/Topic(href, list/href_list)
|
||||
switch(href_list["choice"])
|
||||
/datum/data/pda/app/notekeeper/tgui_act(action, list/params, datum/tgui/ui, datum/tgui_state/state)
|
||||
if(..())
|
||||
return TRUE
|
||||
switch(action)
|
||||
if("Edit")
|
||||
var/n = input("Please enter message", name, notehtml) as message
|
||||
if(pda.loc == usr)
|
||||
@@ -63,49 +69,59 @@
|
||||
note = replacetext(note, "\n", "<br>")
|
||||
else
|
||||
pda.close(usr)
|
||||
return TRUE
|
||||
|
||||
/datum/data/pda/app/manifest
|
||||
name = "Crew Manifest"
|
||||
icon = "user"
|
||||
template = "pda_manifest"
|
||||
update = PDA_APP_UPDATE_SLOW
|
||||
|
||||
// /datum/data/pda/app/manifest/update_ui(mob/user as mob, list/data)
|
||||
// data_core.get_manifest_json()
|
||||
// data["manifest"] = PDA_Manifest
|
||||
/datum/data/pda/app/manifest/update_ui(mob/user as mob, list/data)
|
||||
if(data_core)
|
||||
data_core.get_manifest_list()
|
||||
data["manifest"] = PDA_Manifest
|
||||
|
||||
/datum/data/pda/app/manifest/Topic(href, list/href_list)
|
||||
/datum/data/pda/app/manifest/tgui_act(action, list/params, datum/tgui/ui, datum/tgui_state/state)
|
||||
if(..())
|
||||
return TRUE
|
||||
|
||||
/datum/data/pda/app/atmos_scanner
|
||||
name = "Atmospheric Scan"
|
||||
icon = "fire"
|
||||
template = "pda_atmos_scan"
|
||||
category = "Utilities"
|
||||
update = PDA_APP_UPDATE_SLOW
|
||||
|
||||
// /datum/data/pda/app/atmos_scanner/update_ui(mob/user as mob, list/data)
|
||||
// var/turf/T = get_turf(user.loc)
|
||||
// if(!isnull(T))
|
||||
// var/datum/gas_mixture/environment = T.return_air()
|
||||
/datum/data/pda/app/atmos_scanner/update_ui(mob/user as mob, list/data)
|
||||
var/list/results = list()
|
||||
var/turf/T = get_turf(user)
|
||||
if(!isnull(T))
|
||||
var/datum/gas_mixture/environment = T.return_air()
|
||||
var/pressure = environment.return_pressure()
|
||||
var/total_moles = environment.total_moles
|
||||
if (total_moles)
|
||||
var/o2_level = environment.gas["oxygen"]/total_moles
|
||||
var/n2_level = environment.gas["nitrogen"]/total_moles
|
||||
var/co2_level = environment.gas["carbon_dioxide"]/total_moles
|
||||
var/phoron_level = environment.gas["phoron"]/total_moles
|
||||
var/unknown_level = 1-(o2_level+n2_level+co2_level+phoron_level)
|
||||
|
||||
// var/pressure = environment.return_pressure()
|
||||
// var/total_moles = environment.total_moles
|
||||
// entry is what the element is describing
|
||||
// Type identifies which unit or other special characters to use
|
||||
// Val is the information reported
|
||||
// Bad_high/_low are the values outside of which the entry reports as dangerous
|
||||
// Poor_high/_low are the values outside of which the entry reports as unideal
|
||||
// Values were extracted from the template itself
|
||||
results = list(
|
||||
list("entry" = "Pressure", "units" = "kPa", "val" = "[round(pressure,0.1)]", "bad_high" = 120, "poor_high" = 110, "poor_low" = 95, "bad_low" = 80),
|
||||
list("entry" = "Temperature", "units" = "°C", "val" = "[round(environment.temperature-T0C,0.1)]", "bad_high" = 35, "poor_high" = 25, "poor_low" = 15, "bad_low" = 5),
|
||||
list("entry" = "Oxygen", "units" = "kPa", "val" = "[round(o2_level*100,0.1)]", "bad_high" = 140, "poor_high" = 135, "poor_low" = 19, "bad_low" = 17),
|
||||
list("entry" = "Nitrogen", "units" = "kPa", "val" = "[round(n2_level*100,0.1)]", "bad_high" = 105, "poor_high" = 85, "poor_low" = 50, "bad_low" = 40),
|
||||
list("entry" = "Carbon Dioxide", "units" = "kPa", "val" = "[round(co2_level*100,0.1)]", "bad_high" = 10, "poor_high" = 5, "poor_low" = 0, "bad_low" = 0),
|
||||
list("entry" = "Phoron", "units" = "kPa", "val" = "[round(phoron_level*100,0.01)]", "bad_high" = 0.5, "poor_high" = 0, "poor_low" = 0, "bad_low" = 0),
|
||||
list("entry" = "Other", "units" = "kPa", "val" = "[round(unknown_level, 0.01)]", "bad_high" = 1, "poor_high" = 0.5, "poor_low" = 0, "bad_low" = 0)
|
||||
)
|
||||
|
||||
// if(total_moles)
|
||||
// var/o2_level = environment.oxygen/total_moles
|
||||
// var/n2_level = environment.nitrogen/total_moles
|
||||
// var/co2_level = environment.carbon_dioxide/total_moles
|
||||
// var/plasma_level = environment.toxins/total_moles
|
||||
// var/unknown_level = 1-(o2_level+n2_level+co2_level+plasma_level)
|
||||
// data["aircontents"] = list(
|
||||
// "pressure" = pressure,
|
||||
// "nitrogen" = n2_level*100,
|
||||
// "oxygen" = o2_level*100,
|
||||
// "carbon_dioxide" = co2_level*100,
|
||||
// "plasma" = plasma_level*100,
|
||||
// "other" = unknown_level,
|
||||
// "temp" = environment.temperature-T0C,
|
||||
// "reading" = 1
|
||||
// )
|
||||
// if(isnull(data["aircontents"]))
|
||||
// data["aircontents"] = list("reading" = 0)
|
||||
if(isnull(results))
|
||||
results = list(list("entry" = "pressure", "units" = "kPa", "val" = "0", "bad_high" = 120, "poor_high" = 110, "poor_low" = 95, "bad_low" = 80))
|
||||
|
||||
data["aircontents"] = results
|
||||
Reference in New Issue
Block a user