Make it KBM only

This commit is contained in:
Daniloch 2026-03-06 19:12:02 -03:00
parent ef8d0f98ce
commit acdaf3f956

View file

@ -1450,28 +1450,37 @@ bool IUIScene_AbstractContainerMenu::handleKeyDown(int iPad, int iAction, bool b
case ACTION_MENU_B: case ACTION_MENU_B:
case ACTION_MENU_RIGHT_SCROLL: case ACTION_MENU_RIGHT_SCROLL:
{ {
bool allowedCloseInventory = true;
ui.SetTooltips(iPad, -1); bool isKBMCloseInventory = iAction == ACTION_MENU_RIGHT_SCROLL && g_KBMInput.IsKBMActive();
// 4J Stu - Fix for #11302 - TCR 001: Network Connectivity: Host crashed after being killed by the client while accessing a chest during burst packet loss. if (isKBMCloseInventory) {
// We need to make sure that we call closeContainer() anytime this menu is closed, even if it is forced to close by some other reason (like the player dying) allowedCloseInventory = g_KBMInput.IsKeyPressed(KeyboardMouseInput::KEY_INVENTORY);
// Therefore I have moved this call to the OnDestroy() method to make sure that it always happens.
//Minecraft::GetInstance()->localplayers[pInputData->UserIndex]->closeContainer();
// Return to the game. We should really callback to the app here as well
// to let it know that we have closed the ui incase we need to do things when that happens
if(m_bNavigateBack)
{
ui.NavigateBack(iPad);
}
else
{
ui.CloseUIScenes(iPad);
} }
bHandled = true; if (allowedCloseInventory) {
return S_OK; ui.SetTooltips(iPad, -1);
// 4J Stu - Fix for #11302 - TCR 001: Network Connectivity: Host crashed after being killed by the client while accessing a chest during burst packet loss.
// We need to make sure that we call closeContainer() anytime this menu is closed, even if it is forced to close by some other reason (like the player dying)
// Therefore I have moved this call to the OnDestroy() method to make sure that it always happens.
//Minecraft::GetInstance()->localplayers[pInputData->UserIndex]->closeContainer();
// Return to the game. We should really callback to the app here as well
// to let it know that we have closed the ui incase we need to do things when that happens
if (m_bNavigateBack)
{
ui.NavigateBack(iPad);
}
else
{
ui.CloseUIScenes(iPad);
}
bHandled = true;
return S_OK;
}
} }
break; break;
case ACTION_MENU_LEFT: case ACTION_MENU_LEFT: