Merge pull request #5351 from Citadel-Station-13/upstream-merge-35303

[MIRROR] Holopictures and more!
This commit is contained in:
deathride58
2018-02-07 19:10:37 +00:00
committed by GitHub
3 changed files with 56 additions and 14 deletions
+7 -1
View File
@@ -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
+18 -10
View File
@@ -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...<br>"
temp += "<A href='?src=[REF(src)];replay_stop=1'>End replay.</A>"
temp += "<A href='?src=[REF(src)];offset=1'>Change offset</A><br>"
temp += "<A href='?src=[REF(src)];replay_stop=1'>End replay</A>"
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...<br>"
temp += "<A href='?src=[REF(src)];record_stop=1'>End recording.</A>"
/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()
+31 -3
View File
@@ -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, "<span class='warning'>[I] is stuck to your hand!</span>")
return TRUE
to_chat(user, "<span class='notice'>You slide [I] into the back of [src].</span>")
disk = I
else
to_chat(user, "<span class='warning'>There's already a disk inside [src].</span>")
return TRUE //no afterattack
..()
/obj/item/device/camera/attack_self(mob/user)
if(!disk)
return
to_chat(user, "<span class='notice'>You eject [disk] out the back of [src].</span>")
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, "<span class='notice'>[pictures_left] photos left.</span>")
playsound(loc, pick('sound/items/polaroid1.ogg', 'sound/items/polaroid2.ogg'), 75, 1, -3)
pictures_left--
to_chat(user, "<span class='notice'>[pictures_left] photos left.</span>")
icon_state = "camera_off"
on = FALSE
addtimer(CALLBACK(src, .proc/cooldown), 64)