From bd5b092357790e8b396b945254ca67c273ec916c Mon Sep 17 00:00:00 2001 From: notmatthewbeshay <92357869+NotMachow@users.noreply.github.com> Date: Wed, 11 Mar 2026 00:17:21 +1100 Subject: [PATCH] Remove Win32 local state from common UI helpers --- .../Platform/Common/UI/UIComponent_TutorialPopup.cpp | 8 ++++---- .../Platform/Common/UI/UIScene_LoadOrJoinMenu.cpp | 8 ++++---- Minecraft.Client/Platform/Common/UI/UIScene_MainMenu.cpp | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Minecraft.Client/Platform/Common/UI/UIComponent_TutorialPopup.cpp b/Minecraft.Client/Platform/Common/UI/UIComponent_TutorialPopup.cpp index 844a8b8ca..e3a139cae 100644 --- a/Minecraft.Client/Platform/Common/UI/UIComponent_TutorialPopup.cpp +++ b/Minecraft.Client/Platform/Common/UI/UIComponent_TutorialPopup.cpp @@ -334,7 +334,7 @@ std::wstring UIComponent_TutorialPopup::_SetImage(std::wstring &desc) { // 4J Stu - Unused #if 0 - BOOL imageShowAtStart = m_image.IsShown(); + bool imageShowAtStart = m_image.IsShown(); std::wstring openTag(L"{*IMAGE*}"); std::wstring closeTag(L"{*/IMAGE*}"); @@ -348,7 +348,7 @@ std::wstring UIComponent_TutorialPopup::_SetImage(std::wstring &desc) { std::wstring id = desc.substr(imageStartPos, imageEndPos - imageStartPos); m_image.SetImagePath( id.c_str() ); - m_image.SetShow( TRUE ); + m_image.SetShow( true ); desc.replace(imageTagStartPos, imageEndPos - imageTagStartPos + closeTag.length(), L""); } @@ -356,10 +356,10 @@ std::wstring UIComponent_TutorialPopup::_SetImage(std::wstring &desc) else { // hide the icon slot - m_image.SetShow( FALSE ); + m_image.SetShow( false ); } - BOOL imageShowAtEnd = m_image.IsShown(); + bool imageShowAtEnd = m_image.IsShown(); if(imageShowAtStart != imageShowAtEnd) { float fHeight, fWidth, fIconHeight, fDescHeight, fDescWidth; diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_LoadOrJoinMenu.cpp b/Minecraft.Client/Platform/Common/UI/UIScene_LoadOrJoinMenu.cpp index fd8037c07..29f32e602 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_LoadOrJoinMenu.cpp +++ b/Minecraft.Client/Platform/Common/UI/UIScene_LoadOrJoinMenu.cpp @@ -1035,7 +1035,7 @@ void UIScene_LoadOrJoinMenu::handleInput(int iPad, int key, bool repeat, bool pr #elif defined(_DURANGO) if(getControlFocus() == eControl_GamesList && m_buttonListGames.getItemCount() > 0) { - DWORD nIndex = m_buttonListGames.getCurrentSelection(); + const int nIndex = m_buttonListGames.getCurrentSelection(); FriendSessionInfo *pSelectedSession = m_currentSessions->at( nIndex ); PlayerUID uid = pSelectedSession->searchResult.m_playerXuids[0]; @@ -1617,7 +1617,7 @@ void UIScene_LoadOrJoinMenu::UpdateGamesList() FriendSessionInfo *pSelectedSession = NULL; if(DoesGamesListHaveFocus() && m_buttonListGames.getItemCount() > 0) { - unsigned int nIndex = m_buttonListGames.getCurrentSelection(); + const int nIndex = m_buttonListGames.getCurrentSelection(); pSelectedSession = m_currentSessions->at( nIndex ); } @@ -1641,7 +1641,7 @@ void UIScene_LoadOrJoinMenu::UpdateGamesList() unsigned int xuiListSize = m_buttonListGames.getItemCount(); unsigned int filteredListSize = (unsigned int)m_currentSessions->size(); - BOOL gamesListHasFocus = DoesGamesListHaveFocus(); + const bool gamesListHasFocus = DoesGamesListHaveFocus(); if(filteredListSize > 0) { @@ -2204,7 +2204,7 @@ int UIScene_LoadOrJoinMenu::TexturePackDialogReturned(void *pParam,int iPad,C4JS std::wstring ProductId; app.GetDLCFullOfferIDForPackID(pClass->m_initData->selectedSession->data.texturePackParentId,ProductId); - StorageManager.InstallOffer(1,(WCHAR *)ProductId.c_str(),NULL,NULL); + StorageManager.InstallOffer(1, const_cast(ProductId.c_str()), NULL, NULL); } else { diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_MainMenu.cpp b/Minecraft.Client/Platform/Common/UI/UIScene_MainMenu.cpp index eeac83238..bcd7764fb 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_MainMenu.cpp +++ b/Minecraft.Client/Platform/Common/UI/UIScene_MainMenu.cpp @@ -2019,7 +2019,7 @@ void UIScene_MainMenu::LoadTrial(void) LoadingInputParams *loadingParams = new LoadingInputParams(); loadingParams->func = &CGameNetworkManager::RunNetworkGameThreadProc; - loadingParams->lpParam = (LPVOID)param; + loadingParams->lpParam = param; UIFullscreenProgressCompletionData *completionData = new UIFullscreenProgressCompletionData(); completionData->bShowBackground=TRUE;