From 80cede3490f69fbecfd897d9f4aaffcf5fd9d020 Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Sun, 21 Mar 2021 02:04:35 +0100 Subject: [PATCH] [MIRROR] Stack splitting now uses right click (#4283) * Stack splitting now uses right click (#57837) Co-authored-by: Arkatos * Stack splitting now uses right click Co-authored-by: Arkatos1 <43862960+Arkatos1@users.noreply.github.com> Co-authored-by: Arkatos --- code/game/objects/items/stacks/stack.dm | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/code/game/objects/items/stacks/stack.dm b/code/game/objects/items/stacks/stack.dm index eb1a36fec3a..0c63f2af74f 100644 --- a/code/game/objects/items/stacks/stack.dm +++ b/code/game/objects/items/stacks/stack.dm @@ -152,7 +152,7 @@ . += "There are [get_amount()] in the stack." else . += "There is [get_amount()] in the stack." - . += "Alt-click to take a custom amount." + . += "Right-click with an empty hand to take a custom amount." /obj/item/stack/proc/get_amount() if(is_cyborg) @@ -456,21 +456,18 @@ else . = ..() -/obj/item/stack/AltClick(mob/living/user) - . = ..() - if(isturf(loc)) // to prevent people that are alt clicking a tile to see its content from getting undesidered pop ups - return +/obj/item/stack/attack_hand_secondary(mob/user, modifiers) if(is_cyborg || !user.canUseTopic(src, BE_CLOSE, NO_DEXTERITY, FALSE, !iscyborg(user)) || zero_amount()) - return - //get amount from user + return SECONDARY_ATTACK_CONTINUE_CHAIN var/max = get_amount() - var/stackmaterial = round(input(user,"How many sheets do you wish to take out of this stack? (Maximum [max])") as null|num) + var/stackmaterial = round(input(user, "How many sheets do you wish to take out of this stack? (Maximum [max])", "Stack Split") as null|num) max = get_amount() stackmaterial = min(max, stackmaterial) if(stackmaterial == null || stackmaterial <= 0 || !user.canUseTopic(src, BE_CLOSE, NO_DEXTERITY, FALSE, !iscyborg(user))) - return + return SECONDARY_ATTACK_CONTINUE_CHAIN split_stack(user, stackmaterial) to_chat(user, "You take [stackmaterial] sheets out of the stack.") + return SECONDARY_ATTACK_CANCEL_ATTACK_CHAIN /** Splits the stack into two stacks. *