Some cleanup

Just a bit. i dont want to clean all the ifdef for consoles right now
This commit is contained in:
GabsPuNs
2026-05-28 18:52:42 -04:00
parent d1dbe882bb
commit 7c3e4fb0d5
24 changed files with 60 additions and 4112 deletions

View File

@@ -281,13 +281,6 @@ void UIScene_PauseMenu::updateControlsVisibility()
removeControl( &m_buttons[BUTTON_PAUSE_ACHIEVEMENTS], false );
#endif
}
#ifdef __PSVITA__
// MGH added - remove leaderboards in adhoc
if(CGameNetworkManager::usingAdhocMode())
{
removeControl( &m_buttons[BUTTON_PAUSE_LEADERBOARDS], false );
}
#endif
if( !g_NetworkManager.IsHost() )
{
@@ -347,10 +340,6 @@ void UIScene_PauseMenu::handleInput(int iPad, int key, bool repeat, bool pressed
case ACTION_MENU_CANCEL:
if(pressed)
{
#ifdef _DURANGO
//DurangoStatsDebugger::PrintStats(iPad);
#endif
if( iPad == ProfileManager.GetPrimaryPad() && g_NetworkManager.IsLocalGame() )
{
app.SetXuiServerAction(ProfileManager.GetPrimaryPad(),eXuiServerAction_PauseServer,(void *)FALSE);
@@ -376,102 +365,6 @@ void UIScene_PauseMenu::handleInput(int iPad, int key, bool repeat, bool pressed
}
break;
#if TO_BE_IMPLEMENTED
case VK_PAD_X:
// Change device
if(bIsisPrimaryHost)
{
// we need a function to deal with the return from this - if it changes, we need to update the pause menu and tooltips
// Fix for #12531 - TCR 001: BAS Game Stability: When a player selects to change a storage
// device, and repeatedly backs out of the SD screen, disconnects from LIVE, and then selects a SD, the title crashes.
m_bIgnoreInput=true;
StorageManager.SetSaveDevice(&UIScene_PauseMenu::DeviceSelectReturned,this,true);
}
rfHandled = TRUE;
break;
#endif
case ACTION_MENU_Y:
{
#if defined(__PS3__) || defined(__ORBIS__)
if(pressed && iPad == ProfileManager.GetPrimaryPad())
{
#ifdef __ORBIS__
// If a patch is available, can't view invites
if (CheckForPatch()) break;
#endif
// Are we offline?
if(!ProfileManager.IsSignedInLive(iPad))
{
m_eAction=eAction_ViewInvitesPSN;
#ifdef __ORBIS__
int npAvailability = ProfileManager.getNPAvailability(iPad);
if (npAvailability == SCE_NP_ERROR_AGE_RESTRICTION)
{
// 4J Stu - This is a bit messy and is due to the library incorrectly returning false for IsSignedInLive is the npAvailability isn't SCE_OK
UINT uiIDA[1];
uiIDA[0]=IDS_OK;
ui.RequestErrorMessage(IDS_ONLINE_SERVICE_TITLE, IDS_CONTENT_RESTRICTION, uiIDA, 1, iPad);
}
else
// Determine why they're not "signed in live"
if (ProfileManager.isSignedInPSN(iPad))
{
// Signed in to PSN but not connected (no internet access)
assert(!ProfileManager.isConnectedToPSN(iPad));
UINT uiIDA[1];
uiIDA[0] = IDS_OK;
ui.RequestErrorMessage( IDS_ERROR_NETWORK_TITLE, IDS_ERROR_NETWORK, uiIDA, 1, iPad);
}
else
{
// Not signed in to PSN
UINT uiIDA[1];
uiIDA[0] = IDS_PRO_NOTONLINE_ACCEPT;
ui.RequestAlertMessage( IDS_PRO_NOTONLINE_TITLE, IDS_PRO_NOTONLINE_TEXT, uiIDA, 1, iPad, &UIScene_PauseMenu::MustSignInReturnedPSN, (LPVOID)GetCallbackUniqueId() );
}
#else // __PS3__
// get them to sign in to online
UINT uiIDA[1];
uiIDA[0]=IDS_PRO_NOTONLINE_ACCEPT;
ui.RequestAlertMessage(IDS_PRO_NOTONLINE_TITLE, IDS_PRO_NOTONLINE_TEXT, uiIDA, 1, iPad, &UIScene_PauseMenu::MustSignInReturnedPSN, (LPVOID)GetCallbackUniqueId() );
#endif
}
else
{
#ifdef __ORBIS__
SQRNetworkManager_Orbis::RecvInviteGUI();
#else // __PS3__
int ret = sceNpBasicRecvMessageCustom(SCE_NP_BASIC_MESSAGE_MAIN_TYPE_INVITE, SCE_NP_BASIC_RECV_MESSAGE_OPTIONS_INCLUDE_BOOTABLE, SYS_MEMORY_CONTAINER_ID_INVALID);
app.DebugPrintf("sceNpBasicRecvMessageCustom return %d ( %08x )\n", ret, ret);
#endif
}
}
#else
#if TO_BE_IMPLEMENTED
if(bUserisClientSide)
{
// 4J Stu - Added check in 1.8.2 bug fix (TU6) to stop repeat key presses
bool bCanScreenshot = true;
for(int j=0; j < XUSER_MAX_COUNT;++j)
{
if(app.GetXuiAction(j) == eAppAction_SocialPostScreenshot)
{
bCanScreenshot = false;
break;
}
}
if(bCanScreenshot) app.SetAction(pInputData->UserIndex,eAppAction_SocialPost);
}
rfHandled = TRUE;
#endif
#endif // __PS3__
}
break;
#ifdef _XBOX_ONE
case ACTION_MENU_RIGHT_SCROLL:
if( bDisplayBanTip )
@@ -516,114 +409,18 @@ void UIScene_PauseMenu::handlePress(F64 controlId, F64 childId)
}
else if(!ProfileManager.IsSignedInLive(m_iPad))
{
#ifdef __ORBIS__
// If a patch is available, can't show leaderboard
if (CheckForPatch()) break;
// Check for content restricted user
// Update error code
int errorCode = ProfileManager.getNPAvailability(m_iPad);
// Check if PSN is unavailable because of age restriction
if (errorCode == SCE_NP_ERROR_AGE_RESTRICTION)
{
UINT uiIDA[1];
uiIDA[0] = IDS_CONFIRM_OK;
ui.RequestErrorMessage(IDS_ONLINE_SERVICE_TITLE, IDS_CONTENT_RESTRICTION, uiIDA, 1, m_iPad);
break;;
}
#endif
#if defined __PS3__ || __PSVITA__
// get them to sign in to online
m_eAction=eAction_ViewLeaderboardsPSN;
UINT uiIDA[1];
uiIDA[0]=IDS_PRO_NOTONLINE_ACCEPT;
ui.RequestAlertMessage(IDS_PRO_NOTONLINE_TITLE, IDS_PRO_XBOXLIVE_NOTIFICATION, uiIDA, 1, ProfileManager.GetPrimaryPad(),&UIScene_PauseMenu::MustSignInReturnedPSN,(LPVOID)GetCallbackUniqueId() );
#elif defined(__ORBIS__)
m_eAction=eAction_ViewLeaderboardsPSN;
int npAvailability = ProfileManager.getNPAvailability(m_iPad);
if (npAvailability == SCE_NP_ERROR_AGE_RESTRICTION)
{
// 4J Stu - This is a bit messy and is due to the library incorrectly returning false for IsSignedInLive is the npAvailability isn't SCE_OK
UINT uiIDA[1];
uiIDA[0]=IDS_OK;
ui.RequestErrorMessage(IDS_ONLINE_SERVICE_TITLE, IDS_CONTENT_RESTRICTION, uiIDA, 1, m_iPad);
}
else
// Determine why they're not "signed in live"
if (ProfileManager.isSignedInPSN(m_iPad))
{
// Signed in to PSN but not connected (no internet access)
// Id
assert(!ProfileManager.isConnectedToPSN(m_iPad));
UINT uiIDA[1];
uiIDA[0] = IDS_OK;
ui.RequestErrorMessage( IDS_ERROR_NETWORK_TITLE, IDS_ERROR_NETWORK, uiIDA, 1, m_iPad);
}
else
{
// Not signed in to PSN
UINT uiIDA[1];
uiIDA[0] = IDS_PRO_NOTONLINE_ACCEPT;
ui.RequestAlertMessage( IDS_PRO_NOTONLINE_TITLE, IDS_PRO_NOTONLINE_TEXT, uiIDA, 1, m_iPad, &UIScene_PauseMenu::MustSignInReturnedPSN, (LPVOID)GetCallbackUniqueId() );
}
#else
UINT uiIDA[1] = { IDS_OK };
ui.RequestErrorMessage(IDS_PRO_NOTONLINE_TITLE, IDS_PRO_XBOXLIVE_NOTIFICATION, uiIDA, 1, m_iPad);
#endif
}
else
{
bool bContentRestricted=false;
#if defined(__PS3__) || defined(__PSVITA__)
ProfileManager.GetChatAndContentRestrictions(m_iPad,true,nullptr,&bContentRestricted,nullptr);
#endif
if(bContentRestricted)
{
#if !(defined(_XBOX) || defined(_WINDOWS64) || defined(_XBOX_ONE)) // 4J Stu - Temp to get the win build running, but so we check this for other platforms
// you can't see leaderboards
UINT uiIDA[1];
uiIDA[0]=IDS_CONFIRM_OK;
ui.RequestAlertMessage(IDS_ONLINE_SERVICE_TITLE, IDS_CONTENT_RESTRICTION, uiIDA, 1, m_iPad);
#endif
}
else
{
if(!bContentRestricted)
ui.NavigateToScene(m_iPad, eUIScene_LeaderboardsMenu);
}
}
}
break;
#ifdef _DURANGO
case BUTTON_PAUSE_XBOXHELP:
{
// 4J: Launch the crummy xbox help application.
WXS::User^ user = ProfileManager.GetUser(m_iPad);
Windows::Xbox::ApplicationModel::Help::Show(user);
}
break;
#elif TO_BE_IMPLEMENTED
case BUTTON_PAUSE_ACHIEVEMENTS:
// guests can't look at achievements
if(ProfileManager.IsGuest(pNotifyPressData->UserIndex))
{
UINT uiIDA[1];
uiIDA[0]=IDS_OK;
ui.RequestAlertMessage(IDS_PRO_GUESTPROFILE_TITLE, IDS_PRO_GUESTPROFILE_TEXT, uiIDA, 1, ProfileManager.GetPrimaryPad());
}
else
{
XShowAchievementsUI( pNotifyPressData->UserIndex );
}
break;
#endif
case BUTTON_PAUSE_HELPANDOPTIONS:
ui.NavigateToScene(m_iPad,eUIScene_HelpAndOptionsMenu);
break;
@@ -933,456 +730,7 @@ int UIScene_PauseMenu::BanGameDialogReturned(void *pParam,int iPad,C4JStorage::E
}
#endif
#if defined(__PS3__) || defined (__PSVITA__) || defined(__ORBIS__)
int UIScene_PauseMenu::MustSignInReturnedPSN(void *pParam,int iPad,C4JStorage::EMessageResult result)
{
UIScene_PauseMenu* pClass = (UIScene_PauseMenu*)ui.GetSceneFromCallbackId((size_t)pParam);
if(result==C4JStorage::EMessage_ResultAccept && pClass)
{
#ifdef __PS3__
switch(pClass->m_eAction)
{
case eAction_ViewLeaderboardsPSN:
SQRNetworkManager_PS3::AttemptPSNSignIn(&UIScene_PauseMenu::ViewLeaderboards_SignInReturned, pParam);
break;
case eAction_ViewInvitesPSN:
SQRNetworkManager_PS3::AttemptPSNSignIn(&UIScene_PauseMenu::ViewInvites_SignInReturned, pParam);
break;
case eAction_SaveGamePSN:
SQRNetworkManager_PS3::AttemptPSNSignIn(&UIScene_PauseMenu::SaveGame_SignInReturned, pParam);
break;
case eAction_BuyTexturePackPSN:
SQRNetworkManager_PS3::AttemptPSNSignIn(&UIScene_PauseMenu::BuyTexturePack_SignInReturned, pParam);
break;
}
#elif defined __PSVITA__
switch(pClass->m_eAction)
{
case eAction_ViewLeaderboardsPSN:
//CD - Must force Ad-Hoc off if they want leaderboard PSN sign-in
//Save settings change
app.SetGameSettings(0, eGameSetting_PSVita_NetworkModeAdhoc, 0);
//Force off
CGameNetworkManager::setAdhocMode(false);
//Now Sign-in
SQRNetworkManager_Vita::AttemptPSNSignIn(&UIScene_PauseMenu::ViewLeaderboards_SignInReturned, pParam);
break;
case eAction_ViewInvitesPSN:
SQRNetworkManager_Vita::AttemptPSNSignIn(&UIScene_PauseMenu::ViewInvites_SignInReturned, pParam);
break;
case eAction_SaveGamePSN:
pClass->SetIgnoreInput(true);
SQRNetworkManager_Vita::AttemptPSNSignIn(&UIScene_PauseMenu::SaveGame_SignInReturned, pParam, true);
break;
case eAction_BuyTexturePackPSN:
SQRNetworkManager_Vita::AttemptPSNSignIn(&UIScene_PauseMenu::BuyTexturePack_SignInReturned, pParam);
break;
}
#else
switch(pClass->m_eAction)
{
case eAction_ViewLeaderboardsPSN:
SQRNetworkManager_Orbis::AttemptPSNSignIn(&UIScene_PauseMenu::ViewLeaderboards_SignInReturned, pClass, false, iPad);
break;
case eAction_ViewInvitesPSN:
SQRNetworkManager_Orbis::AttemptPSNSignIn(&UIScene_PauseMenu::ViewInvites_SignInReturned, pClass, false, iPad);
break;
case eAction_SaveGamePSN:
SQRNetworkManager_Orbis::AttemptPSNSignIn(&UIScene_PauseMenu::SaveGame_SignInReturned, pClass, false, iPad);
break;
case eAction_BuyTexturePackPSN:
SQRNetworkManager_Orbis::AttemptPSNSignIn(&UIScene_PauseMenu::BuyTexturePack_SignInReturned, pClass, false, iPad);
break;
}
#endif
}
return 0;
}
int UIScene_PauseMenu::ViewLeaderboards_SignInReturned(void *pParam,bool bContinue, int iPad)
{
UIScene_PauseMenu* pClass = (UIScene_PauseMenu*)ui.GetSceneFromCallbackId((size_t)pParam);
if(!pClass) return 0;
if(bContinue==true)
{
UINT uiIDA[1];
uiIDA[0]=IDS_CONFIRM_OK;
// guests can't look at leaderboards
if(ProfileManager.IsGuest(pClass->m_iPad))
{
ui.RequestAlertMessage(IDS_PRO_GUESTPROFILE_TITLE, IDS_PRO_GUESTPROFILE_TEXT, uiIDA, 1, ProfileManager.GetPrimaryPad());
}
else if(ProfileManager.IsSignedInLive(iPad))
{
#ifndef __ORBIS__
bool bContentRestricted=false;
ProfileManager.GetChatAndContentRestrictions(pClass->m_iPad,true,nullptr,&bContentRestricted,nullptr);
if(bContentRestricted)
{
// you can't see leaderboards
ui.RequestAlertMessage(IDS_ONLINE_SERVICE_TITLE, IDS_CONTENT_RESTRICTION, uiIDA, 1, ProfileManager.GetPrimaryPad());
}
else
#endif
{
ui.NavigateToScene(pClass->m_iPad, eUIScene_LeaderboardsMenu);
}
}
}
return 0;
}
int UIScene_PauseMenu::WarningTrialTexturePackReturned(void *pParam,int iPad,C4JStorage::EMessageResult result)
{
UIScene_PauseMenu* pClass = (UIScene_PauseMenu*)ui.GetSceneFromCallbackId((size_t)pParam);
#ifdef __ORBIS__
// If a patch is available, can't proceed
if (!pClass || pClass->CheckForPatch()) return 0;
#endif
#if defined(__PS3__) || defined(__ORBIS__) || defined(__PSVITA__)
if(result==C4JStorage::EMessage_ResultAccept)
{
if(!ProfileManager.IsSignedInLive(iPad))
{
if(pClass) pClass->m_eAction=eAction_SaveGamePSN;
#ifdef __ORBIS__// Check if PSN is unavailable because of age restriction
int npAvailability = ProfileManager.getNPAvailability(iPad);
if (npAvailability == SCE_NP_ERROR_AGE_RESTRICTION)
{
// 4J Stu - This is a bit messy and is due to the library incorrectly returning false for IsSignedInLive is the npAvailability isn't SCE_OK
UINT uiIDA[1];
uiIDA[0]=IDS_OK;
ui.RequestErrorMessage(IDS_ONLINE_SERVICE_TITLE, IDS_CONTENT_RESTRICTION, uiIDA, 1, iPad);
}
else
// Determine why they're not "signed in live"
if (ProfileManager.isSignedInPSN(iPad))
{
// Signed in to PSN but not connected (no internet access)
assert(!ProfileManager.isConnectedToPSN(iPad));
UINT uiIDA[1];
uiIDA[0] = IDS_OK;
ui.RequestErrorMessage( IDS_ERROR_NETWORK_TITLE, IDS_ERROR_NETWORK, uiIDA, 1, iPad);
}
else
{
UINT uiIDA[1];
uiIDA[0] = IDS_PRO_NOTONLINE_ACCEPT;
ui.RequestAlertMessage( IDS_PRO_NOTONLINE_TITLE, IDS_PRO_NOTONLINE_TEXT, uiIDA, 1, iPad, &UIScene_PauseMenu::MustSignInReturnedPSN, pParam);
}
#else // __PS3__
// You're not signed in to PSN!
UINT uiIDA[2];
uiIDA[0]=IDS_PRO_NOTONLINE_ACCEPT;
uiIDA[1]=IDS_PRO_NOTONLINE_DECLINE;
ui.RequestAlertMessage(IDS_PRO_NOTONLINE_TITLE, IDS_PRO_XBOXLIVE_NOTIFICATION, uiIDA, 2, iPad,&UIScene_PauseMenu::MustSignInReturnedPSN,pParam);
#endif
}
else
{
#ifndef __ORBIS__
// 4J-PB - need to check this user can access the store
bool bContentRestricted=false;
ProfileManager.GetChatAndContentRestrictions(ProfileManager.GetPrimaryPad(),true,nullptr,&bContentRestricted,nullptr);
if(bContentRestricted)
{
UINT uiIDA[1];
uiIDA[0]=IDS_CONFIRM_OK;
ui.RequestAlertMessage(IDS_ONLINE_SERVICE_TITLE, IDS_CONTENT_RESTRICTION, uiIDA, 1, iPad);
}
else
#endif
{
// need to get info on the pack to see if the user has already downloaded it
TexturePack *tPack = Minecraft::GetInstance()->skins->getSelected();
DLCTexturePack *pDLCTexPack=(DLCTexturePack *)tPack;
// retrieve the store name for the skin pack
DLCPack *pDLCPack=pDLCTexPack->getDLCInfoParentPack();//tPack->getDLCPack();
const char *pchPackName=wstringtofilename(pDLCPack->getName());
app.DebugPrintf("Texture Pack - %s\n",pchPackName);
SONYDLC *pSONYDLCInfo=app.GetSONYDLCInfo((char *)pchPackName);
if(pSONYDLCInfo!=nullptr)
{
char chName[42];
char chKeyName[20];
char chSkuID[SCE_NP_COMMERCE2_SKU_ID_LEN];
memset(chSkuID,0,SCE_NP_COMMERCE2_SKU_ID_LEN);
// find the info on the skin pack
// we have to retrieve the skuid from the store info, it can't be hardcoded since Sony may change it.
// So we assume the first sku for the product is the one we want
// MGH - keyname in the DLC file is 16 chars long, but there's no space for a nullptr terminating char
memset(chKeyName, 0, sizeof(chKeyName));
strncpy(chKeyName, pSONYDLCInfo->chDLCKeyname, 16);
#ifdef __ORBIS__
strcpy(chName, chKeyName);
#else
sprintf(chName,"%s-%s",app.GetCommerceCategory(),chKeyName);
#endif
app.GetDLCSkuIDFromProductList(chName,chSkuID);
// 4J-PB - need to check for an empty store
#if defined __ORBIS__ || defined __PSVITA__ || defined __PS3__
if(app.CheckForEmptyStore(iPad)==false)
#endif
{
if(app.DLCAlreadyPurchased(chSkuID))
{
app.DownloadAlreadyPurchased(chSkuID);
}
else
{
app.Checkout(chSkuID);
}
}
}
}
}
}
#endif //
return 0;
}
int UIScene_PauseMenu::BuyTexturePack_SignInReturned(void *pParam,bool bContinue, int iPad)
{
if(bContinue==true)
{
// Check if we're signed in to LIVE
if(ProfileManager.IsSignedInLive(iPad))
{
#if defined(__PS3__) || defined(__ORBIS__) || defined(__PSVITA__)
#ifndef __ORBIS__
// 4J-PB - need to check this user can access the store
bool bContentRestricted=false;
ProfileManager.GetChatAndContentRestrictions(iPad,true,nullptr,&bContentRestricted,nullptr);
if(bContentRestricted)
{
UINT uiIDA[1];
uiIDA[0]=IDS_CONFIRM_OK;
ui.RequestAlertMessage(IDS_ONLINE_SERVICE_TITLE, IDS_CONTENT_RESTRICTION, uiIDA, 1, iPad);
}
else
#endif
{
// need to get info on the pack to see if the user has already downloaded it
TexturePack *tPack = Minecraft::GetInstance()->skins->getSelected();
DLCTexturePack *pDLCTexPack=(DLCTexturePack *)tPack;
// retrieve the store name for the skin pack
DLCPack *pDLCPack=pDLCTexPack->getDLCInfoParentPack();//tPack->getDLCPack();
const char *pchPackName=wstringtofilename(pDLCPack->getName());
app.DebugPrintf("Texture Pack - %s\n",pchPackName);
SONYDLC *pSONYDLCInfo=app.GetSONYDLCInfo((char *)pchPackName);
if(pSONYDLCInfo!=nullptr)
{
char chName[42];
char chKeyName[20];
char chSkuID[SCE_NP_COMMERCE2_SKU_ID_LEN];
memset(chSkuID,0,SCE_NP_COMMERCE2_SKU_ID_LEN);
// find the info on the skin pack
// we have to retrieve the skuid from the store info, it can't be hardcoded since Sony may change it.
// So we assume the first sku for the product is the one we want
// MGH - keyname in the DLC file is 16 chars long, but there's no space for a nullptr terminating char
memset(chKeyName, 0, sizeof(chKeyName));
strncpy(chKeyName, pSONYDLCInfo->chDLCKeyname, 16);
#ifdef __ORBIS__
strcpy(chName, chKeyName);
#else
sprintf(chName,"%s-%s",app.GetCommerceCategory(),chKeyName);
#endif
app.GetDLCSkuIDFromProductList(chName,chSkuID);
// 4J-PB - need to check for an empty store
#if defined __ORBIS__ || defined __PSVITA__ || defined __PS3__
if(app.CheckForEmptyStore(iPad)==false)
#endif
{
if(app.DLCAlreadyPurchased(chSkuID))
{
app.DownloadAlreadyPurchased(chSkuID);
}
else
{
app.Checkout(chSkuID);
}
}
}
}
#else
// TO BE IMPEMENTED FOR ORBIS
#endif
}
}
return 0;
}
int UIScene_PauseMenu::ViewInvites_SignInReturned(void *pParam,bool bContinue, int iPad)
{
if(bContinue==true)
{
// Check if we're signed in to LIVE
if(ProfileManager.IsSignedInLive(iPad))
{
#ifdef __ORBIS__
SQRNetworkManager_Orbis::RecvInviteGUI();
#elif defined __PS3__
int ret = sceNpBasicRecvMessageCustom(SCE_NP_BASIC_MESSAGE_MAIN_TYPE_INVITE, SCE_NP_BASIC_RECV_MESSAGE_OPTIONS_INCLUDE_BOOTABLE, SYS_MEMORY_CONTAINER_ID_INVALID);
app.DebugPrintf("sceNpBasicRecvMessageCustom return %d ( %08x )\n", ret, ret);
#else // __PSVITA__
PSVITA_STUBBED;
#endif
}
}
return 0;
}
int UIScene_PauseMenu::ExitGameSaveDialogReturned(void *pParam,int iPad,C4JStorage::EMessageResult result)
{
// Exit with or without saving
// Decline means save in this dialog
if(result==C4JStorage::EMessage_ResultDecline || result==C4JStorage::EMessage_ResultThirdOption)
{
if( result==C4JStorage::EMessage_ResultDecline ) // Save
{
// 4J-PB - Is the player trying to save but they are using a trial texturepack ?
if(!Minecraft::GetInstance()->skins->isUsingDefaultSkin())
{
TexturePack *tPack = Minecraft::GetInstance()->skins->getSelected();
DLCTexturePack *pDLCTexPack=(DLCTexturePack *)tPack;
DLCPack *pDLCPack=pDLCTexPack->getDLCInfoParentPack();//tPack->getDLCPack();
if(!pDLCPack->hasPurchasedFile( DLCManager::e_DLCType_Texture, L"" ))
{
#ifdef _XBOX
// upsell
ULONGLONG ullOfferID_Full;
// get the dlc texture pack
DLCTexturePack *pDLCTexPack=(DLCTexturePack *)tPack;
app.GetDLCFullOfferIDForPackID(pDLCTexPack->getDLCParentPackId(),&ullOfferID_Full);
// tell sentient about the upsell of the full version of the skin pack
TelemetryManager->RecordUpsellPresented(iPad, eSet_UpsellID_Texture_DLC, ullOfferID_Full & 0xFFFFFFFF);
#endif
UINT uiIDA[2];
uiIDA[0]=IDS_CONFIRM_OK;
uiIDA[1]=IDS_CONFIRM_CANCEL;
// Give the player a warning about the trial version of the texture pack
ui.RequestAlertMessage(IDS_WARNING_DLC_TRIALTEXTUREPACK_TITLE, IDS_WARNING_DLC_TRIALTEXTUREPACK_TEXT, uiIDA, 2, ProfileManager.GetPrimaryPad() ,&UIScene_PauseMenu::WarningTrialTexturePackReturned, pParam);
return S_OK;
}
}
// does the save exist?
bool bSaveExists;
StorageManager.DoesSaveExist(&bSaveExists);
// 4J-PB - we check if the save exists inside the libs
// we need to ask if they are sure they want to overwrite the existing game
if(bSaveExists)
{
UINT uiIDA[2];
uiIDA[0]=IDS_CONFIRM_CANCEL;
uiIDA[1]=IDS_CONFIRM_OK;
ui.RequestAlertMessage(IDS_TITLE_SAVE_GAME, IDS_CONFIRM_SAVE_GAME, uiIDA, 2, ProfileManager.GetPrimaryPad(),&IUIScene_PauseMenu::ExitGameAndSaveReturned, pParam);
return 0;
}
else
{
#if defined(_XBOX_ONE) || defined(__ORBIS__)
StorageManager.SetSaveDisabled(false);
#endif
MinecraftServer::getInstance()->setSaveOnExit( true );
}
}
else
{
// been a few requests for a confirm on exit without saving
UINT uiIDA[2];
uiIDA[0]=IDS_CONFIRM_CANCEL;
uiIDA[1]=IDS_CONFIRM_OK;
ui.RequestAlertMessage(IDS_TITLE_DECLINE_SAVE_GAME, IDS_CONFIRM_DECLINE_SAVE_GAME, uiIDA, 2, ProfileManager.GetPrimaryPad(),&IUIScene_PauseMenu::ExitGameDeclineSaveReturned, pParam);
return 0;
}
app.SetAction(iPad,eAppAction_ExitWorld);
}
return 0;
}
#endif
void UIScene_PauseMenu::SetIgnoreInput(bool ignoreInput)
{
m_bIgnoreInput = ignoreInput;
}
#ifdef _XBOX_ONE
void UIScene_PauseMenu::HandleDLCLicenseChange()
{
}
#endif
#ifdef __ORBIS__
bool UIScene_PauseMenu::CheckForPatch()
{
int npAvailability = ProfileManager.getNPAvailability(ProfileManager.GetPrimaryPad());
bool bPatchAvailable;
switch(npAvailability)
{
case SCE_NP_ERROR_LATEST_PATCH_PKG_EXIST:
case SCE_NP_ERROR_LATEST_PATCH_PKG_DOWNLOADED:
bPatchAvailable=true;
break;
default:
bPatchAvailable=false;
break;
}
if(bPatchAvailable)
{
int32_t ret = sceErrorDialogInitialize();
if ( ret==SCE_OK )
{
m_bErrorDialogRunning = true;
SceErrorDialogParam param;
sceErrorDialogParamInitialize( &param );
// 4J-PB - We want to display the option to get the patch now
param.errorCode = SCE_NP_ERROR_LATEST_PATCH_PKG_DOWNLOADED;//pClass->m_errorCode;
ret = sceUserServiceGetInitialUser( &param.userId );
if ( ret == SCE_OK )
{
ret = sceErrorDialogOpen( &param );
}
else
{
sceErrorDialogTerminate();
}
}
}
return bPatchAvailable;
}
#endif
}