Adds new SecHUD designations and tweaks secHUD on examining (updated 22 May) (#12666)

* Add new criminal_status

* Add new criminal_status

* Update security.dm

Add new criminal_statuses to sec records console

* Fix beepsky not arresting executees

* Sechud now shows latest comment on examination

* Update human.dm

Add new criminal_status

* Update hud.dmi

Add new sechud icons, animated hudexecute

* Sechud now shows latest comment on examination

Simplified it according to farie's notes

* Sechud now shows latest comment on examination

Once more, thanks Henk!

* Sechud now shows latest comment on examination

Per Henk's review, another one bites the dust.

* Machinery threatcounts fixed

I just noticed that actually this doesn't affect beepsky, but turrets at portable_turret.dm. Well, now there they are.

* Turret threatcounts fixed

Now it should be proper: execute status now counts as threat to turrets.

* Update hud.dmi

New sechud statuses. Hourglass symbol for search status

* Update hud.dmi

DISREGARD: Test commit for affected on icondiffbot

* Update hud.dmi

New sechud statuses. Hourglass symbol for search status

* Revert "Update hud.dmi"

This reverts commit 8deaf40679.

* New sechud statuses. Zoomglass for search status (now).

* New sechud statuses

Make ghosts with all HUDs or sechud enabled able to use the examine function of sechud.

* Add new sec statuses

LF and conflicts resolved

* add new sec statuses

LF and conflicts resolved

* fix turret threatcounts

LF and conflicts resolved

* add new sec statuses

LF and conflicts resolved

* add new sec statuses, add sechud ghost examine

LF and conflicts resolved

* Add new sec statuses

LF and conflict resolving take2

* Add new sec stasuses

LF and conflict resolve take2, rid with empty lines

* Fixing Travis warning on list access at 355

* On built fail

trailing newlines accidentially forgotten, check, warning on list access, better but still not gone (got to git gut)

* Fixing usage of LAZYACCESS

Yeah - there was just un-necessary stuff there. Thanks to AA and Farie for help

* One last un-necessary thing off

* Move criminal status to defines.

Per Farie request: criminal statuses are now defines, every usage of them moved to utilize them. Minor: CC evilfax uses now 'demote' status in demote reply

* Beepsky prisoner threatcount: status quo

back to what it was since indeed, it becomes a nuisance if he tried to chase prisoners in jail

* Requests done

Removed useless check from secrecordComment, used isobserver at ghost omnihud

* re-add isobserver check

My bad, this check actually gives ghosts the View Comment Log from the HUD where they can't interact with the other buttons. I guess this is exactly why you comment code

* More sane expression on check at secrecordComment

As requested!

Co-authored-by: xXx-RegularJoe-xXx <53127823+xXx-RegularJoe-xXx@users.noreply.github.com>
This commit is contained in:
Regular-Joe-SF
2020-05-23 11:26:48 -06:00
committed by GitHub
co-authored by xXx-RegularJoe-xXx
parent 798cf7a8be
commit 826cefeca7
11 changed files with 103 additions and 42 deletions
+10
View File
@@ -0,0 +1,10 @@
//criminal status defines
#define SEC_RECORD_STATUS_NONE "None"
#define SEC_RECORD_STATUS_ARREST "*Arrest*"
#define SEC_RECORD_STATUS_EXECUTE "*Execute*"
#define SEC_RECORD_STATUS_INCARCERATED "Incarcerated"
#define SEC_RECORD_STATUS_RELEASED "Released"
#define SEC_RECORD_STATUS_PAROLLED "Parolled"
#define SEC_RECORD_STATUS_DEMOTE "Demote"
#define SEC_RECORD_STATUS_SEARCH "Search"
#define SEC_RECORD_STATUS_MONITOR "Monitor"
+12 -6
View File
@@ -244,21 +244,27 @@ proc/age2agedescription(age)
var/their_rank = target_records.fields["rank"]
switch(criminal_status)
if("arrest")
status = "*Arrest*"
status = SEC_RECORD_STATUS_ARREST
if("none")
status = "None"
status = SEC_RECORD_STATUS_NONE
if("execute")
if((ACCESS_MAGISTRATE in authcard_access) || (ACCESS_ARMORY in authcard_access))
status = "*Execute*"
status = SEC_RECORD_STATUS_EXECUTE
message_admins("[ADMIN_FULLMONTY(usr)] authorized <span class='warning'>EXECUTION</span> for [their_rank] [their_name], with comment: [comment]")
else
return 0
if("search")
status = SEC_RECORD_STATUS_SEARCH
if("monitor")
status = SEC_RECORD_STATUS_MONITOR
if ("demote")
status = SEC_RECORD_STATUS_DEMOTE
if("incarcerated")
status = "Incarcerated"
status = SEC_RECORD_STATUS_INCARCERATED
if("parolled")
status = "Parolled"
status = SEC_RECORD_STATUS_PAROLLED
if("released")
status = "Released"
status = SEC_RECORD_STATUS_RELEASED
target_records.fields["criminal"] = status
log_admin("[key_name_admin(user)] set secstatus of [their_rank] [their_name] to [status], comment: [comment]")
target_records.fields["comments"] += "Set to [status] by [user.name] ([user_rank]) on [GLOB.current_date_string] [station_time_timestamp()], comment: [comment]"
+14 -5
View File
@@ -223,19 +223,28 @@
var/datum/data/record/R = find_record("name", perpname, GLOB.data_core.security)
if(R)
switch(R.fields["criminal"])
if("*Execute*")
if(SEC_RECORD_STATUS_EXECUTE)
holder.icon_state = "hudexecute"
return
if("*Arrest*")
if(SEC_RECORD_STATUS_ARREST)
holder.icon_state = "hudwanted"
return
if("Incarcerated")
if(SEC_RECORD_STATUS_SEARCH)
holder.icon_state = "hudsearch"
return
if(SEC_RECORD_STATUS_MONITOR)
holder.icon_state = "hudmonitor"
return
if(SEC_RECORD_STATUS_DEMOTE)
holder.icon_state = "huddemote"
return
if(SEC_RECORD_STATUS_INCARCERATED)
holder.icon_state = "hudprisoner"
return
if("Parolled")
if(SEC_RECORD_STATUS_PAROLLED)
holder.icon_state = "hudparolled"
return
if("Released")
if(SEC_RECORD_STATUS_RELEASED)
holder.icon_state = "hudreleased"
return
holder.icon_state = null
+22 -13
View File
@@ -72,17 +72,23 @@
break
var/background = "''"
switch(crimstat)
if("*Execute*")
if(SEC_RECORD_STATUS_EXECUTE)
background = "'background-color:#5E0A1A'"
if("*Arrest*")
if(SEC_RECORD_STATUS_ARREST)
background = "'background-color:#890E26'"
if("Incarcerated")
if(SEC_RECORD_STATUS_SEARCH)
background = "'background-color:#999900'"
if(SEC_RECORD_STATUS_MONITOR)
background = "'background-color:#004C99'"
if(SEC_RECORD_STATUS_DEMOTE)
background = "'background-color:#C2A111'"
if(SEC_RECORD_STATUS_INCARCERATED)
background = "'background-color:#743B03'"
if("Parolled")
if(SEC_RECORD_STATUS_PAROLLED)
background = "'background-color:#743B03'"
if("Released")
if(SEC_RECORD_STATUS_RELEASED)
background = "'background-color:#216489'"
if("None")
if(SEC_RECORD_STATUS_NONE)
background = "'background-color:#007f47'"
if("null")
crimstat = "No record."
@@ -464,12 +470,15 @@
if("criminal")
if(istype(active2, /datum/data/record))
var/list/buttons = list()
buttons[++buttons.len] = list("name" = "None", "icon" = "unlock", "href" = "criminal=none", "status" = (active2.fields["criminal"] == "None" ? "selected" : null))
buttons[++buttons.len] = list("name" = "*Arrest*", "icon" = "lock", "href" = "criminal=arrest", "status" = (active2.fields["criminal"] == "*Arrest*" ? "selected" : null))
buttons[++buttons.len] = list("name" = "Incarcerated", "icon" = "lock", "href" = "criminal=incarcerated", "status" = (active2.fields["criminal"] == "Incarcerated" ? "selected" : null))
buttons[++buttons.len] = list("name" = "*Execute*", "icon" = "lock", "href" = "criminal=execute", "status" = (active2.fields["criminal"] == "*Execute*" ? "selected" : null))
buttons[++buttons.len] = list("name" = "Parolled", "icon" = "unlock-alt", "href" = "criminal=parolled", "status" = (active2.fields["criminal"] == "Parolled" ? "selected" : null))
buttons[++buttons.len] = list("name" = "Released", "icon" = "unlock", "href" = "criminal=released", "status" = (active2.fields["criminal"] == "Released" ? "selected" : null))
buttons[++buttons.len] = list("name" = "None", "icon" = "unlock", "href" = "criminal=none", "status" = (active2.fields["criminal"] == SEC_RECORD_STATUS_NONE ? "selected" : null))
buttons[++buttons.len] = list("name" = "*Arrest*", "icon" = "lock", "href" = "criminal=arrest", "status" = (active2.fields["criminal"] == SEC_RECORD_STATUS_ARREST ? "selected" : null))
buttons[++buttons.len] = list("name" = "Search", "icon" = "lock", "href" = "criminal=search", "status" = (active2.fields["criminal"] == SEC_RECORD_STATUS_SEARCH ? "selected" : null))
buttons[++buttons.len] = list("name" = "Monitor", "icon" = "unlock", "href" = "criminal=monitor", "status" = (active2.fields["criminal"] == SEC_RECORD_STATUS_MONITOR ? "selected" : null))
buttons[++buttons.len] = list("name" = "Demote", "icon" = "lock", "href" = "criminal=demote", "status" = (active2.fields["criminal"] == SEC_RECORD_STATUS_DEMOTE ? "selected" : null))
buttons[++buttons.len] = list("name" = "Incarcerated", "icon" = "lock", "href" = "criminal=incarcerated", "status" = (active2.fields["criminal"] == SEC_RECORD_STATUS_INCARCERATED ? "selected" : null))
buttons[++buttons.len] = list("name" = "*Execute*", "icon" = "lock", "href" = "criminal=execute", "status" = (active2.fields["criminal"] == SEC_RECORD_STATUS_EXECUTE ? "selected" : null))
buttons[++buttons.len] = list("name" = "Parolled", "icon" = "unlock-alt", "href" = "criminal=parolled", "status" = (active2.fields["criminal"] == SEC_RECORD_STATUS_PAROLLED ? "selected" : null))
buttons[++buttons.len] = list("name" = "Released", "icon" = "unlock", "href" = "criminal=released", "status" = (active2.fields["criminal"] == SEC_RECORD_STATUS_RELEASED ? "selected" : null))
setTemp("<h3>Criminal Status</h3>", buttons)
if("rank")
var/list/L = list("Head of Personnel", "Captain", "AI")
@@ -548,7 +557,7 @@
if(3)
R.fields["age"] = rand(5, 85)
if(4)
R.fields["criminal"] = pick("None", "*Arrest*", "Incarcerated", "Parolled", "Released")
R.fields["criminal"] = pick(SEC_RECORD_STATUS_NONE, SEC_RECORD_STATUS_ARREST, SEC_RECORD_STATUS_SEARCH, SEC_RECORD_STATUS_MONITOR, SEC_RECORD_STATUS_DEMOTE, SEC_RECORD_STATUS_INCARCERATED, SEC_RECORD_STATUS_PAROLLED, SEC_RECORD_STATUS_RELEASED)
if(5)
R.fields["p_stat"] = pick("*Unconcious*", "Active", "Physically Unfit")
if(6)
+1 -1
View File
@@ -310,7 +310,7 @@
if(3)
R.fields["age"] = rand(5, 85)
if(4)
R.fields["criminal"] = pick("None", "*Arrest*", "Incarcerated", "Parolled", "Released")
R.fields["criminal"] = pick(SEC_RECORD_STATUS_NONE, SEC_RECORD_STATUS_ARREST, SEC_RECORD_STATUS_INCARCERATED, SEC_RECORD_STATUS_PAROLLED, SEC_RECORD_STATUS_RELEASED)
if(5)
R.fields["p_stat"] = pick("*Unconcious*", "Active", "Physically Unfit")
if(6)
+6 -2
View File
@@ -552,8 +552,12 @@ Class Procs:
if(check_records && !R)
threatcount += 4
if(check_arrest && R && (R.fields["criminal"] == "*Arrest*"))
threatcount += 4
if(R && R.fields["criminal"])
switch(R.fields["criminal"])
if(SEC_RECORD_STATUS_EXECUTE)
threatcount += 7
if(SEC_RECORD_STATUS_ARREST)
threatcount += 5
return threatcount
@@ -346,6 +346,7 @@
if(hasHUD(user,"security"))
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
if(perpname)
for(var/datum/data/record/E in GLOB.data_core.general)
@@ -353,9 +354,16 @@
for(var/datum/data/record/R in GLOB.data_core.security)
if(R.fields["id"] == E.fields["id"])
criminal = R.fields["criminal"]
if(LAZYLEN(R.fields["comments"])) //if the commentlist is present
var/list/comments = R.fields["comments"]
commentLatest = LAZYACCESS(comments, comments.len) //get the latest entry from the comment log
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>"
msg += "<span class = 'deptradio'>Criminal status:</span> [criminal_status]\n"
msg += "<span class = 'deptradio'>Security records:</span> <a href='?src=[UID()];secrecord=`'>\[View\]</a> <a href='?src=[UID()];secrecordadd=`'>\[Add comment\]</a>\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,"medical"))
var/perpname = get_visible_name(TRUE)
@@ -398,17 +406,25 @@
if("medical")
return istype(H.glasses, /obj/item/clothing/glasses/hud/health) || istype(CIH,/obj/item/organ/internal/cyberimp/eyes/hud/medical)
else
return 0
return FALSE
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 1
return TRUE
if("medical")
return 1
return TRUE
else
return 0
return FALSE
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
else
return FALSE
else
return 0
return FALSE
// Ignores robotic limb branding prefixes like "Morpheus Cybernetics"
/proc/ignore_limb_branding(limb_name)
@@ -715,14 +715,14 @@
for(var/datum/data/record/R in GLOB.data_core.security)
if(R.fields["id"] == E.fields["id"])
var/setcriminal = input(usr, "Specify a new criminal status for this person.", "Security HUD", R.fields["criminal"]) in list("None", "*Arrest*", "Incarcerated", "Parolled", "Released", "Cancel")
var/setcriminal = input(usr, "Specify a new criminal status for this person.", "Security HUD", R.fields["criminal"]) in list(SEC_RECORD_STATUS_NONE, SEC_RECORD_STATUS_ARREST, SEC_RECORD_STATUS_SEARCH, SEC_RECORD_STATUS_MONITOR, SEC_RECORD_STATUS_DEMOTE, SEC_RECORD_STATUS_INCARCERATED, SEC_RECORD_STATUS_PAROLLED, SEC_RECORD_STATUS_RELEASED, "Cancel")
var/t1 = copytext(trim(sanitize(input("Enter Reason:", "Security HUD", null, null) as text)), 1, MAX_MESSAGE_LEN)
if(!t1)
t1 = "(none)"
if(hasHUD(usr, "security") && setcriminal != "Cancel")
found_record = 1
if(R.fields["criminal"] == "*Execute*")
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>")
else
var/rank
@@ -768,7 +768,7 @@
if(href_list["secrecordComment"])
if(hasHUD(usr,"security"))
if(usr.incapacitated())
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)
var/read = 0
@@ -783,7 +783,7 @@
for(var/c in R.fields["comments"])
to_chat(usr, c)
else
to_chat(usr, "<span class='warning'>No comment found</span>")
to_chat(usr, "<span class='warning'>No comments found</span>")
to_chat(usr, "<a href='?src=[UID()];secrecordadd=`'>\[Add comment\]</a>")
if(!read)
@@ -1554,13 +1554,13 @@ Eyes need to have significantly high darksight to shine unless the mob has the X
var/datum/data/record/R = find_record("name", perpname, GLOB.data_core.security)
if(R && R.fields["criminal"])
switch(R.fields["criminal"])
if("*Execute*")
if(SEC_RECORD_STATUS_EXECUTE)
threatcount += 7
if("*Arrest*")
if(SEC_RECORD_STATUS_ARREST)
threatcount += 5
if("Incarcerated")
if(SEC_RECORD_STATUS_INCARCERATED)
threatcount += 2
if("Parolled")
if(SEC_RECORD_STATUS_PAROLLED)
threatcount += 2
//Check for dresscode violations
+7 -1
View File
@@ -694,11 +694,17 @@
H.makeCluwne()
else if(myeffect == "Demote")
GLOB.event_announcement.Announce("[target.real_name] is hereby demoted to the rank of Civilian. Process this demotion immediately. Failure to comply with these orders is grounds for termination.","CC Demotion Order")
for(var/datum/data/record/R in sortRecord(GLOB.data_core.security))
if(R.fields["name"] == target.real_name)
R.fields["criminal"] = SEC_RECORD_STATUS_DEMOTE
R.fields["comments"] += "Central Command Demotion Order, given on [GLOB.current_date_string] [station_time_timestamp()]<BR> Process this demotion immediately. Failure to comply with these orders is grounds for termination."
update_all_mob_security_hud()
else if(myeffect == "Demote with Bot")
GLOB.event_announcement.Announce("[target.real_name] is hereby demoted to the rank of Civilian. Process this demotion immediately. Failure to comply with these orders is grounds for termination.","CC Demotion Order")
for(var/datum/data/record/R in sortRecord(GLOB.data_core.security))
if(R.fields["name"] == target.real_name)
R.fields["criminal"] = "*Arrest*"
R.fields["criminal"] = SEC_RECORD_STATUS_ARREST
R.fields["comments"] += "Central Command Demotion Order, given on [GLOB.current_date_string] [station_time_timestamp()]<BR> Process this demotion immediately. Failure to comply with these orders is grounds for termination."
update_all_mob_security_hud()
if(fax)
var/turf/T = get_turf(fax)
BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 15 KiB

+1
View File
@@ -32,6 +32,7 @@
#include "code\__DEFINES\construction.dm"
#include "code\__DEFINES\contracts.dm"
#include "code\__DEFINES\crafting.dm"
#include "code\__DEFINES\criminal_status.dm"
#include "code\__DEFINES\dna.dm"
#include "code\__DEFINES\error_handler.dm"
#include "code\__DEFINES\flags.dm"