Skip to content

Commit

Permalink
Lets observer with SecHUD enabled see sec records on examine. (#4890)
Browse files Browse the repository at this point in the history
# About the pull request

Lets observer with Security HUD switched on see and read security
records.

# Explain why it's good for the game

Entertaining to see why the Bravo SL is wanted on the frontline after
you're dead.

# Testing Photographs and Procedure
<details>
<summary>Screenshots & Videos</summary>

Put screenshots and videos here with an empty line between the
screenshots and the `<details>` tags.

</details>


# Changelog
:cl:
add: Observer with Security HUD enabled can examine and read security
records.
/:cl:
  • Loading branch information
Birdtalon authored Nov 13, 2023
1 parent f1036b8 commit 45cbeba
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
17 changes: 14 additions & 3 deletions code/modules/mob/living/carbon/human/examine.dm
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
if(user.sdisabilities & DISABILITY_BLIND || user.blinded || user.stat==UNCONSCIOUS)
return list(SPAN_NOTICE("Something is there but you can't see it."))

var/mob/dead/observer/observer
if(isobserver(user))
observer = user

if(isxeno(user))
var/msg = "<span class='info'>This is "

Expand Down Expand Up @@ -435,7 +439,7 @@
for(var/implant in get_visible_implants())
msg += SPAN_WARNING("<b>[t_He] has \a [implant] sticking out of [t_his] flesh!\n")

if(hasHUD(user,"security"))
if(hasHUD(user,"security") || (observer && observer.HUD_toggled["Security HUD"]))
var/perpref


Expand All @@ -450,8 +454,15 @@
if(R.fields["id"] == E.fields["id"])
criminal = R.fields["criminal"]

msg += "<span class = 'deptradio'>Criminal status:</span> <a href='?src=\ref[src];criminal=1'>\[[criminal]\]</a>\n"
msg += "<span class = 'deptradio'>Security records:</span> <a href='?src=\ref[src];secrecord=1'>\[View\]</a> <a href='?src=\ref[src];secrecordadd=1'>\[Add comment\]</a>\n"
msg += "<span class = 'deptradio'>Criminal status:</span>"
if(!observer)
msg += "<a href='?src=\ref[src];criminal=1'>\[[criminal]\]</a>\n"
else
msg += "\[[criminal]\]\n"

msg += "<span class = 'deptradio'>Security records:</span> <a href='?src=\ref[src];secrecord=1'>\[View\]</a>"
if(!observer)
msg += " <a href='?src=\ref[src];secrecordadd=1'>\[Add comment\]</a>\n"

if(hasHUD(user,"medical"))
var/cardcolor = holo_card_color
Expand Down
9 changes: 5 additions & 4 deletions code/modules/mob/living/carbon/human/human.dm
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@
to_chat(usr, SPAN_DANGER("Unable to locate a data core entry for this person."))

if(href_list["secrecord"])
if(hasHUD(usr,"security"))
if(hasHUD(usr,"security") || isobserver(usr))
var/perpref = null
var/read = 0

Expand All @@ -624,7 +624,7 @@
if(E.fields["ref"] == perpref)
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,"security") || isobserver(usr))
to_chat(usr, "<b>Name:</b> [R.fields["name"]] <b>Criminal Status:</b> [R.fields["criminal"]]")
to_chat(usr, "<b>Incidents:</b> [R.fields["incident"]]")
to_chat(usr, "<a href='?src=\ref[src];secrecordComment=1'>\[View Comment Log\]</a>")
Expand All @@ -633,7 +633,7 @@
if(!read)
to_chat(usr, SPAN_DANGER("Unable to locate a data core entry for this person."))

if(href_list["secrecordComment"] && hasHUD(usr,"security"))
if(href_list["secrecordComment"] && (hasHUD(usr,"security") || isobserver(usr)))
var/perpref = null
if(wear_id)
var/obj/item/card/id/ID = wear_id.GetID()
Expand Down Expand Up @@ -662,7 +662,8 @@
continue
comment_markup += text("<i>Comment deleted by [] at []</i><br />", comment["deleted_by"], comment["deleted_at"])
to_chat(usr, comment_markup)
to_chat(usr, "<a href='?src=\ref[src];secrecordadd=1'>\[Add comment\]</a><br />")
if(!isobserver(usr))
to_chat(usr, "<a href='?src=\ref[src];secrecordadd=1'>\[Add comment\]</a><br />")

if(!read)
to_chat(usr, SPAN_DANGER("Unable to locate a data core entry for this person."))
Expand Down

0 comments on commit 45cbeba

Please sign in to comment.