mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-21 02:57:48 +01:00
Merge pull request #14855 from moxian/hud
Skills HUD now shows job icon, and other minor HUD improvements
This commit is contained in:
@@ -347,7 +347,7 @@
|
||||
if(decaylevel == 4)
|
||||
msg += "[p_they(TRUE)] [p_are()] mostly desiccated now, with only bones remaining of what used to be a person.\n"
|
||||
|
||||
if(hasHUD(user,"security"))
|
||||
if(hasHUD(user, EXAMINE_HUD_SECURITY_READ))
|
||||
var/perpname = get_visible_name(TRUE)
|
||||
var/criminal = "None"
|
||||
var/commentLatest = "ERROR: Unable to locate a data core entry for this person." //If there is no datacore present, give this
|
||||
@@ -364,12 +364,12 @@
|
||||
else
|
||||
commentLatest = "No entries." //If present but without entries (=target is recognized crew)
|
||||
|
||||
var/criminal_status = hasHUD(user, "read_only_security") ? "\[[criminal]\]" : "<a href='?src=[UID()];criminal=1'>\[[criminal]\]</a>"
|
||||
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, "skills"))
|
||||
if(hasHUD(user, EXAMINE_HUD_SKILLS))
|
||||
var/perpname = get_visible_name(TRUE)
|
||||
var/skills
|
||||
|
||||
@@ -378,9 +378,14 @@
|
||||
if(E.fields["name"] == perpname)
|
||||
skills = E.fields["notes"]
|
||||
if(skills)
|
||||
msg += "<span class='deptradio'>Employment records:</span> [skills]\n"
|
||||
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,"medical"))
|
||||
|
||||
if(hasHUD(user,EXAMINE_HUD_MEDICAL))
|
||||
var/perpname = get_visible_name(TRUE)
|
||||
var/medical = "None"
|
||||
|
||||
@@ -408,45 +413,31 @@
|
||||
. = list(msg)
|
||||
|
||||
//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 as mob, hudtype)
|
||||
/proc/hasHUD(mob/M, hudtype)
|
||||
if(istype(M, /mob/living/carbon/human))
|
||||
var/have_hudtypes = list()
|
||||
var/mob/living/carbon/human/H = M
|
||||
|
||||
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
|
||||
|
||||
var/obj/item/organ/internal/cyberimp/eyes/hud/CIH = H.get_int_organ(/obj/item/organ/internal/cyberimp/eyes/hud)
|
||||
switch(hudtype)
|
||||
if("security")
|
||||
return istype(H.glasses, /obj/item/clothing/glasses/hud/security) || istype(CIH,/obj/item/organ/internal/cyberimp/eyes/hud/security)
|
||||
if("read_only_security")
|
||||
var/obj/item/clothing/glasses/hud/security/S
|
||||
if(istype(H.glasses, /obj/item/clothing/glasses/hud/security))
|
||||
S = H.glasses
|
||||
return !istype(CIH,/obj/item/organ/internal/cyberimp/eyes/hud/security) && S && S.read_only
|
||||
if("medical")
|
||||
return istype(H.glasses, /obj/item/clothing/glasses/hud/health) || istype(CIH,/obj/item/organ/internal/cyberimp/eyes/hud/medical)
|
||||
if("skills")
|
||||
return istype(H.glasses, /obj/item/clothing/glasses/hud/skills)
|
||||
else
|
||||
return FALSE
|
||||
if(CIH?.examine_extensions)
|
||||
have_hudtypes += CIH.examine_extensions
|
||||
|
||||
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
|
||||
switch(hudtype)
|
||||
if("security")
|
||||
return TRUE
|
||||
if("medical")
|
||||
return TRUE
|
||||
else
|
||||
return FALSE
|
||||
return (hudtype in list(EXAMINE_HUD_SECURITY_READ, EXAMINE_HUD_SECURITY_WRITE, EXAMINE_HUD_MEDICAL))
|
||||
|
||||
else if(isobserver(M))
|
||||
var/mob/dead/observer/O = M
|
||||
if(O.data_hud_seen == DATA_HUD_SECURITY_ADVANCED || O.data_hud_seen == DATA_HUD_DIAGNOSTIC + DATA_HUD_SECURITY_ADVANCED + DATA_HUD_MEDICAL_ADVANCED)
|
||||
switch(hudtype)
|
||||
if("security")
|
||||
return TRUE
|
||||
if("skills")
|
||||
return TRUE
|
||||
else
|
||||
return FALSE
|
||||
else
|
||||
return FALSE
|
||||
return (hudtype in list(EXAMINE_HUD_SECURITY_READ, EXAMINE_HUD_SKILLS))
|
||||
|
||||
return FALSE
|
||||
|
||||
// Ignores robotic limb branding prefixes like "Morpheus Cybernetics"
|
||||
/proc/ignore_limb_branding(limb_name)
|
||||
|
||||
@@ -730,7 +730,7 @@
|
||||
update_inv_w_uniform()
|
||||
|
||||
if(href_list["criminal"])
|
||||
if(hasHUD(usr,"security"))
|
||||
if(hasHUD(usr, EXAMINE_HUD_SECURITY_WRITE))
|
||||
if(usr.incapacitated())
|
||||
return
|
||||
var/found_record = 0
|
||||
@@ -747,7 +747,7 @@
|
||||
if(!t1)
|
||||
t1 = "(none)"
|
||||
|
||||
if(hasHUD(usr, "security") && setcriminal != "Cancel")
|
||||
if(hasHUD(usr, EXAMINE_HUD_SECURITY_WRITE) && setcriminal != "Cancel")
|
||||
found_record = 1
|
||||
if(R.fields["criminal"] == SEC_RECORD_STATUS_EXECUTE)
|
||||
to_chat(usr, "<span class='warning'>Unable to modify the sec status of a person with an active Execution order. Use a security computer instead.</span>")
|
||||
@@ -770,7 +770,7 @@
|
||||
to_chat(usr, "<span class='warning'>Unable to locate a data core entry for this person.</span>")
|
||||
|
||||
if(href_list["secrecord"])
|
||||
if(hasHUD(usr,"security"))
|
||||
if(hasHUD(usr, EXAMINE_HUD_SECURITY_READ))
|
||||
if(usr.incapacitated())
|
||||
return
|
||||
var/perpname = get_visible_name(TRUE)
|
||||
@@ -780,7 +780,7 @@
|
||||
if(E.fields["name"] == perpname)
|
||||
for(var/datum/data/record/R in GLOB.data_core.security)
|
||||
if(R.fields["id"] == E.fields["id"])
|
||||
if(hasHUD(usr,"security"))
|
||||
if(hasHUD(usr, EXAMINE_HUD_SECURITY_READ))
|
||||
to_chat(usr, "<b>Name:</b> [R.fields["name"]] <b>Criminal Status:</b> [R.fields["criminal"]]")
|
||||
to_chat(usr, "<b>Minor Crimes:</b> [R.fields["mi_crim"]]")
|
||||
to_chat(usr, "<b>Details:</b> [R.fields["mi_crim_d"]]")
|
||||
@@ -794,7 +794,7 @@
|
||||
to_chat(usr, "<span class='warning'>Unable to locate a data core entry for this person.</span>")
|
||||
|
||||
if(href_list["secrecordComment"])
|
||||
if(hasHUD(usr,"security"))
|
||||
if(hasHUD(usr, EXAMINE_HUD_SECURITY_READ))
|
||||
if(usr.incapacitated() && !isobserver(usr)) //give the ghosts access to "View Comment Log" while they can't manipulate it
|
||||
return
|
||||
var/perpname = get_visible_name(TRUE)
|
||||
@@ -804,44 +804,30 @@
|
||||
if(E.fields["name"] == perpname)
|
||||
for(var/datum/data/record/R in GLOB.data_core.security)
|
||||
if(R.fields["id"] == E.fields["id"])
|
||||
if(hasHUD(usr,"security"))
|
||||
if(hasHUD(usr, EXAMINE_HUD_SECURITY_READ))
|
||||
read = 1
|
||||
if(LAZYLEN(R.fields["comments"]))
|
||||
for(var/c in R.fields["comments"])
|
||||
to_chat(usr, c)
|
||||
else
|
||||
to_chat(usr, "<span class='warning'>No comments found</span>")
|
||||
to_chat(usr, "<a href='?src=[UID()];secrecordadd=`'>\[Add comment\]</a>")
|
||||
if(hasHUD(usr, EXAMINE_HUD_SECURITY_WRITE))
|
||||
to_chat(usr, "<a href='?src=[UID()];secrecordadd=`'>\[Add comment\]</a>")
|
||||
|
||||
if(!read)
|
||||
to_chat(usr, "<span class='warning'>Unable to locate a data core entry for this person.</span>")
|
||||
|
||||
if(href_list["secrecordadd"])
|
||||
if(hasHUD(usr,"security"))
|
||||
if(usr.incapacitated())
|
||||
return
|
||||
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.security)
|
||||
if(R.fields["id"] == E.fields["id"])
|
||||
if(hasHUD(usr,"security"))
|
||||
var/t1 = copytext(trim(sanitize(input("Add Comment:", "Sec. records", null, null) as message)), 1, MAX_MESSAGE_LEN)
|
||||
if(!t1 || usr.stat || usr.restrained() || !hasHUD(usr, "security"))
|
||||
return
|
||||
if(ishuman(usr))
|
||||
var/mob/living/carbon/human/U = usr
|
||||
R.fields["comments"] += "Made by [U.get_authentification_name()] ([U.get_assignment()]) on [GLOB.current_date_string] [station_time_timestamp()]<BR>[t1]"
|
||||
if(isrobot(usr))
|
||||
var/mob/living/silicon/robot/U = usr
|
||||
R.fields["comments"] += "Made by [U.name] ([U.modtype] [U.braintype]) on [GLOB.current_date_string] [station_time_timestamp()]<BR>[t1]"
|
||||
if(isAI(usr))
|
||||
var/mob/living/silicon/ai/U = usr
|
||||
R.fields["comments"] += "Made by [U.name] (artificial intelligence) on [GLOB.current_date_string] [station_time_timestamp()]<BR>[t1]"
|
||||
if(usr.incapacitated() || !hasHUD(usr, EXAMINE_HUD_SECURITY_WRITE))
|
||||
return
|
||||
var/raw_input = input("Add Comment:", "Security 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_SECURITY_WRITE))
|
||||
return
|
||||
add_comment(usr, "security", sanitized)
|
||||
|
||||
if(href_list["medical"])
|
||||
if(hasHUD(usr,"medical"))
|
||||
if(hasHUD(usr, EXAMINE_HUD_MEDICAL))
|
||||
if(usr.incapacitated())
|
||||
return
|
||||
var/modified = 0
|
||||
@@ -853,7 +839,7 @@
|
||||
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,"medical"))
|
||||
if(hasHUD(usr, EXAMINE_HUD_MEDICAL))
|
||||
if(setmedical != "Cancel")
|
||||
R.fields["p_stat"] = setmedical
|
||||
modified = 1
|
||||
@@ -867,7 +853,7 @@
|
||||
to_chat(usr, "<span class='warning'>Unable to locate a data core entry for this person.</span>")
|
||||
|
||||
if(href_list["medrecord"])
|
||||
if(hasHUD(usr,"medical"))
|
||||
if(hasHUD(usr, EXAMINE_HUD_MEDICAL))
|
||||
if(usr.incapacitated())
|
||||
return
|
||||
var/read = 0
|
||||
@@ -877,7 +863,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,"medical"))
|
||||
if(hasHUD(usr, EXAMINE_HUD_MEDICAL))
|
||||
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"]]")
|
||||
@@ -892,18 +878,18 @@
|
||||
to_chat(usr, "<span class='warning'>Unable to locate a data core entry for this person.</span>")
|
||||
|
||||
if(href_list["medrecordComment"])
|
||||
if(hasHUD(usr,"medical"))
|
||||
if(hasHUD(usr, EXAMINE_HUD_MEDICAL))
|
||||
if(usr.incapacitated())
|
||||
return
|
||||
var/perpname = get_visible_name(TRUE)
|
||||
var/read = 0
|
||||
var/read = FALSE
|
||||
|
||||
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.medical)
|
||||
if(R.fields["id"] == E.fields["id"])
|
||||
if(hasHUD(usr,"medical"))
|
||||
read = 1
|
||||
if(hasHUD(usr, EXAMINE_HUD_MEDICAL))
|
||||
read = TRUE
|
||||
if(LAZYLEN(R.fields["comments"]))
|
||||
for(var/c in R.fields["comments"])
|
||||
to_chat(usr, c)
|
||||
@@ -915,27 +901,28 @@
|
||||
to_chat(usr, "<span class='warning'>Unable to locate a data core entry for this person.</span>")
|
||||
|
||||
if(href_list["medrecordadd"])
|
||||
if(hasHUD(usr,"medical"))
|
||||
if(usr.incapacitated() || !hasHUD(usr, EXAMINE_HUD_MEDICAL))
|
||||
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))
|
||||
return
|
||||
add_comment(usr, "medical", sanitized)
|
||||
|
||||
if(href_list["employment_more"])
|
||||
if(hasHUD(usr, EXAMINE_HUD_SKILLS))
|
||||
if(usr.incapacitated())
|
||||
return
|
||||
|
||||
var/skills
|
||||
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.medical)
|
||||
if(R.fields["id"] == E.fields["id"])
|
||||
if(hasHUD(usr,"medical"))
|
||||
var/t1 = copytext(trim(sanitize(input("Add Comment:", "Med. records", null, null) as message)), 1, MAX_MESSAGE_LEN)
|
||||
if(!t1 || usr.stat || usr.restrained() || !hasHUD(usr, "medical"))
|
||||
return
|
||||
if(ishuman(usr))
|
||||
var/mob/living/carbon/human/U = usr
|
||||
R.fields["comments"] += "Made by [U.get_authentification_name()] ([U.get_assignment()]) on [GLOB.current_date_string] [station_time_timestamp()]<BR>[t1]"
|
||||
if(isrobot(usr))
|
||||
var/mob/living/silicon/robot/U = usr
|
||||
R.fields["comments"] += "Made by [U.name] ([U.modtype] [U.braintype]) on [GLOB.current_date_string] [station_time_timestamp()]<BR>[t1]"
|
||||
if(isAI(usr))
|
||||
var/mob/living/silicon/ai/U = usr
|
||||
R.fields["comments"] += "Made by [U.name] (artificial intelligence) on [GLOB.current_date_string] [station_time_timestamp()]<BR>[t1]"
|
||||
if(perpname)
|
||||
for(var/datum/data/record/E in GLOB.data_core.general)
|
||||
if(E.fields["name"] == perpname)
|
||||
skills = E.fields["notes"]
|
||||
break
|
||||
if(skills)
|
||||
to_chat(usr, "<span class='deptradio'>Employment records: [skills]</span>\n")
|
||||
|
||||
if(href_list["lookitem"])
|
||||
var/obj/item/I = locate(href_list["lookitem"])
|
||||
|
||||
@@ -441,11 +441,15 @@
|
||||
|
||||
switch(stat)
|
||||
if(CONSCIOUS)
|
||||
if(!client) msg += "\nIt appears to be in stand-by mode." //afk
|
||||
if(UNCONSCIOUS) msg += "\n<span class='warning'>It doesn't seem to be responding.</span>"
|
||||
if(DEAD) msg += "\n<span class='deadsay'>It looks completely unsalvageable.</span>"
|
||||
if(!client)
|
||||
msg += "\nIt appears to be in stand-by mode." //afk
|
||||
if(UNCONSCIOUS)
|
||||
msg += "\n<span class='warning'>It doesn't seem to be responding.</span>"
|
||||
if(DEAD)
|
||||
msg += "\n<span class='deadsay'>It looks completely unsalvageable.</span>"
|
||||
|
||||
if(print_flavor_text()) msg += "\n[print_flavor_text()]"
|
||||
if(print_flavor_text())
|
||||
msg += "\n[print_flavor_text()]"
|
||||
|
||||
if(pose)
|
||||
if( findtext(pose,".",length(pose)) == 0 && findtext(pose,"!",length(pose)) == 0 && findtext(pose,"?",length(pose)) == 0 )
|
||||
|
||||
@@ -47,7 +47,8 @@
|
||||
msg += "<span class='warning'>It looks like its system is corrupted beyond repair. There is no hope of recovery.</span>\n"
|
||||
msg += "*---------*</span>"
|
||||
|
||||
if(print_flavor_text()) msg += "\n[print_flavor_text()]\n"
|
||||
if(print_flavor_text())
|
||||
msg += "\n[print_flavor_text()]\n"
|
||||
|
||||
if(pose)
|
||||
if( findtext(pose,".",length(pose)) == 0 && findtext(pose,"!",length(pose)) == 0 && findtext(pose,"?",length(pose)) == 0 )
|
||||
|
||||
@@ -732,7 +732,7 @@ GLOBAL_LIST_INIT(slot_equipment_priority, list( \
|
||||
|
||||
flavor_text = msg
|
||||
|
||||
/mob/proc/print_flavor_text(var/shrink = 1)
|
||||
/mob/proc/print_flavor_text(var/shrink = TRUE)
|
||||
if(flavor_text && flavor_text != "")
|
||||
var/msg = replacetext(flavor_text, "\n", " ")
|
||||
if(length(msg) <= 40 || !shrink)
|
||||
|
||||
Reference in New Issue
Block a user