From c3622c3e1617c9331fe9b4b8a7d19ffd4200f501 Mon Sep 17 00:00:00 2001 From: Joshua Kidder <49173900+Metekillot@users.noreply.github.com> Date: Sun, 12 May 2024 02:21:54 -0400 Subject: [PATCH] Enables right click, alt click, ctrl click for alt-click item window (#83179) ## About The Pull Request This fix enables most of the clicks that have been disabled in the alt click menu up to this point. However, I did have to cut out the pointing thing it would do for right clicking. The only thing you aren't able to do with the new alt-click menu at this point is dragging items onto each other, pointing, and the shift-click context menu. Maybe we'll leave that for another PR, because I think I'd have to rewrite core components of TGUI for that? ## Why It's Good For The Game Lets you perform almost all of the alternative and right click functions on things you have alt-clicked the tiles for. I believe this outweighs the benefits of pointing at stuff on a tile instead. ## Changelog The alt-click item panel now lets you perform most of the alternative click options. :cl: Bisar qol: Most of the alternate click modes (right click, control clicking, shift clicking, etc) have been enabled in the alt-click item menu. fix: You will no longer point at things you right-click in the alt-click item menu. /:cl: --- code/modules/lootpanel/ui.dm | 5 +++++ tgui/packages/tgui/interfaces/LootPanel/LootBox.tsx | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/code/modules/lootpanel/ui.dm b/code/modules/lootpanel/ui.dm index c7f0cf2358d..14d41b02b79 100644 --- a/code/modules/lootpanel/ui.dm +++ b/code/modules/lootpanel/ui.dm @@ -36,6 +36,11 @@ modifiers += "middle=1;" if(params["shift"]) modifiers += "shift=1;" + if(params["alt"]) + modifiers += "alt=1;" + if(params["right"]) + modifiers += "right=1;" + user.ClickOn(thing, modifiers) diff --git a/tgui/packages/tgui/interfaces/LootPanel/LootBox.tsx b/tgui/packages/tgui/interfaces/LootPanel/LootBox.tsx index 613db1ead53..137021b34ef 100644 --- a/tgui/packages/tgui/interfaces/LootPanel/LootBox.tsx +++ b/tgui/packages/tgui/interfaces/LootPanel/LootBox.tsx @@ -36,6 +36,7 @@ export function LootBox(props: Props) { className="SearchItem--box" onClick={(event) => act('grab', { + alt: event.altKey, ctrl: event.ctrlKey, ref: item.ref, shift: event.shiftKey, @@ -44,9 +45,8 @@ export function LootBox(props: Props) { onContextMenu={(event) => { event.preventDefault(); act('grab', { - middle: true, + right: true, ref: item.ref, - shift: true, }); }} >