Skip to content

Commit

Permalink
Modsuit HUD now shows medical/security/employment records on examine() (
Browse files Browse the repository at this point in the history
#28256)

* modsuit huds a bit more useful

* just return true

---------

Co-authored-by: Luc <[email protected]>
  • Loading branch information
kyunkyunkyun and lewcc authored Mar 5, 2025
1 parent 7cd066e commit a65b047
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 24 deletions.
2 changes: 1 addition & 1 deletion code/datums/outfits/outfit_debug.dm
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,14 @@
name = "AVD-CNED glasses"
desc = "Diagnostic, Hydroponic, Medical, Security, and Skills HUD. Built-in advanced reagent scanner. Alt-click to toggle X-ray vision."
icon_state = "nvgmeson"
hud_debug = TRUE
flags_cover = GLASSESCOVERSEYES
flash_protect = FLASH_PROTECTION_WELDER
scan_reagents_advanced = TRUE

prescription_upgradable = FALSE

hud_types = list(DATA_HUD_MEDICAL_ADVANCED, DATA_HUD_DIAGNOSTIC_ADVANCED, DATA_HUD_SECURITY_ADVANCED, DATA_HUD_HYDROPONIC)
examine_extensions = list(EXAMINE_HUD_SECURITY_READ, EXAMINE_HUD_SECURITY_WRITE, EXAMINE_HUD_MEDICAL_READ, EXAMINE_HUD_MEDICAL_WRITE, EXAMINE_HUD_SKILLS)

var/xray = FALSE

Expand Down
2 changes: 1 addition & 1 deletion code/modules/clothing/chameleon.dm
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@
lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_INVISIBLE

/obj/item/clothing/glasses/hud/security/chameleon
examine_extensions = list(EXAMINE_HUD_SECURITY_READ, EXAMINE_HUD_SECURITY_WRITE)
hud_access_override = TRUE
flash_protect = FLASH_PROTECTION_FLASH

var/datum/action/item_action/chameleon_change/chameleon_action
Expand Down
9 changes: 4 additions & 5 deletions code/modules/clothing/glasses/hudglasses.dm
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@
prescription_upgradable = TRUE
/// The visual icons granted by wearing these glasses.
var/hud_types = null
/// List of things added to examine text, like security or medical records.
var/list/examine_extensions = null
/// Whether we want this hud be able to override id card access requirement to alter security records
var/hud_access_override = FALSE
/// Used for debug huds at examine.dm, gives us all rights for records
var/hud_debug = FALSE

/obj/item/clothing/glasses/hud/Initialize(mapload)
. = ..()
Expand Down Expand Up @@ -41,7 +43,6 @@
icon_state = "healthhud"
origin_tech = "magnets=3;biotech=2"
hud_types = DATA_HUD_MEDICAL_ADVANCED
examine_extensions = list(EXAMINE_HUD_MEDICAL_READ)

sprite_sheets = list(
"Vox" = 'icons/mob/clothing/species/vox/eyes.dmi',
Expand Down Expand Up @@ -106,7 +107,6 @@
origin_tech = "magnets=3;combat=2"
var/global/list/jobs[0]
hud_types = DATA_HUD_SECURITY_ADVANCED
examine_extensions = list(EXAMINE_HUD_SECURITY_READ)

sprite_sheets = list(
"Vox" = 'icons/mob/clothing/species/vox/eyes.dmi',
Expand Down Expand Up @@ -181,7 +181,6 @@
icon_state = "skill"
item_state = "glasses"
hud_types = DATA_HUD_SECURITY_BASIC
examine_extensions = list(EXAMINE_HUD_SKILLS)
sprite_sheets = list(
"Drask" = 'icons/mob/clothing/species/drask/eyes.dmi',
"Grey" = 'icons/mob/clothing/species/grey/eyes.dmi',
Expand Down
4 changes: 0 additions & 4 deletions code/modules/clothing/glasses/tajblind.dm
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@
icon_state = "tajblind_med"
item_state = "tajblind_med"
hud_types = DATA_HUD_MEDICAL_ADVANCED
examine_extensions = list(EXAMINE_HUD_MEDICAL_READ)

/obj/item/clothing/glasses/hud/tajblind/med/Initialize(mapload)
. = ..()
Expand All @@ -110,7 +109,6 @@
icon_state = "tajblind_sec"
item_state = "tajblind_sec"
hud_types = DATA_HUD_SECURITY_ADVANCED
examine_extensions = list(EXAMINE_HUD_SECURITY_READ)

/obj/item/clothing/glasses/hud/tajblind/sec/Initialize(mapload)
. = ..()
Expand Down Expand Up @@ -170,7 +168,6 @@
icon_state = "tajblind_med"
item_state = "tajblind_med"
hud_types = DATA_HUD_MEDICAL_ADVANCED
examine_extensions = list(EXAMINE_HUD_MEDICAL_READ)

/obj/item/clothing/glasses/hud/tajblind/shaded/med/Initialize(mapload)
. = ..()
Expand All @@ -182,7 +179,6 @@
item_state = "tajblind_sec"
see_in_dark = 1
hud_types = DATA_HUD_SECURITY_ADVANCED
examine_extensions = list(EXAMINE_HUD_SECURITY_READ)

/obj/item/clothing/glasses/hud/tajblind/shaded/sec/Initialize(mapload)
. = ..()
Expand Down
25 changes: 16 additions & 9 deletions code/modules/mob/living/carbon/examine.dm
Original file line number Diff line number Diff line change
Expand Up @@ -342,22 +342,29 @@
//Helper procedure. Called by /mob/living/carbon/human/examine() and /mob/living/carbon/human/Topic() to determine HUD access to security and medical records.
/proc/hasHUD(mob/M, hudtype)
if(ishuman(M))
var/have_hudtypes = list()
var/mob/living/carbon/human/H = M

var/obj/item/clothing/glasses/hud/hudglasses
if(istype(H.glasses, /obj/item/clothing/glasses/hud))
var/obj/item/clothing/glasses/hud/hudglasses = H.glasses
if(hudglasses?.examine_extensions)
have_hudtypes += hudglasses.examine_extensions
hudglasses = H.glasses
if(hudglasses.hud_debug)
return TRUE

var/obj/item/organ/internal/cyberimp/eyes/hud/CIH = H.get_int_organ(/obj/item/organ/internal/cyberimp/eyes/hud)
if(CIH?.examine_extensions)
have_hudtypes += CIH.examine_extensions
var/have_hudtypes = list()
var/datum/atom_hud/data/human/medbasic = GLOB.huds[DATA_HUD_MEDICAL_BASIC]
var/datum/atom_hud/data/human/medadv = GLOB.huds[DATA_HUD_MEDICAL_ADVANCED]
var/datum/atom_hud/data/human/secbasic = GLOB.huds[DATA_HUD_SECURITY_BASIC]
var/datum/atom_hud/data/human/secadv = GLOB.huds[DATA_HUD_SECURITY_ADVANCED]
if((H in medbasic.hudusers) || (H in medadv.hudusers))
have_hudtypes += EXAMINE_HUD_MEDICAL_READ
if(H in secadv.hudusers)
have_hudtypes += EXAMINE_HUD_SECURITY_READ
if(H in secbasic.hudusers)
have_hudtypes += EXAMINE_HUD_SKILLS

var/user_accesses = M.get_access()
var/secwrite = has_access(null, list(ACCESS_SECURITY, ACCESS_FORENSICS_LOCKERS), user_accesses) // same as obj/machinery/computer/secure_data/req_one_access
var/medwrite = has_access(null, list(ACCESS_MEDICAL, ACCESS_FORENSICS_LOCKERS), user_accesses) // same access as obj/machinery/computer/med_data/req_one_access
if(secwrite)
if(secwrite || hudglasses?.hud_access_override)
have_hudtypes += EXAMINE_HUD_SECURITY_WRITE
if(medwrite)
have_hudtypes += EXAMINE_HUD_MEDICAL_WRITE
Expand Down
2 changes: 1 addition & 1 deletion code/modules/mob/living/carbon/human/human_mob.dm
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,7 @@
for(var/datum/data/record/R in GLOB.data_core.medical)
if(R.fields["id"] == E.fields["id"])
if(hasHUD(usr, EXAMINE_HUD_MEDICAL_READ))
to_chat(usr, "<b>Name:</b> [R.fields["name"]] <b>Blood Type:</b> [R.fields["b_type"]]")
to_chat(usr, "<b>Name:</b> [R.fields["name"]] <b>Blood Type:</b> [R.fields["blood_type"]]")
to_chat(usr, "<b>DNA:</b> [R.fields["b_dna"]]")
to_chat(usr, "<b>Minor Disabilities:</b> [R.fields["mi_dis"]]")
to_chat(usr, "<b>Details:</b> [R.fields["mi_dis_d"]]")
Expand Down
3 changes: 0 additions & 3 deletions code/modules/surgery/organs/augments_eyes.dm
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
slot = "eye_hud"
var/HUD_type = 0
/// A list of extension kinds added to the examine text. Things like medical or security records.
var/list/examine_extensions = null

/obj/item/organ/internal/cyberimp/eyes/hud/insert(mob/living/carbon/M, special = 0)
..()
Expand All @@ -42,7 +41,6 @@
origin_tech = "materials=4;programming=4;biotech=4"
aug_message = "You suddenly see health bars floating above people's heads..."
HUD_type = DATA_HUD_MEDICAL_ADVANCED
examine_extensions = list(EXAMINE_HUD_MEDICAL_READ)

/obj/item/organ/internal/cyberimp/eyes/hud/diagnostic
name = "Diagnostic HUD implant"
Expand All @@ -59,7 +57,6 @@
origin_tech = "materials=4;programming=4;biotech=3;combat=3"
aug_message = "Job indicator icons pop up in your vision. That is not a certified surgeon..."
HUD_type = DATA_HUD_SECURITY_ADVANCED
examine_extensions = list(EXAMINE_HUD_SECURITY_READ)

/obj/item/organ/internal/cyberimp/eyes/hud/security/hidden
stealth_level = 4 // Only surgery or a body scanner with the highest tier of stock parts can detect this.
Expand Down

0 comments on commit a65b047

Please sign in to comment.