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:
deathride58
2018-08-04 00:22:07 -04:00
committed by GitHub
49 changed files with 1456 additions and 811 deletions
+4 -4
View File
@@ -148,12 +148,12 @@
/datum/objective_item/steal/blueprints/check_special_completion(obj/item/I)
if(istype(I, /obj/item/areaeditor/blueprints))
return 1
return TRUE
if(istype(I, /obj/item/photo))
var/obj/item/photo/P = I
if(P.blueprints) //if the blueprints are in frame
return 1
return 0
if(P.picture.has_blueprints) //if the blueprints are in frame
return TRUE
return FALSE
/datum/objective_item/steal/slime
name = "an unused sample of slime extract."
+2 -2
View File
@@ -108,10 +108,10 @@
if(active1 in GLOB.data_core.general)
if(istype(active1.fields["photo_front"], /obj/item/photo))
var/obj/item/photo/P1 = active1.fields["photo_front"]
user << browse_rsc(P1.img, "photo_front")
user << browse_rsc(P1.picture.picture_image, "photo_front")
if(istype(active1.fields["photo_side"], /obj/item/photo))
var/obj/item/photo/P2 = active1.fields["photo_side"]
user << browse_rsc(P2.img, "photo_side")
user << browse_rsc(P2.picture.picture_image, "photo_side")
dat += "<tr><td>Name:</td><td>[active1.fields["name"]]</td>"
dat += "<td><a href='?src=[REF(src)];field=show_photo_front'><img src=photo_front height=80 width=80 border=4></a></td>"
dat += "<td><a href='?src=[REF(src)];field=show_photo_side'><img src=photo_side height=80 width=80 border=4></a></td></tr>"
+10 -11
View File
@@ -182,10 +182,10 @@
if(istype(active1, /datum/data/record) && GLOB.data_core.general.Find(active1))
if(istype(active1.fields["photo_front"], /obj/item/photo))
var/obj/item/photo/P1 = active1.fields["photo_front"]
user << browse_rsc(P1.img, "photo_front")
user << browse_rsc(P1.picture.picture_image, "photo_front")
if(istype(active1.fields["photo_side"], /obj/item/photo))
var/obj/item/photo/P2 = active1.fields["photo_side"]
user << browse_rsc(P2.img, "photo_side")
user << browse_rsc(P2.picture.picture_image, "photo_side")
dat += {"<table><tr><td><table>
<tr><td>Name:</td><td><A href='?src=[REF(src)];choice=Edit Field;field=name'>&nbsp;[active1.fields["name"]]&nbsp;</A></td></tr>
<tr><td>ID:</td><td><A href='?src=[REF(src)];choice=Edit Field;field=id'>&nbsp;[active1.fields["id"]]&nbsp;</A></td></tr>
@@ -446,7 +446,7 @@ What a mess.*/
sleep(30)
if((istype(active1, /datum/data/record) && GLOB.data_core.general.Find(active1)))//make sure the record still exists.
var/obj/item/photo/photo = active1.fields["photo_front"]
new /obj/item/poster/wanted(src.loc, photo.img, wanted_name, info)
new /obj/item/poster/wanted(loc, photo.picture.picture_image, wanted_name, info)
printing = 0
//RECORD DELETE
@@ -611,7 +611,7 @@ What a mess.*/
if(photo)
qdel(active1.fields["photo_front"])
//Lets center it to a 32x32.
var/icon/I = photo.img
var/icon/I = photo.picture.picture_image
var/w = I.Width()
var/h = I.Height()
var/dw = w - 32
@@ -622,7 +622,7 @@ What a mess.*/
if(active1.fields["photo_front"])
if(istype(active1.fields["photo_front"], /obj/item/photo))
var/obj/item/photo/P = active1.fields["photo_front"]
print_photo(P.img, active1.fields["name"])
print_photo(P.picture.picture_image, active1.fields["name"])
if("show_photo_side")
if(active1.fields["photo_side"])
if(istype(active1.fields["photo_side"], /obj/item/photo))
@@ -633,7 +633,7 @@ What a mess.*/
if(photo)
qdel(active1.fields["photo_side"])
//Lets center it to a 32x32.
var/icon/I = photo.img
var/icon/I = photo.picture.picture_image
var/w = I.Width()
var/h = I.Height()
var/dw = w - 32
@@ -644,7 +644,7 @@ What a mess.*/
if(active1.fields["photo_side"])
if(istype(active1.fields["photo_side"], /obj/item/photo))
var/obj/item/photo/P = active1.fields["photo_side"]
print_photo(P.img, active1.fields["name"])
print_photo(P.picture.picture_image, active1.fields["name"])
if("mi_crim_add")
if(istype(active1, /datum/data/record))
var/t1 = stripped_input(usr, "Please input minor crime names:", "Secure. records", "", null)
@@ -759,10 +759,9 @@ What a mess.*/
var/obj/item/photo/P = null
if(issilicon(user))
var/mob/living/silicon/tempAI = user
var/datum/picture/selection = tempAI.GetPhoto()
var/datum/picture/selection = tempAI.GetPhoto(user)
if(selection)
P = new()
P.photocreate(selection.fields["icon"], selection.fields["img"], selection.fields["desc"])
P = new(null, selection)
else if(istype(user.get_active_held_item(), /obj/item/photo))
P = user.get_active_held_item()
return P
@@ -778,7 +777,7 @@ What a mess.*/
small_img.Scale(8, 8)
ic.Blend(small_img,ICON_OVERLAY, 13, 13)
P.icon = ic
P.img = temp
P.picture.picture_image = temp
P.desc = "The photo on file for [name]."
P.pixel_x = rand(-10, 10)
P.pixel_y = rand(-10, 10)
+9 -19
View File
@@ -126,9 +126,9 @@ GLOBAL_LIST_EMPTY(allCasters)
newMsg.is_admin_message = adminMessage
newMsg.locked = !allow_comments
if(photo)
newMsg.img = photo.img
newMsg.img = photo.picture.picture_image
newMsg.caption = photo.scribble
newMsg.photo_file = save_photo(photo.img)
newMsg.photo_file = save_photo(photo.picture.picture_image)
for(var/datum/newscaster/feed_channel/FC in network_channels)
if(FC.channel_name == channel_name)
FC.messages += newMsg
@@ -145,8 +145,8 @@ GLOBAL_LIST_EMPTY(allCasters)
wanted_issue.scannedUser = scanned_user
wanted_issue.isAdminMsg = adminMsg
if(photo)
wanted_issue.img = photo.img
wanted_issue.photo_file = save_photo(photo.img)
wanted_issue.img = photo.picture.picture_image
wanted_issue.photo_file = save_photo(photo.picture.picture_image)
if(newMessage)
for(var/obj/machinery/newscaster/N in GLOB.allCasters)
N.newsAlert()
@@ -794,10 +794,7 @@ GLOBAL_LIST_EMPTY(allCasters)
if(photo && !user.transferItemToLoc(photo, src))
photo = null
if(issilicon(user))
var/list/nametemp = list()
var/find
var/datum/picture/selection
var/obj/item/camera/siliconcam/targetcam = null
var/obj/item/camera/siliconcam/targetcam
if(isAI(user))
var/mob/living/silicon/ai/R = user
targetcam = R.aicamera
@@ -809,19 +806,12 @@ GLOBAL_LIST_EMPTY(allCasters)
targetcam = R.aicamera
else
to_chat(user, "<span class='warning'>You cannot interface with silicon photo uploading!</span>")
if(targetcam.aipictures.len == 0)
if(!targetcam.stored.len)
to_chat(usr, "<span class='boldannounce'>No images saved</span>")
return
for(var/datum/picture/t in targetcam.aipictures)
nametemp += t.fields["name"]
find = input("Select image (numbered in order taken)") in nametemp
var/obj/item/photo/P = new/obj/item/photo()
for(var/datum/picture/q in targetcam.aipictures)
if(q.fields["name"] == find)
selection = q
break
P.photocreate(selection.fields["icon"], selection.fields["img"], selection.fields["desc"])
P.sillynewscastervar = 1
var/datum/picture/selection = targetcam.selectpicture(user)
var/obj/item/photo/P = new(null, selection)
P.sillynewscastervar = TRUE
photo = P
qdel(P)
@@ -141,7 +141,7 @@
break
// Del - Sender - Recepient - Message
// X - Al Green - Your Mom - WHAT UP!?
dat += "<tr><td width = '5%'><center><A href='?src=[REF(src)];delete_logs=[REF(pda)]' style='color: rgb(255,0,0)'>X</a></center></td><td width='15%'>[pda.sender]</td><td width='15%'>[pda.recipient]</td><td width='300px'>[pda.message][pda.photo ? " <a href='byond://?src=[REF(pda)];photo=1'>(Photo)</a>":""]</td></tr>"
dat += "<tr><td width = '5%'><center><A href='?src=[REF(src)];delete_logs=[REF(pda)]' style='color: rgb(255,0,0)'>X</a></center></td><td width='15%'>[pda.sender]</td><td width='15%'>[pda.recipient]</td><td width='300px'>[pda.message][pda.picture ? " <a href='byond://?src=[REF(pda)];photo=1'>(Photo)</a>":""]</td></tr>"
dat += "</table>"
//Hacking screen.
if(2)
@@ -124,7 +124,7 @@
var/sender = "Unspecified"
var/recipient = "Unspecified"
var/message = "Blank" // transferred message
var/icon/photo // attached photo
var/datum/picture/picture // attached photo
/datum/data_pda_msg/New(param_rec, param_sender, param_message, param_photo)
if(param_rec)
@@ -134,17 +134,17 @@
if(param_message)
message = param_message
if(param_photo)
photo = param_photo
picture = param_photo
/datum/data_pda_msg/Topic(href,href_list)
..()
if(href_list["photo"])
var/mob/M = usr
M << browse_rsc(photo, "pda_photo.png")
M << browse_rsc(picture.picture_image, "pda_photo.png")
M << browse("<html><head><title>PDA Photo</title></head>" \
+ "<body style='overflow:hidden;margin:0;text-align:center'>" \
+ "<img src='pda_photo.png' width='192' style='-ms-interpolation-mode:nearest-neighbor' />" \
+ "</body></html>", "window=pdaphoto;size=192x192")
+ "</body></html>", "window=pdaphoto;size=[picture.psize_x]x[picture.psize_y]")
onclose(M, "pdaphoto")
/datum/data_rc_msg
+8 -8
View File
@@ -72,7 +72,7 @@ GLOBAL_LIST_EMPTY(PDAs)
var/obj/item/paicard/pai = null // A slot for a personal AI device
var/icon/photo //Scanned photo
var/datum/picture/picture //Scanned photo
var/list/contained_item = list(/obj/item/pen, /obj/item/toy/crayon, /obj/item/lipstick, /obj/item/flashlight/pen, /obj/item/clothing/mask/cigarette)
var/obj/item/inserted_item //Used for pen, crayon, and lipstick insertion or removal. Same as above.
@@ -636,8 +636,8 @@ GLOBAL_LIST_EMPTY(PDAs)
"message" = message,
"targets" = string_targets
))
if (photo)
signal.data["photo"] = photo
if (picture)
signal.data["photo"] = picture
signal.send_to_receivers()
// If it didn't reach, note that fact
@@ -657,7 +657,7 @@ GLOBAL_LIST_EMPTY(PDAs)
log_talk(user, "[key_name(user)] (PDA: [initial(name)]) sent \"[message]\" to [target_text]", LOGPDA)
to_chat(user, "<span class='info'>Message sent to [target_text]: \"[message]\"</span>")
// Reset the photo
photo = null
picture = null
last_text = world.time
if (everyone)
last_everyone = world.time
@@ -811,7 +811,7 @@ GLOBAL_LIST_EMPTY(PDAs)
update_icon()
else if(istype(C, /obj/item/photo))
var/obj/item/photo/P = C
photo = P.img
picture = P.picture
to_chat(user, "<span class='notice'>You scan \the [C].</span>")
else
return ..()
@@ -925,11 +925,11 @@ GLOBAL_LIST_EMPTY(PDAs)
var/selected = plist[c]
if(aicamera.aipictures.len>0)
if(aicamera.stored.len)
var/add_photo = input(user,"Do you want to attach a photo?","Photo","No") as null|anything in list("Yes","No")
if(add_photo=="Yes")
var/datum/picture/Pic = aicamera.selectpicture(aicamera)
aiPDA.photo = Pic.fields["img"]
var/datum/picture/Pic = aicamera.selectpicture(user)
aiPDA.picture = Pic
if(incapacitated())
return
@@ -19,3 +19,4 @@
new /obj/item/export_scanner(src)
new /obj/item/door_remote/quartermaster(src)
new /obj/item/circuitboard/machine/techfab/department/cargo(src)
new /obj/item/storage/photo_album/QM(src)
@@ -29,6 +29,7 @@
new /obj/item/inducer(src)
new /obj/item/circuitboard/machine/techfab/department/engineering(src)
new /obj/item/extinguisher/advanced(src)
new /obj/item/storage/photo_album/CE(src)
/obj/structure/closet/secure_closet/engineering_electrical
name = "electrical supplies locker"
@@ -76,6 +76,7 @@
new /obj/item/pet_carrier(src)
new /obj/item/wallframe/defib_mount(src)
new /obj/item/circuitboard/machine/techfab/department/medical(src)
new /obj/item/storage/photo_album/CMO(src)
/obj/structure/closet/secure_closet/animal
name = "animal control"
@@ -25,3 +25,4 @@
new /obj/item/laser_pointer(src)
new /obj/item/door_remote/research_director(src)
new /obj/item/circuitboard/machine/techfab/department/science(src)
new /obj/item/storage/photo_album/RD(src)
@@ -33,6 +33,7 @@
new /obj/item/gun/energy/e_gun(src)
new /obj/item/door_remote/captain(src)
new /obj/item/card/id/captains_spare(src)
new /obj/item/storage/photo_album/Captain(src)
/obj/structure/closet/secure_closet/hop
name = "\proper head of personnel's locker"
@@ -59,6 +60,7 @@
new /obj/item/pet_carrier(src)
new /obj/item/door_remote/civillian(src)
new /obj/item/circuitboard/machine/techfab/department/service(src)
new /obj/item/storage/photo_album/HoP(src)
/obj/structure/closet/secure_closet/hos
name = "\proper head of security's locker"
@@ -91,6 +93,7 @@
new /obj/item/flashlight/seclite(src)
new /obj/item/pinpointer/nuke(src)
new /obj/item/circuitboard/machine/techfab/department/security(src)
new /obj/item/storage/photo_album/HoS(src)
/obj/structure/closet/secure_closet/warden
name = "\proper warden's locker"
+13 -2
View File
@@ -79,13 +79,24 @@ GLOBAL_PROTECT(security_mode)
/world/proc/SetupLogs()
var/override_dir = params[OVERRIDE_LOG_DIRECTORY_PARAMETER]
if(!override_dir)
GLOB.log_directory = "data/logs/[time2text(world.realtime, "YYYY/MM/DD")]/round-"
var/realtime = world.realtime
var/texttime = time2text(realtime, "YYYY/MM/DD")
GLOB.log_directory = "data/logs/[texttime]/round-"
GLOB.picture_logging_prefix = "L_[time2text(realtime, "YYYYMMDD")]_"
GLOB.picture_log_directory = "data/picture_logs/[texttime]/round-"
if(GLOB.round_id)
GLOB.log_directory += "[GLOB.round_id]"
GLOB.picture_logging_prefix += "R_[GLOB.round_id]_"
GLOB.picture_log_directory += "[GLOB.round_id]"
else
GLOB.log_directory += "[replacetext(time_stamp(), ":", ".")]"
var/timestamp = replacetext(time_stamp(), ":", ".")
GLOB.log_directory += "[timestamp]"
GLOB.picture_log_directory += "[timestamp]"
GLOB.picture_logging_prefix += "T_[timestamp]_"
else
GLOB.log_directory = "data/logs/[override_dir]"
GLOB.picture_logging_prefix = "O_[override_dir]_"
GLOB.picture_log_directory = "data/picture_logs/[override_dir]"
GLOB.world_game_log = "[GLOB.log_directory]/game.log"
GLOB.world_attack_log = "[GLOB.log_directory]/attack.log"