diff --git a/baystation12.dme b/baystation12.dme index 7aadf41ef0..677d4ed90c 100644 --- a/baystation12.dme +++ b/baystation12.dme @@ -171,6 +171,7 @@ #include "code\defines\procs\AStar.dm" #include "code\defines\procs\command_alert.dm" #include "code\defines\procs\dbcore.dm" +#include "code\defines\procs\records.dm" #include "code\defines\procs\sd_Alert.dm" #include "code\defines\procs\statistics.dm" #include "code\game\asteroid.dm" diff --git a/code/WorkInProgress/computer3/computers/medical.dm b/code/WorkInProgress/computer3/computers/medical.dm index f1d5018bc0..5cb984ee36 100644 --- a/code/WorkInProgress/computer3/computers/medical.dm +++ b/code/WorkInProgress/computer3/computers/medical.dm @@ -86,8 +86,8 @@ if(3.0) dat += text("Records Maintenance
\nBackup To Disk
\nUpload From disk
\nDelete All Records
\n
\nBack", 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"] usr << browse_rsc(front, "front.png") usr << browse_rsc(side, "side.png") dat += "
Medical Record

" diff --git a/code/WorkInProgress/computer3/computers/security.dm b/code/WorkInProgress/computer3/computers/security.dm index f4682a8d50..f3a3d3ae2b 100644 --- a/code/WorkInProgress/computer3/computers/security.dm +++ b/code/WorkInProgress/computer3/computers/security.dm @@ -127,8 +127,8 @@ if(3.0) dat += "
Security Record

" 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"] usr << browse_rsc(front, "front.png") usr << browse_rsc(side, "side.png") dat += text("
\ @@ -430,34 +430,11 @@ 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 diff --git a/code/datums/datacore.dm b/code/datums/datacore.dm index a1a626313b..143e24a7f9 100644 --- a/code/datums/datacore.dm +++ b/code/datums/datacore.dm @@ -52,7 +52,8 @@ var/id = add_zero(num2hex(rand(1, 1.6777215E7)), 6) //this was the best they could come up with? A large random number? *sigh* - + var/icon/front = new(get_id_photo(H), dir = SOUTH) + var/icon/side = new(get_id_photo(H), dir = WEST) //General Record var/datum/data/record/G = new() G.fields["id"] = id @@ -65,7 +66,8 @@ G.fields["m_stat"] = "Stable" G.fields["sex"] = H.gender G.fields["species"] = H.get_species() - G.fields["photo"] = get_id_photo(H) + G.fields["photo_front"] = front + G.fields["photo_side"] = side if(H.gen_record && !jobban_isbanned(H, "Records")) G.fields["notes"] = H.gen_record else diff --git a/code/defines/procs/records.dm b/code/defines/procs/records.dm new file mode 100644 index 0000000000..9d419607c0 --- /dev/null +++ b/code/defines/procs/records.dm @@ -0,0 +1,36 @@ +/proc/CreateGeneralRecord() + var/mob/living/carbon/human/dummy = new() + dummy.mind = new() + var/icon/front = new(get_id_photo(dummy), dir = SOUTH) + var/icon/side = new(get_id_photo(dummy), dir = WEST) + 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" + G.fields["photo_front"] = front + G.fields["photo_side"] = side + data_core.general += G + + del(dummy) + return G + +/proc/CreateSecurityRecord(var/name as text, var/id as text) + var/datum/data/record/R = new /datum/data/record() + R.fields["name"] = name + R.fields["id"] = id + R.name = text("Security Record #[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 + return R \ No newline at end of file diff --git a/code/game/machinery/computer/medical.dm b/code/game/machinery/computer/medical.dm index 18f1ca059f..a23c717a7b 100644 --- a/code/game/machinery/computer/medical.dm +++ b/code/game/machinery/computer/medical.dm @@ -78,8 +78,8 @@ if(3.0) dat += text("Records Maintenance
\nBackup To Disk
\nUpload From disk
\nDelete All Records
\n
\nBack", 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 += "
Medical Record

" diff --git a/code/game/machinery/computer/security.dm b/code/game/machinery/computer/security.dm index e7060f7577..fde49fb7e3 100644 --- a/code/game/machinery/computer/security.dm +++ b/code/game/machinery/computer/security.dm @@ -123,21 +123,21 @@ if(3.0) dat += "
Security Record

" 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(" \ -
\ Name: [active1.fields["name"]]
\ - ID: [active1.fields["id"]]
\n \ + ID: [active1.fields["id"]]
\n \ Sex: [active1.fields["sex"]]
\n \ Age: [active1.fields["age"]]
\n \ Rank: [active1.fields["rank"]]
\n \ Fingerprint: [active1.fields["fingerprint"]]
\n \ Physical Status: [active1.fields["p_stat"]]
\n \ Mental Status: [active1.fields["m_stat"]]
Photo:
\ -
") +
Photo:
\ + \ +

Update front photo

Update side photo
\ +
") else dat += "General Record Lost!
" 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) diff --git a/code/game/machinery/computer/skills.dm b/code/game/machinery/computer/skills.dm index bc4d977dad..6d2a4857c5 100644 --- a/code/game/machinery/computer/skills.dm +++ b/code/game/machinery/computer/skills.dm @@ -87,8 +87,8 @@ if(3.0) dat += "
Employment Record

" 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("
\ @@ -302,22 +302,9 @@ What a mess.*/ temp += "No" //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") diff --git a/code/game/machinery/newscaster.dm b/code/game/machinery/newscaster.dm index 18b8e96186..794fd75c2e 100644 --- a/code/game/machinery/newscaster.dm +++ b/code/game/machinery/newscaster.dm @@ -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 diff --git a/code/modules/paperwork/silicon_photography.dm b/code/modules/paperwork/silicon_photography.dm index 4fbe953d72..ce31514adc 100644 --- a/code/modules/paperwork/silicon_photography.dm +++ b/code/modules/paperwork/silicon_photography.dm @@ -160,3 +160,8 @@ obj/item/device/camera/siliconcam/proc/getsource() else Cinfo = src return Cinfo + +/mob/living/silicon/proc/GetPicture() + if(!aiCamera) + return + return aiCamera.selectpicture()