mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 18:22:39 +00:00
One can now update crew record photos using a security console.
This commit is contained in:
@@ -78,8 +78,8 @@
|
||||
if(3.0)
|
||||
dat += text("<B>Records Maintenance</B><HR>\n<A href='?src=\ref[];back=1'>Backup To Disk</A><BR>\n<A href='?src=\ref[];u_load=1'>Upload From disk</A><BR>\n<A href='?src=\ref[];del_all=1'>Delete All Records</A><BR>\n<BR>\n<A href='?src=\ref[];screen=1'>Back</A>", src, src, src, src)
|
||||
if(4.0)
|
||||
var/icon/front = new(active1.fields["photo"], dir = SOUTH)
|
||||
var/icon/side = new(active1.fields["photo"], dir = WEST)
|
||||
var/icon/front = active1.fields["photo_front"]
|
||||
var/icon/side = active1.fields["photo_side"]
|
||||
user << browse_rsc(front, "front.png")
|
||||
user << browse_rsc(side, "side.png")
|
||||
dat += "<CENTER><B>Medical Record</B></CENTER><BR>"
|
||||
|
||||
@@ -123,21 +123,21 @@
|
||||
if(3.0)
|
||||
dat += "<CENTER><B>Security Record</B></CENTER><BR>"
|
||||
if ((istype(active1, /datum/data/record) && data_core.general.Find(active1)))
|
||||
var/icon/front = new(active1.fields["photo"], dir = SOUTH)
|
||||
var/icon/side = new(active1.fields["photo"], dir = WEST)
|
||||
user << browse_rsc(front, "front.png")
|
||||
user << browse_rsc(side, "side.png")
|
||||
user << browse_rsc(active1.fields["photo_front"], "front.png")
|
||||
user << browse_rsc(active1.fields["photo_side"], "side.png")
|
||||
dat += text("<table><tr><td> \
|
||||
Name: <A href='?src=\ref[src];choice=Edit Field;field=name'>[active1.fields["name"]]</A><BR> \
|
||||
ID: <A href='?src=\ref[src];choice=Edit Field;field=id'>[active1.fields["id"]]</A><BR>\n \
|
||||
ID: <A href='?src=\ref[src];choice=Edit Field;field=id'>[active1.fields["id"]]</A><BR>\n \
|
||||
Sex: <A href='?src=\ref[src];choice=Edit Field;field=sex'>[active1.fields["sex"]]</A><BR>\n \
|
||||
Age: <A href='?src=\ref[src];choice=Edit Field;field=age'>[active1.fields["age"]]</A><BR>\n \
|
||||
Rank: <A href='?src=\ref[src];choice=Edit Field;field=rank'>[active1.fields["rank"]]</A><BR>\n \
|
||||
Fingerprint: <A href='?src=\ref[src];choice=Edit Field;field=fingerprint'>[active1.fields["fingerprint"]]</A><BR>\n \
|
||||
Physical Status: [active1.fields["p_stat"]]<BR>\n \
|
||||
Mental Status: [active1.fields["m_stat"]]<BR></td> \
|
||||
<td align = center valign = top>Photo:<br><img src=front.png height=80 width=80 border=4> \
|
||||
<img src=side.png height=80 width=80 border=4></td></tr></table>")
|
||||
<td align = center valign = top>Photo:<br> \
|
||||
<table><td align = center><img src=front.png height=80 width=80 border=4><BR><A href='?src=\ref[src];choice=Edit Field;field=photo front'>Update front photo</A></td> \
|
||||
<td align = center><img src=side.png height=80 width=80 border=4><BR><A href='?src=\ref[src];choice=Edit Field;field=photo side'>Update side photo</A></td></table> \
|
||||
</td></tr></table>")
|
||||
else
|
||||
dat += "<B>General Record Lost!</B><BR>"
|
||||
if ((istype(active2, /datum/data/record) && data_core.security.Find(active2)))
|
||||
@@ -413,57 +413,36 @@ What a mess.*/
|
||||
//RECORD CREATE
|
||||
if ("New Record (Security)")
|
||||
if ((istype(active1, /datum/data/record) && !( istype(active2, /datum/data/record) )))
|
||||
var/datum/data/record/R = new /datum/data/record()
|
||||
R.fields["name"] = active1.fields["name"]
|
||||
R.fields["id"] = active1.fields["id"]
|
||||
R.name = text("Security Record #[]", R.fields["id"])
|
||||
R.fields["criminal"] = "None"
|
||||
R.fields["mi_crim"] = "None"
|
||||
R.fields["mi_crim_d"] = "No minor crime convictions."
|
||||
R.fields["ma_crim"] = "None"
|
||||
R.fields["ma_crim_d"] = "No major crime convictions."
|
||||
R.fields["notes"] = "No notes."
|
||||
data_core.security += R
|
||||
active2 = R
|
||||
active2 = CreateSecurityRecord(active1.fields["name"], active1.fields["id"])
|
||||
screen = 3
|
||||
|
||||
if ("New Record (General)")
|
||||
var/datum/data/record/G = new /datum/data/record()
|
||||
G.fields["name"] = "New Record"
|
||||
G.fields["id"] = text("[]", add_zero(num2hex(rand(1, 1.6777215E7)), 6))
|
||||
G.fields["rank"] = "Unassigned"
|
||||
G.fields["real_rank"] = "Unassigned"
|
||||
G.fields["sex"] = "Male"
|
||||
G.fields["age"] = "Unknown"
|
||||
G.fields["fingerprint"] = "Unknown"
|
||||
G.fields["p_stat"] = "Active"
|
||||
G.fields["m_stat"] = "Stable"
|
||||
G.fields["species"] = "Human"
|
||||
data_core.general += G
|
||||
active1 = G
|
||||
active1 = CreateGeneralRecord()
|
||||
active2 = null
|
||||
|
||||
//FIELD FUNCTIONS
|
||||
if ("Edit Field")
|
||||
if (is_not_allowed(usr))
|
||||
return
|
||||
var/a1 = active1
|
||||
var/a2 = active2
|
||||
switch(href_list["field"])
|
||||
if("name")
|
||||
if (istype(active1, /datum/data/record))
|
||||
var/t1 = reject_bad_name(input("Please input name:", "Secure. records", active1.fields["name"], null) as text)
|
||||
if ((!( t1 ) || !length(trim(t1)) || !( authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon)))) || active1 != a1)
|
||||
if (!t1 || active1 != a1)
|
||||
return
|
||||
active1.fields["name"] = t1
|
||||
if("id")
|
||||
if (istype(active2, /datum/data/record))
|
||||
var/t1 = copytext(trim(sanitize(input("Please input id:", "Secure. records", active1.fields["id"], null) as text)),1,MAX_MESSAGE_LEN)
|
||||
if ((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || active1 != a1))
|
||||
if (!t1 || active1 != a1)
|
||||
return
|
||||
active1.fields["id"] = t1
|
||||
if("fingerprint")
|
||||
if (istype(active1, /datum/data/record))
|
||||
var/t1 = copytext(trim(sanitize(input("Please input fingerprint hash:", "Secure. records", active1.fields["fingerprint"], null) as text)),1,MAX_MESSAGE_LEN)
|
||||
if ((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || active1 != a1))
|
||||
if (!t1 || active1 != a1)
|
||||
return
|
||||
active1.fields["fingerprint"] = t1
|
||||
if("sex")
|
||||
@@ -475,37 +454,37 @@ What a mess.*/
|
||||
if("age")
|
||||
if (istype(active1, /datum/data/record))
|
||||
var/t1 = input("Please input age:", "Secure. records", active1.fields["age"], null) as num
|
||||
if ((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || active1 != a1))
|
||||
if (!t1 || active1 != a1)
|
||||
return
|
||||
active1.fields["age"] = t1
|
||||
if("mi_crim")
|
||||
if (istype(active2, /datum/data/record))
|
||||
var/t1 = copytext(trim(sanitize(input("Please input minor disabilities list:", "Secure. records", active2.fields["mi_crim"], null) as text)),1,MAX_MESSAGE_LEN)
|
||||
if ((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || active2 != a2))
|
||||
if (!t1 || active2 != a2)
|
||||
return
|
||||
active2.fields["mi_crim"] = t1
|
||||
if("mi_crim_d")
|
||||
if (istype(active2, /datum/data/record))
|
||||
var/t1 = copytext(trim(sanitize(input("Please summarize minor dis.:", "Secure. records", active2.fields["mi_crim_d"], null) as message)),1,MAX_MESSAGE_LEN)
|
||||
if ((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || active2 != a2))
|
||||
if (!t1 || active2 != a2)
|
||||
return
|
||||
active2.fields["mi_crim_d"] = t1
|
||||
if("ma_crim")
|
||||
if (istype(active2, /datum/data/record))
|
||||
var/t1 = copytext(trim(sanitize(input("Please input major diabilities list:", "Secure. records", active2.fields["ma_crim"], null) as text)),1,MAX_MESSAGE_LEN)
|
||||
if ((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || active2 != a2))
|
||||
if (!t1 || active2 != a2)
|
||||
return
|
||||
active2.fields["ma_crim"] = t1
|
||||
if("ma_crim_d")
|
||||
if (istype(active2, /datum/data/record))
|
||||
var/t1 = copytext(trim(sanitize(input("Please summarize major dis.:", "Secure. records", active2.fields["ma_crim_d"], null) as message)),1,MAX_MESSAGE_LEN)
|
||||
if ((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || active2 != a2))
|
||||
if (!t1 || active2 != a2)
|
||||
return
|
||||
active2.fields["ma_crim_d"] = t1
|
||||
if("notes")
|
||||
if (istype(active2, /datum/data/record))
|
||||
var/t1 = copytext(html_encode(trim(input("Please summarize notes:", "Secure. records", html_decode(active2.fields["notes"]), null) as message)),1,MAX_MESSAGE_LEN)
|
||||
if ((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || active2 != a2))
|
||||
if (!t1 || active2 != a2)
|
||||
return
|
||||
active2.fields["notes"] = t1
|
||||
if("criminal")
|
||||
@@ -532,9 +511,18 @@ What a mess.*/
|
||||
if("species")
|
||||
if (istype(active1, /datum/data/record))
|
||||
var/t1 = copytext(trim(sanitize(input("Please enter race:", "General records", active1.fields["species"], null) as message)),1,MAX_MESSAGE_LEN)
|
||||
if ((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || active1 != a1))
|
||||
if (!t1 || active1 != a1)
|
||||
return
|
||||
active1.fields["species"] = t1
|
||||
if("photo front")
|
||||
var/icon/photo = get_photo(usr)
|
||||
if(photo)
|
||||
active1.fields["photo_front"] = photo
|
||||
if("photo side")
|
||||
var/icon/photo = get_photo(usr)
|
||||
if(photo)
|
||||
active1.fields["photo_side"] = photo
|
||||
|
||||
|
||||
//TEMPORARY MENU FUNCTIONS
|
||||
else//To properly clear as per clear screen.
|
||||
@@ -582,6 +570,19 @@ What a mess.*/
|
||||
updateUsrDialog()
|
||||
return
|
||||
|
||||
/obj/machinery/computer/secure_data/proc/is_not_allowed(var/mob/user)
|
||||
return !src.authenticated || user.stat || user.restrained() || (!in_range(src, user) && (!istype(user, /mob/living/silicon)))
|
||||
|
||||
/obj/machinery/computer/secure_data/proc/get_photo(var/mob/user)
|
||||
if(istype(user.get_active_hand(), /obj/item/weapon/photo))
|
||||
var/obj/item/weapon/photo/photo = user.get_active_hand()
|
||||
return photo.img
|
||||
if(istype(user, /mob/living/silicon))
|
||||
var/mob/living/silicon/tempAI = usr
|
||||
var/datum/picture/selection = tempAI.GetPicture()
|
||||
if (selection)
|
||||
return selection.fields["img"]
|
||||
|
||||
/obj/machinery/computer/secure_data/emp_act(severity)
|
||||
if(stat & (BROKEN|NOPOWER))
|
||||
..(severity)
|
||||
|
||||
@@ -87,8 +87,8 @@
|
||||
if(3.0)
|
||||
dat += "<CENTER><B>Employment Record</B></CENTER><BR>"
|
||||
if ((istype(active1, /datum/data/record) && data_core.general.Find(active1)))
|
||||
var/icon/front = new(active1.fields["photo"], dir = SOUTH)
|
||||
var/icon/side = new(active1.fields["photo"], dir = WEST)
|
||||
var/icon/front = active1.fields["photo_front"]
|
||||
var/icon/side = active1.fields["photo_side"]
|
||||
user << browse_rsc(front, "front.png")
|
||||
user << browse_rsc(side, "side.png")
|
||||
dat += text("<table><tr><td> \
|
||||
@@ -302,22 +302,9 @@ What a mess.*/
|
||||
temp += "<a href='?src=\ref[src];choice=Clear Screen'>No</a>"
|
||||
//RECORD CREATE
|
||||
if ("New Record (General)")
|
||||
|
||||
if(PDA_Manifest.len)
|
||||
PDA_Manifest.Cut()
|
||||
var/datum/data/record/G = new /datum/data/record()
|
||||
G.fields["name"] = "New Record"
|
||||
G.fields["id"] = text("[]", add_zero(num2hex(rand(1, 1.6777215E7)), 6))
|
||||
G.fields["rank"] = "Unassigned"
|
||||
G.fields["real_rank"] = "Unassigned"
|
||||
G.fields["sex"] = "Male"
|
||||
G.fields["age"] = "Unknown"
|
||||
G.fields["fingerprint"] = "Unknown"
|
||||
G.fields["p_stat"] = "Active"
|
||||
G.fields["m_stat"] = "Stable"
|
||||
G.fields["species"] = "Human"
|
||||
data_core.general += G
|
||||
active1 = G
|
||||
active1 = CreateGeneralRecord()
|
||||
|
||||
//FIELD FUNCTIONS
|
||||
if ("Edit Field")
|
||||
|
||||
@@ -758,11 +758,7 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co
|
||||
photo.loc = src
|
||||
else if(istype(user,/mob/living/silicon))
|
||||
var/mob/living/silicon/tempAI = user
|
||||
var/obj/item/device/camera/siliconcam/camera = tempAI.aiCamera
|
||||
|
||||
if(!camera)
|
||||
return
|
||||
var/datum/picture/selection = camera.selectpicture()
|
||||
var/datum/picture/selection = tempAI.GetPicture()
|
||||
if (!selection)
|
||||
return
|
||||
|
||||
|
||||
Reference in New Issue
Block a user