From 7b39869e38187f312f560a2b12c3fea0202e686e Mon Sep 17 00:00:00 2001 From: notmatthewbeshay <92357869+NotMachow@users.noreply.github.com> Date: Sat, 14 Mar 2026 07:08:46 +1100 Subject: [PATCH] Remove WinAPI counts from XUI menu locals --- .../Platform/Common/XUI/XUI_LoadSettings.cpp | 10 +++++----- .../Platform/Common/XUI/XUI_MultiGameCreate.cpp | 12 ++++++------ .../Platform/Common/XUI/XUI_MultiGameInfo.cpp | 7 +++---- .../Common/XUI/XUI_MultiGameJoinLoad.cpp | 16 ++++++++-------- 4 files changed, 22 insertions(+), 23 deletions(-) diff --git a/Minecraft.Client/Platform/Common/XUI/XUI_LoadSettings.cpp b/Minecraft.Client/Platform/Common/XUI/XUI_LoadSettings.cpp index b082709f5..df5493ddc 100644 --- a/Minecraft.Client/Platform/Common/XUI/XUI_LoadSettings.cpp +++ b/Minecraft.Client/Platform/Common/XUI/XUI_LoadSettings.cpp @@ -847,7 +847,7 @@ int CScene_LoadGameSettings::LoadSaveDataReturned(void *pParam,bool bContinue) bool isClientSide = ProfileManager.IsSignedInLive(ProfileManager.GetPrimaryPad()) && pClass->m_MoreOptionsParams.bOnlineGame; // 4J Stu - If we only have one controller connected, then don't show the sign-in UI again - DWORD connectedControllers = 0; + int connectedControllers = 0; for(unsigned int i = 0; i < XUSER_MAX_COUNT; ++i) { if( InputManager.IsPadConnected(i) || ProfileManager.IsSignedIn(i) ) ++connectedControllers; @@ -872,7 +872,7 @@ int CScene_LoadGameSettings::LoadSaveDataReturned(void *pParam,bool bContinue) } else { - DWORD dwLocalUsersMask = CGameNetworkManager::GetLocalPlayerMask(ProfileManager.GetPrimaryPad()); + unsigned int dwLocalUsersMask = CGameNetworkManager::GetLocalPlayerMask(ProfileManager.GetPrimaryPad()); // No guest problems so we don't need to force a sign-in of players here StartGameFromSave(pClass, dwLocalUsersMask); @@ -1007,7 +1007,7 @@ int CScene_LoadGameSettings::StartGame_SignInReturned(void *pParam,bool bContinu // It's possible that the player has not signed in - they can back out if(ProfileManager.IsSignedIn(iPad)) { - DWORD dwLocalUsersMask = 0; + unsigned int dwLocalUsersMask = 0; bool isClientSide = ProfileManager.IsSignedInLive(ProfileManager.GetPrimaryPad()) && pClass->m_MoreOptionsParams.bOnlineGame; bool noPrivileges = false; @@ -1397,7 +1397,7 @@ void CScene_LoadGameSettings::LoadLevelGen(LevelGenerationOptions *levelGen) bool isClientSide = ProfileManager.IsSignedInLive(ProfileManager.GetPrimaryPad()) && m_MoreOptionsParams.bOnlineGame; // 4J Stu - If we only have one controller connected, then don't show the sign-in UI again - DWORD connectedControllers = 0; + int connectedControllers = 0; for(unsigned int i = 0; i < XUSER_MAX_COUNT; ++i) { if( InputManager.IsPadConnected(i) || ProfileManager.IsSignedIn(i) ) ++connectedControllers; @@ -1423,7 +1423,7 @@ void CScene_LoadGameSettings::LoadLevelGen(LevelGenerationOptions *levelGen) } } - DWORD dwLocalUsersMask = 0; + unsigned int dwLocalUsersMask = 0; dwLocalUsersMask |= CGameNetworkManager::GetLocalPlayerMask(ProfileManager.GetPrimaryPad()); // Load data from disc diff --git a/Minecraft.Client/Platform/Common/XUI/XUI_MultiGameCreate.cpp b/Minecraft.Client/Platform/Common/XUI/XUI_MultiGameCreate.cpp index d1da94594..dcdf3e07c 100644 --- a/Minecraft.Client/Platform/Common/XUI/XUI_MultiGameCreate.cpp +++ b/Minecraft.Client/Platform/Common/XUI/XUI_MultiGameCreate.cpp @@ -459,7 +459,7 @@ HRESULT CScene_MultiGameCreate::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPr else { // 4J Stu - If we only have one controller connected, then don't show the sign-in UI again - DWORD connectedControllers = 0; + int connectedControllers = 0; for(unsigned int i = 0; i < XUSER_MAX_COUNT; ++i) { if( InputManager.IsPadConnected(i) || ProfileManager.IsSignedIn(i) ) ++connectedControllers; @@ -565,7 +565,7 @@ int CScene_MultiGameCreate::WarningTrialTexturePackReturned(void *pParam,int iPa // 4J Stu - If we only have one controller connected, then don't show the sign-in UI again - DWORD connectedControllers = 0; + int connectedControllers = 0; for(unsigned int i = 0; i < XUSER_MAX_COUNT; ++i) { if( InputManager.IsPadConnected(i) || ProfileManager.IsSignedIn(i) ) ++connectedControllers; @@ -628,7 +628,7 @@ HRESULT CScene_MultiGameCreate::OnNotifyValueChanged (HXUIOBJ hObjSource, XUINot { // Enable the done button when we have all of the necessary information std::wstring wWorldName = m_EditWorldName.GetText(); - BOOL bHasWorldName = ( wWorldName.length()!=0); + bool bHasWorldName = ( wWorldName.length()!=0); m_NewWorld.SetEnable(bHasWorldName); } else if(hObjSource==m_SliderDifficulty.GetSlider() ) @@ -761,7 +761,7 @@ int CScene_MultiGameCreate::ConfirmCreateReturned(void *pParam,int iPad,C4JStora bool isClientSide = ProfileManager.IsSignedInLive(ProfileManager.GetPrimaryPad()) && pClass->m_MoreOptionsParams.bOnlineGame; // 4J Stu - If we only have one controller connected, then don't show the sign-in UI again - DWORD connectedControllers = 0; + int connectedControllers = 0; for(unsigned int i = 0; i < XUSER_MAX_COUNT; ++i) { if( InputManager.IsPadConnected(i) || ProfileManager.IsSignedIn(i) ) ++connectedControllers; @@ -815,7 +815,7 @@ int CScene_MultiGameCreate::StartGame_SignInReturned(void *pParam,bool bContinue // It's possible that the player has not signed in - they can back out if(ProfileManager.IsSignedIn(iPad)) { - DWORD dwLocalUsersMask = 0; + unsigned int dwLocalUsersMask = 0; bool isClientSide = ProfileManager.IsSignedInLive(ProfileManager.GetPrimaryPad()) && pClass->m_MoreOptionsParams.bOnlineGame; bool noPrivileges = false; @@ -889,7 +889,7 @@ void CScene_MultiGameCreate::CreateGame(CScene_MultiGameCreate* pClass, DWORD dw // Make our next save default to the name of the level StorageManager.SetSaveTitle((wchar_t *)wWorldName.c_str()); - BOOL bHasSeed = (pClass->m_EditSeed.GetText() != NULL); + bool bHasSeed = (pClass->m_EditSeed.GetText() != NULL); std::wstring wSeed; if(bHasSeed) diff --git a/Minecraft.Client/Platform/Common/XUI/XUI_MultiGameInfo.cpp b/Minecraft.Client/Platform/Common/XUI/XUI_MultiGameInfo.cpp index 987467514..354ac9119 100644 --- a/Minecraft.Client/Platform/Common/XUI/XUI_MultiGameInfo.cpp +++ b/Minecraft.Client/Platform/Common/XUI/XUI_MultiGameInfo.cpp @@ -149,7 +149,7 @@ HRESULT CScene_MultiGameInfo::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPres m_bIgnoreInput=true; // 4J Stu - If we only have one controller connected, then don't show the sign-in UI again - DWORD connectedControllers = 0; + int connectedControllers = 0; for(unsigned int i = 0; i < XUSER_MAX_COUNT; ++i) { if( InputManager.IsPadConnected(i) || ProfileManager.IsSignedIn(i) ) ++connectedControllers; @@ -258,9 +258,9 @@ int CScene_MultiGameInfo::StartGame_SignInReturned(void *pParam,bool bContinue, // Shared function to join the game that is the same whether we used the sign-in UI or not void CScene_MultiGameInfo::JoinGame(CScene_MultiGameInfo* pClass) { - DWORD dwLocalUsersMask = 0; + unsigned int dwLocalUsersMask = 0; bool noPrivileges = false; - DWORD dwSignedInUsers = 0; + unsigned int dwSignedInUsers = 0; // if we're in SD mode, then only the primary player gets to play if(RenderManager.IsHiDef()) @@ -389,4 +389,3 @@ HRESULT CScene_MultiGameInfo::OnTimer( XUIMessageTimer *pTimer, BOOL& bHandled ) return S_OK; } - diff --git a/Minecraft.Client/Platform/Common/XUI/XUI_MultiGameJoinLoad.cpp b/Minecraft.Client/Platform/Common/XUI/XUI_MultiGameJoinLoad.cpp index 68b0eee10..5f7c468b0 100644 --- a/Minecraft.Client/Platform/Common/XUI/XUI_MultiGameJoinLoad.cpp +++ b/Minecraft.Client/Platform/Common/XUI/XUI_MultiGameJoinLoad.cpp @@ -455,7 +455,7 @@ HRESULT CScene_MultiGameJoinLoad::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotify { m_bIgnoreInput=true; - DWORD nIndex = m_pGamesList->GetCurSel(); + int nIndex = m_pGamesList->GetCurSel(); if( m_pGamesList->GetItemCount() > 0 && nIndex < currentSessions.size() ) { @@ -645,7 +645,7 @@ HRESULT CScene_MultiGameJoinLoad::OnKeyDown(XUIMessageInput* pInputData, BOOL& r case VK_PAD_Y: if(m_pGamesList->TreeHasFocus() && m_pGamesList->GetItemCount() > 0) { - DWORD nIndex = m_pGamesList->GetCurSel(); + int nIndex = m_pGamesList->GetCurSel(); FriendSessionInfo *pSelectedSession = currentSessions.at( nIndex ); PlayerUID xuid = pSelectedSession->data.hostPlayerUID; @@ -659,7 +659,7 @@ HRESULT CScene_MultiGameJoinLoad::OnKeyDown(XUIMessageInput* pInputData, BOOL& r if(ProfileManager.IsSignedInLive( m_iPad )) { // 4J-PB - required for a delete of the save if it's found to be a corrupted save - DWORD nIndex = m_pSavesList->GetCurSel(); + int nIndex = m_pSavesList->GetCurSel(); m_iChangingSaveGameInfoIndex=m_pSavesList->GetData(nIndex).iIndex; unsigned int uiIDA[2]; @@ -1133,7 +1133,7 @@ void CScene_MultiGameJoinLoad::UpdateGamesList() return; } - DWORD nIndex = -1; + int nIndex = -1; FriendSessionInfo *pSelectedSession = NULL; if(m_pGamesList->TreeHasFocus() && m_pGamesList->GetItemCount() > 0) { @@ -1216,7 +1216,7 @@ void CScene_MultiGameJoinLoad::UpdateGamesList() unsigned int xuiListSize = m_pGamesList->GetItemCount(); unsigned int filteredListSize = (unsigned int)currentSessions.size(); - BOOL gamesListHasFocus = m_pGamesList->TreeHasFocus(); + bool gamesListHasFocus = m_pGamesList->TreeHasFocus() != FALSE; if(filteredListSize > 0) { @@ -1790,7 +1790,7 @@ int CScene_MultiGameJoinLoad::LoadSaveDataReturned(void *pParam,bool bContinue) bool isClientSide = ProfileManager.IsSignedInLive(ProfileManager.GetPrimaryPad()); // 4J Stu - If we only have one controller connected, then don't show the sign-in UI again - DWORD connectedControllers = 0; + int connectedControllers = 0; for(unsigned int i = 0; i < XUSER_MAX_COUNT; ++i) { if( InputManager.IsPadConnected(i) || ProfileManager.IsSignedIn(i) ) ++connectedControllers; @@ -1798,7 +1798,7 @@ int CScene_MultiGameJoinLoad::LoadSaveDataReturned(void *pParam,bool bContinue) if(!isClientSide || connectedControllers == 1 || !RenderManager.IsHiDef()) { - DWORD dwLocalUsersMask = CGameNetworkManager::GetLocalPlayerMask(ProfileManager.GetPrimaryPad()); + unsigned int dwLocalUsersMask = CGameNetworkManager::GetLocalPlayerMask(ProfileManager.GetPrimaryPad()); // No guest problems so we don't need to force a sign-in of players here StartGameFromSave(pClass, dwLocalUsersMask); @@ -1825,7 +1825,7 @@ int CScene_MultiGameJoinLoad::StartGame_SignInReturned(void *pParam,bool bContin // It's possible that the player has not signed in - they can back out if(ProfileManager.IsSignedIn(iPad)) { - DWORD dwLocalUsersMask = 0; + unsigned int dwLocalUsersMask = 0; for(unsigned int index = 0; index < XUSER_MAX_COUNT; ++index) {