mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-13 03:33:21 +00:00
- Fixed the issue which caused a storage item to be opened whenever you tried to put something in it. I could have sworn I fixed this one before...
- Moved update_icon() calls from storage/fancy to all storage items, whenever an item is added or removed from the storage item. Also renamed updateIcon() to update_icon(), since that's the obj-wide proc. - Part of fixing issue u - Removed crayon and crayonbox snowflake code - Removed bible snowflake code - Made the click-drag to move to l_hand or r_hand thing something that works on all storage items. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4484 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
@@ -186,9 +186,11 @@
|
|||||||
usr << "\red [src] is locked and cannot be opened!"
|
usr << "\red [src] is locked and cannot be opened!"
|
||||||
else if ((src.loc == user) && (!src.locked))
|
else if ((src.loc == user) && (!src.locked))
|
||||||
playsound(src.loc, "rustle", 50, 1, -5)
|
playsound(src.loc, "rustle", 50, 1, -5)
|
||||||
if (user.s_active)
|
if (user.s_active == src)
|
||||||
user.s_active.close(user)
|
user.s_active.close(user) //Close and re-open
|
||||||
src.show_to(user)
|
src.show_to(user)
|
||||||
|
else
|
||||||
|
user.s_active.close(user) //Just close
|
||||||
else
|
else
|
||||||
..()
|
..()
|
||||||
for(var/mob/M in range(1))
|
for(var/mob/M in range(1))
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
/obj/item/weapon/storage/backpack/MouseDrop(obj/over_object as obj)
|
/obj/item/weapon/storage/MouseDrop(obj/over_object as obj)
|
||||||
if (ishuman(usr) || ismonkey(usr)) //so monkeys can take off their backpacks -- Urist
|
if (ishuman(usr) || ismonkey(usr)) //so monkeys can take off their backpacks -- Urist
|
||||||
var/mob/M = usr
|
var/mob/M = usr
|
||||||
if (!( istype(over_object, /obj/screen) ))
|
if (!( istype(over_object, /obj/screen) ))
|
||||||
return ..()
|
return ..()
|
||||||
playsound(src.loc, "rustle", 50, 1, -5)
|
playsound(src.loc, "rustle", 50, 1, -5)
|
||||||
if ((!( M.restrained() ) && !( M.stat ) && M.back == src))
|
if ((!( M.restrained() ) && !( M.stat ))
|
||||||
switch(over_object.name)
|
switch(over_object.name)
|
||||||
if("r_hand")
|
if("r_hand")
|
||||||
M.u_equip(src)
|
M.u_equip(src)
|
||||||
|
|||||||
@@ -86,26 +86,3 @@
|
|||||||
/obj/item/weapon/storage/bible/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
/obj/item/weapon/storage/bible/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||||
playsound(src.loc, "rustle", 50, 1, -5)
|
playsound(src.loc, "rustle", 50, 1, -5)
|
||||||
..()
|
..()
|
||||||
|
|
||||||
/obj/item/weapon/storage/bible/MouseDrop(obj/over_object as obj)
|
|
||||||
|
|
||||||
if (ishuman(usr) || ismonkey(usr))
|
|
||||||
var/mob/M = usr
|
|
||||||
if (!( istype(over_object, /obj/screen) ))
|
|
||||||
return ..()
|
|
||||||
if ((!( M.restrained() ) && !( M.stat )))
|
|
||||||
switch(over_object.name)
|
|
||||||
if("r_hand")
|
|
||||||
M.u_equip(src)
|
|
||||||
M.put_in_r_hand(src)
|
|
||||||
if("l_hand")
|
|
||||||
M.u_equip(src)
|
|
||||||
M.put_in_l_hand(src)
|
|
||||||
src.add_fingerprint(usr)
|
|
||||||
return
|
|
||||||
if(over_object == usr && in_range(src, usr) || usr.contents.Find(src))
|
|
||||||
if (usr.s_active)
|
|
||||||
usr.s_active.close(usr)
|
|
||||||
src.show_to(usr)
|
|
||||||
return
|
|
||||||
return
|
|
||||||
|
|||||||
@@ -16,16 +16,6 @@
|
|||||||
name = "donut box"
|
name = "donut box"
|
||||||
var/icon_type = "donut"
|
var/icon_type = "donut"
|
||||||
|
|
||||||
/obj/item/weapon/storage/fancy/attack_hand(mob/user as mob)
|
|
||||||
..()
|
|
||||||
update_icon()
|
|
||||||
return
|
|
||||||
|
|
||||||
/obj/item/weapon/storage/fancy/attackby(obj/item/W as obj, mob/user as mob)
|
|
||||||
..()
|
|
||||||
update_icon()
|
|
||||||
return
|
|
||||||
|
|
||||||
/obj/item/weapon/storage/fancy/update_icon(var/itemremoved = 0)
|
/obj/item/weapon/storage/fancy/update_icon(var/itemremoved = 0)
|
||||||
var/total_contents = src.contents.len - itemremoved
|
var/total_contents = src.contents.len - itemremoved
|
||||||
src.icon_state = "[src.icon_type]box[total_contents]"
|
src.icon_state = "[src.icon_type]box[total_contents]"
|
||||||
|
|||||||
@@ -225,7 +225,8 @@
|
|||||||
|
|
||||||
src.orient2hud(usr)
|
src.orient2hud(usr)
|
||||||
if(usr.s_active)
|
if(usr.s_active)
|
||||||
src.show_to(usr)
|
usr.s_active.show_to(usr)
|
||||||
|
update_icon()
|
||||||
|
|
||||||
//Call this proc to handle the removal of an item from the storage item. The item will be moved to the atom sent as new_target
|
//Call this proc to handle the removal of an item from the storage item. The item will be moved to the atom sent as new_target
|
||||||
/obj/item/weapon/storage/proc/remove_from_storage(obj/item/W as obj, atom/new_location)
|
/obj/item/weapon/storage/proc/remove_from_storage(obj/item/W as obj, atom/new_location)
|
||||||
@@ -248,10 +249,11 @@
|
|||||||
if(usr)
|
if(usr)
|
||||||
src.orient2hud(usr)
|
src.orient2hud(usr)
|
||||||
if(usr.s_active)
|
if(usr.s_active)
|
||||||
src.show_to(usr)
|
usr.s_active.show_to(usr)
|
||||||
if(W.maptext)
|
if(W.maptext)
|
||||||
W.maptext = ""
|
W.maptext = ""
|
||||||
W.on_exit_storage(src)
|
W.on_exit_storage(src)
|
||||||
|
update_icon()
|
||||||
|
|
||||||
//This proc is called when you want to place an item into the storage item.
|
//This proc is called when you want to place an item into the storage item.
|
||||||
/obj/item/weapon/storage/attackby(obj/item/W as obj, mob/user as mob)
|
/obj/item/weapon/storage/attackby(obj/item/W as obj, mob/user as mob)
|
||||||
|
|||||||
@@ -10,9 +10,9 @@ CRAYONS
|
|||||||
new /obj/item/toy/crayon/green(src)
|
new /obj/item/toy/crayon/green(src)
|
||||||
new /obj/item/toy/crayon/blue(src)
|
new /obj/item/toy/crayon/blue(src)
|
||||||
new /obj/item/toy/crayon/purple(src)
|
new /obj/item/toy/crayon/purple(src)
|
||||||
updateIcon()
|
update_icon()
|
||||||
|
|
||||||
/obj/item/weapon/storage/crayonbox/proc/updateIcon()
|
/obj/item/weapon/storage/crayonbox/update_icon()
|
||||||
overlays = list() //resets list
|
overlays = list() //resets list
|
||||||
overlays += image('icons/obj/crayons.dmi',"crayonbox")
|
overlays += image('icons/obj/crayons.dmi',"crayonbox")
|
||||||
for(var/obj/item/toy/crayon/crayon in contents)
|
for(var/obj/item/toy/crayon/crayon in contents)
|
||||||
@@ -28,34 +28,6 @@ CRAYONS
|
|||||||
usr << "This crayon is too powerful to be contained in this box."
|
usr << "This crayon is too powerful to be contained in this box."
|
||||||
return
|
return
|
||||||
..()
|
..()
|
||||||
updateIcon()
|
|
||||||
|
|
||||||
/obj/item/weapon/storage/crayonbox/attack_hand(mob/user as mob)
|
|
||||||
updateIcon()
|
|
||||||
..()
|
|
||||||
|
|
||||||
/obj/item/weapon/storage/crayonbox/MouseDrop(obj/over_object as obj)
|
|
||||||
|
|
||||||
if (ishuman(usr) || ismonkey(usr))
|
|
||||||
var/mob/M = usr
|
|
||||||
if (!( istype(over_object, /obj/screen) ))
|
|
||||||
return ..()
|
|
||||||
if ((!( M.restrained() ) && !( M.stat )))
|
|
||||||
switch(over_object.name)
|
|
||||||
if("r_hand")
|
|
||||||
M.u_equip(src)
|
|
||||||
M.put_in_r_hand(src)
|
|
||||||
if("l_hand")
|
|
||||||
M.u_equip(src)
|
|
||||||
M.put_in_l_hand(src)
|
|
||||||
src.add_fingerprint(usr)
|
|
||||||
return
|
|
||||||
if(over_object == usr && in_range(src, usr) || usr.contents.Find(src))
|
|
||||||
if (usr.s_active)
|
|
||||||
usr.s_active.close(usr)
|
|
||||||
src.show_to(usr)
|
|
||||||
return
|
|
||||||
return
|
|
||||||
|
|
||||||
/obj/item/toy/crayon/red
|
/obj/item/toy/crayon/red
|
||||||
icon_state = "crayonred"
|
icon_state = "crayonred"
|
||||||
@@ -157,14 +129,6 @@ CRAYONS
|
|||||||
else
|
else
|
||||||
..()
|
..()
|
||||||
|
|
||||||
/obj/item/toy/crayon/attack_hand(mob/user as mob)
|
|
||||||
var/obj/item/weapon/storage/crayonbox/CB
|
|
||||||
if(istype(src.loc, /obj/item/weapon/storage/crayonbox))
|
|
||||||
CB = src.loc
|
|
||||||
..()
|
|
||||||
if(CB)
|
|
||||||
CB.updateIcon()
|
|
||||||
|
|
||||||
/obj/effect/decal/cleanable/crayon
|
/obj/effect/decal/cleanable/crayon
|
||||||
name = "rune"
|
name = "rune"
|
||||||
desc = "A rune drawn in crayon."
|
desc = "A rune drawn in crayon."
|
||||||
|
|||||||
Reference in New Issue
Block a user