mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-21 11:07:12 +01:00
HUDs can now only change status with sufficient ID access (#23086)
* Added mental to MedHUD * Made HUDs write based on ID access * Makes Chamelion secHUD have write access * adds trailing newline in defines * med examine spacing adjustment Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com> * sec examine spacing adjustment Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com> * 0 and 1s Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com> Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com> * removes the sec_hud_set call, probably a bad idea --------- Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com> Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
This commit is contained in:
co-authored by
Burzah
Luc
parent
7181d869d7
commit
4a3437355e
@@ -329,6 +329,7 @@
|
||||
prescription_upgradable = TRUE
|
||||
|
||||
/obj/item/clothing/glasses/hud/security/chameleon
|
||||
examine_extensions = list(EXAMINE_HUD_SECURITY_READ, EXAMINE_HUD_SECURITY_WRITE)
|
||||
flash_protect = FLASH_PROTECTION_FLASH
|
||||
|
||||
var/datum/action/item_action/chameleon/change/chameleon_action
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
icon_state = "healthhud"
|
||||
origin_tech = "magnets=3;biotech=2"
|
||||
hud_types = DATA_HUD_MEDICAL_ADVANCED
|
||||
examine_extensions = list(EXAMINE_HUD_MEDICAL)
|
||||
examine_extensions = list(EXAMINE_HUD_MEDICAL_READ)
|
||||
|
||||
sprite_sheets = list(
|
||||
"Vox" = 'icons/mob/clothing/species/vox/eyes.dmi',
|
||||
@@ -105,7 +105,7 @@
|
||||
origin_tech = "magnets=3;combat=2"
|
||||
var/global/list/jobs[0]
|
||||
hud_types = DATA_HUD_SECURITY_ADVANCED
|
||||
examine_extensions = list(EXAMINE_HUD_SECURITY_READ, EXAMINE_HUD_SECURITY_WRITE)
|
||||
examine_extensions = list(EXAMINE_HUD_SECURITY_READ)
|
||||
|
||||
sprite_sheets = list(
|
||||
"Vox" = 'icons/mob/clothing/species/vox/eyes.dmi',
|
||||
@@ -131,9 +131,6 @@
|
||||
see_in_dark = 8
|
||||
lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_INVISIBLE //don't render darkness while wearing these
|
||||
|
||||
/obj/item/clothing/glasses/hud/security/sunglasses/read_only
|
||||
examine_extensions = list(EXAMINE_HUD_SECURITY_READ)
|
||||
|
||||
/obj/item/clothing/glasses/hud/security/sunglasses
|
||||
name = "HUDSunglasses"
|
||||
desc = "Sunglasses with a HUD."
|
||||
|
||||
@@ -314,15 +314,23 @@
|
||||
if(CIH?.examine_extensions)
|
||||
have_hudtypes += CIH.examine_extensions
|
||||
|
||||
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)
|
||||
have_hudtypes += EXAMINE_HUD_SECURITY_WRITE
|
||||
if(medwrite)
|
||||
have_hudtypes += EXAMINE_HUD_MEDICAL_WRITE
|
||||
|
||||
return (hudtype in have_hudtypes)
|
||||
|
||||
else if(isrobot(M) || isAI(M)) //Stand-in/Stopgap to prevent pAIs from freely altering records, pending a more advanced Records system
|
||||
return (hudtype in list(EXAMINE_HUD_SECURITY_READ, EXAMINE_HUD_SECURITY_WRITE, EXAMINE_HUD_MEDICAL))
|
||||
return (hudtype in list(EXAMINE_HUD_SECURITY_READ, EXAMINE_HUD_SECURITY_WRITE, EXAMINE_HUD_MEDICAL_READ, EXAMINE_HUD_MEDICAL_WRITE))
|
||||
|
||||
else if(isobserver(M))
|
||||
var/mob/dead/observer/O = M
|
||||
if(DATA_HUD_SECURITY_ADVANCED in O.data_hud_seen)
|
||||
return (hudtype in list(EXAMINE_HUD_SECURITY_READ, EXAMINE_HUD_SKILLS))
|
||||
return (hudtype in list(EXAMINE_HUD_SECURITY_READ, EXAMINE_HUD_MEDICAL_READ, EXAMINE_HUD_SKILLS))
|
||||
|
||||
return FALSE
|
||||
|
||||
|
||||
@@ -180,6 +180,40 @@
|
||||
msg += "[p_they(TRUE)] [p_are()] mostly desiccated now, with only [isslimeperson(src) ? "congealed slime" : "bones"] remaining of what used to be a person.\n"
|
||||
|
||||
// only humans get employment records
|
||||
if(hasHUD(user, EXAMINE_HUD_SKILLS))
|
||||
var/perpname = get_visible_name(TRUE)
|
||||
var/skills
|
||||
|
||||
if(perpname)
|
||||
for(var/datum/data/record/E in GLOB.data_core.general)
|
||||
if(E.fields["name"] == perpname)
|
||||
skills = E.fields["notes"]
|
||||
if(skills)
|
||||
var/char_limit = 40
|
||||
if(length(skills) <= char_limit)
|
||||
msg += "<span class='deptradio'>Employment records:</span> [skills]\n"
|
||||
else
|
||||
msg += "<span class='deptradio'>Employment records: [copytext_preserve_html(skills, 1, char_limit-3)]...</span><a href='byond://?src=[UID()];employment_more=1'>More...</a>\n"
|
||||
|
||||
|
||||
if(hasHUD(user, EXAMINE_HUD_MEDICAL_READ))
|
||||
var/perpname = get_visible_name(TRUE)
|
||||
var/medical = "None"
|
||||
var/mental = "None"
|
||||
|
||||
for(var/datum/data/record/E in GLOB.data_core.general)
|
||||
if(E.fields["name"] == perpname)
|
||||
for(var/datum/data/record/R in GLOB.data_core.general)
|
||||
if(R.fields["id"] == E.fields["id"])
|
||||
medical = R.fields["p_stat"]
|
||||
mental = R.fields["m_stat"]
|
||||
|
||||
var/medical_status = hasHUD(user, EXAMINE_HUD_MEDICAL_WRITE) ? "<a href='?src=[UID()];medical=1'>\[[medical]\]</a>" : "\[[medical]\]"
|
||||
var/mental_status = hasHUD(user, EXAMINE_HUD_MEDICAL_WRITE) ? "<a href='?src=[UID()];mental=1'>\[[mental]\]</a>" : "\[[mental]\]"
|
||||
msg += "<span class='deptradio'>Physical status: </span>[medical_status]\n"
|
||||
msg += "<span class='deptradio'>Mental Status: </span>[mental_status]\n"
|
||||
msg += "<span class='deptradio'>Medical records:</span> <a href='?src=[UID()];medrecord=`'>\[View\]</a> <a href='?src=[UID()];medrecordadd=`'>\[Add comment\]</a>\n"
|
||||
|
||||
if(hasHUD(user, EXAMINE_HUD_SECURITY_READ))
|
||||
var/perpname = get_visible_name(TRUE)
|
||||
var/criminal = "None"
|
||||
@@ -200,38 +234,9 @@
|
||||
commentLatest = "No entries." //If present but without entries (=target is recognized crew)
|
||||
|
||||
var/criminal_status = hasHUD(user, EXAMINE_HUD_SECURITY_WRITE) ? "<a href='?src=[UID()];criminal=1'>\[[criminal]\]</a>" : "\[[criminal]\]"
|
||||
msg += "<span class = 'deptradio'>Criminal status:</span> [criminal_status]\n"
|
||||
msg += "<span class = 'deptradio'>Security records:</span> <a href='?src=[UID()];secrecordComment=`'>\[View comment log\]</a> <a href='?src=[UID()];secrecordadd=`'>\[Add comment\]</a>\n"
|
||||
msg += "<span class = 'deptradio'>Latest entry:</span> [commentLatest]\n"
|
||||
|
||||
if(hasHUD(user, EXAMINE_HUD_SKILLS))
|
||||
var/perpname = get_visible_name(TRUE)
|
||||
var/skills
|
||||
|
||||
if(perpname)
|
||||
for(var/datum/data/record/E in GLOB.data_core.general)
|
||||
if(E.fields["name"] == perpname)
|
||||
skills = E.fields["notes"]
|
||||
if(skills)
|
||||
var/char_limit = 40
|
||||
if(length(skills) <= char_limit)
|
||||
msg += "<span class='deptradio'>Employment records:</span> [skills]\n"
|
||||
else
|
||||
msg += "<span class='deptradio'>Employment records: [copytext_preserve_html(skills, 1, char_limit-3)]...</span><a href='byond://?src=[UID()];employment_more=1'>More...</a>\n"
|
||||
|
||||
|
||||
if(hasHUD(user,EXAMINE_HUD_MEDICAL))
|
||||
var/perpname = get_visible_name(TRUE)
|
||||
var/medical = "None"
|
||||
|
||||
for(var/datum/data/record/E in GLOB.data_core.general)
|
||||
if(E.fields["name"] == perpname)
|
||||
for(var/datum/data/record/R in GLOB.data_core.general)
|
||||
if(R.fields["id"] == E.fields["id"])
|
||||
medical = R.fields["p_stat"]
|
||||
|
||||
msg += "<span class = 'deptradio'>Physical status:</span> <a href='?src=[UID()];medical=1'>\[[medical]\]</a>\n"
|
||||
msg += "<span class = 'deptradio'>Medical records:</span> <a href='?src=[UID()];medrecord=`'>\[View\]</a> <a href='?src=[UID()];medrecordadd=`'>\[Add comment\]</a>\n"
|
||||
msg += "<span class='deptradio'>Criminal status:</span> [criminal_status]\n"
|
||||
msg += "<span class='deptradio'>Security records:</span> <a href='?src=[UID()];secrecordComment=`'>\[View comment log\]</a> <a href='?src=[UID()];secrecordadd=`'>\[Add comment\]</a>\n"
|
||||
msg += "<span class='deptradio'>Latest entry:</span> [commentLatest]\n"
|
||||
|
||||
|
||||
return msg
|
||||
|
||||
@@ -770,10 +770,10 @@
|
||||
add_comment(usr, "security", sanitized)
|
||||
|
||||
if(href_list["medical"])
|
||||
if(hasHUD(usr, EXAMINE_HUD_MEDICAL))
|
||||
if(hasHUD(usr, EXAMINE_HUD_MEDICAL_WRITE))
|
||||
if(usr.incapacitated())
|
||||
return
|
||||
var/modified = 0
|
||||
var/modified = FALSE
|
||||
var/perpname = get_visible_name(TRUE)
|
||||
|
||||
for(var/datum/data/record/E in GLOB.data_core.general)
|
||||
@@ -782,21 +782,39 @@
|
||||
if(R.fields["id"] == E.fields["id"])
|
||||
var/setmedical = input(usr, "Specify a new medical status for this person.", "Medical HUD", R.fields["p_stat"]) in list("*SSD*", "*Deceased*", "Physically Unfit", "Active", "Disabled", "Cancel")
|
||||
|
||||
if(hasHUD(usr, EXAMINE_HUD_MEDICAL))
|
||||
if(hasHUD(usr, EXAMINE_HUD_MEDICAL_WRITE))
|
||||
if(setmedical != "Cancel")
|
||||
R.fields["p_stat"] = setmedical
|
||||
modified = 1
|
||||
modified = TRUE
|
||||
if(GLOB.PDA_Manifest.len)
|
||||
GLOB.PDA_Manifest.Cut()
|
||||
|
||||
spawn()
|
||||
sec_hud_set_security_status()
|
||||
if(!modified)
|
||||
to_chat(usr, "<span class='warning'>Unable to locate a data core entry for this person.</span>")
|
||||
|
||||
if(href_list["mental"])
|
||||
if(hasHUD(usr, EXAMINE_HUD_MEDICAL_WRITE))
|
||||
if(usr.incapacitated())
|
||||
return
|
||||
var/modified = FALSE
|
||||
var/perpname = get_visible_name(TRUE)
|
||||
|
||||
for(var/datum/data/record/E in GLOB.data_core.general)
|
||||
if(E.fields["name"] == perpname)
|
||||
for(var/datum/data/record/R in GLOB.data_core.general)
|
||||
if(R.fields["id"] == E.fields["id"])
|
||||
var/setmental = input(usr, "Specify a new mental status for this person.", "Medical HUD", R.fields["m_stat"]) in list("*Insane*", "*Unstable*", "*Watch*", "Stable", "Cancel")
|
||||
|
||||
if(hasHUD(usr, EXAMINE_HUD_MEDICAL_WRITE))
|
||||
if(setmental != "Cancel")
|
||||
R.fields["m_stat"] = setmental
|
||||
modified = TRUE
|
||||
|
||||
if(!modified)
|
||||
to_chat(usr, "<span class='warning'>Unable to locate a data core entry for this person.</span>")
|
||||
|
||||
if(href_list["medrecord"])
|
||||
if(hasHUD(usr, EXAMINE_HUD_MEDICAL))
|
||||
if(hasHUD(usr, EXAMINE_HUD_MEDICAL_READ))
|
||||
if(usr.incapacitated())
|
||||
return
|
||||
var/read = 0
|
||||
@@ -806,7 +824,7 @@
|
||||
if(E.fields["name"] == perpname)
|
||||
for(var/datum/data/record/R in GLOB.data_core.medical)
|
||||
if(R.fields["id"] == E.fields["id"])
|
||||
if(hasHUD(usr, EXAMINE_HUD_MEDICAL))
|
||||
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>DNA:</b> [R.fields["b_dna"]]")
|
||||
to_chat(usr, "<b>Minor Disabilities:</b> [R.fields["mi_dis"]]")
|
||||
@@ -821,7 +839,7 @@
|
||||
to_chat(usr, "<span class='warning'>Unable to locate a data core entry for this person.</span>")
|
||||
|
||||
if(href_list["medrecordComment"])
|
||||
if(hasHUD(usr, EXAMINE_HUD_MEDICAL))
|
||||
if(hasHUD(usr, EXAMINE_HUD_MEDICAL_READ))
|
||||
if(usr.incapacitated())
|
||||
return
|
||||
var/perpname = get_visible_name(TRUE)
|
||||
@@ -831,7 +849,7 @@
|
||||
if(E.fields["name"] == perpname)
|
||||
for(var/datum/data/record/R in GLOB.data_core.medical)
|
||||
if(R.fields["id"] == E.fields["id"])
|
||||
if(hasHUD(usr, EXAMINE_HUD_MEDICAL))
|
||||
if(hasHUD(usr, EXAMINE_HUD_MEDICAL_READ))
|
||||
read = TRUE
|
||||
if(LAZYLEN(R.fields["comments"]))
|
||||
for(var/c in R.fields["comments"])
|
||||
@@ -844,11 +862,11 @@
|
||||
to_chat(usr, "<span class='warning'>Unable to locate a data core entry for this person.</span>")
|
||||
|
||||
if(href_list["medrecordadd"])
|
||||
if(usr.incapacitated() || !hasHUD(usr, EXAMINE_HUD_MEDICAL))
|
||||
if(usr.incapacitated() || !hasHUD(usr, EXAMINE_HUD_MEDICAL_WRITE))
|
||||
return
|
||||
var/raw_input = input("Add Comment:", "Medical records", null, null) as message
|
||||
var/sanitized = copytext(trim(sanitize(raw_input)), 1, MAX_MESSAGE_LEN)
|
||||
if(!sanitized || usr.stat || usr.restrained() || !hasHUD(usr, EXAMINE_HUD_MEDICAL))
|
||||
if(!sanitized || usr.stat || usr.restrained() || !hasHUD(usr, EXAMINE_HUD_MEDICAL_WRITE))
|
||||
return
|
||||
add_comment(usr, "medical", sanitized)
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
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)
|
||||
examine_extensions = list(EXAMINE_HUD_MEDICAL_READ)
|
||||
|
||||
/obj/item/organ/internal/cyberimp/eyes/hud/diagnostic
|
||||
name = "Diagnostic HUD implant"
|
||||
@@ -60,4 +60,4 @@
|
||||
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, EXAMINE_HUD_SECURITY_WRITE)
|
||||
examine_extensions = list(EXAMINE_HUD_SECURITY_READ)
|
||||
|
||||
Reference in New Issue
Block a user