From d8e6893e359a635127d4cd2920e324b60154bf89 Mon Sep 17 00:00:00 2001 From: Krausus Date: Fri, 8 May 2015 07:20:44 -0400 Subject: [PATCH 1/3] Improves dumping of "quick" containers Allows all "quick" containers to be dumped into a disposal (click) or onto a table (drag-drop). --- .../objects/items/weapons/storage/storage.dm | 12 ++++++++++ code/modules/recycling/disposal.dm | 24 +++++++------------ 2 files changed, 20 insertions(+), 16 deletions(-) diff --git a/code/game/objects/items/weapons/storage/storage.dm b/code/game/objects/items/weapons/storage/storage.dm index b22b813d1c1..e705521954d 100644 --- a/code/game/objects/items/weapons/storage/storage.dm +++ b/code/game/objects/items/weapons/storage/storage.dm @@ -38,6 +38,18 @@ show_to(M) return + if((allow_quick_empty || allow_quick_gather) && istype(over_object, /obj/structure/table) \ + && contents.len && over_object.Adjacent(usr)) + var/turf/T = get_turf(over_object) + hide_from(usr) + usr.face_atom(src) + usr.visible_message("[usr] empties \the [src] onto \the [over_object].", + "You empty \the [src] onto \the [over_object].") + for(var/obj/item/I in contents) + remove_from_storage(I, T) + update_icon() // For content-sensitive icons + return + if (!( istype(over_object, /obj/screen) )) return ..() if (!(src.loc == usr) || (src.loc && src.loc.loc == usr)) diff --git a/code/modules/recycling/disposal.dm b/code/modules/recycling/disposal.dm index d1506aa8dbc..5bc8b20a6bb 100644 --- a/code/modules/recycling/disposal.dm +++ b/code/modules/recycling/disposal.dm @@ -93,22 +93,14 @@ user << "You can't place that item inside the disposal unit." return - if(istype(I, /obj/item/weapon/storage/bag/trash)) - var/obj/item/weapon/storage/bag/trash/T = I - if(T.contents.len) - user << "\blue You empty the bag." - for(var/obj/item/O in T.contents) - T.remove_from_storage(O,src) - T.update_icon() - update() - return - - if(istype(I, /obj/item/weapon/storage/part_replacer)) - var/obj/item/weapon/storage/part_replacer/P = I - if(P.contents.len) - user << "\blue You empty the RPED's contents." - for(var/obj/item/O in P.contents) - P.remove_from_storage(O,src) + if(istype(I, /obj/item/weapon/storage)) + var/obj/item/weapon/storage/S = I + if((S.allow_quick_empty || S.allow_quick_gather) && S.contents.len) + S.hide_from(user) + user.visible_message("[user] empties \the [S] into \the [src].", "You empty \the [S] into \the [src].") + for(var/obj/item/O in S.contents) + S.remove_from_storage(O, src) + S.update_icon() // For content-sensitive icons update() return From 5567c99a44ff6ef512c4689f14569db7b454e90d Mon Sep 17 00:00:00 2001 From: Krausus Date: Sat, 9 May 2015 02:25:38 -0400 Subject: [PATCH 2/3] Adds drag-drop emptying to all containers Also, fixes several missing checks and a facing mistake. --- code/game/objects/items/weapons/storage/storage.dm | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/code/game/objects/items/weapons/storage/storage.dm b/code/game/objects/items/weapons/storage/storage.dm index e705521954d..db813980846 100644 --- a/code/game/objects/items/weapons/storage/storage.dm +++ b/code/game/objects/items/weapons/storage/storage.dm @@ -38,11 +38,19 @@ show_to(M) return - if((allow_quick_empty || allow_quick_gather) && istype(over_object, /obj/structure/table) \ - && contents.len && over_object.Adjacent(usr)) + if ((istype(over_object, /obj/structure/table) || istype(over_object, /turf/simulated/floor)) \ + && contents.len && loc == usr && !usr.stat && !usr.restrained() && over_object.Adjacent(usr) \ + && !istype(src, /obj/item/weapon/storage/lockbox)) var/turf/T = get_turf(over_object) + if (istype(over_object, /turf/simulated/floor)) + if (get_turf(usr) != T) + return // Can only empty containers onto the floor under you + if("Yes" != alert(usr,"Empty \the [src] onto \the [T]?","Confirm","Yes","No")) + return + if(!(usr && over_object && contents.len && loc == usr && !usr.stat && !usr.restrained() && get_turf(usr) == T)) + return // Something happened while the player was thinking hide_from(usr) - usr.face_atom(src) + usr.face_atom(over_object) usr.visible_message("[usr] empties \the [src] onto \the [over_object].", "You empty \the [src] onto \the [over_object].") for(var/obj/item/I in contents) From 6ef0c009214be9e2b13001fd5cbaa9a806ff405a Mon Sep 17 00:00:00 2001 From: Krausus Date: Sat, 9 May 2015 07:41:21 -0400 Subject: [PATCH 3/3] Adds missing canmove check --- code/game/objects/items/weapons/storage/storage.dm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/game/objects/items/weapons/storage/storage.dm b/code/game/objects/items/weapons/storage/storage.dm index db813980846..613fe2d844c 100644 --- a/code/game/objects/items/weapons/storage/storage.dm +++ b/code/game/objects/items/weapons/storage/storage.dm @@ -39,7 +39,7 @@ return if ((istype(over_object, /obj/structure/table) || istype(over_object, /turf/simulated/floor)) \ - && contents.len && loc == usr && !usr.stat && !usr.restrained() && over_object.Adjacent(usr) \ + && contents.len && loc == usr && !usr.stat && !usr.restrained() && usr.canmove && over_object.Adjacent(usr) \ && !istype(src, /obj/item/weapon/storage/lockbox)) var/turf/T = get_turf(over_object) if (istype(over_object, /turf/simulated/floor)) @@ -47,7 +47,7 @@ return // Can only empty containers onto the floor under you if("Yes" != alert(usr,"Empty \the [src] onto \the [T]?","Confirm","Yes","No")) return - if(!(usr && over_object && contents.len && loc == usr && !usr.stat && !usr.restrained() && get_turf(usr) == T)) + if(!(usr && over_object && contents.len && loc == usr && !usr.stat && !usr.restrained() && usr.canmove && get_turf(usr) == T)) return // Something happened while the player was thinking hide_from(usr) usr.face_atom(over_object)