Merge pull request #7916 from deathride58/altclicktoopenstorageport

Ports tgstation/tgstation#41712 - Open storage by alt clicking
This commit is contained in:
nik707
2019-01-14 22:22:17 -06:00
committed by GitHub
+21 -7
View File
@@ -732,16 +732,30 @@
return hide_from(target)
/datum/component/storage/proc/on_alt_click(datum/source, mob/user)
if(!isliving(user) || user.incapacitated() || !quickdraw || locked || !user.CanReach(parent))
if(!isliving(user) || !user.CanReach(parent))
return
var/obj/item/I = locate() in real_location()
if(!I)
if(locked)
to_chat(user, "<span class='warning'>[parent] seems to be locked!</span>")
return
remove_from_storage(I, get_turf(user))
if(!user.put_in_hands(I))
to_chat(user, "<span class='notice'>You fumble for [I] and it falls on the floor.</span>")
var/atom/A = parent
if(!quickdraw)
A.add_fingerprint(user)
user_show_to_mob(user)
playsound(A, "rustle", 50, 1, -5)
return
if(!user.incapacitated())
var/obj/item/I = locate() in real_location()
if(!I)
return
A.add_fingerprint(user)
remove_from_storage(I, get_turf(user))
if(!user.put_in_hands(I))
to_chat(user, "<span class='notice'>You fumble for [I] and it falls on the floor.</span>")
return
user.visible_message("<span class='warning'>[user] draws [I] from [parent]!</span>", "<span class='notice'>You draw [I] from [parent].</span>")
return
user.visible_message("<span class='warning'>[user] draws [I] from [parent]!</span>", "<span class='notice'>You draw [I] from [parent].</span>")
/datum/component/storage/proc/action_trigger(datum/signal_source, datum/action/source)
gather_mode_switch(source.owner)