mirror of
https://github.com/GabsPuNs/Project-Zenith-Main.git
synced 2026-05-29 22:24:34 +00:00
Some cleanup
Just a bit. i dont want to clean all the ifdef for consoles right now
This commit is contained in:
@@ -581,57 +581,9 @@ void UIScene_LoadMenu::tick()
|
||||
ui.NavigateToScene(ProfileManager.GetPrimaryPad(),eUIScene_QuadrantSignin,&info);
|
||||
}
|
||||
|
||||
#ifdef __ORBIS__
|
||||
// check the status of the PSPlus common dialog
|
||||
switch (sceNpCommerceDialogUpdateStatus())
|
||||
{
|
||||
case SCE_COMMON_DIALOG_STATUS_FINISHED:
|
||||
{
|
||||
SceNpCommerceDialogResult Result;
|
||||
sceNpCommerceDialogGetResult(&Result);
|
||||
sceNpCommerceDialogTerminate();
|
||||
|
||||
if(Result.authorized)
|
||||
{
|
||||
ProfileManager.PsPlusUpdate(ProfileManager.GetPrimaryPad(), &Result);
|
||||
// they just became a PSPlus member
|
||||
LoadDataComplete(this);
|
||||
}
|
||||
else
|
||||
{
|
||||
// continue offline?
|
||||
UINT uiIDA[1];
|
||||
uiIDA[0]=IDS_PRO_NOTONLINE_DECLINE;
|
||||
|
||||
// Give the player a warning about the texture pack missing
|
||||
ui.RequestAlertMessage(IDS_PLAY_OFFLINE,IDS_NO_PLAYSTATIONPLUS, uiIDA, 1, ProfileManager.GetPrimaryPad(),&UIScene_LoadMenu::ContinueOffline,this);
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
|
||||
UIScene::tick();
|
||||
}
|
||||
|
||||
#ifdef __ORBIS__
|
||||
int UIScene_LoadMenu::ContinueOffline(void *pParam,int iPad,C4JStorage::EMessageResult result)
|
||||
{
|
||||
UIScene_LoadMenu* pClass = (UIScene_LoadMenu*)pParam;
|
||||
|
||||
// results switched for this dialog
|
||||
if(result==C4JStorage::EMessage_ResultAccept)
|
||||
{
|
||||
pClass->m_MoreOptionsParams.bOnlineGame=false;
|
||||
pClass->LoadDataComplete(pClass);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
void UIScene_LoadMenu::handleInput(int iPad, int key, bool repeat, bool pressed, bool released, bool &handled)
|
||||
{
|
||||
if(m_bIgnoreInput) return;
|
||||
@@ -1193,34 +1145,11 @@ int UIScene_LoadMenu::LoadDataComplete(void *pParam)
|
||||
// If this is an online game but not all players are signed in to Live, stop!
|
||||
if (isOnlineGame && !isSignedInLive)
|
||||
{
|
||||
#ifdef __ORBIS__
|
||||
assert(iPadNotSignedInLive != -1);
|
||||
// Check if PSN is unavailable because of age restriction
|
||||
int npAvailability = ProfileManager.getNPAvailability(iPadNotSignedInLive);
|
||||
if (npAvailability == SCE_NP_ERROR_AGE_RESTRICTION)
|
||||
{
|
||||
pClass->m_bIgnoreInput = false;
|
||||
// 4J Stu - This is a bit messy and is due to the library incorrectly returning false for IsSignedInLive if the npAvailability isn't SCE_OK
|
||||
UINT uiIDA[1];
|
||||
uiIDA[0]=IDS_OK;
|
||||
ui.RequestErrorMessage(IDS_ONLINE_SERVICE_TITLE, IDS_CONTENT_RESTRICTION, uiIDA, 1, iPadNotSignedInLive);
|
||||
}
|
||||
else
|
||||
{
|
||||
pClass->m_bIgnoreInput=true;
|
||||
UINT uiIDA[2];
|
||||
uiIDA[0] = IDS_PRO_NOTONLINE_ACCEPT;
|
||||
uiIDA[1] = IDS_CANCEL;
|
||||
ui.RequestAlertMessage( IDS_PRO_NOTONLINE_TITLE, IDS_PRO_NOTONLINE_TEXT, uiIDA, 2, iPadNotSignedInLive, &UIScene_LoadMenu::MustSignInReturnedPSN, pClass);
|
||||
}
|
||||
return 0;
|
||||
#else
|
||||
pClass->m_bIgnoreInput=false;
|
||||
UINT uiIDA[1];
|
||||
uiIDA[0]=IDS_CONFIRM_OK;
|
||||
ui.RequestAlertMessage( IDS_PRO_NOTONLINE_TITLE, IDS_PRO_NOTONLINE_TEXT, uiIDA,1,ProfileManager.GetPrimaryPad());
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
// Check if user-created content is allowed, as we cannot play multiplayer if it's not
|
||||
@@ -1229,29 +1158,7 @@ int UIScene_LoadMenu::LoadDataComplete(void *pParam)
|
||||
BOOL pccFriendsAllowed = TRUE;
|
||||
bool bContentRestricted = false;
|
||||
ProfileManager.AllowedPlayerCreatedContent(ProfileManager.GetPrimaryPad(),false,&pccAllowed,&pccFriendsAllowed);
|
||||
#if defined(__PS3__) || defined(__PSVITA__)
|
||||
if(isOnlineGame)
|
||||
{
|
||||
ProfileManager.GetChatAndContentRestrictions(ProfileManager.GetPrimaryPad(),false,nullptr,&bContentRestricted,nullptr);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef __ORBIS__
|
||||
bool bPlayStationPlus=true;
|
||||
int iPadWithNoPlaystationPlus=0;
|
||||
for(unsigned int i = 0; i < XUSER_MAX_COUNT; ++i)
|
||||
{
|
||||
if(ProfileManager.IsSignedIn(i) && ((i == iPrimaryPad) || isLocalMultiplayerAvailable))
|
||||
{
|
||||
if(!ProfileManager.HasPlayStationPlus(i))
|
||||
{
|
||||
bPlayStationPlus=false;
|
||||
iPadWithNoPlaystationPlus=i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
noUGC = !pccAllowed && !pccFriendsAllowed;
|
||||
|
||||
if(!isOnlineGame || !isLocalMultiplayerAvailable)
|
||||
@@ -1271,54 +1178,8 @@ int UIScene_LoadMenu::LoadDataComplete(void *pParam)
|
||||
ui.RequestContentRestrictedMessageBox();
|
||||
pClass->m_bIgnoreInput=false;
|
||||
}
|
||||
#ifdef __ORBIS__
|
||||
else if(isOnlineGame && (bPlayStationPlus==false))
|
||||
{
|
||||
pClass->setVisible( true );
|
||||
pClass->m_bIgnoreInput=false;
|
||||
|
||||
if(ProfileManager.RequestingPlaystationPlus(iPadWithNoPlaystationPlus))
|
||||
{
|
||||
// MGH - added this so we don't try and upsell when we don't know if the player has PS Plus yet (if it can't connect to the PS Plus server).
|
||||
UINT uiIDA[1];
|
||||
uiIDA[0]=IDS_OK;
|
||||
ui.RequestAlertMessage(IDS_ERROR_NETWORK_TITLE, IDS_ERROR_NETWORK, uiIDA, 1, ProfileManager.GetPrimaryPad(), nullptr, nullptr);
|
||||
return 0;
|
||||
}
|
||||
|
||||
// 4J-PB - we're not allowed to show the text Playstation Plus - have to call the upsell all the time!
|
||||
// upsell psplus
|
||||
int32_t iResult=sceNpCommerceDialogInitialize();
|
||||
|
||||
SceNpCommerceDialogParam param;
|
||||
sceNpCommerceDialogParamInitialize(¶m);
|
||||
param.mode=SCE_NP_COMMERCE_DIALOG_MODE_PLUS;
|
||||
param.features = SCE_NP_PLUS_FEATURE_REALTIME_MULTIPLAY;
|
||||
param.userId = ProfileManager.getUserID(iPadWithNoPlaystationPlus);
|
||||
|
||||
iResult=sceNpCommerceDialogOpen(¶m);
|
||||
|
||||
// UINT uiIDA[2];
|
||||
// uiIDA[0]=IDS_PLAY_OFFLINE;
|
||||
// uiIDA[1]=IDS_PLAYSTATIONPLUS_SIGNUP;
|
||||
// ui.RequestMessageBox( IDS_FAILED_TO_CREATE_GAME_TITLE, IDS_NO_PLAYSTATIONPLUS, uiIDA,2,ProfileManager.GetPrimaryPad(),&UIScene_LoadMenu::PSPlusReturned,pClass, app.GetStringTable(),nullptr,0,false);
|
||||
}
|
||||
|
||||
#endif
|
||||
else
|
||||
{
|
||||
|
||||
#if defined(__ORBIS__) || defined(__PSVITA__)
|
||||
if(isOnlineGame)
|
||||
{
|
||||
bool chatRestricted = false;
|
||||
ProfileManager.GetChatAndContentRestrictions(ProfileManager.GetPrimaryPad(),false,&chatRestricted,nullptr,nullptr);
|
||||
if(chatRestricted)
|
||||
{
|
||||
ProfileManager.DisplaySystemMessage( SCE_MSG_DIALOG_SYSMSG_TYPE_TRC_PSN_CHAT_RESTRICTION, ProfileManager.GetPrimaryPad() );
|
||||
}
|
||||
}
|
||||
#endif
|
||||
DWORD dwLocalUsersMask = CGameNetworkManager::GetLocalPlayerMask(ProfileManager.GetPrimaryPad());
|
||||
|
||||
// No guest problems so we don't need to force a sign-in of players here
|
||||
@@ -1488,13 +1349,6 @@ void UIScene_LoadMenu::StartGameFromSave(UIScene_LoadMenu* pClass, DWORD dwLocal
|
||||
}
|
||||
|
||||
bool isClientSide = ProfileManager.IsSignedInLive(ProfileManager.GetPrimaryPad()) && pClass->m_MoreOptionsParams.bOnlineGame;
|
||||
#ifdef __PSVITA__
|
||||
if(CGameNetworkManager::usingAdhocMode())
|
||||
{
|
||||
if(SQRNetworkManager_AdHoc_Vita::GetAdhocStatus())// && pClass->m_MoreOptionsParams.bOnlineGame)
|
||||
isClientSide = true;
|
||||
}
|
||||
#endif // __PSVITA__
|
||||
|
||||
bool isPrivate = (app.GetGameSettings(pClass->m_iPad,eGameSetting_InviteOnly)>0)?true:false;
|
||||
|
||||
@@ -1630,35 +1484,11 @@ int UIScene_LoadMenu::StartGame_SignInReturned(void *pParam,bool bContinue, int
|
||||
// If this is an online game but not all players are signed in to Live, stop!
|
||||
if (isOnlineGame && !isSignedInLive)
|
||||
{
|
||||
#ifdef __ORBIS__
|
||||
assert(iPadNotSignedInLive != -1);
|
||||
|
||||
// Check if PSN is unavailable because of age restriction
|
||||
int npAvailability = ProfileManager.getNPAvailability(iPadNotSignedInLive);
|
||||
if (npAvailability == SCE_NP_ERROR_AGE_RESTRICTION)
|
||||
{
|
||||
pClass->m_bIgnoreInput = false;
|
||||
// 4J Stu - This is a bit messy and is due to the library incorrectly returning false for IsSignedInLive if the npAvailability isn't SCE_OK
|
||||
UINT uiIDA[1];
|
||||
uiIDA[0]=IDS_OK;
|
||||
ui.RequestErrorMessage(IDS_ONLINE_SERVICE_TITLE, IDS_CONTENT_RESTRICTION, uiIDA, 1, iPadNotSignedInLive);
|
||||
}
|
||||
else
|
||||
{
|
||||
pClass->m_bIgnoreInput=true;
|
||||
UINT uiIDA[2];
|
||||
uiIDA[0] = IDS_PRO_NOTONLINE_ACCEPT;
|
||||
uiIDA[1] = IDS_CANCEL;
|
||||
ui.RequestAlertMessage( IDS_PRO_NOTONLINE_TITLE, IDS_PRO_NOTONLINE_TEXT, uiIDA, 2, iPadNotSignedInLive, &UIScene_LoadMenu::MustSignInReturnedPSN, pClass);
|
||||
}
|
||||
return 0;
|
||||
#else
|
||||
pClass->m_bIgnoreInput=false;
|
||||
UINT uiIDA[1];
|
||||
uiIDA[0]=IDS_CONFIRM_OK;
|
||||
ui.RequestAlertMessage( IDS_PRO_NOTONLINE_TITLE, IDS_PRO_NOTONLINE_TEXT, uiIDA,1,ProfileManager.GetPrimaryPad());
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
// Check if user-created content is allowed, as we cannot play multiplayer if it's not
|
||||
@@ -1727,50 +1557,4 @@ void UIScene_LoadMenu::handleGainFocus(bool navBack)
|
||||
{
|
||||
m_checkboxOnline.setChecked(m_MoreOptionsParams.bOnlineGame == TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef __ORBIS__
|
||||
int UIScene_LoadMenu::MustSignInReturnedPSN(void *pParam,int iPad,C4JStorage::EMessageResult result)
|
||||
{
|
||||
UIScene_LoadMenu* pClass = (UIScene_LoadMenu *)pParam;
|
||||
pClass->m_bIgnoreInput = false;
|
||||
|
||||
if(result==C4JStorage::EMessage_ResultAccept)
|
||||
{
|
||||
SQRNetworkManager_Orbis::AttemptPSNSignIn(&UIScene_LoadMenu::StartGame_SignInReturned, pClass, false, iPad);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
// int UIScene_LoadMenu::PSPlusReturned(void *pParam,int iPad,C4JStorage::EMessageResult result)
|
||||
// {
|
||||
// int32_t iResult;
|
||||
// UIScene_LoadMenu *pClass = (UIScene_LoadMenu *)pParam;
|
||||
//
|
||||
// // continue offline, or upsell PS Plus?
|
||||
// if(result==C4JStorage::EMessage_ResultDecline)
|
||||
// {
|
||||
// // upsell psplus
|
||||
// iResult=sceNpCommerceDialogInitialize();
|
||||
//
|
||||
// SceNpCommerceDialogParam param;
|
||||
// sceNpCommerceDialogParamInitialize(¶m);
|
||||
// param.mode=SCE_NP_COMMERCE_DIALOG_MODE_PLUS;
|
||||
// param.features = SCE_NP_PLUS_FEATURE_REALTIME_MULTIPLAY;
|
||||
// param.userId = ProfileManager.getUserID(pClass->m_iPad);
|
||||
//
|
||||
//
|
||||
// iResult=sceNpCommerceDialogOpen(¶m);
|
||||
// }
|
||||
// else if(result==C4JStorage::EMessage_ResultAccept)
|
||||
// {
|
||||
// // continue offline
|
||||
// pClass->m_MoreOptionsParams.bOnlineGame=false;
|
||||
// pClass->LoadDataComplete(pClass);
|
||||
// }
|
||||
//
|
||||
// pClass->m_bIgnoreInput=false;
|
||||
// return 0;
|
||||
// }
|
||||
#endif
|
||||
}
|
||||
Reference in New Issue
Block a user