diff --git a/code/datums/repositories/crew/binary.dm b/code/datums/repositories/crew/binary.dm
index b060d051cbd93..ee36558f533e5 100644
--- a/code/datums/repositories/crew/binary.dm
+++ b/code/datums/repositories/crew/binary.dm
@@ -1,26 +1,33 @@
-/*********
- *Binary *
-*********/
-
+/* Binary */
/crew_sensor_modifier/binary/process_crew_data(var/mob/living/carbon/human/H, var/obj/item/clothing/under/C, var/turf/pos, var/list/crew_data)
- crew_data["dead"] = H.stat > UNCONSCIOUS
+ crew_data["alert"] = FALSE
+ if(!H.isSynthetic() && H.should_have_organ(BP_HEART))
+ var/obj/item/organ/internal/heart/O = H.internal_organs_by_name[BP_HEART]
+ if (!O || O.robotic < ORGAN_ROBOT) // Don't make medical freak out over prosthetic hearts
+ var/pulse = H.pulse()
+ if(pulse == PULSE_NONE || pulse == PULSE_THREADY)
+ crew_data["alert"] = TRUE
+ if(H.get_blood_oxygenation() < BLOOD_VOLUME_SAFE)
+ crew_data["alert"] = TRUE
return ..()
-/**********
- *Jamming *
-**********/
-
+/* Jamming */
/crew_sensor_modifier/binary/jamming
priority = 5
/crew_sensor_modifier/binary/jamming/alive/process_crew_data(var/mob/living/carbon/human/H, var/obj/item/clothing/under/C, var/turf/pos, var/list/crew_data)
- crew_data["dead"] = FALSE
- return MOD_SUIT_SENSORS_HANDLED
+ if (crew_data["sensor_type"] == SUIT_SENSOR_BINARY )
+ crew_data["alert"] = FALSE
+ return MOD_SUIT_SENSORS_HANDLED
+ return ..()
/crew_sensor_modifier/binary/jamming/dead/process_crew_data(var/mob/living/carbon/human/H, var/obj/item/clothing/under/C, var/turf/pos, var/list/crew_data)
- crew_data["dead"] = TRUE
- return MOD_SUIT_SENSORS_HANDLED
+ if (crew_data["sensor_type"] == SUIT_SENSOR_BINARY )
+ crew_data["alert"] = TRUE
+ return MOD_SUIT_SENSORS_HANDLED
+ return ..()
+/* Random */
/crew_sensor_modifier/binary/jamming/random
var/error_prob = 25
@@ -33,4 +40,4 @@
/crew_sensor_modifier/binary/jamming/random/process_crew_data(var/mob/living/carbon/human/H, var/obj/item/clothing/under/C, var/turf/pos, var/list/crew_data)
. = ..()
if(prob(error_prob))
- crew_data["dead"] = pick(TRUE, FALSE)
+ crew_data["alert"] = pick(TRUE, FALSE)
diff --git a/code/datums/repositories/crew/crew.dm b/code/datums/repositories/crew/crew.dm
index 7e1c3955819fe..86461bf2dc6b1 100644
--- a/code/datums/repositories/crew/crew.dm
+++ b/code/datums/repositories/crew/crew.dm
@@ -2,11 +2,13 @@ var/global/datum/repository/crew/crew_repository = new()
/datum/repository/crew
var/list/cache_data
+ var/list/cache_data_alert
var/list/modifier_queues
var/list/modifier_queues_by_type
/datum/repository/crew/New()
cache_data = list()
+ cache_data_alert = list()
var/PriorityQueue/general_modifiers = new/PriorityQueue(/proc/cmp_crew_sensor_modifier)
var/PriorityQueue/binary_modifiers = new/PriorityQueue(/proc/cmp_crew_sensor_modifier)
var/PriorityQueue/vital_modifiers = new/PriorityQueue(/proc/cmp_crew_sensor_modifier)
@@ -44,6 +46,7 @@ var/global/datum/repository/crew/crew_repository = new()
if(world.time < cache_entry.timestamp)
return cache_entry.data
+ cache_data_alert[num2text(z_level)] = 0
var/tracked = scan()
for(var/obj/item/clothing/under/C in tracked)
var/turf/pos = get_turf(C)
@@ -52,48 +55,28 @@ var/global/datum/repository/crew/crew_repository = new()
var/mob/living/carbon/human/H = C.loc
if(H.w_uniform != C)
continue
-
- var/pressure = H.get_blood_pressure()
- if(H.isSynthetic() || !H.should_have_organ(BP_HEART))
- pressure = "N/A"
- else
- var/blood_result = H.get_blood_oxygenation()
- if(blood_result > 110)
- blood_result = "increased"
- else if(blood_result < 90)
- blood_result = "low"
- else if(blood_result < 60)
- blood_result = "extremely low"
- else
- blood_result = "normal"
- pressure += " ([blood_result] oxygenation)"
-
- var/true_pulse = H.pulse()
- var/pulse_span = "good"
- switch(true_pulse)
- if(PULSE_NONE)
- pulse_span = "bad"
- if(PULSE_SLOW)
- pulse_span = "highlight"
- if(PULSE_NORM)
- pulse_span = "good"
- if(PULSE_FAST)
- pulse_span = "average"
- if(PULSE_2FAST)
- pulse_span = "bad"
- if(PULSE_THREADY)
- pulse_span = "bad"
-
- var/list/crewmemberData = list("sensor_type" = C.sensor_mode, "stat"= H.stat, "span" = pulse_span, "pulse"= H.get_pulse(1), "pressure"= pressure, "bodytemp" = H.bodytemperature - T0C, "area"="", "x"=-1, "y"=-1, "z"=-1, "ref" = "\ref[H]")
+
+ var/list/crewmemberData = list("sensor_type"=C.sensor_mode, "stat"=H.stat, "area"="", "x"=-1, "y"=-1, "z"=-1, "ref"="\ref[H]")
if(!(run_queues(H, C, pos, crewmemberData) & MOD_SUIT_SENSORS_REJECTED))
crewmembers[++crewmembers.len] = crewmemberData
+ if (crewmemberData["alert"])
+ cache_data_alert[num2text(z_level)] = 1
crewmembers = sortByKey(crewmembers, "name")
cache_entry.timestamp = world.time + 5 SECONDS
cache_entry.data = crewmembers
+ cache_data[num2text(z_level)] = cache_entry
+
return crewmembers
+/datum/repository/crew/proc/has_health_alert(var/z_level)
+ . = 0
+ if(!z_level)
+ return
+ health_data(z_level) // Make sure cache doesn't get stale
+ . = cache_data_alert[num2text(z_level)]
+
/datum/repository/crew/proc/scan()
var/list/tracked = list()
for(var/mob/living/carbon/human/H in SSmobs.mob_list)
diff --git a/code/datums/repositories/crew/general.dm b/code/datums/repositories/crew/general.dm
index 9278ff8595c97..a2c09ddab375b 100644
--- a/code/datums/repositories/crew/general.dm
+++ b/code/datums/repositories/crew/general.dm
@@ -1,17 +1,11 @@
-/**********
- *General *
-**********/
-
+/* General */
/crew_sensor_modifier/general/process_crew_data(var/mob/living/carbon/human/H, var/obj/item/clothing/under/C, var/turf/pos, var/list/crew_data)
crew_data["name"] = H.get_authentification_name(if_no_id="Unknown")
crew_data["rank"] = H.get_authentification_rank(if_no_id="Unknown", if_no_job="No Job")
crew_data["assignment"] = H.get_assignment(if_no_id="Unknown", if_no_job="No Job")
return ..()
-/**********
-* Jamming *
-**********/
-
+/* Jamming */
/crew_sensor_modifier/general/jamming
priority = 5
@@ -19,6 +13,7 @@
. = ..()
// This works only because general is checked first and crew_data["sensor_type"] is used to check if whether any additional data should be included.
crew_data["sensor_type"] = SUIT_SENSOR_OFF
+ return MOD_SUIT_SENSORS_REJECTED
/crew_sensor_modifier/general/jamming/binary/process_crew_data(var/mob/living/carbon/human/H, var/obj/item/clothing/under/C, var/turf/pos, var/list/crew_data)
. = ..()
@@ -32,21 +27,22 @@
. = ..()
crew_data["sensor_type"] = SUIT_SENSOR_TRACKING
+/* Random */
/crew_sensor_modifier/general/jamming/random
var/random_sensor_type_prob = 15
- var/random_rank_prob = 10
+ var/random_assignment_prob = 10
/crew_sensor_modifier/general/jamming/random/moderate
random_sensor_type_prob = 30
- random_rank_prob = 20
+ random_assignment_prob = 20
/crew_sensor_modifier/general/jamming/random/major
random_sensor_type_prob = 60
- random_rank_prob = 40
+ random_assignment_prob = 40
/crew_sensor_modifier/general/jamming/random/process_crew_data(var/mob/living/carbon/human/H, var/obj/item/clothing/under/C, var/turf/pos, var/list/crew_data)
. = ..()
if(prob(random_sensor_type_prob))
crew_data["sensor_type"] = pick(SUIT_SENSOR_OFF, SUIT_SENSOR_BINARY, SUIT_SENSOR_VITAL, SUIT_SENSOR_TRACKING)
- if(prob(random_rank_prob))
- crew_data["rank"] = pick("Clown", "Mime", "Janitor", "Unknown")
+ if(prob(random_assignment_prob))
+ crew_data["assignment"] = pick("Agent", "Infiltrator", "Passenger", "Crewman", "Unknown")
diff --git a/code/datums/repositories/crew/tracking.dm b/code/datums/repositories/crew/tracking.dm
index 71a88c9e160d9..111408a685741 100644
--- a/code/datums/repositories/crew/tracking.dm
+++ b/code/datums/repositories/crew/tracking.dm
@@ -1,7 +1,4 @@
-/*********
- *Vital *
-*********/
-
+/* Tracking */
/crew_sensor_modifier/tracking/process_crew_data(var/mob/living/carbon/human/H, var/obj/item/clothing/under/C, var/turf/pos, var/list/crew_data)
if(pos)
var/area/A = get_area(pos)
@@ -11,10 +8,7 @@
crew_data["z"] = pos.z
return ..()
-/**********
- *Jamming *
-**********/
-
+/* Random */
/crew_sensor_modifier/tracking/jamming
priority = 5
diff --git a/code/datums/repositories/crew/vital.dm b/code/datums/repositories/crew/vital.dm
index 2da1887d2064f..86c7b1848f89e 100644
--- a/code/datums/repositories/crew/vital.dm
+++ b/code/datums/repositories/crew/vital.dm
@@ -1,82 +1,105 @@
-/*********
- *Vital *
-*********/
-
+/* Vital */
/crew_sensor_modifier/vital/process_crew_data(var/mob/living/carbon/human/H, var/obj/item/clothing/under/C, var/turf/pos, var/list/crew_data)
- crew_data["oxy"] = round(H.getOxyLoss(), 1)
- crew_data["tox"] = round(H.getToxLoss(), 1)
- crew_data["fire"] = round(H.getFireLoss(), 1)
- crew_data["brute"] = round(H.getBruteLoss(), 1)
+ crew_data["true_pulse"] = -1
+ crew_data["pulse"] = "N/A"
+ crew_data["pulse_span"] = "neutral"
+ if(!H.isSynthetic() && H.should_have_organ(BP_HEART))
+ var/obj/item/organ/internal/heart/O = H.internal_organs_by_name[BP_HEART]
+ if (!O || O.robotic < ORGAN_ROBOT) // Don't make medical freak out over prosthetic hearts
+ crew_data["true_pulse"] = H.pulse()
+ crew_data["pulse"] = H.get_pulse(1)
+ switch(crew_data["true_pulse"])
+ if(PULSE_NONE)
+ crew_data["pulse_span"] = "bad"
+ if(PULSE_SLOW)
+ crew_data["pulse_span"] = "average"
+ if(PULSE_NORM)
+ crew_data["pulse_span"] = "good"
+ if(PULSE_FAST)
+ crew_data["pulse_span"] = "highlight"
+ if(PULSE_2FAST)
+ crew_data["pulse_span"] = "average"
+ if(PULSE_THREADY)
+ crew_data["pulse_span"] = "bad"
+
+ crew_data["pressure"] = "N/A"
+ crew_data["true_oxygenation"] = -1
+ crew_data["oxygenation"] = ""
+ crew_data["oxygenation_span"] = ""
+ if(!H.isSynthetic() && H.should_have_organ(BP_HEART))
+ crew_data["pressure"] = H.get_blood_pressure()
+ crew_data["true_oxygenation"] = H.get_blood_oxygenation()
+ switch (crew_data["true_oxygenation"])
+ if(105 to INFINITY)
+ crew_data["oxygenation"] = "increased"
+ crew_data["oxygenation_span"] = "highlight"
+ if(BLOOD_VOLUME_SAFE to 105)
+ crew_data["oxygenation"] = "normal"
+ crew_data["oxygenation_span"] = "good"
+ if(BLOOD_VOLUME_OKAY to BLOOD_VOLUME_SAFE)
+ crew_data["oxygenation"] = "low"
+ crew_data["oxygenation_span"] = "average"
+ if(BLOOD_VOLUME_BAD to BLOOD_VOLUME_OKAY)
+ crew_data["oxygenation"] = "very low"
+ crew_data["oxygenation_span"] = "bad"
+ if(-(INFINITY) to BLOOD_VOLUME_BAD)
+ crew_data["oxygenation"] = "extremely low"
+ crew_data["oxygenation_span"] = "bad"
+
+ crew_data["bodytemp"] = H.bodytemperature - T0C
return ..()
-/**********
- *Jamming *
-**********/
+/crew_sensor_modifier/vital/proc/set_healthy(var/list/crew_data)
+ crew_data["alert"] = FALSE
+ if(crew_data["true_pulse"] != -1)
+ crew_data["true_pulse"] = PULSE_NORM
+ crew_data["pulse"] = rand(60, 90)
+ crew_data["pulse_span"] = "good"
-/crew_sensor_modifier/vital/jamming
- priority = 5
+ if(crew_data["true_oxygenation"] != -1)
+ crew_data["pressure"] = "[Floor(120+rand(-5,5))]/[Floor(80+rand(-5,5))]"
+ crew_data["true_oxygenation"] = 100
+ crew_data["oxygenation"] = "normal"
+ crew_data["oxygenation_span"] = "good"
-/crew_sensor_modifier/vital/jamming/healthy/process_crew_data(var/mob/living/carbon/human/H, var/obj/item/clothing/under/C, var/turf/pos, var/list/crew_data)
- crew_data["oxy"] = 0
- crew_data["tox"] = 0
- crew_data["fire"] = 0
- crew_data["brute"] = 0
- return MOD_SUIT_SENSORS_HANDLED
+/crew_sensor_modifier/vital/proc/set_dead(var/list/crew_data)
+ crew_data["alert"] = TRUE
+ if(crew_data["true_pulse"] != -1)
+ crew_data["true_pulse"] = PULSE_NONE
+ crew_data["pulse"] = 0
+ crew_data["pulse_span"] = "bad"
-/crew_sensor_modifier/vital/jamming/oxy/process_crew_data(var/mob/living/carbon/human/H, var/obj/item/clothing/under/C, var/turf/pos, var/list/crew_data)
- . = ..()
- crew_data["oxy"] = max(200, crew_data["oxy"])
+ if(crew_data["true_oxygenation"] != -1)
+ crew_data["pressure"] = "[Floor((120+rand(-5,5))*0.25)]/[Floor((80+rand(-5,5))*0.25)]"
+ crew_data["true_oxygenation"] = 25
+ crew_data["oxygenation"] = "extremely low"
+ crew_data["oxygenation_span"] = "bad"
-/crew_sensor_modifier/vital/jamming/tox/process_crew_data(var/mob/living/carbon/human/H, var/obj/item/clothing/under/C, var/turf/pos, var/list/crew_data)
- . = ..()
- crew_data["tox"] = max(200, crew_data["tox"])
+/* Jamming */
+/crew_sensor_modifier/vital/jamming
+ priority = 5
-/crew_sensor_modifier/vital/jamming/fire/process_crew_data(var/mob/living/carbon/human/H, var/obj/item/clothing/under/C, var/turf/pos, var/list/crew_data)
+/crew_sensor_modifier/vital/jamming/healthy/process_crew_data(var/mob/living/carbon/human/H, var/obj/item/clothing/under/C, var/turf/pos, var/list/crew_data)
. = ..()
- crew_data["fire"] = max(200, crew_data["fire"])
+ set_healthy(crew_data)
+ return MOD_SUIT_SENSORS_HANDLED
-/crew_sensor_modifier/vital/jamming/brute/process_crew_data(var/mob/living/carbon/human/H, var/obj/item/clothing/under/C, var/turf/pos, var/list/crew_data)
+/crew_sensor_modifier/vital/jamming/dead/process_crew_data(var/mob/living/carbon/human/H, var/obj/item/clothing/under/C, var/turf/pos, var/list/crew_data)
. = ..()
- crew_data["brute"] = max(200, crew_data["brute"])
-
-/*********
-* Random *
-*********/
+ set_dead(crew_data)
+ return MOD_SUIT_SENSORS_HANDLED
+/* Random */
/crew_sensor_modifier/vital/jamming/random
- var/min_diff = -10
- var/max_diff = 50
- var/next_shift = 0
- var/list/harm_diffs
- var/static/list/harms
-
-/crew_sensor_modifier/vital/jamming/random/New()
- ..()
- if(!harms)
- harms = list("brute", "fire", "oxy", "tox")
- harm_diffs = list()
+ var/error_prob = 25
/crew_sensor_modifier/vital/jamming/random/moderate
- min_diff = -15
- max_diff = 100
+ error_prob = 50
/crew_sensor_modifier/vital/jamming/random/major
- min_diff = -20
- max_diff = 200
-
-/crew_sensor_modifier/vital/jamming/random/proc/update_diff_range()
- if(world.time < next_shift)
- return
- next_shift = world.time + rand(30 SECONDS, 2 MINUTES)
- for(var/harm in harms)
- harm_diffs[harm] = rand(min_diff, max_diff)
+ error_prob = 100
/crew_sensor_modifier/vital/jamming/random/process_crew_data(var/mob/living/carbon/human/H, var/obj/item/clothing/under/C, var/turf/pos, var/list/crew_data)
- ..()
- update_diff_range()
- for(var/harm in harms)
- if(crew_data[harm] == 0 && harm_diffs[harm] < 0) // Making sure jamming(almost) always has an effect
- crew_data[harm] = crew_data[harm] - harm_diffs[harm]
- else
- crew_data[harm] = max(0, crew_data[harm] + harm_diffs[harm])
- return MOD_SUIT_SENSORS_HANDLED
+ . = ..()
+ if(prob(error_prob))
+ pick(set_healthy(crew_data), set_dead(crew_data))
diff --git a/code/datums/suit_sensor_jammer_method.dm b/code/datums/suit_sensor_jammer_method.dm
index d0731a4519f8e..d9a4c1b66e3a9 100644
--- a/code/datums/suit_sensor_jammer_method.dm
+++ b/code/datums/suit_sensor_jammer_method.dm
@@ -58,54 +58,30 @@
/crew_sensor_modifier/vital = /crew_sensor_modifier/vital/jamming/healthy
)
-/suit_sensor_jammer_method/dead_brute
- name = "Dead - Brute"
+/suit_sensor_jammer_method/dead
+ name = "Dead"
energy_cost = 2
jammer_methods = list(
/crew_sensor_modifier/binary = /crew_sensor_modifier/binary/jamming/dead,
- /crew_sensor_modifier/vital = /crew_sensor_modifier/vital/jamming/brute
- )
-
-/suit_sensor_jammer_method/dead_fire
- name = "Dead - Fire"
- energy_cost = 2
- jammer_methods = list(
- /crew_sensor_modifier/binary = /crew_sensor_modifier/binary/jamming/dead,
- /crew_sensor_modifier/vital = /crew_sensor_modifier/vital/jamming/fire
- )
-
-/suit_sensor_jammer_method/dead_oxy
- name = "Dead - Oxy"
- energy_cost = 2
- jammer_methods = list(
- /crew_sensor_modifier/binary = /crew_sensor_modifier/binary/jamming/dead,
- /crew_sensor_modifier/vital = /crew_sensor_modifier/vital/jamming/oxy
- )
-
-/suit_sensor_jammer_method/dead_tox
- name = "Dead - Tox"
- energy_cost = 2
- jammer_methods = list(
- /crew_sensor_modifier/binary = /crew_sensor_modifier/binary/jamming/dead,
- /crew_sensor_modifier/vital = /crew_sensor_modifier/vital/jamming/tox
+ /crew_sensor_modifier/vital = /crew_sensor_modifier/vital/jamming/dead
)
/suit_sensor_jammer_method/cap_off
- name = "Cap Data - Off"
+ name = "Cap Data - Off"
energy_cost = 3
jammer_methods = list(
/crew_sensor_modifier/general = /crew_sensor_modifier/general/jamming/off
)
/suit_sensor_jammer_method/cap_binary
- name = "Cap Data - Binary"
+ name = "Cap Data - Binary"
energy_cost = 2
jammer_methods = list(
/crew_sensor_modifier/general = /crew_sensor_modifier/general/jamming/binary
)
/suit_sensor_jammer_method/cap_vital
- name = "Cap Data - Vital"
+ name = "Cap Data - Vital"
energy_cost = 1
jammer_methods = list(
/crew_sensor_modifier/general = /crew_sensor_modifier/general/jamming/vital
diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm
index 0238b50f027f4..34fbb44f7635f 100644
--- a/code/modules/mob/living/carbon/human/human.dm
+++ b/code/modules/mob/living/carbon/human/human.dm
@@ -1313,7 +1313,7 @@
/mob/living/carbon/human/proc/get_pulse(var/method) //method 0 is for hands, 1 is for machines, more accurate
var/obj/item/organ/internal/heart/H = internal_organs_by_name[BP_HEART]
if(!H)
- return
+ return "0"
if(H.open && !method)
return "muddled and unclear; you can't seem to find a vein"
diff --git a/code/modules/modular_computers/file_system/program_events.dm b/code/modules/modular_computers/file_system/program_events.dm
index 2b3240b474a9b..392cbe1ab6e2c 100644
--- a/code/modules/modular_computers/file_system/program_events.dm
+++ b/code/modules/modular_computers/file_system/program_events.dm
@@ -15,4 +15,5 @@
if(background)
computer.visible_message("\The [computer]'s screen displays an error: \"Network connectivity lost - process [filename].[filetype] (PID [rand(100,999)]) terminated.\"", range = 1)
else
- computer.visible_message("\The [computer]'s screen briefly freezes and then shows: \"FATAL NETWORK ERROR - NTNet connection lost. Please try again later. If problem persists, please contact your system administrator.\"", range = 1)
\ No newline at end of file
+ computer.visible_message("\The [computer]'s screen briefly freezes and then shows: \"FATAL NETWORK ERROR - NTNet connection lost. Please try again later. If problem persists, please contact your system administrator.\"", range = 1)
+ computer.update_icon()
\ No newline at end of file
diff --git a/code/modules/modular_computers/file_system/programs/medical/suit_sensors.dm b/code/modules/modular_computers/file_system/programs/medical/suit_sensors.dm
index 61d1ccdc2e68a..32a08e0359edc 100644
--- a/code/modules/modular_computers/file_system/programs/medical/suit_sensors.dm
+++ b/code/modules/modular_computers/file_system/programs/medical/suit_sensors.dm
@@ -2,6 +2,7 @@
filename = "sensormonitor"
filedesc = "Suit Sensors Monitoring"
nanomodule_path = /datum/nano_module/crew_monitor
+ ui_header = "crew_green.gif"
program_icon_state = "crew"
program_key_state = "med_key"
program_menu_icon = "heart"
@@ -10,14 +11,34 @@
requires_ntnet = 1
network_destination = "crew lifesigns monitoring system"
size = 11
+ var/has_alert = 0
-
-
-
+/datum/computer_file/program/suit_sensors/process_tick()
+ ..()
+ var/datum/nano_module/crew_monitor/NMC = NM
+ if(istype(NMC) && NMC.has_alerts())
+ if(!has_alert)
+ program_icon_state = "crew-red"
+ ui_header = "crew_red.gif"
+ update_computer_icon()
+ has_alert = 1
+ else
+ if(has_alert)
+ program_icon_state = "crew"
+ ui_header = "crew_green.gif"
+ update_computer_icon()
+ has_alert = 0
+ return 1
/datum/nano_module/crew_monitor
name = "Crew monitor"
+/datum/nano_module/crew_monitor/proc/has_alerts()
+ for(var/z_level in GLOB.using_map.map_levels)
+ if (crew_repository.has_health_alert(z_level))
+ return 1
+ return 0
+
/datum/nano_module/crew_monitor/Topic(href, href_list)
if(..()) return 1
@@ -39,15 +60,14 @@
ui = SSnano.try_update_ui(user, src, ui_key, ui, data, force_open)
if(!ui)
- ui = new(user, src, ui_key, "crew_monitor.tmpl", "Crew Monitoring Computer", 900, 800, state = state)
+ ui = new(user, src, ui_key, "crew_monitor.tmpl", "Crew Monitoring Computer", 1050, 800, state = state)
// adding a template with the key "mapContent" enables the map ui functionality
ui.add_template("mapContent", "crew_monitor_map_content.tmpl")
// adding a template with the key "mapHeader" replaces the map header content
ui.add_template("mapHeader", "crew_monitor_map_header.tmpl")
+ // ui.auto_update_layout = 1 // Disabled as with camera monitor - breaks the UI map. Re-enable once it's fixed somehow.
ui.set_initial_data(data)
ui.open()
-
- // should make the UI auto-update; doesn't seem to?
ui.set_auto_update(1)
diff --git a/code/modules/nano/nanoui.dm b/code/modules/nano/nanoui.dm
index 5ffd85243eaf5..65fbbadadeabb 100644
--- a/code/modules/nano/nanoui.dm
+++ b/code/modules/nano/nanoui.dm
@@ -35,6 +35,8 @@ nanoui is used to open and update nano browser uis
var/templates[0]
// the layout key for this ui (this is used on the frontend, leave it as "default" unless you know what you're doing)
var/layout_key = "default"
+ // optional layout key for additional ui header content to include
+ var/layout_header_key = "default_header"
// this sets whether to re-render the ui layout with each update (default 0, turning on will break the map ui if it's in use)
var/auto_update_layout = 0
// this sets whether to re-render the ui content with each update (default 1)
@@ -347,6 +349,8 @@ nanoui is used to open and update nano browser uis
// before the UI opens, add the layout files based on the layout key
add_stylesheet("layout_[layout_key].css")
add_template("layout", "layout_[layout_key].tmpl")
+ if (layout_header_key)
+ add_template("layoutHeader", "layout_[layout_header_key].tmpl")
var/head_content = ""
diff --git a/icons/obj/modular_console.dmi b/icons/obj/modular_console.dmi
index 31d2be915804c..125711410dcbb 100644
Binary files a/icons/obj/modular_console.dmi and b/icons/obj/modular_console.dmi differ
diff --git a/icons/obj/modular_laptop.dmi b/icons/obj/modular_laptop.dmi
index 897d26f7cb46f..6dc2af2d0178b 100644
Binary files a/icons/obj/modular_laptop.dmi and b/icons/obj/modular_laptop.dmi differ
diff --git a/icons/obj/modular_tablet.dmi b/icons/obj/modular_tablet.dmi
index e563f731a7f31..44521837942a1 100644
Binary files a/icons/obj/modular_tablet.dmi and b/icons/obj/modular_tablet.dmi differ
diff --git a/icons/obj/modular_telescreen.dmi b/icons/obj/modular_telescreen.dmi
index 2b82cdb11f824..eee9853a93ceb 100644
Binary files a/icons/obj/modular_telescreen.dmi and b/icons/obj/modular_telescreen.dmi differ
diff --git a/nano/images/modular_computers/crew_green.gif b/nano/images/modular_computers/crew_green.gif
new file mode 100644
index 0000000000000..c44698f3a3ecf
Binary files /dev/null and b/nano/images/modular_computers/crew_green.gif differ
diff --git a/nano/images/modular_computers/crew_red.gif b/nano/images/modular_computers/crew_red.gif
new file mode 100644
index 0000000000000..bdc360511cbe8
Binary files /dev/null and b/nano/images/modular_computers/crew_red.gif differ
diff --git a/nano/js/nano_state.js b/nano/js/nano_state.js
index 3e9ef3ab1ff60..14291de953dd6 100644
--- a/nano/js/nano_state.js
+++ b/nano/js/nano_state.js
@@ -56,6 +56,11 @@ NanoStateClass.prototype.onUpdate = function (data) {
if (!this.contentRendered || (data['config'].hasOwnProperty('autoUpdateContent') && data['config']['autoUpdateContent']))
{
$("#uiContent").html(NanoTemplate.parse('main', data)); // render the 'mail' template to the #mainTemplate div
+
+ if (NanoTemplate.templateExists('layoutHeader'))
+ {
+ $("#uiHeaderContent").html(NanoTemplate.parse('layoutHeader', data));
+ }
this.contentRendered = true;
}
if (NanoTemplate.templateExists('mapContent'))
diff --git a/nano/templates/crew_monitor.tmpl b/nano/templates/crew_monitor.tmpl
index 150ac160aaa56..8355410f565c6 100644
--- a/nano/templates/crew_monitor.tmpl
+++ b/nano/templates/crew_monitor.tmpl
@@ -1,19 +1,17 @@
-
{{:helper.link('Show Tracker Map', 'pin-s', {'showMap' : 1})}}
@@ -22,34 +20,46 @@ Used In File(s): \code\game\machinery\computer\crew.dm
{{:value.name}} ({{:value.assignment}}): |
- {{if value.sensor_type == 1}}
-
- {{if value.pulse}}
- Pulse detected |
+ {{if value.sensor_type >= 2}}
+ {{if value.true_pulse == -1}}
+ Pulse {{:value.pulse}} |
{{else}}
- No pulse detected |
+ Pulse {{:value.pulse}} bpm |
{{/if}}
-
- {{if data.isAI}}
- {{:helper.link('Track', null, {}, 'disabled')}} |
+ {{else}}
+ {{if value.alert}}
+ Medical issue detected |
+ {{else}}
+ No issues detected |
{{/if}}
+ {{/if}}
- {{else value.sensor_type == 2}}
+ {{if value.sensor_type >= 2}}
+ BP {{:value.pressure}} {{if value.oxygenation}}({{:value.oxygenation}} oxygenation){{/if}} |
+ {{else}}
+ |
+ {{/if}}
- Pulse {{:value.pulse}} bpm | BP {{:value.pressure}} | Temp {{:value.bodytemp}} C | Location Not Available |
-
- {{if data.isAI}}
- {{:helper.link('Track', null, {}, 'disabled')}} |
- {{/if}}
-
- {{else value.sensor_type == 3}}
+ {{if value.sensor_type >= 2}}
+ Temp {{:value.bodytemp}} C |
+ {{else}}
+ |
+ {{/if}}
- Pulse {{:value.pulse}} bpm | BP {{:value.pressure}} | Temp {{:value.bodytemp}} C | Location {{:value.area}} ({{:value.x}}, {{:value.y}}, {{:value.z}}) |
+ {{if value.sensor_type >= 3}}
+ Location {{:value.area}} ({{:value.x}}, {{:value.y}}, {{:value.z}}) |
+ {{else value.sensor_type == 2}}
+ Location Not Available |
+ {{else}}
+ |
+ {{/if}}
- {{if data.isAI}}
+ {{if data.isAI}}
+ {{if value.sensor_type >= 3}}
{{:helper.link('Track', null, {'track' : value.ref})}} |
+ {{else}}
+ {{:helper.link('Track', null, {}, 'disabled')}} |
{{/if}}
-
{{/if}}
{{/for}}
diff --git a/nano/templates/crew_monitor_map_content.tmpl b/nano/templates/crew_monitor_map_content.tmpl
index f2c7765357dde..b2fc216c9763a 100644
--- a/nano/templates/crew_monitor_map_content.tmpl
+++ b/nano/templates/crew_monitor_map_content.tmpl
@@ -1,14 +1,13 @@
{{for data.crewmembers}}
- {{if value.sensor_type == 3 && value.z == config.mapZLevel}}
-
-
- {{:value.name}} ({{:value.assignment}}) - {{if data.stat == 0}} conscious {{else data.stat == 1}} unconscious {{else data.stat == 2}} deceased {{/if}} - pulse {{data.pulse}}bpm, body temperature {{data.bodytemp}}C ({{:value.area}}: {{:value.x}}, {{:value.y}})
-
-
- {{/if}}
+ {{if value.sensor_type == 3 && value.z == config.mapZLevel}}
+
+
+ {{:value.name}} ({{:value.assignment}}) - {{:value.alert ? 'Medical issue detected' : 'No issues detected'}} - {{:value.area}} ({{:value.x}}, {{:value.y}})
+
+
+ {{/if}}
{{/for}}
-
diff --git a/nano/templates/crew_monitor_map_header.tmpl b/nano/templates/crew_monitor_map_header.tmpl
index 39d45dea17c77..24398dec5b01a 100644
--- a/nano/templates/crew_monitor_map_header.tmpl
+++ b/nano/templates/crew_monitor_map_header.tmpl
@@ -1,6 +1,6 @@
{{:helper.link('Show Detail List', 'script', {'showMap' : 0})}}
{{:helper.link('Hide Map', 'close', {'showMap' : 0})}}
@@ -12,9 +12,9 @@ Used In File(s): \code\game\machinery\computer\crew.dm
-
Zoom Level:
-
x1.0
-
x1.5
-
x2.0
-
x2.5
+
Zoom Level:
+
x1.0
+
x1.5
+
x2.0
+
x2.5
diff --git a/nano/templates/layout_default.tmpl b/nano/templates/layout_default.tmpl
index ed6ff4a4c2a61..8dae1468bfb1c 100644
--- a/nano/templates/layout_default.tmpl
+++ b/nano/templates/layout_default.tmpl
@@ -1,40 +1,6 @@
-{{if data.PC_hasheader}}
-
-
-
- {{:helper.link('Shutdown', null, {'PC_shutdown' : 1})}}
- {{if data.PC_showexitprogram}}
- | {{:helper.link('Exit Program', null, {'PC_exit' : 1})}}
- | {{:helper.link('Minimize Program', null, {'PC_minimize' : 1})}}
- {{/if}}
- |
-
-