- 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:
baloh.matevz
2012-08-18 01:21:12 +00:00
parent 413dd153dc
commit 73ec1110cd
6 changed files with 13 additions and 78 deletions

View File

@@ -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
var/mob/M = usr
if (!( istype(over_object, /obj/screen) ))
return ..()
playsound(src.loc, "rustle", 50, 1, -5)
if ((!( M.restrained() ) && !( M.stat ) && M.back == src))
if ((!( M.restrained() ) && !( M.stat ))
switch(over_object.name)
if("r_hand")
M.u_equip(src)

View File

@@ -86,26 +86,3 @@
/obj/item/weapon/storage/bible/attackby(obj/item/weapon/W as obj, mob/user as mob)
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

View File

@@ -16,16 +16,6 @@
name = "donut box"
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)
var/total_contents = src.contents.len - itemremoved
src.icon_state = "[src.icon_type]box[total_contents]"

View File

@@ -225,7 +225,8 @@
src.orient2hud(usr)
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
/obj/item/weapon/storage/proc/remove_from_storage(obj/item/W as obj, atom/new_location)
@@ -248,10 +249,11 @@
if(usr)
src.orient2hud(usr)
if(usr.s_active)
src.show_to(usr)
usr.s_active.show_to(usr)
if(W.maptext)
W.maptext = ""
W.on_exit_storage(src)
update_icon()
//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)