From ed18c63441c414efadf9095a91f6e571958d4506 Mon Sep 17 00:00:00 2001 From: Dax Dupont Date: Wed, 7 Feb 2018 12:16:44 +0100 Subject: [PATCH 1/2] Holopictures and more! (#35303) * Holopictures and more! * Remiedation --- code/datums/holocall.dm | 8 ++++++- code/game/machinery/hologram.dm | 28 ++++++++++++++-------- code/modules/paperwork/photography.dm | 34 ++++++++++++++++++++++++--- 3 files changed, 56 insertions(+), 14 deletions(-) diff --git a/code/datums/holocall.dm b/code/datums/holocall.dm index 342e84974a..d19e8be2e1 100644 --- a/code/datums/holocall.dm +++ b/code/datums/holocall.dm @@ -202,6 +202,12 @@ var/list/entries = list() var/language = /datum/language/common //Initial language, can be changed by HOLORECORD_LANGUAGE entries +/datum/holorecord/proc/set_caller_image(mob/user) + var/olddir = user.dir + user.setDir(SOUTH) + caller_image = getFlatIcon(user) + user.setDir(olddir) + /obj/item/disk/holodisk name = "holorecord disk" desc = "Stores recorder holocalls." @@ -278,7 +284,7 @@ else var/datum/preset_holoimage/H = new preset_image_type record.caller_image = H.build_image() - + //These build caller image from outfit and some additional data, for use by mappers for ruin holorecords /datum/preset_holoimage var/nonhuman_mobtype //Fill this if you just want something nonhuman diff --git a/code/game/machinery/hologram.dm b/code/game/machinery/hologram.dm index 12fe90f04d..0642f1bef8 100644 --- a/code/game/machinery/hologram.dm +++ b/code/game/machinery/hologram.dm @@ -58,6 +58,7 @@ Possible to do for anyone motivated enough: var/static/force_answer_call = FALSE //Calls will be automatically answered after a couple rings, here for debugging var/static/list/holopads = list() var/obj/effect/overlay/holoray/ray + var/offset = FALSE /obj/machinery/holopad/Initialize() . = ..() @@ -279,7 +280,16 @@ Possible to do for anyone motivated enough: record_stop() else if(href_list["record_clear"]) record_clear() - + else if(href_list["offset"]) + offset++ + if (offset > 4) + offset = FALSE + var/turf/new_turf + if (!offset) + new_turf = get_turf(src) + else + new_turf = get_step(src, GLOB.cardinals[offset]) + replay_holo.forceMove(new_turf) updateDialog() //do not allow AIs to answer calls or people will use it to meta the AI sattelite @@ -493,7 +503,8 @@ For the other part of the code, check silicon say.dm. Particularly robot talk.*/ replay_mode = TRUE replay_holo = setup_replay_holo(disk.record) temp = "Replaying...
" - temp += "End replay." + temp += "Change offset
" + temp += "End replay" SetLightsAndPower() replay_entry(1) return @@ -502,6 +513,7 @@ For the other part of the code, check silicon say.dm. Particularly robot talk.*/ if(replay_mode) replay_mode = FALSE loop_mode = FALSE + offset = FALSE temp = null QDEL_NULL(replay_holo) SetLightsAndPower() @@ -514,16 +526,10 @@ For the other part of the code, check silicon say.dm. Particularly robot talk.*/ record_mode = TRUE record_start = world.time record_user = user - disk.record.caller_image = get_record_icon(user) + disk.record.set_caller_image(user) temp = "Recording...
" temp += "End recording." -/obj/machinery/holopad/proc/get_record_icon(mob/living/user) - var/olddir = user.dir - user.setDir(SOUTH) - . = getFlatIcon(user) - user.setDir(olddir) - /obj/machinery/holopad/proc/record_message(mob/living/speaker,message,language) if(!record_mode) return @@ -553,8 +559,10 @@ For the other part of the code, check silicon say.dm. Particularly robot talk.*/ /obj/machinery/holopad/proc/replay_entry(entry_number) if(!replay_mode) return + if (!disk.record.entries.len) // check for zero entries such as photographs and no text recordings + return // and pretty much just display them statically untill manually stopped if(disk.record.entries.len < entry_number) - if (loop_mode) + if(loop_mode) entry_number = 1 else replay_stop() diff --git a/code/modules/paperwork/photography.dm b/code/modules/paperwork/photography.dm index 78dba1b3a7..14aad9c7b7 100644 --- a/code/modules/paperwork/photography.dm +++ b/code/modules/paperwork/photography.dm @@ -131,6 +131,7 @@ var/blueprints = 0 //are blueprints visible in the current photo being created? var/list/aipictures = list() //Allows for storage of pictures taken by AI, in a similar manner the datacore stores info. Keeping this here allows us to share some procs w/ regualar camera var/see_ghosts = 0 //for the spoop of it + var/obj/item/disk/holodisk/disk /obj/item/device/camera/CheckParts(list/parts_list) @@ -189,8 +190,24 @@ qdel(I) pictures_left = pictures_max return + if(istype(I, /obj/item/disk/holodisk)) + if (!disk) + if(!user.transferItemToLoc(I, src)) + to_chat(user, "[I] is stuck to your hand!") + return TRUE + to_chat(user, "You slide [I] into the back of [src].") + disk = I + else + to_chat(user, "There's already a disk inside [src].") + return TRUE //no afterattack ..() +/obj/item/device/camera/attack_self(mob/user) + if(!disk) + return + to_chat(user, "You eject [disk] out the back of [src].") + user.put_in_hands(disk) + disk = null /obj/item/device/camera/examine(mob/user) ..() @@ -437,13 +454,24 @@ /obj/item/device/camera/afterattack(atom/target, mob/user, flag) if(!on || !pictures_left || !isturf(target.loc)) return + if (disk) + if(ismob(target)) + if (disk.record) + QDEL_NULL(disk.record) - captureimage(target, user, flag) + disk.record = new + var/mob/M = target + disk.record.caller_name = M.name + disk.record.set_caller_image(M) + else + return + else + captureimage(target, user, flag) + pictures_left-- + to_chat(user, "[pictures_left] photos left.") playsound(loc, pick('sound/items/polaroid1.ogg', 'sound/items/polaroid2.ogg'), 75, 1, -3) - pictures_left-- - to_chat(user, "[pictures_left] photos left.") icon_state = "camera_off" on = FALSE addtimer(CALLBACK(src, .proc/cooldown), 64)