Merge pull request #7386 from Citadel-Station-13/photography_update
Photography update - Photo persistence, 7x7 photos, adjustable camera photo size, photo logging with full metadata, etc etc
This commit is contained in:
+10
-7
@@ -214,13 +214,16 @@
|
||||
if(!C)
|
||||
C = H.client
|
||||
var/image = get_id_photo(H, C, show_directions)
|
||||
var/obj/item/photo/photo_front = new()
|
||||
var/obj/item/photo/photo_side = new()
|
||||
for(var/D in show_directions)
|
||||
if(D == SOUTH)
|
||||
photo_front.photocreate(null, icon(image, dir = D))
|
||||
if(D == WEST || D == EAST)
|
||||
photo_side.photocreate(null, icon(image, dir = D))
|
||||
var/datum/picture/pf = new
|
||||
var/datum/picture/ps = new
|
||||
pf.picture_name = "[H]"
|
||||
ps.picture_name = "[H]"
|
||||
pf.picture_desc = "This is [H]."
|
||||
ps.picture_desc = "This is [H]."
|
||||
pf.picture_image = icon(image, dir = SOUTH)
|
||||
ps.picture_image = icon(image, dir = WEST)
|
||||
var/obj/item/photo/photo_front = new(null, pf)
|
||||
var/obj/item/photo/photo_side = new(null, ps)
|
||||
|
||||
//These records should ~really~ be merged or something
|
||||
//General Record
|
||||
|
||||
@@ -83,3 +83,67 @@
|
||||
/datum/proc/to_chat_check_changed_vars(target = world)
|
||||
to_chat(target, txt_changed_vars())
|
||||
#endif
|
||||
|
||||
//Return a LIST for serialize_datum to encode! Not the actual json!
|
||||
/datum/proc/serialize_list(list/options)
|
||||
return NOT_IMPLEMENTED
|
||||
|
||||
//Accepts a LIST from deserialize_datum. Should return src or another datum.
|
||||
/datum/proc/deserialize_list(json, list/options)
|
||||
return NOT_IMPLEMENTED
|
||||
|
||||
//Serializes into JSON. Does not encode type.
|
||||
/datum/proc/serialize_json(list/options)
|
||||
. = serialize_list(options)
|
||||
if((. == NOT_IMPLEMENTED) || !islist(.))
|
||||
. = null
|
||||
else
|
||||
. = json_encode(.)
|
||||
|
||||
//Deserializes from JSON. Does not parse type.
|
||||
/datum/proc/deserialize_json(list/input, list/options)
|
||||
var/list/jsonlist = json_decode(input)
|
||||
. = deserialize_list(jsonlist)
|
||||
if(!istype(., /datum))
|
||||
. = null
|
||||
|
||||
/proc/json_serialize_datum(datum/D, list/options)
|
||||
if(!istype(D))
|
||||
return
|
||||
var/list/jsonlist = D.serialize_list(options)
|
||||
if(islist(jsonlist))
|
||||
jsonlist["DATUM_TYPE"] = D.type
|
||||
return json_encode(jsonlist)
|
||||
|
||||
/proc/json_deserialize_datum(list/jsonlist, list/options, target_type, strict_target_type = FALSE)
|
||||
if(!islist(jsonlist))
|
||||
if(!istext(jsonlist))
|
||||
CRASH("Invalid JSON")
|
||||
return
|
||||
jsonlist = json_decode(jsonlist)
|
||||
if(!islist(jsonlist))
|
||||
CRASH("Invalid JSON")
|
||||
return
|
||||
if(!jsonlist["DATUM_TYPE"])
|
||||
return
|
||||
if(!ispath(jsonlist["DATUM_TYPE"]))
|
||||
if(!istext(jsonlist["DATUM_TYPE"]))
|
||||
return
|
||||
jsonlist["DATUM_TYPE"] = text2path(jsonlist["DATUM_TYPE"])
|
||||
if(!ispath(jsonlist["DATUM_TYPE"]))
|
||||
return
|
||||
if(target_type)
|
||||
if(!ispath(target_type))
|
||||
return
|
||||
if(strict_target_type)
|
||||
if(target_type != jsonlist["DATUM_TYPE"])
|
||||
return
|
||||
else if(!ispath(jsonlist["DATUM_TYPE"], target_type))
|
||||
return
|
||||
var/typeofdatum = jsonlist["DATUM_TYPE"] //BYOND won't directly read if this is just put in the line below, and will instead runtime because it thinks you're trying to make a new list?
|
||||
var/datum/D = new typeofdatum
|
||||
var/datum/returned = D.deserialize_list(jsonlist, options)
|
||||
if(!istype(returned, /datum))
|
||||
qdel(D)
|
||||
else
|
||||
return returned
|
||||
@@ -12,7 +12,7 @@
|
||||
var/mob/living/carbon/human/H = quirk_holder
|
||||
if(NOBLOOD in H.dna.species.species_traits) //can't lose blood if your species doesn't have any
|
||||
return
|
||||
else
|
||||
else
|
||||
quirk_holder.blood_volume -= 0.275
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user