chore: fix settings ui focus, w64 compile & update xzp

This commit is contained in:
str1k3r committed 2026-10-08 20:31:48 -04:00
1 parent be14897736
commit 7c6ed9dbcb
10 files changed
+223 -350

No files matched your search

@@ -16,148 +16,17 @@ HRESULT CScene_HelpAndOptions::OnInit( XUIMessageInit* pInitData, BOOL& bHandled
bool bNotInGame=(Minecraft::GetInstance()->level==NULL);
MapChildControls();
XuiControlSetText(m_Buttons[BUTTON_HAO_CHANGESKIN],app.GetString(IDS_CHANGE_SKIN));
XuiControlSetText(m_Buttons[BUTTON_HAO_HOWTOPLAY],app.GetString(IDS_HOW_TO_PLAY));
XuiControlSetText(m_Buttons[BUTTON_HAO_CONTROLS],app.GetString(IDS_CONTROLS));
XuiControlSetText(m_Buttons[BUTTON_HAO_SETTINGS],app.GetString(IDS_SETTINGS));
XuiControlSetText(m_Buttons[BUTTON_HAO_CREDITS],app.GetString(IDS_CREDITS));
XuiControlSetText(m_Buttons[BUTTON_HAO_RESETTODEFAULTS],app.GetString(IDS_RESET_TO_DEFAULTS));
XuiControlSetText(m_Buttons[BUTTON_HAO_REINSTALL],app.GetString(IDS_REINSTALL_CONTENT));
XuiControlSetText(m_Buttons[BUTTON_HAO_DEBUG],app.GetString(IDS_DEBUG_SETTINGS));
//if(app.GetTMSDLCInfoRead())
{
m_Timer.SetShow(FALSE);
m_bIgnoreInput=false;
#ifndef _FINAL_BUILD
if(!app.DebugSettingsOn())
{
m_Buttons[BUTTON_HAO_DEBUG].SetEnable(FALSE);
m_Buttons[BUTTON_HAO_DEBUG].SetShow(FALSE);
}
else
{
m_Buttons[BUTTON_HAO_DEBUG].SetEnable(TRUE);
m_Buttons[BUTTON_HAO_DEBUG].SetShow(TRUE);
}
#endif
// 4J-PB - do not need a storage device to see this menu - just need one when you choose to re-install them
// any content to be re-installed?
if(m_iPad==ProfileManager.GetPrimaryPad() && bNotInGame)
{
// We should show the reinstall menu
app.DebugPrintf("Reinstall Menu required...\n");
m_Buttons[BUTTON_HAO_REINSTALL].SetEnable(TRUE);
m_Buttons[BUTTON_HAO_REINSTALL].SetShow(TRUE);
}
else
{
m_Buttons[BUTTON_HAO_REINSTALL].SetEnable(FALSE);
m_Buttons[BUTTON_HAO_REINSTALL].SetShow(FALSE);
}
if(app.GetLocalPlayerCount()>1)
{
// no credits in splitscreen
D3DXVECTOR3 vec;
m_Buttons[BUTTON_HAO_CREDITS].GetPosition(&vec);
m_Buttons[BUTTON_HAO_CREDITS].SetEnable(FALSE);
m_Buttons[BUTTON_HAO_CREDITS].SetShow(FALSE);
m_Buttons[BUTTON_HAO_REINSTALL].SetPosition(&vec);
app.AdjustSplitscreenScene(m_hObj,&m_OriginalPosition,m_iPad,false);
CXuiSceneBase::ShowLogo( m_iPad, FALSE );
if(ProfileManager.GetPrimaryPad()!=m_iPad)
{
m_Buttons[BUTTON_HAO_DEBUG].SetEnable(FALSE);
m_Buttons[BUTTON_HAO_DEBUG].SetShow(FALSE);
}
}
else
{
if(bNotInGame)
{
CXuiSceneBase::ShowLogo( DEFAULT_XUI_MENU_USER, TRUE );
}
else
{
CXuiSceneBase::ShowLogo( m_iPad, TRUE );
}
}
// Display the tooltips
// if we're not in the game, we need to use basescene 0
if(bNotInGame)
{
ui.SetTooltips( DEFAULT_XUI_MENU_USER, IDS_TOOLTIPS_SELECT,IDS_TOOLTIPS_BACK);
}
else
{
ui.SetTooltips( m_iPad, IDS_TOOLTIPS_SELECT,IDS_TOOLTIPS_BACK);
}
if(!ProfileManager.IsFullVersion() )//|| ProfileManager.IsGuest(m_iPad))
{
// disable save button
m_Buttons[BUTTON_HAO_CHANGESKIN].SetEnable(FALSE);
m_Buttons[BUTTON_HAO_CHANGESKIN].EnableInput(FALSE);
// set the focus to the second button
XuiElementSetUserFocus(m_Buttons[BUTTON_HAO_HOWTOPLAY].m_hObj, m_iPad);
}
}
/*else
{
m_bIgnoreInput=true;
m_Timer.SetShow(TRUE);
// hide all the buttons
for(int i=0;i<BUTTONS_HAO_MAX;i++)
{
m_Buttons[i].SetEnable(FALSE);
m_Buttons[i].SetShow(FALSE);
}
if(bNotInGame)
{
ui.SetTooltips( DEFAULT_XUI_MENU_USER, -1,-1);
}
else
{
ui.SetTooltips( m_iPad, -1,-1);
}
}*/
return S_OK;
}
/*HRESULT CScene_HelpAndOptions::OnTMSDLCFileRetrieved( )
{
bool bNotInGame=(Minecraft::GetInstance()->level==NULL);
m_Timer.SetShow(FALSE);
m_bIgnoreInput=false;
// show all the buttons - except the debug settings and reinstall content
m_Buttons[BUTTON_HAO_CHANGESKIN].SetEnable(TRUE);
m_Buttons[BUTTON_HAO_CHANGESKIN].SetShow(TRUE);
m_Buttons[BUTTON_HAO_HOWTOPLAY].SetEnable(TRUE);
m_Buttons[BUTTON_HAO_HOWTOPLAY].SetShow(TRUE);
m_Buttons[BUTTON_HAO_CONTROLS].SetEnable(TRUE);
m_Buttons[BUTTON_HAO_CONTROLS].SetShow(TRUE);
m_Buttons[BUTTON_HAO_SETTINGS].SetEnable(TRUE);
m_Buttons[BUTTON_HAO_SETTINGS].SetShow(TRUE);
m_Buttons[BUTTON_HAO_CREDITS].SetEnable(TRUE);
m_Buttons[BUTTON_HAO_CREDITS].SetShow(TRUE);
#ifndef _FINAL_BUILD
if(!app.DebugSettingsOn())
{
@@ -168,14 +37,13 @@ HRESULT CScene_HelpAndOptions::OnInit( XUIMessageInit* pInitData, BOOL& bHandled
{
m_Buttons[BUTTON_HAO_DEBUG].SetEnable(TRUE);
m_Buttons[BUTTON_HAO_DEBUG].SetShow(TRUE);
}
#endif
// 4J-PB - do not need a storage device to see this menu - just need one when you choose to re-install them
// any content to be re-installed?
if(m_iPad==ProfileManager.GetPrimaryPad() && bNotInGame)
if(app.GetTMSDLCInfoRead() && m_iPad==ProfileManager.GetPrimaryPad() && bNotInGame)
{
// We should show the reinstall menu
app.DebugPrintf("Reinstall Menu required...\n");
@@ -184,21 +52,28 @@ HRESULT CScene_HelpAndOptions::OnInit( XUIMessageInit* pInitData, BOOL& bHandled
}
else
{
D3DXVECTOR3 vec;
m_Buttons[BUTTON_HAO_REINSTALL].SetEnable(FALSE);
m_Buttons[BUTTON_HAO_REINSTALL].SetShow(FALSE);
m_Buttons[BUTTON_HAO_REINSTALL].GetPosition(&vec);
m_Buttons[BUTTON_HAO_DEBUG].SetPosition(&vec);
}
if(app.GetLocalPlayerCount()>1)
{
// no credits in splitscreen
D3DXVECTOR3 vec;
D3DXVECTOR3 vec,vec2;
m_Buttons[BUTTON_HAO_CREDITS].GetPosition(&vec);
m_Buttons[BUTTON_HAO_CREDITS].SetEnable(FALSE);
m_Buttons[BUTTON_HAO_CREDITS].SetShow(FALSE);
m_Buttons[BUTTON_HAO_REINSTALL].SetPosition(&vec);
m_Buttons[BUTTON_HAO_RESETTODEFAULTS].GetPosition(&vec2);
m_Buttons[BUTTON_HAO_RESETTODEFAULTS].SetPosition(&vec);
m_Buttons[BUTTON_HAO_DEBUG].SetPosition(&vec2);
app.AdjustSplitscreenScene(m_hObj,&m_OriginalPosition,m_iPad,false);
CXuiSceneBase::ShowLogo( m_iPad, FALSE );
@@ -232,22 +107,10 @@ HRESULT CScene_HelpAndOptions::OnInit( XUIMessageInit* pInitData, BOOL& bHandled
ui.SetTooltips( m_iPad, IDS_TOOLTIPS_SELECT,IDS_TOOLTIPS_BACK);
}
XuiElementSetUserFocus(m_Buttons[BUTTON_HAO_HOWTOPLAY].m_hObj, m_iPad);
if(!ProfileManager.IsFullVersion() )//|| ProfileManager.IsGuest(m_iPad))
{
// disable save button
m_Buttons[BUTTON_HAO_CHANGESKIN].SetEnable(FALSE);
m_Buttons[BUTTON_HAO_CHANGESKIN].EnableInput(FALSE);
// set the focus to the second button
XuiElementSetUserFocus(m_Buttons[BUTTON_HAO_HOWTOPLAY].m_hObj, m_iPad);
}
else
{
XuiElementSetUserFocus(m_Buttons[BUTTON_HAO_CHANGESKIN].m_hObj, m_iPad);
}
return S_OK;
}*/
}
HRESULT CScene_HelpAndOptions::OnControlNavigate(XUIMessageControlNavigate *pControlNavigateData, BOOL& bHandled)
{
@@ -287,21 +150,22 @@ HRESULT CScene_HelpAndOptions::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPre
case BUTTON_HAO_SETTINGS:
app.NavigateToScene(pNotifyPressData->UserIndex,eUIScene_SettingsMenu);
break;
case BUTTON_HAO_CHANGESKIN:
app.NavigateToScene(pNotifyPressData->UserIndex,eUIScene_SkinSelectMenu);
break;
case BUTTON_HAO_CREDITS:
app.NavigateToScene(pNotifyPressData->UserIndex,eUIScene_Credits);
break;
case BUTTON_HAO_RESETTODEFAULTS:
{
// check they really want to do this
UINT uiIDA[2];
uiIDA[0]=IDS_CONFIRM_CANCEL;
uiIDA[1]=IDS_CONFIRM_OK;
case BUTTON_HAO_REINSTALL:
app.NavigateToScene(pNotifyPressData->UserIndex,eUIScene_ReinstallMenu);
StorageManager.RequestMessageBox(IDS_DEFAULTS_TITLE, IDS_DEFAULTS_TEXT, uiIDA, 2, pNotifyPressData->UserIndex,&CScene_HelpAndOptions::ResetDefaultsDialogReturned,this, app.GetStringTable());
}
break;
case BUTTON_HAO_DEBUG:
app.NavigateToScene(pNotifyPressData->UserIndex,eUIScene_DebugOptions);
break;
default:
break;
}
@@ -350,28 +214,6 @@ HRESULT CScene_HelpAndOptions::OnNavReturn(HXUIOBJ hObj,BOOL& rfHandled)
{
ui.SetTooltips( DEFAULT_XUI_MENU_USER, IDS_TOOLTIPS_SELECT,IDS_TOOLTIPS_BACK);
CXuiSceneBase::ShowLogo( DEFAULT_XUI_MENU_USER, TRUE );
if(m_iPad==ProfileManager.GetPrimaryPad() )//&&
// StorageManager.GetSaveDeviceSelected(m_iPad) &&
// !StorageManager.GetSaveDisabled() &&
// ( ProfileManager.IsAwardsFlagSet(m_iPad,eAward_mine100Blocks) ||
// ProfileManager.IsAwardsFlagSet(m_iPad,eAward_kill10Creepers) ||
// ProfileManager.IsAwardsFlagSet(m_iPad,eAward_eatPorkChop) ||
// ProfileManager.IsAwardsFlagSet(m_iPad,eAward_play100Days) ||
// ProfileManager.IsAwardsFlagSet(m_iPad,eAward_arrowKillCreeper) ||
// ProfileManager.IsAwardsFlagSet(m_iPad,eAward_socialPost)) )
{
// We should show the reinstall menu
app.DebugPrintf("Reinstall Menu required...\n");
m_Buttons[BUTTON_HAO_REINSTALL].SetEnable(TRUE);
m_Buttons[BUTTON_HAO_REINSTALL].SetShow(TRUE);
}
else
{
m_Buttons[BUTTON_HAO_REINSTALL].SetEnable(FALSE);
m_Buttons[BUTTON_HAO_REINSTALL].SetShow(FALSE);
}
}
else
{
@@ -390,20 +232,20 @@ HRESULT CScene_HelpAndOptions::OnNavReturn(HXUIOBJ hObj,BOOL& rfHandled)
}
// int CScene_HelpAndOptions::ResetDefaultsDialogReturned(void *pParam,int iPad,C4JStorage::EMessageResult result)
// {
// CScene_HelpAndOptions* pClass = (CScene_HelpAndOptions*)pParam;
//
// // results switched for this dialog
// if(result==C4JStorage::EMessage_ResultDecline)
// {
// app.SetDefaultOptions(ProfileManager.GetDashboardProfileSettings(pClass->m_iPad),pClass->m_iPad);
// // if the profile data has been changed, then force a profile write
// // It seems we're allowed to break the 5 minute rule if it's the result of a user action
// app.CheckGameSettingsChanged(true,iPad);
// }
// return 0;
// }
int CScene_HelpAndOptions::ResetDefaultsDialogReturned(void *pParam,int iPad,C4JStorage::EMessageResult result)
{
//CScene_SettingsAll* pClass = (CScene_SettingsAll*)pParam;
// results switched for this dialog
if(result==C4JStorage::EMessage_ResultDecline)
{
app.SetDefaultOptions(ProfileManager.GetDashboardProfileSettings(iPad),iPad);
// if the profile data has been changed, then force a profile write
// It seems we're allowed to break the 5 minute rule if it's the result of a user action
app.CheckGameSettingsChanged(true,iPad);
}
return 0;
}
HRESULT CScene_HelpAndOptions::OnTransitionStart( XUIMessageTransition *pTransition, BOOL& bHandled )
{