From e45dfbeee6277117c308027c1b46b360d5f016c3 Mon Sep 17 00:00:00 2001 From: notmatthewbeshay <92357869+NotMachow@users.noreply.github.com> Date: Sat, 14 Mar 2026 07:06:48 +1100 Subject: [PATCH] Remove WinAPI booleans from XUI scene locals --- .../Platform/Common/XUI/XUI_HelpControls.cpp | 8 ++++---- .../Platform/Common/XUI/XUI_SkinSelect.cpp | 7 ++++--- .../Platform/Common/XUI/XUI_SocialPost.cpp | 6 +++--- .../Platform/Common/XUI/XUI_TutorialPopup.cpp | 20 +++++++++---------- 4 files changed, 21 insertions(+), 20 deletions(-) diff --git a/Minecraft.Client/Platform/Common/XUI/XUI_HelpControls.cpp b/Minecraft.Client/Platform/Common/XUI/XUI_HelpControls.cpp index 06ddb4aa9..867a2171c 100644 --- a/Minecraft.Client/Platform/Common/XUI/XUI_HelpControls.cpp +++ b/Minecraft.Client/Platform/Common/XUI/XUI_HelpControls.cpp @@ -196,10 +196,10 @@ HRESULT CScene_Controls::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) delete [] layoutString; // Set check box initial states. - BOOL bInvertLook = app.GetGameSettings(m_iPad,eGameSetting_ControlInvertLook); + bool bInvertLook = app.GetGameSettings(m_iPad,eGameSetting_ControlInvertLook) != 0; m_InvertLook.SetCheck( bInvertLook ); - BOOL bSouthPaw = app.GetGameSettings(m_iPad,eGameSetting_ControlSouthPaw); + bool bSouthPaw = app.GetGameSettings(m_iPad,eGameSetting_ControlSouthPaw) != 0; m_SouthPaw.SetCheck( bSouthPaw ); return S_OK; @@ -531,12 +531,12 @@ HRESULT CScene_Controls::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pN // Handle check box changes. if ( hObjPressed == m_InvertLook.m_hObj ) { - BOOL bIsChecked = m_InvertLook.IsChecked(); + bool bIsChecked = m_InvertLook.IsChecked() != FALSE; app.SetGameSettings(m_iPad,eGameSetting_ControlInvertLook,(unsigned char)( bIsChecked ) ); } else if ( hObjPressed == m_SouthPaw.m_hObj ) { - BOOL bIsChecked = m_SouthPaw.IsChecked(); + bool bIsChecked = m_SouthPaw.IsChecked() != FALSE; app.SetGameSettings(m_iPad,eGameSetting_ControlSouthPaw,(unsigned char)( bIsChecked ) ); PositionAllText(m_iPad); } diff --git a/Minecraft.Client/Platform/Common/XUI/XUI_SkinSelect.cpp b/Minecraft.Client/Platform/Common/XUI/XUI_SkinSelect.cpp index cdc88e27b..493d812fd 100644 --- a/Minecraft.Client/Platform/Common/XUI/XUI_SkinSelect.cpp +++ b/Minecraft.Client/Platform/Common/XUI/XUI_SkinSelect.cpp @@ -620,7 +620,8 @@ HRESULT CScene_SkinSelect::OnBasePositionChanged() void CScene_SkinSelect::handleSkinIndexChanged() { - BOOL showPrevious = FALSE, showNext = FALSE; + bool showPrevious = false; + bool showNext = false; int previousIndex = 0, nextIndex = 0; std::wstring skinName = L""; std::wstring skinOrigin = L""; @@ -767,8 +768,8 @@ void CScene_SkinSelect::handleSkinIndexChanged() m_previewControl->SetTexture(m_selectedSkinPath, backupTexture); m_previewControl->SetCapeTexture(m_selectedCapePath); - showNext = TRUE; - showPrevious = TRUE; + showNext = true; + showPrevious = true; nextIndex = getNextSkinIndex(m_skinIndex); previousIndex = getPreviousSkinIndex(m_skinIndex); diff --git a/Minecraft.Client/Platform/Common/XUI/XUI_SocialPost.cpp b/Minecraft.Client/Platform/Common/XUI/XUI_SocialPost.cpp index cb6d3f4a6..15d05661d 100644 --- a/Minecraft.Client/Platform/Common/XUI/XUI_SocialPost.cpp +++ b/Minecraft.Client/Platform/Common/XUI/XUI_SocialPost.cpp @@ -51,7 +51,7 @@ HRESULT CScene_SocialPost::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) m_EditCaption.SetCaretPosition((int)wCaption.length()); m_EditDesc.SetCaretPosition((int)wDesc.length()); - BOOL bHasAllText = /*( wTitle.length()!=0) && */(wCaption.length()!=0) && (wDesc.length()!=0); + bool bHasAllText = /*( wTitle.length()!=0) && */(wCaption.length()!=0) && (wDesc.length()!=0); m_OK.SetEnable(bHasAllText); @@ -78,7 +78,7 @@ std::wstring wDesc = m_EditDesc.GetText(); std::wstring wCaption = m_EditCaption.GetText(); std::wstring wDesc = m_EditDesc.GetText(); - BOOL bHasAllText = /*( wTitle.length()!=0) &&*/ (wCaption.length()!=0) && (wDesc.length()!=0); + bool bHasAllText = /*( wTitle.length()!=0) &&*/ (wCaption.length()!=0) && (wDesc.length()!=0); m_OK.SetEnable(bHasAllText); } @@ -144,4 +144,4 @@ HRESULT CScene_SocialPost::OnCustomMessage_Splitscreenplayer(bool bJoining, BOOL { bHandled=true; return app.AdjustSplitscreenScene_PlayerChanged(m_hObj,&m_OriginalPosition,m_iPad,bJoining,false); -} \ No newline at end of file +} diff --git a/Minecraft.Client/Platform/Common/XUI/XUI_TutorialPopup.cpp b/Minecraft.Client/Platform/Common/XUI/XUI_TutorialPopup.cpp index 1b3d6298d..5544c0c92 100644 --- a/Minecraft.Client/Platform/Common/XUI/XUI_TutorialPopup.cpp +++ b/Minecraft.Client/Platform/Common/XUI/XUI_TutorialPopup.cpp @@ -79,8 +79,8 @@ void CScene_TutorialPopup::UpdateInteractScenePosition(bool visible) HXUICLASS brewingClass = XuiFindClass( L"CXuiSceneBrewingStand" ); HXUICLASS anvilClass = XuiFindClass( L"CXuiSceneAnvil" ); HXUICLASS tradingClass = XuiFindClass( L"CXuiSceneTrading" ); - BOOL isCraftingScene = XuiClassDerivesFrom( sceneClass, craftingClass ); - BOOL isCreativeScene = XuiClassDerivesFrom( sceneClass, creativeInventoryClass ); + bool isCraftingScene = XuiClassDerivesFrom( sceneClass, craftingClass ) != FALSE; + bool isCreativeScene = XuiClassDerivesFrom( sceneClass, creativeInventoryClass ) != FALSE; switch(Minecraft::GetInstance()->localplayers[m_iPad]->m_iScreenSection) { @@ -115,7 +115,7 @@ void CScene_TutorialPopup::UpdateInteractScenePosition(bool visible) XuiClassDerivesFrom( sceneClass, anvilClass ) || XuiClassDerivesFrom( sceneClass, tradingClass ) || isCreativeScene || - isCraftingScene == TRUE ) + isCraftingScene ) { XuiElementGetTimeline( m_interactScene->m_hObj, &timeline); if(visible) @@ -194,7 +194,7 @@ HRESULT CScene_TutorialPopup::_SetDescription(CXuiScene *interactScene, LPCWSTR D3DXVECTOR3 titlePos; hr = XuiElementGetPosition( m_title, &titlePos ); - BOOL titleShowAtStart = m_title.IsShown(); + bool titleShowAtStart = m_title.IsShown() != FALSE; if( title != NULL && title[0] != 0 ) { m_title.SetText( title ); @@ -205,7 +205,7 @@ HRESULT CScene_TutorialPopup::_SetDescription(CXuiScene *interactScene, LPCWSTR m_title.SetText( L"" ); m_title.SetShow(FALSE); } - BOOL titleShowAtEnd = m_title.IsShown(); + bool titleShowAtEnd = m_title.IsShown() != FALSE; if(titleShowAtStart != titleShowAtEnd) { float fHeight, fWidth, fTitleHeight, fDescHeight, fDescWidth; @@ -284,7 +284,7 @@ std::wstring CScene_TutorialPopup::_SetIcon(int icon, int iAuxVal, bool isFoil, { std::wstring temp(desc); - BOOL iconShowAtStart = m_pCraftingPic->IsShown(); + bool iconShowAtStart = m_pCraftingPic->IsShown() != FALSE; if( icon != TUTORIAL_NO_ICON ) { @@ -411,7 +411,7 @@ std::wstring CScene_TutorialPopup::_SetIcon(int icon, int iAuxVal, bool isFoil, } } - BOOL iconShowAtEnd = m_pCraftingPic->IsShown(); + bool iconShowAtEnd = m_pCraftingPic->IsShown() != FALSE; if(iconShowAtStart != iconShowAtEnd) { float fHeight, fWidth, fIconHeight, fDescHeight, fDescWidth; @@ -439,7 +439,7 @@ std::wstring CScene_TutorialPopup::_SetIcon(int icon, int iAuxVal, bool isFoil, std::wstring CScene_TutorialPopup::_SetImage(std::wstring &desc) { - BOOL imageShowAtStart = m_image.IsShown(); + bool imageShowAtStart = m_image.IsShown() != FALSE; std::wstring openTag(L"{*IMAGE*}"); std::wstring closeTag(L"{*/IMAGE*}"); @@ -464,7 +464,7 @@ std::wstring CScene_TutorialPopup::_SetImage(std::wstring &desc) m_image.SetShow( FALSE ); } - BOOL imageShowAtEnd = m_image.IsShown(); + bool imageShowAtEnd = m_image.IsShown() != FALSE; if(imageShowAtStart != imageShowAtEnd) { float fHeight, fWidth, fIconHeight, fDescHeight, fDescWidth; @@ -600,4 +600,4 @@ bool CScene_TutorialPopup::IsSceneVisible(int iPad) isVisible = pThis->_IsSceneVisible(); } return isVisible; -} \ No newline at end of file +}