mirror of
https://github.com/smartcmd/MinecraftConsoles.git
synced 2026-08-20 09:57:09 +00:00
Fix: player movement and input leaks when UI is active
This commit is contained in:
parent
31cc598b75
commit
1f67fe2959
|
|
@ -1606,7 +1606,7 @@ bool UIController::NavigateBack(int iPad, bool forceUsePad, EUIScene eScene, EUI
|
||||||
bool navComplete = false;
|
bool navComplete = false;
|
||||||
if( app.GetGameStarted() )
|
if( app.GetGameStarted() )
|
||||||
{
|
{
|
||||||
bool navComplete = m_groups[(int)eUIGroup_Fullscreen]->NavigateBack(iPad, eScene, eLayer);
|
navComplete = m_groups[(int)eUIGroup_Fullscreen]->NavigateBack(iPad, eScene, eLayer);
|
||||||
|
|
||||||
if(!navComplete && ( iPad != 255 ) && ( iPad >= 0 ) )
|
if(!navComplete && ( iPad != 255 ) && ( iPad >= 0 ) )
|
||||||
{
|
{
|
||||||
|
|
@ -1632,6 +1632,11 @@ bool UIController::NavigateBack(int iPad, bool forceUsePad, EUIScene eScene, EUI
|
||||||
navComplete = m_groups[(int)eUIGroup_Fullscreen]->NavigateBack(iPad, eScene, eLayer);
|
navComplete = m_groups[(int)eUIGroup_Fullscreen]->NavigateBack(iPad, eScene, eLayer);
|
||||||
if(!m_groups[(int)eUIGroup_Fullscreen]->GetMenuDisplayed()) SetMenuDisplayed(XUSER_INDEX_ANY,false);
|
if(!m_groups[(int)eUIGroup_Fullscreen]->GetMenuDisplayed()) SetMenuDisplayed(XUSER_INDEX_ANY,false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (navComplete) {
|
||||||
|
KMInput.ConsumeMousePress(0);
|
||||||
|
}
|
||||||
|
|
||||||
return navComplete;
|
return navComplete;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -379,7 +379,7 @@ void LocalPlayer::aiStep()
|
||||||
{
|
{
|
||||||
// yd = 0;
|
// yd = 0;
|
||||||
// 4J - note that the 0.42 added for going down is to make it match with what happens when you jump - jumping itself adds 0.42 to yd in Mob::jumpFromGround
|
// 4J - note that the 0.42 added for going down is to make it match with what happens when you jump - jumping itself adds 0.42 to yd in Mob::jumpFromGround
|
||||||
if (ullButtonsPressed & (1LL<<MINECRAFT_ACTION_SNEAK_TOGGLE) ) yd -= ( 0.15 + 0.42 ); // 4J - for flying mode, MINECRAFT_ACTION_SNEAK_TOGGLE isn't a toggle but just indicates that this button is down
|
if (ullButtonsPressed & (1LL<<MINECRAFT_ACTION_SNEAK_TOGGLE) && !ui.GetMenuDisplayed(m_iPad)) yd -= ( 0.15 + 0.42 ); // 4J - for flying mode, MINECRAFT_ACTION_SNEAK_TOGGLE isn't a toggle but just indicates that this button is down
|
||||||
if (input->jumping)
|
if (input->jumping)
|
||||||
{
|
{
|
||||||
noJumpDelay = 0;
|
noJumpDelay = 0;
|
||||||
|
|
@ -1519,7 +1519,7 @@ bool LocalPlayer::handleMouseClick(int button)
|
||||||
{
|
{
|
||||||
bool returnItemPlaced = false;
|
bool returnItemPlaced = false;
|
||||||
|
|
||||||
if (button == 0 && missTime > 0) return false;
|
if (button == 0 && missTime > 0) return false;
|
||||||
if (button == 0)
|
if (button == 0)
|
||||||
{
|
{
|
||||||
//app.DebugPrintf("handleMouseClick - Player %d is swinging\n",GetXboxPad());
|
//app.DebugPrintf("handleMouseClick - Player %d is swinging\n",GetXboxPad());
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue