mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-13 11:43:31 +00:00
Merge pull request #4231 from Ccomp5950/pda_fix
PDA NanoUI Optimizations.
This commit is contained in:
@@ -341,8 +341,7 @@ var/global/list/obj/item/device/pda/PDAs = list()
|
|||||||
data["idInserted"] = (id ? 1 : 0)
|
data["idInserted"] = (id ? 1 : 0)
|
||||||
data["idLink"] = (id ? text("[id.registered_name], [id.assignment]") : "--------")
|
data["idLink"] = (id ? text("[id.registered_name], [id.assignment]") : "--------")
|
||||||
|
|
||||||
data["cartridge"] = null
|
data["cart_loaded"] = cartridge ? 1:0
|
||||||
data["records"] = null
|
|
||||||
if(cartridge)
|
if(cartridge)
|
||||||
var/cartdata[0]
|
var/cartdata[0]
|
||||||
|
|
||||||
@@ -403,18 +402,12 @@ var/global/list/obj/item/device/pda/PDAs = list()
|
|||||||
data["messagescount"] = null
|
data["messagescount"] = null
|
||||||
data["messages"] = null
|
data["messages"] = null
|
||||||
|
|
||||||
var/found = 0
|
|
||||||
if(active_conversation)
|
if(active_conversation)
|
||||||
for(var/c in tnote)
|
for(var/c in tnote)
|
||||||
if(c["target"] == active_conversation)
|
if(c["target"] == active_conversation)
|
||||||
data["convo_name"] = sanitize(c["owner"])
|
data["convo_name"] = sanitize(c["owner"])
|
||||||
data["convo_job"] = sanitize(c["job"])
|
data["convo_job"] = sanitize(c["job"])
|
||||||
found = 1
|
|
||||||
break
|
break
|
||||||
if(!found)
|
|
||||||
data["convo_name"] = null
|
|
||||||
data["convo_job"] = null
|
|
||||||
|
|
||||||
if(mode==41)
|
if(mode==41)
|
||||||
data["manifest"] = data_core.get_manifest_json()
|
data["manifest"] = data_core.get_manifest_json()
|
||||||
|
|
||||||
@@ -444,16 +437,7 @@ var/global/list/obj/item/device/pda/PDAs = list()
|
|||||||
"reading" = 1\
|
"reading" = 1\
|
||||||
)
|
)
|
||||||
if(isnull(data["aircontents"]))
|
if(isnull(data["aircontents"]))
|
||||||
data["aircontents"] = list(\
|
data["aircontents"] = list("reading" = 0)
|
||||||
"pressure" = null,\
|
|
||||||
"nitrogen" = null,\
|
|
||||||
"oxygen" = null,\
|
|
||||||
"carbon_dioxide" = null,\
|
|
||||||
"plasma" = null,\
|
|
||||||
"other" = null,\
|
|
||||||
"temp" = null,\
|
|
||||||
"reading" = 0\
|
|
||||||
)
|
|
||||||
|
|
||||||
// update the ui if it exists, returns null if no ui is passed/found
|
// update the ui if it exists, returns null if no ui is passed/found
|
||||||
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data)
|
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data)
|
||||||
|
|||||||
@@ -241,14 +241,12 @@
|
|||||||
|
|
||||||
|
|
||||||
/obj/item/weapon/cartridge/proc/create_NanoUI_values(mob/user as mob)
|
/obj/item/weapon/cartridge/proc/create_NanoUI_values(mob/user as mob)
|
||||||
var/obj/item/device/pda/PDA = loc
|
|
||||||
var/datum/nanoui/ui = nanomanager.get_open_ui(user, PDA, "main")
|
|
||||||
var/values[0]
|
var/values[0]
|
||||||
|
|
||||||
/* Signaler (Mode: 40) */
|
/* Signaler (Mode: 40) */
|
||||||
|
|
||||||
|
|
||||||
if(istype(radio,/obj/item/radio/integrated/signal) && (mode==40 || !ui ))
|
if(istype(radio,/obj/item/radio/integrated/signal) && (mode==40))
|
||||||
var/obj/item/radio/integrated/signal/R = radio
|
var/obj/item/radio/integrated/signal/R = radio
|
||||||
values["signal_freq"] = format_frequency(R.frequency)
|
values["signal_freq"] = format_frequency(R.frequency)
|
||||||
values["signal_code"] = R.code
|
values["signal_code"] = R.code
|
||||||
@@ -256,14 +254,14 @@
|
|||||||
|
|
||||||
/* Station Display (Mode: 42) */
|
/* Station Display (Mode: 42) */
|
||||||
|
|
||||||
if(mode==42 || (!ui && access_status_display))
|
if(mode==42)
|
||||||
values["message1"] = message1 ? message1 : "(none)"
|
values["message1"] = message1 ? message1 : "(none)"
|
||||||
values["message2"] = message2 ? message2 : "(none)"
|
values["message2"] = message2 ? message2 : "(none)"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* Power Monitor (Mode: 43 / 433) */
|
/* Power Monitor (Mode: 43 / 433) */
|
||||||
if(mode==43 || mode==433 || (!ui && access_engine))
|
if(mode==43 || mode==433)
|
||||||
var/pMonData[0]
|
var/pMonData[0]
|
||||||
for(var/obj/machinery/power/monitor/pMon in world)
|
for(var/obj/machinery/power/monitor/pMon in world)
|
||||||
if(!(pMon.stat & (NOPOWER|BROKEN)) )
|
if(!(pMon.stat & (NOPOWER|BROKEN)) )
|
||||||
@@ -294,30 +292,19 @@
|
|||||||
|
|
||||||
|
|
||||||
/* General Records (Mode: 44 / 441 / 45 / 451) */
|
/* General Records (Mode: 44 / 441 / 45 / 451) */
|
||||||
if(mode == 44 || mode == 441 || mode == 45 || mode ==451 || (!ui && (access_medical || access_security)))
|
if(mode == 44 || mode == 441 || mode == 45 || mode ==451)
|
||||||
if(istype(active1, /datum/data/record) && (active1 in data_core.general))
|
if(istype(active1, /datum/data/record) && (active1 in data_core.general))
|
||||||
values["general"] = active1.fields
|
values["general"] = active1.fields
|
||||||
values["general_exists"] = 1
|
values["general_exists"] = 1
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|
||||||
values["general"] = list("name" = null,\
|
|
||||||
"id" = null,\
|
|
||||||
"sex" = null,\
|
|
||||||
"species" = null,\
|
|
||||||
"age" = null,\
|
|
||||||
"rank" = null,\
|
|
||||||
"fingerprint" = null,\
|
|
||||||
"p_stat" = null,\
|
|
||||||
"m_stat" = null,\
|
|
||||||
)
|
|
||||||
values["general_exists"] = 0
|
values["general_exists"] = 0
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* Medical Records (Mode: 44 / 441) */
|
/* Medical Records (Mode: 44 / 441) */
|
||||||
|
|
||||||
if(mode == 44 || mode == 441 || (!ui && access_medical))
|
if(mode == 44 || mode == 441)
|
||||||
var/medData[0]
|
var/medData[0]
|
||||||
for(var/datum/data/record/R in sortRecord(data_core.general))
|
for(var/datum/data/record/R in sortRecord(data_core.general))
|
||||||
medData[++medData.len] = list(Name = R.fields["name"],"ref" = "\ref[R]")
|
medData[++medData.len] = list(Name = R.fields["name"],"ref" = "\ref[R]")
|
||||||
@@ -327,23 +314,11 @@
|
|||||||
values["medical"] = active2.fields
|
values["medical"] = active2.fields
|
||||||
values["medical_exists"] = 1
|
values["medical_exists"] = 1
|
||||||
else
|
else
|
||||||
values["medical"] = list(\
|
|
||||||
"b_type" = null,\
|
|
||||||
"mi_dis" = null,\
|
|
||||||
"mi_dis_d" = null,\
|
|
||||||
"ma_dis" = null,\
|
|
||||||
"ma_dis_d" = null,\
|
|
||||||
"alg" = null,\
|
|
||||||
"alg_d" = null,\
|
|
||||||
"cdi" = null,\
|
|
||||||
"cdi_d" = null,\
|
|
||||||
"notes" = null,\
|
|
||||||
)
|
|
||||||
values["medical_exists"] = 0
|
values["medical_exists"] = 0
|
||||||
|
|
||||||
/* Security Records (Mode:45 / 451) */
|
/* Security Records (Mode:45 / 451) */
|
||||||
|
|
||||||
if(mode == 45 || mode == 451 || (!ui && access_security))
|
if(mode == 45 || mode == 451)
|
||||||
var/secData[0]
|
var/secData[0]
|
||||||
for (var/datum/data/record/R in sortRecord(data_core.general))
|
for (var/datum/data/record/R in sortRecord(data_core.general))
|
||||||
secData[++secData.len] = list(Name = R.fields["name"], "ref" = "\ref[R]")
|
secData[++secData.len] = list(Name = R.fields["name"], "ref" = "\ref[R]")
|
||||||
@@ -353,18 +328,11 @@
|
|||||||
values["security"] = active3.fields
|
values["security"] = active3.fields
|
||||||
values["security_exists"] = 1
|
values["security_exists"] = 1
|
||||||
else
|
else
|
||||||
values["security"] = list(\
|
|
||||||
"criminal" = null,\
|
|
||||||
"mi_crim" = null,\
|
|
||||||
"ma_crim" = null,\
|
|
||||||
"ma_crim_d" = null,\
|
|
||||||
"notes"\
|
|
||||||
)
|
|
||||||
values["security_exists"] = 0
|
values["security_exists"] = 0
|
||||||
|
|
||||||
/* Security Bot Control (Mode: 46) */
|
/* Security Bot Control (Mode: 46) */
|
||||||
|
|
||||||
if(mode==46 || !ui)
|
if(mode==46)
|
||||||
var/botsData[0]
|
var/botsData[0]
|
||||||
var/beepskyData[0]
|
var/beepskyData[0]
|
||||||
if(istype(radio,/obj/item/radio/integrated/beepsky))
|
if(istype(radio,/obj/item/radio/integrated/beepsky))
|
||||||
@@ -401,7 +369,7 @@
|
|||||||
|
|
||||||
/* MULEBOT Control (Mode: 48) */
|
/* MULEBOT Control (Mode: 48) */
|
||||||
|
|
||||||
if(mode==48 || !ui)
|
if(mode==48)
|
||||||
var/muleData[0]
|
var/muleData[0]
|
||||||
var/mulebotsData[0]
|
var/mulebotsData[0]
|
||||||
if(istype(radio,/obj/item/radio/integrated/mule))
|
if(istype(radio,/obj/item/radio/integrated/mule))
|
||||||
@@ -441,7 +409,7 @@
|
|||||||
|
|
||||||
/* Supply Shuttle Requests Menu (Mode: 47) */
|
/* Supply Shuttle Requests Menu (Mode: 47) */
|
||||||
|
|
||||||
if(mode==47 || (!ui && access_quartermaster))
|
if(mode==47)
|
||||||
var/supplyData[0]
|
var/supplyData[0]
|
||||||
supplyData["shuttle_moving"] = supply_shuttle.moving
|
supplyData["shuttle_moving"] = supply_shuttle.moving
|
||||||
supplyData["shuttle_eta"] = supply_shuttle.eta
|
supplyData["shuttle_eta"] = supply_shuttle.eta
|
||||||
@@ -476,7 +444,7 @@
|
|||||||
|
|
||||||
|
|
||||||
/* Janitor Supplies Locator (Mode: 49) */
|
/* Janitor Supplies Locator (Mode: 49) */
|
||||||
if(mode==49 || (!ui && access_janitor))
|
if(mode==49)
|
||||||
var/JaniData[0]
|
var/JaniData[0]
|
||||||
var/turf/cl = get_turf(src)
|
var/turf/cl = get_turf(src)
|
||||||
|
|
||||||
|
|||||||
@@ -49,7 +49,11 @@ Used In File(s): \code\game\objects\items\devices\PDA\PDA.dm
|
|||||||
<b>Cartridge</b>:
|
<b>Cartridge</b>:
|
||||||
</div>
|
</div>
|
||||||
<div class="itemContent">
|
<div class="itemContent">
|
||||||
{{:~link(cartridge ? cartridge.name : 'no cartridge', 'eject', {'choice' : "Eject"}, cartridge ? null : 'disabled', cartridge ? null : 'fixedLeft')}}
|
{{if cart_loaded==1}}
|
||||||
|
{{:~link(cartridge.name, 'eject', {'choice' : "Eject"},null,null)}}
|
||||||
|
{{else}}
|
||||||
|
{{:~link('None', 'eject', {'choice' : "Eject"},'disabled',null)}}
|
||||||
|
{{/if}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="item">
|
<div class="item">
|
||||||
@@ -469,10 +473,10 @@ Used In File(s): \code\game\objects\items\devices\PDA\PDA.dm
|
|||||||
<b> ALERT!</b>:
|
<b> ALERT!</b>:
|
||||||
</div>
|
</div>
|
||||||
<div class="itemContent">
|
<div class="itemContent">
|
||||||
{{:~link('None', 'alert', {'cartmenu' : "1", 'choice' : "Status",'statdisp' : "alert", 'default' : "alert"}, null, null)}}
|
{{:~link('None', 'alert', {'cartmenu' : "1", 'choice' : "Status",'statdisp' : "alert", 'alert' : "default"}, null, null)}}
|
||||||
{{:~link('Alert', 'alert', {'cartmenu' : "1", 'choice' : "Status",'statdisp' : "alert", 'alert' : "alert"}, null, null)}}
|
{{:~link('Red Alert', 'alert', {'cartmenu' : "1", 'choice' : "Status",'statdisp' : "alert", 'alert' : "redalert"}, null, null)}}
|
||||||
{{:~link('Lockdown', 'caution', {'cartmenu' : "1", 'choice' : "Status",'statdisp' : "alert", 'alert' : "alert"}, null, null)}}
|
{{:~link('Lockdown', 'caution', {'cartmenu' : "1", 'choice' : "Status",'statdisp' : "alert", 'alert' : "lockdown"}, null, null)}}
|
||||||
{{:~link('Biohazard', 'radiation', {'cartmenu' : "1", 'choice' : "Status",'statdisp' : "alert", 'alert' : "alert"}, null, null)}}
|
{{:~link('Biohazard', 'radiation', {'cartmenu' : "1", 'choice' : "Status",'statdisp' : "alert", 'alert' : "biohazard"}, null, null)}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user