Merge pull request #508 from Citadel-Station-13/upstream-merge-26337
[MIRROR] Refactors picture frames to use wall frames system
This commit is contained in:
@@ -787,7 +787,8 @@ GLOBAL_LIST_INIT(WALLITEMS, typecacheof(list(
|
||||
/obj/machinery/newscaster, /obj/machinery/firealarm, /obj/structure/noticeboard, /obj/machinery/button,
|
||||
/obj/machinery/computer/security/telescreen, /obj/machinery/embedded_controller/radio/simple_vent_controller,
|
||||
/obj/item/weapon/storage/secure/safe, /obj/machinery/door_timer, /obj/machinery/flasher, /obj/machinery/keycard_auth,
|
||||
/obj/structure/mirror, /obj/structure/fireaxecabinet, /obj/machinery/computer/security/telescreen/entertainment
|
||||
/obj/structure/mirror, /obj/structure/fireaxecabinet, /obj/machinery/computer/security/telescreen/entertainment,
|
||||
/obj/structure/sign/picture_frame
|
||||
)))
|
||||
|
||||
GLOBAL_LIST_INIT(WALLITEMS_EXTERNAL, typecacheof(list(
|
||||
|
||||
@@ -215,7 +215,6 @@
|
||||
/obj/item/wallframe/button
|
||||
name = "button frame"
|
||||
desc = "Used for building buttons."
|
||||
icon = 'icons/obj/apc_repair.dmi'
|
||||
icon_state = "button_frame"
|
||||
icon_state = "button"
|
||||
result_path = /obj/machinery/button
|
||||
materials = list(MAT_METAL=MINERAL_MATERIAL_AMOUNT)
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
/obj/item/weapon/electronics/firealarm
|
||||
name = "fire alarm electronics"
|
||||
desc = "A circuit. It has a label on it, it says \"Can handle heat levels up to 40 degrees celsius!\""
|
||||
desc = "A fire alarm circuit. Can handle heat levels up to 40 degrees celsius."
|
||||
|
||||
/obj/item/wallframe/firealarm
|
||||
name = "fire alarm frame"
|
||||
desc = "Used for building Fire Alarms"
|
||||
desc = "Used for building fire alarms"
|
||||
icon = 'icons/obj/monitors.dmi'
|
||||
icon_state = "fire_bitem"
|
||||
result_path = /obj/machinery/firealarm
|
||||
|
||||
@@ -784,8 +784,7 @@
|
||||
/obj/item/wallframe/turret_control
|
||||
name = "turret control frame"
|
||||
desc = "Used for building turret control panels"
|
||||
icon = 'icons/obj/apc_repair.dmi'
|
||||
icon_state = "apc_frame"
|
||||
icon_state = "apc"
|
||||
result_path = /obj/machinery/turretid
|
||||
materials = list(MAT_METAL=MINERAL_MATERIAL_AMOUNT)
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/obj/item/wallframe
|
||||
icon = 'icons/obj/wallframe.dmi'
|
||||
materials = list(MAT_METAL=MINERAL_MATERIAL_AMOUNT*2)
|
||||
flags = CONDUCT
|
||||
origin_tech = "materials=1;engineering=1"
|
||||
@@ -38,7 +39,7 @@
|
||||
if(inverse)
|
||||
ndir = turn(ndir, 180)
|
||||
|
||||
var/obj/O = new result_path(get_turf(user), ndir, 1)
|
||||
var/obj/O = new result_path(get_turf(user), ndir, TRUE)
|
||||
after_attach(O)
|
||||
|
||||
qdel(src)
|
||||
@@ -71,8 +72,7 @@
|
||||
/obj/item/wallframe/apc
|
||||
name = "\improper APC frame"
|
||||
desc = "Used for repairing or building APCs"
|
||||
icon = 'icons/obj/apc_repair.dmi'
|
||||
icon_state = "apc_frame"
|
||||
icon_state = "apc"
|
||||
result_path = /obj/machinery/power/apc
|
||||
inverse = 1
|
||||
|
||||
|
||||
@@ -142,7 +142,7 @@ GLOBAL_LIST_INIT(wood_recipes, list ( \
|
||||
new/datum/stack_recipe("book case", /obj/structure/bookcase, 4, time = 15, one_per_turf = 1, on_floor = 1), \
|
||||
new/datum/stack_recipe("drying rack", /obj/machinery/smartfridge/drying_rack, 10, time = 15, one_per_turf = 1, on_floor = 1), \
|
||||
new/datum/stack_recipe("dog bed", /obj/structure/bed/dogbed, 10, time = 10, one_per_turf = 1, on_floor = 1), \
|
||||
new/datum/stack_recipe("picture frame", /obj/item/weapon/picture_frame, 1, time = 10),\
|
||||
new/datum/stack_recipe("picture frame", /obj/item/wallframe/picture, 1, time = 10),\
|
||||
new/datum/stack_recipe("display case chassis", /obj/structure/displaycase_chassis, 5, one_per_turf = 1, on_floor = 1), \
|
||||
new/datum/stack_recipe("wooden buckler", /obj/item/weapon/shield/riot/buckler, 20, time = 40), \
|
||||
new/datum/stack_recipe("apiary", /obj/structure/beebox, 40, time = 50),\
|
||||
|
||||
@@ -144,6 +144,5 @@
|
||||
/obj/item/wallframe/extinguisher_cabinet
|
||||
name = "extinguisher cabinet frame"
|
||||
desc = "Used for building wall-mounted extinguisher cabinets."
|
||||
icon = 'icons/obj/apc_repair.dmi'
|
||||
icon_state = "extinguisher_frame"
|
||||
icon_state = "extinguisher"
|
||||
result_path = /obj/structure/extinguisher_cabinet
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
diff a/code/modules/mob/living/carbon/human/human_defense.dm b/code/modules/mob/living/carbon/human/human_defense.dm (rejected hunks)
|
||||
@@ -682,10 +682,10 @@
|
||||
status += "numb"
|
||||
if(status == "")
|
||||
status = "OK"
|
||||
- to_chat(src, " [status == "OK" ? "\blue" : "\red"] Your [LB.name] is [status].")
|
||||
+ to_chat(src, "\t [status == "OK" ? "\blue" : "\red"] Your [LB.name] is [status].")
|
||||
|
||||
for(var/obj/item/I in LB.embedded_objects)
|
||||
- to_chat(src, " <a href='byond://?src=\ref[src];embedded_object=\ref[I];embedded_limb=\ref[LB]' class='warning'>There is \a [I] embedded in your [LB.name]!</a>")
|
||||
+ to_chat(src, "\t <a href='byond://?src=\ref[src];embedded_object=\ref[I];embedded_limb=\ref[LB]' class='warning'>There is \a [I] embedded in your [LB.name]!</a>")
|
||||
|
||||
for(var/t in missing)
|
||||
to_chat(src, "<span class='boldannounce'>Your [parse_zone(t)] is missing!</span>")
|
||||
@@ -309,7 +309,7 @@
|
||||
var/icon/small_img = icon(temp)
|
||||
var/icon/ic = icon('icons/obj/items.dmi',"photo")
|
||||
small_img.Scale(8, 8)
|
||||
ic.Blend(small_img,ICON_OVERLAY, 10, 13)
|
||||
ic.Blend(small_img,ICON_OVERLAY, 13, 13)
|
||||
P.icon = ic
|
||||
P.img = temp
|
||||
P.desc = mobs
|
||||
@@ -326,7 +326,7 @@
|
||||
var/icon/small_img = icon(temp)
|
||||
var/icon/ic = icon('icons/obj/items.dmi',"photo")
|
||||
small_img.Scale(8, 8)
|
||||
ic.Blend(small_img,ICON_OVERLAY, 10, 13)
|
||||
ic.Blend(small_img,ICON_OVERLAY, 13, 13)
|
||||
var/icon = ic
|
||||
var/img = temp
|
||||
var/desc = mobs
|
||||
@@ -488,27 +488,28 @@
|
||||
|
||||
// Picture frames
|
||||
|
||||
/obj/item/weapon/picture_frame
|
||||
/obj/item/wallframe/picture
|
||||
name = "picture frame"
|
||||
desc = "The perfect showcase for your favorite deathtrap memories."
|
||||
icon = 'icons/obj/decals.dmi'
|
||||
materials = list()
|
||||
flags = 0
|
||||
icon_state = "frame-empty"
|
||||
result_path = /obj/structure/sign/picture_frame
|
||||
var/obj/item/weapon/photo/displayed
|
||||
|
||||
/obj/item/weapon/picture_frame/attackby(obj/item/I, mob/user)
|
||||
/obj/item/wallframe/picture/attackby(obj/item/I, mob/user)
|
||||
if(istype(I, /obj/item/weapon/photo))
|
||||
if(!displayed)
|
||||
var/obj/item/weapon/photo/P = I
|
||||
if(!user.transferItemToLoc(P, src))
|
||||
if(!user.transferItemToLoc(I, src))
|
||||
return
|
||||
displayed = P
|
||||
displayed = I
|
||||
update_icon()
|
||||
else
|
||||
to_chat(user, "<span class=notice>\The [src] already contains a photo.</span>")
|
||||
|
||||
..()
|
||||
|
||||
/obj/item/weapon/picture_frame/attack_hand(mob/user)
|
||||
/obj/item/wallframe/picture/attack_hand(mob/user)
|
||||
if(user.get_inactive_held_item() != src)
|
||||
..()
|
||||
return
|
||||
@@ -519,37 +520,31 @@
|
||||
displayed = null
|
||||
update_icon()
|
||||
|
||||
/obj/item/weapon/picture_frame/attack_self(mob/user)
|
||||
/obj/item/wallframe/picture/attack_self(mob/user)
|
||||
user.examinate(src)
|
||||
|
||||
/obj/item/weapon/picture_frame/examine(mob/user)
|
||||
/obj/item/wallframe/picture/examine(mob/user)
|
||||
if(user.is_holding(src) && displayed)
|
||||
displayed.show(user)
|
||||
else
|
||||
..()
|
||||
|
||||
/obj/item/weapon/picture_frame/update_icon()
|
||||
/obj/item/wallframe/picture/update_icon()
|
||||
cut_overlays()
|
||||
if(displayed)
|
||||
add_overlay(getFlatIcon(displayed))
|
||||
else
|
||||
icon_state = initial(icon_state)
|
||||
add_overlay("frame-overlay")
|
||||
|
||||
/obj/item/weapon/picture_frame/afterattack(atom/target, mob/user, proximity)
|
||||
var/turf/T = target
|
||||
if(!iswallturf(T))
|
||||
return
|
||||
user.visible_message("<span class='notice'>[user] fastens [src] to [T].</span>", \
|
||||
"<span class='notice'>You attach the sign to [T].</span>")
|
||||
playsound(T, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
var/obj/structure/sign/picture_frame/PF = new /obj/structure/sign/picture_frame(T)
|
||||
/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)
|
||||
qdel(src)
|
||||
|
||||
|
||||
/obj/structure/sign/picture_frame
|
||||
name = "picture frame"
|
||||
@@ -558,35 +553,33 @@
|
||||
icon_state = "frame-empty"
|
||||
var/obj/item/weapon/photo/framed
|
||||
|
||||
/obj/structure/sign/picture_frame/New(loc, dir, building)
|
||||
..()
|
||||
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/examine(mob/user)
|
||||
if(in_range(src, user) && framed)
|
||||
framed.show(user)
|
||||
else
|
||||
..()
|
||||
|
||||
/obj/structure/sign/picture_frame/attackby(obj/item/O, mob/user, params)
|
||||
if(istype(O, /obj/item/weapon/screwdriver))
|
||||
user.visible_message("<span class='notice'>[user] starts removing [src]...</span>", \
|
||||
"<span class='notice'>You start unfastening [src].</span>")
|
||||
playsound(src, O.usesound, 50, 1)
|
||||
if(!do_after(user, 30*O.toolspeed, target = src))
|
||||
return
|
||||
playsound(src, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
user.visible_message("<span class='notice'>[user] unfastens [src].</span>", \
|
||||
"<span class='notice'>You unfasten [src].</span>")
|
||||
var/obj/item/weapon/picture_frame/F = new /obj/item/weapon/picture_frame(get_turf(user))
|
||||
if(framed)
|
||||
F.displayed = framed
|
||||
framed = null
|
||||
if(contents.len)
|
||||
var/obj/item/I = pick(contents)
|
||||
I.forceMove(F)
|
||||
F.update_icon()
|
||||
qdel(src)
|
||||
/obj/structure/sign/picture_frame/attackby(obj/item/I, mob/user, params)
|
||||
if(istype(I, /obj/item/weapon/screwdriver) || istype(I, /obj/item/weapon/wrench))
|
||||
to_chat(user, "<span class='notice'>You start unsecuring [name]...</span>")
|
||||
playsound(loc, I.usesound, 50, 1)
|
||||
if(do_after(user, 30*I.toolspeed, target = src))
|
||||
playsound(loc, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
to_chat(user, "<span class='notice'>You unsecure [name].</span>")
|
||||
deconstruct()
|
||||
return
|
||||
|
||||
else if(istype(O, /obj/item/weapon/photo))
|
||||
else if(istype(I, /obj/item/weapon/photo))
|
||||
if(!framed)
|
||||
var/obj/item/weapon/photo/P = O
|
||||
var/obj/item/weapon/photo/P = I
|
||||
if(!user.transferItemToLoc(P, src))
|
||||
return
|
||||
framed = P
|
||||
@@ -604,5 +597,16 @@
|
||||
cut_overlays()
|
||||
if(framed)
|
||||
add_overlay(getFlatIcon(framed))
|
||||
else
|
||||
icon_state = initial(icon_state)
|
||||
add_overlay("frame-overlay")
|
||||
|
||||
/obj/structure/sign/picture_frame/deconstruct(disassembled = TRUE)
|
||||
if(!(flags & NODECONSTRUCT))
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user