From 9975eabef6131d5437249670c5cbfcbf6d788a29 Mon Sep 17 00:00:00 2001 From: The Sharkening <95130227+StrangeWeirdKitten@users.noreply.github.com> Date: Wed, 1 May 2024 19:18:33 -0600 Subject: [PATCH] Stamp papers quickly with a right click (#82993) ## About The Pull Request Right clicking a paper with a stamp will quickly place down the stamp ## Why It's Good For The Game ![fast](https://github.com/tgstation/tgstation/assets/95130227/de3eab11-e8bf-4266-aab6-97c8434663d7) ## Changelog :cl: qol: You can now quickly stamp papers with a right click /:cl: --------- Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com> --- code/modules/paperwork/paper.dm | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/code/modules/paperwork/paper.dm b/code/modules/paperwork/paper.dm index 605e88f1e48..5dd5515c47c 100644 --- a/code/modules/paperwork/paper.dm +++ b/code/modules/paperwork/paper.dm @@ -441,8 +441,8 @@ // Handle stamping items. if(writing_stats["interaction_mode"] == MODE_STAMPING) if(!user.can_read(src) || user.is_blind()) - //The paper's stampable window area is assumed approx 400x500 - add_stamp(writing_stats["stamp_class"], rand(0, 400), rand(0, 500), rand(0, 360), writing_stats["stamp_icon_state"]) + //The paper's stampable window area is assumed approx 300x400 + add_stamp(writing_stats["stamp_class"], rand(0, 300), rand(0, 400), rand(0, 360), writing_stats["stamp_icon_state"]) user.visible_message(span_notice("[user] blindly stamps [src] with \the [attacking_item]!")) to_chat(user, span_notice("You stamp [src] with \the [attacking_item] the best you can!")) playsound(src, 'sound/items/handling/standard_stamp.ogg', 50, vary = TRUE) @@ -454,6 +454,25 @@ ui_interact(user) return ..() +/// Secondary right click interaction to quickly stamp things +/obj/item/paper/item_interaction_secondary(mob/living/user, obj/item/tool, list/modifiers) + var/list/writing_stats = tool.get_writing_implement_details() + + if(!length(writing_stats)) + return NONE + if(writing_stats["interaction_mode"] != MODE_STAMPING) + return NONE + if(!user.can_read(src) || user.is_blind()) // Just leftclick instead + return NONE + + add_stamp(writing_stats["stamp_class"], rand(1, 300), rand(1, 400), stamp_icon_state = writing_stats["stamp_icon_state"]) + user.visible_message( + span_notice("[user] quickly stamps [src] with [tool] without looking."), + span_notice("You quickly stamp [src] with [tool] without looking."), + ) + playsound(src, 'sound/items/handling/standard_stamp.ogg', 50, vary = TRUE) + + return ITEM_INTERACT_BLOCKING // Stop the UI from opening. /** * Attempts to ui_interact the paper to the given user, with some sanity checking * to make sure the camera still exists via the weakref and that this paper is still