diff --git a/code/datums/datacore.dm b/code/datums/datacore.dm
index d07b6e3eb73..ff081676b43 100644
--- a/code/datums/datacore.dm
+++ b/code/datums/datacore.dm
@@ -66,6 +66,8 @@
G.fields["sex"] = capitalize(H.gender)
G.fields["species"] = H.get_species()
G.fields["photo"] = get_id_photo(H)
+ G.fields["photo-south"] = "'data:image/png;base64,[icon2base64(icon(G.fields["photo"], dir = SOUTH))]'"
+ G.fields["photo-west"] = "'data:image/png;base64,[icon2base64(icon(G.fields["photo"], dir = WEST))]'"
if(H.gen_record && !jobban_isbanned(H, "Records"))
G.fields["notes"] = H.gen_record
else
diff --git a/code/game/machinery/computer/medical.dm b/code/game/machinery/computer/medical.dm
index 6e331d46cf3..4727953e5df 100644
--- a/code/game/machinery/computer/medical.dm
+++ b/code/game/machinery/computer/medical.dm
@@ -54,10 +54,6 @@
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)
- user << browse_rsc(front, "front.png")
- user << browse_rsc(side, "side.png")
dat += "Medical Record
"
if ((istype(src.active1, /datum/data/record) && data_core.general.Find(src.active1)))
dat += ""
+ Photo:
\
+
"
else
dat += "General Record Lost!
"
if ((istype(src.active2, /datum/data/record) && data_core.medical.Find(src.active2)))
diff --git a/code/game/machinery/computer/security.dm b/code/game/machinery/computer/security.dm
index 6f285930ab7..f1c475a122b 100644
--- a/code/game/machinery/computer/security.dm
+++ b/code/game/machinery/computer/security.dm
@@ -165,10 +165,6 @@
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")
dat += {"
"}
else
diff --git a/code/game/machinery/computer/skills.dm b/code/game/machinery/computer/skills.dm
index ddcfeed9a74..1d5e0ce53dd 100644
--- a/code/game/machinery/computer/skills.dm
+++ b/code/game/machinery/computer/skills.dm
@@ -87,10 +87,6 @@
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)
- user << browse_rsc(front, "front.png")
- user << browse_rsc(side, "side.png")
dat += text(" \
Name: [active1.fields["name"]] \
ID: [active1.fields["id"]] \n \
@@ -101,8 +97,8 @@
Physical Status: [active1.fields["p_stat"]] \n \
Mental Status: [active1.fields["m_stat"]]
\n \
Employment/skills summary: [active1.fields["notes"]]
| \
- Photo:
\
-  |
")
+ Photo:
\
+  | ")
else
dat += "General Record Lost!
"
dat += text("\nDelete Record (ALL)
\nPrint Record
\nBack
", src, src, src)
diff --git a/code/game/objects/items/weapons/cards_ids.dm b/code/game/objects/items/weapons/cards_ids.dm
index 97f66ec6a72..68efca49825 100644
--- a/code/game/objects/items/weapons/cards_ids.dm
+++ b/code/game/objects/items/weapons/cards_ids.dm
@@ -103,8 +103,6 @@
var/sex
var/age
var/photo
- var/icon/front
- var/icon/side
var/dat
var/stamped = 0
@@ -137,12 +135,6 @@
var/datum/asset/assets = get_asset_datum(/datum/asset/simple/paper)
assets.send(user)
- if(!front)
- front = new(photo, dir = SOUTH)
- if(!side)
- side = new(photo, dir = WEST)
- user << browse_rsc(front, "front.png")
- user << browse_rsc(side, "side.png")
var/datum/browser/popup = new(user, "idcard", name, 600, 400)
popup.set_content(dat)
popup.set_title_image(usr.browse_rsc_icon(src.icon, src.icon_state))
@@ -170,16 +162,22 @@
dna_hash = H.dna.unique_enzymes
fingerprint_hash = md5(H.dna.uni_identity)
- dat = ("")
- dat += text("Name: [] ", registered_name)
- dat += text("Sex: [] \n", sex)
- dat += text("Age: [] \n", age)
- dat += text("Rank: [] \n", assignment)
- dat += text("Fingerprint: [] \n", fingerprint_hash)
- dat += text("Blood Type: [] \n", blood_type)
- dat += text("DNA Hash: []
\n", dna_hash)
- dat +=" | Photo:
\
-  |
"
+ RebuildHTML()
+
+/obj/item/weapon/card/id/proc/RebuildHTML()
+ var/photo_front = "'data:image/png;base64,[icon2base64(icon(photo, dir = SOUTH))]'"
+ var/photo_side = "'data:image/png;base64,[icon2base64(icon(photo, dir = WEST))]'"
+
+ dat = {"
+ Name: [registered_name]
+ Sex: [sex]
+ Age: [age]
+ Rank: [assignment]
+ Fingerprint: [fingerprint_hash]
+ Blood Type: [blood_type]
+ DNA Hash: [dna_hash]
+ | Photo:
+  |
"}
/obj/item/weapon/card/id/GetAccess()
if(!guest_pass)
@@ -292,27 +290,22 @@
to_chat(usr, "The card's microscanners activate as you pass it over \the [I], copying its access.")
src.access |= I.access //Don't copy access if user isn't an antag -- to prevent metagaming
-/obj/item/weapon/card/id/syndicate/proc/fake_id_photo(var/mob/living/carbon/human/H, var/side=0)//get_id_photo wouldn't work correctly
+/obj/item/weapon/card/id/syndicate/proc/fake_id_photo(var/mob/living/carbon/human/H)//get_id_photo wouldn't work correctly
if(!istype(H))
return
var/storedDir = H.dir //don't want to lose track of this
- var/icon/faked
- if(!side)
- if(!H.equip_to_slot_if_possible(src, slot_l_store, 0, 1))
- to_chat(H, "You need to empty your pockets before taking the ID picture.")
- return
+ var/icon/faked = new()
+ if(!H.equip_to_slot_if_possible(src, slot_l_store, 0, 1))
+ to_chat(H, "You need to empty your pockets before taking the ID picture.")
+ return
- if(side)
- H.dir = WEST //ensure the icon is actually the proper direction before copying it
- faked = getFlatIcon(H)
- H.dir = storedDir //reset the user back to their original direction, not even noticable they changed
- H.equip_to_slot_if_possible(src, slot_l_hand, 0, 1)
-
- else
- H.dir = SOUTH
- faked = getFlatIcon(H)
- H.dir = storedDir
+ H.dir = WEST //ensure the icon is actually the proper direction before copying it
+ faked.Insert(getFlatIcon(H), dir = WEST)
+ H.dir = SOUTH
+ faked.Insert(getFlatIcon(H), dir = SOUTH)
+ H.dir = storedDir
+ H.equip_to_slot_if_possible(src, slot_l_hand, 0, 1)
return faked
@@ -349,16 +342,17 @@
src.registered_name = new_name
UpdateName()
to_chat(user, "Name changed to [new_name].")
+ RebuildHTML()
if("Photo")
if(!Adjacent(user))
return
- photo = fake_id_photo(user)
- var/icon/photoside = fake_id_photo(user,1)
- front = new(photo)
- side = new(photoside)
- if(photo && photoside)
- to_chat(user, "Photo changed.")
+ var/icon/newphoto = fake_id_photo(user)
+ if(!newphoto)
+ return
+ photo = newphoto
+ to_chat(user, "Photo changed.")
+ RebuildHTML()
if("Appearance")
var/list/appearances = list(
@@ -403,6 +397,7 @@
return
src.sex = new_sex
to_chat(user, "Sex changed to [new_sex].")
+ RebuildHTML()
if("Age")
var/new_age = sanitize(stripped_input(user,"What age would you like to put on this card?","Agent Card Age","21", MAX_MESSAGE_LEN))
@@ -410,6 +405,7 @@
return
src.age = new_age
to_chat(user, "Age changed to [new_age].")
+ RebuildHTML()
if("Occupation")
var/new_job = sanitize(stripped_input(user,"What job would you like to put on this card?\nChanging occupation will not grant or remove any access levels.","Agent Card Occupation", "Civilian", MAX_MESSAGE_LEN))
@@ -418,6 +414,7 @@
src.assignment = new_job
to_chat(user, "Occupation changed to [new_job].")
UpdateName()
+ RebuildHTML()
if("Money Account")
var/new_account = input(user,"What money account would you like to link to this card?","Agent Card Account",12345) as num
@@ -438,6 +435,7 @@
return
src.blood_type = new_blood_type
to_chat(user, "Blood type changed to [new_blood_type].")
+ RebuildHTML()
if("DNA Hash")
var/default = "\[UNSET\]"
@@ -451,6 +449,7 @@
return
src.dna_hash = new_dna_hash
to_chat(user, "DNA hash changed to [new_dna_hash].")
+ RebuildHTML()
if("Fingerprint Hash")
var/default = "\[UNSET\]"
@@ -464,6 +463,7 @@
return
src.fingerprint_hash = new_fingerprint_hash
to_chat(user, "Fingerprint hash changed to [new_fingerprint_hash].")
+ RebuildHTML()
if("Reset Card")
name = initial(name)
@@ -480,6 +480,7 @@
registered_user = null
to_chat(user, "All information has been deleted from \the [src].")
+ RebuildHTML()
else
..()
diff --git a/code/modules/computer3/computers/medical.dm b/code/modules/computer3/computers/medical.dm
index 5d283af5b53..b3feb23c6a5 100644
--- a/code/modules/computer3/computers/medical.dm
+++ b/code/modules/computer3/computers/medical.dm
@@ -86,10 +86,6 @@
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)
- usr << browse_rsc(front, "front.png")
- usr << browse_rsc(side, "side.png")
dat += "Medical Record
"
if ((istype(src.active1, /datum/data/record) && data_core.general.Find(src.active1)))
dat += ""
+ Photo:
\
+
"
else
dat += "General Record Lost!
"
if ((istype(src.active2, /datum/data/record) && data_core.medical.Find(src.active2)))
diff --git a/code/modules/computer3/computers/security.dm b/code/modules/computer3/computers/security.dm
index ebb218b5cee..57e8de72a79 100644
--- a/code/modules/computer3/computers/security.dm
+++ b/code/modules/computer3/computers/security.dm
@@ -127,10 +127,6 @@
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)
- usr << browse_rsc(front, "front.png")
- usr << browse_rsc(side, "side.png")
dat += text("")
+ Photo:
\
+  | ")
else
dat += "General Record Lost!
"
if ((istype(active2, /datum/data/record) && data_core.security.Find(active2)))