Remove WinAPI booleans from XUI scene locals

This commit is contained in:
notmatthewbeshay 2026-03-14 07:06:48 +11:00
parent ad82b86701
commit e45dfbeee6
4 changed files with 21 additions and 20 deletions

View file

@ -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);
}

View file

@ -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);

View file

@ -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);
}
}

View file

@ -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;
}
}