aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.Client/Common/UI/IUIScene_AbstractContainerMenu.cpp
diff options
context:
space:
mode:
authordaoge_cmd <3523206925@qq.com>2026-03-03 04:59:08 +0800
committerdaoge_cmd <3523206925@qq.com>2026-03-03 04:59:08 +0800
commit8f6647b5d89bbb56eeda727dfee9916d8514104d (patch)
tree38ef3b1a294bfac7d6cf220eaa1b2470cd239a6a /Minecraft.Client/Common/UI/IUIScene_AbstractContainerMenu.cpp
parentf917335b132f527c436a32f07636f503614c4e69 (diff)
fix: fix mouse and controller input handling in container menus
Diffstat (limited to 'Minecraft.Client/Common/UI/IUIScene_AbstractContainerMenu.cpp')
-rw-r--r--Minecraft.Client/Common/UI/IUIScene_AbstractContainerMenu.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/Minecraft.Client/Common/UI/IUIScene_AbstractContainerMenu.cpp b/Minecraft.Client/Common/UI/IUIScene_AbstractContainerMenu.cpp
index ffe83081..1b76141d 100644
--- a/Minecraft.Client/Common/UI/IUIScene_AbstractContainerMenu.cpp
+++ b/Minecraft.Client/Common/UI/IUIScene_AbstractContainerMenu.cpp
@@ -21,6 +21,7 @@ IUIScene_AbstractContainerMenu::IUIScene_AbstractContainerMenu()
m_pointerPos.x = 0.0f;
m_pointerPos.y = 0.0f;
+ m_bPointerDrivenByMouse = false;
}
@@ -357,6 +358,7 @@ void IUIScene_AbstractContainerMenu::onMouseTick()
// If there is any input on sticks, move the pointer.
if ( ( fabs( fInputX ) >= 0.01f ) || ( fabs( fInputY ) >= 0.01f ) )
{
+ m_bPointerDrivenByMouse = false;
fInputDirX = ( fInputX > 0.0f ) ? 1.0f : ( fInputX < 0.0f )?-1.0f : 0.0f;
fInputDirY = ( fInputY > 0.0f ) ? 1.0f : ( fInputY < 0.0f )?-1.0f : 0.0f;
@@ -692,7 +694,7 @@ void IUIScene_AbstractContainerMenu::onMouseTick()
// If there is no stick input, and we are over a slot, then snap pointer to slot centre.
// 4J - TomK - only if this particular component allows so!
- if(CanHaveFocus(eSectionUnderPointer))
+ if(!m_bPointerDrivenByMouse && CanHaveFocus(eSectionUnderPointer))
{
vPointerPos.x = vSnapPos.x;
vPointerPos.y = vSnapPos.y;