Oh hey, all of those compile fixes
This commit is contained in:
@@ -1,145 +0,0 @@
|
||||
// Picture frames
|
||||
|
||||
/obj/item/wallframe/picture
|
||||
name = "picture frame"
|
||||
desc = "The perfect showcase for your favorite deathtrap memories."
|
||||
icon = 'icons/obj/decals.dmi'
|
||||
materials = list()
|
||||
flags_1 = 0
|
||||
icon_state = "frame-empty"
|
||||
result_path = /obj/structure/sign/picture_frame
|
||||
var/obj/item/photo/displayed
|
||||
|
||||
/obj/item/wallframe/picture/attackby(obj/item/I, mob/user)
|
||||
if(istype(I, /obj/item/photo))
|
||||
if(!displayed)
|
||||
if(!user.transferItemToLoc(I, src))
|
||||
return
|
||||
displayed = I
|
||||
update_icon()
|
||||
else
|
||||
to_chat(user, "<span class=notice>\The [src] already contains a photo.</span>")
|
||||
..()
|
||||
|
||||
//ATTACK HAND IGNORING PARENT RETURN VALUE
|
||||
/obj/item/wallframe/picture/attack_hand(mob/user)
|
||||
if(user.get_inactive_held_item() != src)
|
||||
..()
|
||||
return
|
||||
if(contents.len)
|
||||
var/obj/item/I = pick(contents)
|
||||
user.put_in_hands(I)
|
||||
to_chat(user, "<span class='notice'>You carefully remove the photo from \the [src].</span>")
|
||||
displayed = null
|
||||
update_icon()
|
||||
return ..()
|
||||
|
||||
/obj/item/wallframe/picture/attack_self(mob/user)
|
||||
user.examinate(src)
|
||||
|
||||
/obj/item/wallframe/picture/examine(mob/user)
|
||||
if(user.is_holding(src) && displayed)
|
||||
displayed.show(user)
|
||||
else
|
||||
..()
|
||||
|
||||
/obj/item/wallframe/picture/update_icon()
|
||||
cut_overlays()
|
||||
if(displayed)
|
||||
add_overlay(getFlatIcon(displayed))
|
||||
|
||||
/obj/item/wallframe/picture/after_attach(obj/O)
|
||||
..()
|
||||
var/obj/structure/sign/picture_frame/PF = O
|
||||
PF.copy_overlays(src)
|
||||
if(displayed)
|
||||
PF.framed = displayed
|
||||
if(contents.len)
|
||||
var/obj/item/I = pick(contents)
|
||||
I.forceMove(PF)
|
||||
|
||||
/obj/structure/sign/picture_frame
|
||||
name = "picture frame"
|
||||
desc = "Every time you look it makes you laugh."
|
||||
icon = 'icons/obj/decals.dmi'
|
||||
icon_state = "frame-empty"
|
||||
var/obj/item/photo/framed
|
||||
var/persistence_id
|
||||
|
||||
/obj/structure/sign/picture_frame/Initialize(mapload, dir, building)
|
||||
. = ..()
|
||||
LAZYADD(SSpersistence.photo_frames, src)
|
||||
if(dir)
|
||||
setDir(dir)
|
||||
if(building)
|
||||
pixel_x = (dir & 3)? 0 : (dir == 4 ? -30 : 30)
|
||||
pixel_y = (dir & 3)? (dir ==1 ? -30 : 30) : 0
|
||||
|
||||
/obj/structure/sign/picture_frame/Destroy()
|
||||
LAZYREMOVE(SSpersistence.photo_frames, src)
|
||||
return ..()
|
||||
|
||||
/obj/structure/sign/picture_frame/proc/get_photo_id()
|
||||
if(istype(framed) && istype(framed.picture))
|
||||
return framed.picture.id
|
||||
|
||||
/obj/structure/sign/picture_frame/proc/load_from_id(id)
|
||||
var/obj/item/photo/P = load_photo_from_disk(id)
|
||||
if(istype(P))
|
||||
if(istype(framed))
|
||||
framed.forceMove(drop_location())
|
||||
else
|
||||
qdel(framed)
|
||||
framed = P
|
||||
update_icon()
|
||||
|
||||
/obj/structure/sign/picture_frame/examine(mob/user)
|
||||
if(in_range(src, user) && framed)
|
||||
framed.show(user)
|
||||
else
|
||||
..()
|
||||
|
||||
/obj/structure/sign/picture_frame/attackby(obj/item/I, mob/user, params)
|
||||
if(istype(I, /obj/item/screwdriver) || istype(I, /obj/item/wrench))
|
||||
to_chat(user, "<span class='notice'>You start unsecuring [name]...</span>")
|
||||
if(I.use_tool(src, user, 30, volume=50))
|
||||
playsound(loc, 'sound/items/deconstruct.ogg', 50, 1)
|
||||
to_chat(user, "<span class='notice'>You unsecure [name].</span>")
|
||||
deconstruct()
|
||||
return
|
||||
|
||||
else if(istype(I, /obj/item/photo))
|
||||
if(!framed)
|
||||
var/obj/item/photo/P = I
|
||||
if(!user.transferItemToLoc(P, src))
|
||||
return
|
||||
framed = P
|
||||
update_icon()
|
||||
else
|
||||
to_chat(user, "<span class=notice>\The [src] already contains a photo.</span>")
|
||||
|
||||
..()
|
||||
|
||||
/obj/structure/sign/picture_frame/attack_hand(mob/user)
|
||||
. = ..()
|
||||
if(.)
|
||||
return
|
||||
if(framed)
|
||||
framed.show(user)
|
||||
|
||||
/obj/structure/sign/picture_frame/update_icon()
|
||||
cut_overlays()
|
||||
if(framed)
|
||||
add_overlay(getFlatIcon(framed))
|
||||
|
||||
/obj/structure/sign/picture_frame/deconstruct(disassembled = TRUE)
|
||||
if(!(flags_1 & NODECONSTRUCT_1))
|
||||
var/obj/item/wallframe/picture/F = new /obj/item/wallframe/picture(loc)
|
||||
if(framed)
|
||||
F.displayed = framed
|
||||
framed = null
|
||||
if(contents.len)
|
||||
var/obj/item/I = pick(contents)
|
||||
I.forceMove(F)
|
||||
F.update_icon()
|
||||
qdel(src)
|
||||
@@ -1,43 +0,0 @@
|
||||
/*
|
||||
* Photo album
|
||||
*/
|
||||
/obj/item/storage/photo_album
|
||||
name = "photo album"
|
||||
icon = 'icons/obj/items_and_weapons.dmi'
|
||||
icon_state = "album"
|
||||
item_state = "briefcase"
|
||||
lefthand_file = 'icons/mob/inhands/equipment/briefcase_lefthand.dmi'
|
||||
righthand_file = 'icons/mob/inhands/equipment/briefcase_righthand.dmi'
|
||||
resistance_flags = FLAMMABLE
|
||||
var/persistence_id
|
||||
|
||||
/obj/item/storage/photo_album/Initialize()
|
||||
. = ..()
|
||||
GET_COMPONENT(STR, /datum/component/storage)
|
||||
STR.can_hold = typecacheof(list(/obj/item/photo))
|
||||
LAZYADD(SSpersistence.photo_albums, src)
|
||||
|
||||
/obj/item/storage/photo_album/Destroy()
|
||||
LAZYREMOVE(SSpersistence.photo_albums, src)
|
||||
return ..()
|
||||
|
||||
/obj/item/storage/photo_album/proc/get_picture_id_list()
|
||||
var/list/L = list()
|
||||
for(var/i in contents)
|
||||
if(istype(i, /obj/item/photo))
|
||||
L += i
|
||||
if(!L.len)
|
||||
return
|
||||
. = list()
|
||||
for(var/i in L)
|
||||
var/obj/item/photo/P = i
|
||||
if(!istype(P.picture))
|
||||
continue
|
||||
. |= P.picture.id
|
||||
|
||||
/obj/item/storage/photo_album/proc/populate_from_id_list(list/ids)
|
||||
for(var/i in ids)
|
||||
var/obj/item/photo/P = load_photo_from_disk(i)
|
||||
if(istype(P))
|
||||
if(!SEND_SIGNAL(src, COMSIG_TRY_STORAGE_INSERT, P, null, TRUE, TRUE))
|
||||
qdel(P)
|
||||
@@ -1,86 +0,0 @@
|
||||
/*
|
||||
* Photo
|
||||
*/
|
||||
/obj/item/photo
|
||||
name = "photo"
|
||||
icon = 'icons/obj/items_and_weapons.dmi'
|
||||
icon_state = "photo"
|
||||
item_state = "paper"
|
||||
w_class = WEIGHT_CLASS_TINY
|
||||
resistance_flags = FLAMMABLE
|
||||
max_integrity = 50
|
||||
grind_results = list("iodine" = 4)
|
||||
var/datum/picture/picture
|
||||
var/scribble //Scribble on the back.
|
||||
var/sillynewscastervar //Photo objects with this set to 1 will not be ejected by a newscaster. Only gets set to 1 if a silicon puts one of their images into a newscaster
|
||||
|
||||
/obj/item/photo/Initialize(mapload, datum/picture/P, datum_name = TRUE, datum_desc = TRUE)
|
||||
set_picture(P, datum_name, datum_desc)
|
||||
return ..()
|
||||
|
||||
/obj/item/photo/proc/set_picture(datum/picture/P, setname, setdesc)
|
||||
if(!istype(P))
|
||||
return
|
||||
picture = P
|
||||
update_icon()
|
||||
if(P.caption)
|
||||
scribble = P.caption
|
||||
if(setname && P.picture_name)
|
||||
name = P.picture_name
|
||||
if(setdesc && P.picture_desc)
|
||||
desc = P.picture_desc
|
||||
|
||||
/obj/item/photo/update_icon()
|
||||
var/icon/I = picture.get_small_icon()
|
||||
if(I)
|
||||
icon = I
|
||||
|
||||
/obj/item/photo/suicide_act(mob/living/carbon/user)
|
||||
user.visible_message("<span class='suicide'>[user] is taking one last look at \the [src]! It looks like [user.p_theyre()] giving in to death!</span>")//when you wanna look at photo of waifu one last time before you die...
|
||||
if (user.gender == MALE)
|
||||
playsound(user, 'sound/voice/human/manlaugh1.ogg', 50, 1)//EVERY TIME I DO IT MAKES ME LAUGH
|
||||
else if (user.gender == FEMALE)
|
||||
playsound(user, 'sound/voice/human/womanlaugh.ogg', 50, 1)
|
||||
return OXYLOSS
|
||||
|
||||
/obj/item/photo/attack_self(mob/user)
|
||||
user.examinate(src)
|
||||
|
||||
/obj/item/photo/attackby(obj/item/P, mob/user, params)
|
||||
if(istype(P, /obj/item/pen) || istype(P, /obj/item/toy/crayon))
|
||||
if(!user.is_literate())
|
||||
to_chat(user, "<span class='notice'>You scribble illegibly on [src]!</span>")
|
||||
return
|
||||
var/txt = sanitize(input(user, "What would you like to write on the back?", "Photo Writing", null) as text)
|
||||
txt = copytext(txt, 1, 128)
|
||||
if(user.canUseTopic(src, BE_CLOSE))
|
||||
scribble = txt
|
||||
..()
|
||||
|
||||
/obj/item/photo/examine(mob/user)
|
||||
..()
|
||||
|
||||
if(in_range(src, user))
|
||||
show(user)
|
||||
else
|
||||
to_chat(user, "<span class='warning'>You need to get closer to get a good look at this photo!</span>")
|
||||
|
||||
/obj/item/photo/proc/show(mob/user)
|
||||
user << browse_rsc(picture.picture_image, "tmp_photo.png")
|
||||
user << browse("<html><head><title>[name]</title></head>" \
|
||||
+ "<body style='overflow:hidden;margin:0;text-align:center'>" \
|
||||
+ "<img src='tmp_photo.png' width='[picture.psize_y]' style='-ms-interpolation-mode:nearest-neighbor' />" \
|
||||
+ "[scribble ? "<br>Written on the back:<br><i>[scribble]</i>" : ""]"\
|
||||
+ "</body></html>", "window=photo_showing;size=[picture.psize_x + scribble? 128:0]x[picture.psize_y + scribble? 128:0]")
|
||||
onclose(user, "[name]")
|
||||
|
||||
/obj/item/photo/verb/rename()
|
||||
set name = "Rename photo"
|
||||
set category = "Object"
|
||||
set src in usr
|
||||
|
||||
var/n_name = copytext(sanitize(input(usr, "What would you like to label the photo?", "Photo Labelling", null) as text), 1, MAX_NAME_LEN)
|
||||
//loc.loc check is for making possible renaming photos in clipboards
|
||||
if((loc == usr || loc.loc && loc.loc == usr) && usr.stat == CONSCIOUS && usr.canmove && !usr.restrained())
|
||||
name = "photo[(n_name ? text("- '[n_name]'") : null)]"
|
||||
add_fingerprint(usr)
|
||||
Reference in New Issue
Block a user