mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-22 20:48:56 +01:00
[MIRROR] New MOD Suit UI [MDB IGNORE] (#22718)
* New MOD Suit UI * Fix merge conflict+ bug that doesn't respect locked modsuits for non pais --------- Co-authored-by: Andrew <mt.forspam@gmail.com> Co-authored-by: Giz <13398309+vinylspiders@users.noreply.github.com>
This commit is contained in:
+36
-21
@@ -6,24 +6,39 @@
|
||||
|
||||
/obj/item/mod/control/ui_data(mob/user)
|
||||
var/data = list()
|
||||
data["interface_break"] = interface_break
|
||||
data["malfunctioning"] = malfunctioning
|
||||
data["open"] = open
|
||||
data["active"] = active
|
||||
data["locked"] = locked
|
||||
data["complexity"] = complexity
|
||||
data["selected_module"] = selected_module?.name
|
||||
data["wearer_name"] = wearer ? (wearer.get_authentification_name("Unknown") || "Unknown") : "No Occupant"
|
||||
data["wearer_job"] = wearer ? wearer.get_assignment("Unknown", "Unknown", FALSE) : "No Job"
|
||||
// SKYRAT EDIT START - pAIs in MODsuits
|
||||
data["pAI"] = mod_pai?.name
|
||||
data["ispAI"] = mod_pai ? mod_pai == user : FALSE
|
||||
// SKYRAT EDIT END
|
||||
data["core"] = core?.name
|
||||
data["charge"] = get_charge_percent()
|
||||
data["modules"] = list()
|
||||
// Suit information
|
||||
var/suit_status = list(
|
||||
"core_name" = core?.name,
|
||||
"cell_charge_current" = get_charge(),
|
||||
"cell_charge_max" = get_max_charge(),
|
||||
"active" = active,
|
||||
//"ai_name" = ai?.name, // SKYRAT EDIT REMOVAL - pAIs in MODsuits
|
||||
// Wires
|
||||
"open" = open,
|
||||
"seconds_electrified" = seconds_electrified,
|
||||
"malfunctioning" = malfunctioning,
|
||||
"locked" = locked,
|
||||
"interface_break" = interface_break,
|
||||
// Modules
|
||||
"complexity" = complexity,
|
||||
// SKYRAT EDIT START - pAIs in MODsuits
|
||||
"pAI" = mod_pai?.name,
|
||||
"ispAI" = mod_pai ? mod_pai == user : FALSE,
|
||||
// SKYRAT EDIT END
|
||||
)
|
||||
data["suit_status"] = suit_status
|
||||
// User information
|
||||
var/user_status = list(
|
||||
"user_name" = wearer ? (wearer.get_authentification_name("Unknown") || "Unknown") : "",
|
||||
"user_assignment" = wearer ? wearer.get_assignment("Unknown", "Unknown", FALSE) : "",
|
||||
)
|
||||
data["user_status"] = user_status
|
||||
// Module information
|
||||
var/module_custom_status = list()
|
||||
var/module_info = list()
|
||||
for(var/obj/item/mod/module/module as anything in modules)
|
||||
var/list/module_data = list(
|
||||
module_custom_status += module.add_ui_data()
|
||||
module_info += list(list(
|
||||
"module_name" = module.name,
|
||||
"description" = module.desc,
|
||||
"module_type" = module.module_type,
|
||||
@@ -38,9 +53,9 @@
|
||||
"id" = module.tgui_id,
|
||||
"ref" = REF(module),
|
||||
"configuration_data" = module.get_configuration()
|
||||
)
|
||||
module_data += module.add_ui_data()
|
||||
data["modules"] += list(module_data)
|
||||
))
|
||||
data["module_custom_status"] = module_custom_status
|
||||
data["module_info"] = module_info
|
||||
return data
|
||||
|
||||
/obj/item/mod/control/ui_static_data(mob/user)
|
||||
@@ -59,7 +74,7 @@
|
||||
if(.)
|
||||
return
|
||||
// allowed() doesn't allow for pAIs
|
||||
if((!allowed(usr) || !ispAI(usr)) && locked) // SKYRAT EDIT - pAIs in MODsuits
|
||||
if(((locked && !ispAI(usr)) && !allowed(usr))) // SKYRAT EDIT CHANGE - ORIGINAL: if(locked && !allowed(usr))
|
||||
balloon_alert(usr, "insufficient access!")
|
||||
playsound(src, 'sound/machines/scanbuzz.ogg', 25, TRUE, SILENCED_SOUND_EXTRARANGE)
|
||||
return
|
||||
|
||||
@@ -165,10 +165,10 @@
|
||||
|
||||
/obj/item/mod/module/rad_protection/add_ui_data()
|
||||
. = ..()
|
||||
.["userradiated"] = mod.wearer ? HAS_TRAIT(mod.wearer, TRAIT_IRRADIATED) : FALSE
|
||||
.["usertoxins"] = mod.wearer?.getToxLoss() || 0
|
||||
.["usermaxtoxins"] = mod.wearer?.getMaxHealth() || 0
|
||||
.["threatlevel"] = perceived_threat_level
|
||||
.["is_user_irradiated"] = mod.wearer ? HAS_TRAIT(mod.wearer, TRAIT_IRRADIATED) : FALSE
|
||||
.["background_radiation_level"] = perceived_threat_level
|
||||
.["health_max"] = mod.wearer?.getMaxHealth() || 0
|
||||
.["loss_tox"] = mod.wearer?.getToxLoss() || 0
|
||||
|
||||
/obj/item/mod/module/rad_protection/proc/on_pre_potential_irradiation(datum/source, datum/radiation_pulse_information/pulse_information, insulation_to_target)
|
||||
SIGNAL_HANDLER
|
||||
|
||||
@@ -101,7 +101,7 @@
|
||||
overlay_state_active = "module_jetpack_on"
|
||||
/// Do we give the wearer a speed buff.
|
||||
var/full_speed = FALSE
|
||||
var/stabilize = FALSE
|
||||
var/stabilize = TRUE
|
||||
var/thrust_callback
|
||||
|
||||
/obj/item/mod/module/jetpack/Initialize(mapload)
|
||||
@@ -182,8 +182,12 @@
|
||||
use_power_cost = DEFAULT_CHARGE_DRAIN * 0.1
|
||||
incompatible_modules = list(/obj/item/mod/module/status_readout)
|
||||
tgui_id = "status_readout"
|
||||
/// Does this show damage types, body temp, satiety
|
||||
var/display_detailed_vitals = TRUE
|
||||
/// Does this show DNA data
|
||||
var/display_dna = FALSE
|
||||
/// Does this show the round ID and shift time?
|
||||
var/show_time = FALSE
|
||||
var/display_time = FALSE
|
||||
/// Death sound. May or may not be funny. Vareditable at your own risk.
|
||||
var/death_sound = 'sound/effects/flatline3.ogg'
|
||||
/// Death sound volume. Please be responsible with this.
|
||||
@@ -191,20 +195,22 @@
|
||||
|
||||
/obj/item/mod/module/status_readout/add_ui_data()
|
||||
. = ..()
|
||||
.["show_time"] = show_time
|
||||
.["statustime"] = station_time_timestamp()
|
||||
.["statusid"] = GLOB.round_id
|
||||
.["statushealth"] = mod.wearer?.health || 0
|
||||
.["statusmaxhealth"] = mod.wearer?.getMaxHealth() || 0
|
||||
.["statusbrute"] = mod.wearer?.getBruteLoss() || 0
|
||||
.["statusburn"] = mod.wearer?.getFireLoss() || 0
|
||||
.["statustoxin"] = mod.wearer?.getToxLoss() || 0
|
||||
.["statusoxy"] = mod.wearer?.getOxyLoss() || 0
|
||||
.["statustemp"] = mod.wearer?.bodytemperature || 0
|
||||
.["statusnutrition"] = mod.wearer?.nutrition || 0
|
||||
.["statusfingerprints"] = mod.wearer ? md5(mod.wearer.dna.unique_identity) : null
|
||||
.["statusdna"] = mod.wearer?.dna.unique_enzymes
|
||||
.["statusviruses"] = null
|
||||
.["display_time"] = display_time
|
||||
.["shift_time"] = station_time_timestamp()
|
||||
.["shift_id"] = GLOB.round_id
|
||||
.["health"] = mod.wearer?.health || 0
|
||||
.["health_max"] = mod.wearer?.getMaxHealth() || 0
|
||||
if(display_detailed_vitals)
|
||||
.["loss_brute"] = mod.wearer?.getBruteLoss() || 0
|
||||
.["loss_fire"] = mod.wearer?.getFireLoss() || 0
|
||||
.["loss_tox"] = mod.wearer?.getToxLoss() || 0
|
||||
.["loss_oxy"] = mod.wearer?.getOxyLoss() || 0
|
||||
.["body_temperature"] = mod.wearer?.bodytemperature || 0
|
||||
.["nutrition"] = mod.wearer?.nutrition || 0
|
||||
if(display_dna)
|
||||
.["dna_unique_identity"] = mod.wearer ? md5(mod.wearer.dna.unique_identity) : null
|
||||
.["dna_unique_enzymes"] = mod.wearer?.dna.unique_enzymes
|
||||
.["viruses"] = null
|
||||
if(!length(mod.wearer?.diseases))
|
||||
return .
|
||||
var/list/viruses = list()
|
||||
@@ -216,10 +222,22 @@
|
||||
virus_data["maxstage"] = virus.max_stages
|
||||
virus_data["cure"] = virus.cure_text
|
||||
viruses += list(virus_data)
|
||||
.["statusviruses"] = viruses
|
||||
.["viruses"] = viruses
|
||||
|
||||
return .
|
||||
|
||||
/obj/item/mod/module/status_readout/get_configuration()
|
||||
. = ..()
|
||||
.["display_detailed_vitals"] = add_ui_configuration("Detailed Vitals", "bool", display_detailed_vitals)
|
||||
.["display_dna"] = add_ui_configuration("DNA Information", "bool", display_dna)
|
||||
|
||||
/obj/item/mod/module/status_readout/configure_edit(key, value)
|
||||
switch(key)
|
||||
if("display_detailed_vitals")
|
||||
display_detailed_vitals = text2num(value)
|
||||
if("display_dna")
|
||||
display_dna = text2num(value)
|
||||
|
||||
/obj/item/mod/module/status_readout/on_suit_activation()
|
||||
RegisterSignal(mod.wearer, COMSIG_LIVING_DEATH, PROC_REF(death_sound))
|
||||
|
||||
|
||||
@@ -20,22 +20,19 @@
|
||||
tgui_id = "health_analyzer"
|
||||
/// Scanning mode, changes how we scan something.
|
||||
var/mode = HEALTH_SCAN
|
||||
/// Do we relay the wearer's health data to the info tab? Mainly useful for turning off if you also have a status readout.
|
||||
var/show_vitals = TRUE
|
||||
|
||||
/// List of all scanning modes.
|
||||
var/static/list/modes = list(HEALTH_SCAN, WOUND_SCAN, CHEM_SCAN)
|
||||
|
||||
/obj/item/mod/module/health_analyzer/add_ui_data()
|
||||
. = ..()
|
||||
.["show_vitals"] = show_vitals
|
||||
if(show_vitals)
|
||||
.["userhealth"] = mod.wearer?.health || 0
|
||||
.["usermaxhealth"] = mod.wearer?.getMaxHealth() || 0
|
||||
.["userbrute"] = mod.wearer?.getBruteLoss() || 0
|
||||
.["userburn"] = mod.wearer?.getFireLoss() || 0
|
||||
.["usertoxin"] = mod.wearer?.getToxLoss() || 0
|
||||
.["useroxy"] = mod.wearer?.getOxyLoss() || 0
|
||||
|
||||
.["health"] = mod.wearer?.health || 0
|
||||
.["health_max"] = mod.wearer?.getMaxHealth() || 0
|
||||
.["loss_brute"] = mod.wearer?.getBruteLoss() || 0
|
||||
.["loss_fire"] = mod.wearer?.getFireLoss() || 0
|
||||
.["loss_tox"] = mod.wearer?.getToxLoss() || 0
|
||||
.["loss_oxy"] = mod.wearer?.getOxyLoss() || 0
|
||||
|
||||
return .
|
||||
|
||||
/obj/item/mod/module/health_analyzer/on_select_use(atom/target)
|
||||
@@ -56,16 +53,13 @@
|
||||
/obj/item/mod/module/health_analyzer/get_configuration()
|
||||
. = ..()
|
||||
.["mode"] = add_ui_configuration("Scan Mode", "list", mode, modes)
|
||||
.["show_vitals"] = add_ui_configuration("Self Vitals Display", "bool", show_vitals)
|
||||
|
||||
|
||||
return .
|
||||
|
||||
/obj/item/mod/module/health_analyzer/configure_edit(key, value)
|
||||
switch(key)
|
||||
if("mode")
|
||||
mode = value
|
||||
if("show_vitals")
|
||||
show_vitals = value
|
||||
|
||||
#undef HEALTH_SCAN
|
||||
#undef WOUND_SCAN
|
||||
|
||||
@@ -298,7 +298,7 @@
|
||||
all possible biometric data of the wearer; sleep, nutrition, fitness, fingerprints, \
|
||||
and even useful information such as their overall health and wellness. This one comes with a clock that calibrates to the \
|
||||
local system time, and an operational ID number display. The vital monitor's speaker has been removed."
|
||||
show_time = TRUE
|
||||
display_time = TRUE
|
||||
death_sound = null
|
||||
death_sound_volume = null
|
||||
|
||||
|
||||
Reference in New Issue
Block a user