fix(gui): working pauses on iggy

This commit is contained in:
Sally Knight 2026-03-19 18:49:14 +03:00
parent 32fee4334d
commit 009b17ef1b
3 changed files with 18 additions and 7 deletions

View file

@ -92,7 +92,10 @@ UIScene_PauseMenu::UIScene_PauseMenu(int iPad, void *initData, UILayer *parentLa
XuiSetTimer(m_hObj,IGNORE_KEYPRESS_TIMERID,IGNORE_KEYPRESS_TIME);
#endif
if( g_NetworkManager.IsLocalGame() && g_NetworkManager.GetPlayerCount() == 1 )
// TODO: proper fix for pausing
// 4jcraft: replace IsLocalGame() with GetPlayerCount() == 1 due to
// IsLocalGame() issues on Iggy
if( /*g_NetworkManager.IsLocalGame() &&*/ g_NetworkManager.GetPlayerCount() == 1 )
{
app.SetXuiServerAction(ProfileManager.GetPrimaryPad(),eXuiServerAction_PauseServer,(void *)TRUE);
}
@ -364,8 +367,10 @@ void UIScene_PauseMenu::handleInput(int iPad, int key, bool repeat, bool pressed
#ifdef _DURANGO
//DurangoStatsDebugger::PrintStats(iPad);
#endif
if( iPad == ProfileManager.GetPrimaryPad() && g_NetworkManager.IsLocalGame() )
// TODO: proper fix for pausing
// 4jcraft: replace IsLocalGame() with GetPlayerCount() == 1 due to
// IsLocalGame() issues on Iggy
if( iPad == ProfileManager.GetPrimaryPad() && /*g_NetworkManager.IsLocalGame()*/g_NetworkManager.GetPlayerCount() == 1 )
{
app.SetXuiServerAction(ProfileManager.GetPrimaryPad(),eXuiServerAction_PauseServer,(void *)FALSE);
}
@ -509,7 +514,10 @@ void UIScene_PauseMenu::handlePress(F64 controlId, F64 childId)
switch((int)controlId)
{
case BUTTON_PAUSE_RESUMEGAME:
if( m_iPad == ProfileManager.GetPrimaryPad() && g_NetworkManager.IsLocalGame() )
// TODO: proper fix for pausing
// 4jcraft: replace IsLocalGame() with GetPlayerCount() == 1 due to
// IsLocalGame() issues on Iggy
if( m_iPad == ProfileManager.GetPrimaryPad() && /*g_NetworkManager.IsLocalGame()*/g_NetworkManager.GetPlayerCount() == 1 )
{
app.SetXuiServerAction(ProfileManager.GetPrimaryPad(),eXuiServerAction_PauseServer,(void *)FALSE);
}

View file

@ -950,7 +950,12 @@ return -1;
pMinecraft->run_middle();
#endif
app.SetAppPaused(
g_NetworkManager.IsLocalGame() &&
// TODO: proper fix for pausing
// 4jcraft: IsLocalGame() doesn't seem to work properly on Iggy
// UI, this should work even in multiplayer scenarios though
// since it checks for the player count anyway
//
// g_NetworkManager.IsLocalGame() &&
g_NetworkManager.GetPlayerCount() == 1 &&
ui.IsPauseMenuDisplayed(ProfileManager.GetPrimaryPad()));
} else {

View file

@ -1,8 +1,6 @@
#pragma once
#include "../Screen.h"
// 4jcraft addition
class MessageScreen : public Screen {
private:
std::wstring message;