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

@@ -296,56 +296,8 @@ void UIScene_CreateWorldMenu::tick()
m_bShowTexturePackDescription = false;
}
#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
checkStateAndStartGame();
}
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_CreateWorldMenu::ContinueOffline,dynamic_cast<UIScene_CreateWorldMenu*>(this));
}
}
break;
default:
break;
}
#endif
}
#ifdef __ORBIS__
int UIScene_CreateWorldMenu::ContinueOffline(void *pParam,int iPad,C4JStorage::EMessageResult result)
{
UIScene_CreateWorldMenu* pClass = (UIScene_CreateWorldMenu*)pParam;
// results switched for this dialog
if(result==C4JStorage::EMessage_ResultAccept)
{
pClass->m_MoreOptionsParams.bOnlineGame=false;
pClass->checkStateAndStartGame();
}
return 0;
}
#endif
#ifdef _WINDOWS64
void UIScene_CreateWorldMenu::getDirectEditInputs(vector<UIControl_TextInput*> &inputs)
{
@@ -725,54 +677,11 @@ void UIScene_CreateWorldMenu::checkStateAndStartGame()
// 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)
{
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
{
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_CreateWorldMenu::MustSignInReturnedPSN, this);
}
return;
/* 4J-PB - Add this after release
#elif defined __PSVITA__
m_bIgnoreInput=false;
// Determine why they're not "signed in live"
if (ProfileManager.IsSignedInPSN(ProfileManager.GetPrimaryPad()))
{
// Signed in to PSN but not connected (no internet access)
UINT uiIDA[1];
uiIDA[0] = IDS_CONFIRM_OK;
ui.RequestErrorMessage(IDS_PRO_CURRENTLY_NOT_ONLINE_TITLE, IDS_PRO_PSNOFFLINE_TEXT, uiIDA, 1, ProfileManager.GetPrimaryPad());
}
else
{
// Not signed in to PSN
UINT uiIDA[1];
uiIDA[0] = IDS_CONFIRM_OK;
ui.RequestErrorMessage(IDS_PRO_NOTONLINE_TITLE, IDS_PRO_NOTONLINE_TEXT, uiIDA, 1, ProfileManager.GetPrimaryPad());
return;
}*/
#else
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;
#endif
}
#ifdef __ORBIS__
@@ -1007,13 +916,6 @@ void UIScene_CreateWorldMenu::CreateGame(UIScene_CreateWorldMenu* pClass, DWORD
#endif
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 = pClass->m_MoreOptionsParams.bInviteOnly?true:false;
@@ -1218,35 +1120,11 @@ int UIScene_CreateWorldMenu::StartGame_SignInReturned(void *pParam,bool bContinu
// 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.RequestAlertMessage(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_CreateWorldMenu::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
@@ -1362,52 +1240,6 @@ int UIScene_CreateWorldMenu::ConfirmCreateReturned(void *pParam,int iPad,C4JStor
return 0;
}
#ifdef __ORBIS__
int UIScene_CreateWorldMenu::MustSignInReturnedPSN(void *pParam,int iPad,C4JStorage::EMessageResult result)
{
UIScene_CreateWorldMenu* pClass = (UIScene_CreateWorldMenu *)pParam;
pClass->m_bIgnoreInput = false;
if(result==C4JStorage::EMessage_ResultAccept)
{
SQRNetworkManager_Orbis::AttemptPSNSignIn(&UIScene_CreateWorldMenu::StartGame_SignInReturned, pClass, false, iPad);
}
return 0;
}
// int UIScene_CreateWorldMenu::PSPlusReturned(void *pParam,int iPad,C4JStorage::EMessageResult result)
// {
// int32_t iResult;
// UIScene_CreateWorldMenu *pClass = (UIScene_CreateWorldMenu *)pParam;
//
// // continue offline, or upsell PS Plus?
// if(result==C4JStorage::EMessage_ResultDecline)
// {
// // upsell psplus
// int32_t iResult=sceNpCommerceDialogInitialize();
//
// SceNpCommerceDialogParam param;
// sceNpCommerceDialogParamInitialize(&param);
// 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(&param);
// }
// else if(result==C4JStorage::EMessage_ResultAccept)
// {
// // continue offline
// pClass->m_MoreOptionsParams.bOnlineGame=false;
// pClass->checkStateAndStartGame();
// }
//
// pClass->m_bIgnoreInput=false;
// return 0;
// }
#endif
void UIScene_CreateWorldMenu::handleTouchBoxRebuild()
{
m_bRebuildTouchBoxes = true;

View File

@@ -99,12 +99,6 @@ protected:
static void CreateGame(UIScene_CreateWorldMenu* pClass, DWORD dwLocalUsersMask);
static int ConfirmCreateReturned(void *pParam,int iPad,C4JStorage::EMessageResult result);
static int StartGame_SignInReturned(void *pParam,bool bContinue, int iPad);
static int MustSignInReturnedPSN(void *pParam,int iPad,C4JStorage::EMessageResult result);
#ifdef __ORBIS__
//static int PSPlusReturned(void *pParam,int iPad,C4JStorage::EMessageResult result);
static int ContinueOffline(void *pParam,int iPad,C4JStorage::EMessageResult result);
#endif
virtual void checkStateAndStartGame();
};

View File

@@ -88,9 +88,6 @@ void UIScene_InGameInfoMenu::updateTooltips()
}
if(g_NetworkManager.IsLocalGame()) keyX = -1;
#ifdef __PSVITA__
if(CGameNetworkManager::usingAdhocMode()) keyX = -1;
#endif
INetworkPlayer *selectedPlayer = g_NetworkManager.GetPlayerBySmallId(m_players[m_playerList.getCurrentSelection()]->m_smallId);
@@ -250,33 +247,6 @@ void UIScene_InGameInfoMenu::handleInput(int iPad, int key, bool repeat, bool pr
}
break;
case ACTION_MENU_Y:
#if defined(__PS3__) || defined(__ORBIS__)
if(pressed && iPad == ProfileManager.GetPrimaryPad())
{
#ifdef __PS3__
// are we offline?
if(!ProfileManager.IsSignedInLive(iPad))
{
// get them to sign in to online
UINT uiIDA[2];
uiIDA[0]=IDS_PRO_NOTONLINE_ACCEPT;
uiIDA[1]=IDS_PRO_NOTONLINE_DECLINE;
ui.RequestErrorMessage(IDS_PRO_NOTONLINE_TITLE, IDS_PRO_NOTONLINE_TEXT, uiIDA, 2, ProfileManager.GetPrimaryPad(),&UIScene_InGameInfoMenu::MustSignInReturnedPSN,this);
}
else
#endif
{
#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(pressed && m_playerList.hasFocus() && (m_playerList.getItemCount() > 0) && (m_playerList.getCurrentSelection() < m_players.size()) )
{
INetworkPlayer *player = g_NetworkManager.GetPlayerBySmallId(m_players[m_playerList.getCurrentSelection()]->m_smallId);
@@ -284,30 +254,13 @@ void UIScene_InGameInfoMenu::handleInput(int iPad, int key, bool repeat, bool pr
{
PlayerUID uid = player->GetUID();
if( uid != INVALID_XUID )
{
#ifdef __PSVITA__
PSVITA_STUBBED;
#else
ProfileManager.ShowProfileCard(iPad,uid);
#endif
}
}
}
#endif
break;
case ACTION_MENU_X:
if(pressed && !repeat && !g_NetworkManager.IsLocalGame() )
{
#ifdef __PSVITA__
if(CGameNetworkManager::usingAdhocMode() == false)
g_NetworkManager.SendInviteGUI(iPad);
#else
g_NetworkManager.SendInviteGUI(iPad);
#endif
}
break;
case ACTION_MENU_OK:
#ifdef __ORBIS__
@@ -494,42 +447,4 @@ UIScene_InGameInfoMenu::PlayerInfo *UIScene_InGameInfoMenu::BuildPlayerInfo(INet
info->m_name = playerName;
return info;
}
#if defined __PS3__ || defined __PSVITA__
int UIScene_InGameInfoMenu::MustSignInReturnedPSN(void *pParam,int iPad,C4JStorage::EMessageResult result)
{
UIScene_InGameInfoMenu* pClass = (UIScene_InGameInfoMenu*)pParam;
if(result==C4JStorage::EMessage_ResultAccept)
{
#ifdef __PS3__
SQRNetworkManager_PS3::AttemptPSNSignIn(&UIScene_InGameInfoMenu::ViewInvites_SignInReturned, pClass);
#else // __PSVITA__
SQRNetworkManager_Vita::AttemptPSNSignIn(&UIScene_InGameInfoMenu::ViewInvites_SignInReturned, pClass);
#endif
}
return 0;
}
int UIScene_InGameInfoMenu::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__
SQRNetworkManager_Vita::RecvInviteGUI();
#endif
}
}
return 0;
}
#endif
}

View File

@@ -66,9 +66,4 @@ public:
private:
PlayerInfo *BuildPlayerInfo(INetworkPlayer *player);
#if defined(__PS3__) || defined (__PSVITA__) || defined(__ORBIS__)
static int MustSignInReturnedPSN(void *pParam,int iPad,C4JStorage::EMessageResult result);
static int ViewInvites_SignInReturned(void *pParam,bool bContinue, int iPad);
#endif
};

View File

@@ -75,14 +75,6 @@ UIScene_InGameSaveManagementMenu::UIScene_InGameSaveManagementMenu(int iPad, voi
Initialise();
}
#ifdef __PSVITA__
if(CGameNetworkManager::usingAdhocMode() && SQRNetworkManager_AdHoc_Vita::GetAdhocStatus())
{
g_NetworkManager.startAdhocMatching(); // create the client matching context and clear out the friends list
}
#endif
// If we're not ignoring input, then we aren't still waiting for the DLC to mount, and can now check for corrupt dlc. Otherwise this will happen when the dlc has finished mounting.
if( !m_bIgnoreInput)
{

View File

@@ -494,11 +494,6 @@ void UIScene_JoinMenu::JoinGame(UIScene_JoinMenu* pClass)
dwLocalUsersMask |= CGameNetworkManager::GetLocalPlayerMask(ProfileManager.GetPrimaryPad());
isSignedInLive = ProfileManager.IsSignedInLive(ProfileManager.GetPrimaryPad());
#ifdef __PSVITA__
if(CGameNetworkManager::usingAdhocMode() && SQRNetworkManager_AdHoc_Vita::GetAdhocStatus())
isSignedInLive = true;
#endif
}
}
@@ -542,15 +537,6 @@ void UIScene_JoinMenu::JoinGame(UIScene_JoinMenu* pClass)
if(!pccAllowed && !pccFriendsAllowed) noUGC = true;
#endif
#ifdef __PSVITA__
if( CGameNetworkManager::usingAdhocMode() )
{
noPrivileges = false;
noUGC = false;
}
#endif
if(noUGC)
{
pClass->setVisible( true );

View File

@@ -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(&param);
param.mode=SCE_NP_COMMERCE_DIALOG_MODE_PLUS;
param.features = SCE_NP_PLUS_FEATURE_REALTIME_MULTIPLAY;
param.userId = ProfileManager.getUserID(iPadWithNoPlaystationPlus);
iResult=sceNpCommerceDialogOpen(&param);
// 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(&param);
// 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(&param);
// }
// else if(result==C4JStorage::EMessage_ResultAccept)
// {
// // continue offline
// pClass->m_MoreOptionsParams.bOnlineGame=false;
// pClass->LoadDataComplete(pClass);
// }
//
// pClass->m_bIgnoreInput=false;
// return 0;
// }
#endif
}

View File

@@ -117,11 +117,6 @@ private:
static int CheckResetNetherReturned(void *pParam,int iPad,C4JStorage::EMessageResult result);
static int DeleteSaveDialogReturned(void *pParam,int iPad,C4JStorage::EMessageResult result);
static int DeleteSaveDataReturned(void *pParam,bool bSuccess);
static int MustSignInReturnedPSN(void *pParam,int iPad,C4JStorage::EMessageResult result);
#ifdef __ORBIS__
//static int PSPlusReturned(void *pParam,int iPad,C4JStorage::EMessageResult result);
static int ContinueOffline(void *pParam,int iPad,C4JStorage::EMessageResult result);
#endif
public:
static int StartGame_SignInReturned(LPVOID pParam, bool, int);

File diff suppressed because it is too large Load Diff

View File

@@ -187,15 +187,6 @@ private:
static int AddServerKeyboardCallback(LPVOID lpParam, bool bRes);
#endif
#if defined(__PS3__) || defined(__PSVITA__) || defined(__ORBIS__)
static int MustSignInReturnedPSN(void *pParam,int iPad,C4JStorage::EMessageResult result);
static int PSN_SignInReturned(void *pParam,bool bContinue, int iPad);
static void remoteStorageGetSaveCallback(LPVOID lpParam, SonyRemoteStorage::Status s, int error_code);
#endif
#ifdef __ORBIS__
//static int PSPlusReturned(void *pParam,int iPad,C4JStorage::EMessageResult result);
#endif
#ifdef _XBOX_ONE
typedef struct _SaveTransferStateContainer
{

View File

@@ -160,13 +160,7 @@ void UIScene_MainMenu::handleGainFocus(bool navBack)
{
// For returning to menus after exiting a game.
if (ProfileManager.IsSignedIn(iPad) )
{
#ifdef _WINDOWS64
g_DiscordPresence.SetCurrentGameActivity(CONTEXT_PRESENCE_MENUS);
#else
ProfileManager.SetCurrentGameActivity(iPad, CONTEXT_PRESENCE_MENUS, false);
#endif
}
g_DiscordPresence.SetCurrentGameActivity(CONTEXT_PRESENCE_MENUS);
}
}
ProfileManager.SetLockedProfile(-1);
@@ -538,108 +532,13 @@ int UIScene_MainMenu::MustSignInReturned(void *pParam, int iPad, C4JStorage::EMe
{
// if the user is valid, we should set the presence
if(ProfileManager.IsSignedIn(i))
{
#ifdef _WINDOWS64
g_DiscordPresence.SetCurrentGameActivity(CONTEXT_PRESENCE_MENUS);
#else
ProfileManager.SetCurrentGameActivity(i, CONTEXT_PRESENCE_MENUS, false);
#endif
}
g_DiscordPresence.SetCurrentGameActivity(CONTEXT_PRESENCE_MENUS);
}
}
return 0;
}
#if defined(__PS3__) || defined(__PSVITA__) || defined(__ORBIS__)
int UIScene_MainMenu::MustSignInReturnedPSN(void *pParam,int iPad,C4JStorage::EMessageResult result)
{
UIScene_MainMenu* pClass = (UIScene_MainMenu*)pParam;
if(result==C4JStorage::EMessage_ResultAccept)
{
#ifdef __PS3__
// we need to specify local game here to display local and LIVE profiles in the list
switch(pClass->m_eAction)
{
case eAction_RunLeaderboardsPSN:
SQRNetworkManager_PS3::AttemptPSNSignIn(&UIScene_MainMenu::Leaderboards_SignInReturned, pClass);
break;
case eAction_RunGamePSN:
SQRNetworkManager_PS3::AttemptPSNSignIn(&UIScene_MainMenu::CreateLoad_SignInReturned, pClass);
break;
case eAction_RunUnlockOrDLCPSN:
SQRNetworkManager_PS3::AttemptPSNSignIn(&UIScene_MainMenu::UnlockFullGame_SignInReturned, pClass);
break;
}
#elif defined __PSVITA__
switch(pClass->m_eAction)
{
case eAction_RunLeaderboardsPSN:
//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_MainMenu::Leaderboards_SignInReturned, pClass);
break;
case eAction_RunGamePSN:
if(CGameNetworkManager::usingAdhocMode())
{
SQRNetworkManager_AdHoc_Vita::AttemptAdhocSignIn(&UIScene_MainMenu::CreateLoad_SignInReturned, pClass);
}
else
{
SQRNetworkManager_Vita::AttemptPSNSignIn(&UIScene_MainMenu::CreateLoad_SignInReturned, pClass);
}
break;
case eAction_RunUnlockOrDLCPSN:
//CD - Must force Ad-Hoc off if they want commerce 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_MainMenu::UnlockFullGame_SignInReturned, pClass);
break;
}
#else
switch(pClass->m_eAction)
{
case eAction_RunLeaderboardsPSN:
SQRNetworkManager_Orbis::AttemptPSNSignIn(&UIScene_MainMenu::Leaderboards_SignInReturned, pClass, true, iPad);
break;
case eAction_RunGamePSN:
SQRNetworkManager_Orbis::AttemptPSNSignIn(&UIScene_MainMenu::CreateLoad_SignInReturned, pClass, true, iPad);
break;
case eAction_RunUnlockOrDLCPSN:
SQRNetworkManager_Orbis::AttemptPSNSignIn(&UIScene_MainMenu::UnlockFullGame_SignInReturned, pClass, true, iPad);
break;
}
#endif
}
else
{
if( pClass->m_eAction == eAction_RunGamePSN )
{
if( result == C4JStorage::EMessage_Cancelled)
CreateLoad_SignInReturned(pClass, false, 0);
else
CreateLoad_SignInReturned(pClass, true, 0);
}
else
{
pClass->m_bIgnorePress=false;
}
}
return 0;
}
#endif
#ifdef _XBOX_ONE
int UIScene_MainMenu::HelpAndOptions_SignInReturned(void *pParam,bool bContinue,int iPad, int iController)
#else
@@ -651,11 +550,8 @@ int UIScene_MainMenu::HelpAndOptions_SignInReturned(void *pParam,bool bContinue,
if(bContinue)
{
// 4J-JEV: Don't we only need to update rich-presence if the sign-in status changes.
#ifdef _WINDOWS64
g_DiscordPresence.SetCurrentGameActivity(CONTEXT_PRESENCE_MENUS);
#else
ProfileManager.SetCurrentGameActivity(iPad, CONTEXT_PRESENCE_MENUS, false);
#endif
g_DiscordPresence.SetCurrentGameActivity(CONTEXT_PRESENCE_MENUS);
#if TO_BE_IMPLEMENTED
if(app.GetTMSDLCInfoRead())
#endif
@@ -695,13 +591,7 @@ int UIScene_MainMenu::HelpAndOptions_SignInReturned(void *pParam,bool bContinue,
{
// if the user is valid, we should set the presence
if(ProfileManager.IsSignedIn(i))
{
#ifdef _WINDOWS64
g_DiscordPresence.SetCurrentGameActivity(CONTEXT_PRESENCE_MENUS);
#else
ProfileManager.SetCurrentGameActivity(i,CONTEXT_PRESENCE_MENUS,false);
#endif
}
g_DiscordPresence.SetCurrentGameActivity(CONTEXT_PRESENCE_MENUS);
}
}
@@ -729,12 +619,7 @@ int UIScene_MainMenu::CreateLoad_SignInReturned(void *pParam, bool bContinue, in
if(bContinue)
{
// 4J-JEV: We only need to update rich-presence if the sign-in status changes.
#ifdef _WINDOWS64
g_DiscordPresence.SetCurrentGameActivity(CONTEXT_PRESENCE_MENUS);
#else
ProfileManager.SetCurrentGameActivity(iPad, CONTEXT_PRESENCE_MENUS, false);
#endif
g_DiscordPresence.SetCurrentGameActivity(CONTEXT_PRESENCE_MENUS);
UINT uiIDA[1] = { IDS_OK };
@@ -754,21 +639,6 @@ int UIScene_MainMenu::CreateLoad_SignInReturned(void *pParam, bool bContinue, in
if(ProfileManager.IsFullVersion())
{
bool bSignedInLive = ProfileManager.IsSignedInLive(iPad);
#ifdef __PSVITA__
if(CGameNetworkManager::usingAdhocMode())
{
if(SQRNetworkManager_AdHoc_Vita::GetAdhocStatus())
{
bSignedInLive = true;
}
else
{
// adhoc mode, but we didn't make the connection, turn off adhoc mode, and just go with whatever the regular online status is
CGameNetworkManager::setAdhocMode(false);
bSignedInLive = ProfileManager.IsSignedInLive(iPad);
}
}
#endif
// Check if we're signed in to LIVE
if(bSignedInLive)
@@ -916,13 +786,7 @@ int UIScene_MainMenu::CreateLoad_SignInReturned(void *pParam, bool bContinue, in
{
// if the user is valid, we should set the presence
if(ProfileManager.IsSignedIn(i))
{
#ifdef _WINDOWS64
g_DiscordPresence.SetCurrentGameActivity(CONTEXT_PRESENCE_MENUS);
#else
ProfileManager.SetCurrentGameActivity(i, CONTEXT_PRESENCE_MENUS, false);
#endif
}
g_DiscordPresence.SetCurrentGameActivity(CONTEXT_PRESENCE_MENUS);
}
}
@@ -940,11 +804,7 @@ int UIScene_MainMenu::Leaderboards_SignInReturned(void *pParam,bool bContinue,in
if(bContinue)
{
// 4J-JEV: We only need to update rich-presence if the sign-in status changes.
#ifdef _WINDOWS64
g_DiscordPresence.SetCurrentGameActivity(CONTEXT_PRESENCE_MENUS);
#else
ProfileManager.SetCurrentGameActivity(iPad, CONTEXT_PRESENCE_MENUS, false);
#endif
g_DiscordPresence.SetCurrentGameActivity(CONTEXT_PRESENCE_MENUS);
UINT uiIDA[1] = { IDS_OK };
@@ -994,13 +854,7 @@ int UIScene_MainMenu::Leaderboards_SignInReturned(void *pParam,bool bContinue,in
{
// if the user is valid, we should set the presence
if(ProfileManager.IsSignedIn(i))
{
#ifdef _WINDOWS64
g_DiscordPresence.SetCurrentGameActivity(CONTEXT_PRESENCE_MENUS);
#else
ProfileManager.SetCurrentGameActivity(i, CONTEXT_PRESENCE_MENUS, false);
#endif
}
g_DiscordPresence.SetCurrentGameActivity(CONTEXT_PRESENCE_MENUS);
}
}
@@ -1019,11 +873,7 @@ int UIScene_MainMenu::Achievements_SignInReturned(void *pParam,bool bContinue,in
{
pClass->m_bIgnorePress=false;
// 4J-JEV: We only need to update rich-presence if the sign-in status changes.
#ifdef _WINDOWS64
g_DiscordPresence.SetCurrentGameActivity(CONTEXT_PRESENCE_MENUS);
#else
ProfileManager.SetCurrentGameActivity(iPad, CONTEXT_PRESENCE_MENUS, false);
#endif
g_DiscordPresence.SetCurrentGameActivity(CONTEXT_PRESENCE_MENUS);
XShowAchievementsUI( ProfileManager.GetPrimaryPad() );
}
@@ -1036,13 +886,7 @@ int UIScene_MainMenu::Achievements_SignInReturned(void *pParam,bool bContinue,in
{
// if the user is valid, we should set the presence
if(ProfileManager.IsSignedIn(i))
{
#ifdef _WINDOWS64
g_DiscordPresence.SetCurrentGameActivity(CONTEXT_PRESENCE_MENUS);
#else
ProfileManager.SetCurrentGameActivity(i, CONTEXT_PRESENCE_MENUS, false);
#endif
}
g_DiscordPresence.SetCurrentGameActivity(CONTEXT_PRESENCE_MENUS);
}
}
@@ -1060,11 +904,7 @@ int UIScene_MainMenu::UnlockFullGame_SignInReturned(void *pParam,bool bContinue,
if (bContinue)
{
// 4J-JEV: We only need to update rich-presence if the sign-in status changes.
#ifdef _WINDOWS64
g_DiscordPresence.SetCurrentGameActivity(CONTEXT_PRESENCE_MENUS);
#else
ProfileManager.SetCurrentGameActivity(iPad, CONTEXT_PRESENCE_MENUS, false);
#endif
g_DiscordPresence.SetCurrentGameActivity(CONTEXT_PRESENCE_MENUS);
pClass->RunUnlockOrDLC(iPad);
}
@@ -1077,13 +917,7 @@ int UIScene_MainMenu::UnlockFullGame_SignInReturned(void *pParam,bool bContinue,
{
// if the user is valid, we should set the presence
if(ProfileManager.IsSignedIn(i))
{
#ifdef _WINDOWS64
g_DiscordPresence.SetCurrentGameActivity(CONTEXT_PRESENCE_MENUS);
#else
ProfileManager.SetCurrentGameActivity(i, CONTEXT_PRESENCE_MENUS, false);
#endif
}
g_DiscordPresence.SetCurrentGameActivity(CONTEXT_PRESENCE_MENUS);
}
}
@@ -1110,9 +944,7 @@ int UIScene_MainMenu::XboxHelp_SignInReturned(void *pParam, bool bContinue, int
{
// if the user is valid, we should set the presence
if(ProfileManager.IsSignedIn(i))
{
ProfileManager.SetCurrentGameActivity(i,CONTEXT_PRESENCE_MENUS,false);
}
g_DiscordPresence.SetCurrentGameActivity(CONTEXT_PRESENCE_MENUS);
}
}
@@ -1582,55 +1414,7 @@ void UIScene_MainMenu::RunLeaderboards(int iPad)
}
else if(!ProfileManager.IsSignedInLive(iPad))
{
#if defined __PS3__ || defined __PSVITA__
m_eAction=eAction_RunLeaderboardsPSN;
// get them to sign in to online
UINT uiIDA[1];
uiIDA[0]=IDS_PRO_NOTONLINE_ACCEPT;
ui.RequestErrorMessage(IDS_PRO_NOTONLINE_TITLE, IDS_PRO_NOTONLINE_TEXT, uiIDA, 1, ProfileManager.GetPrimaryPad(),&UIScene_MainMenu::MustSignInReturnedPSN,this);
/* 4J-PB - Add this after release
#elif defined __PSVITA__
m_eAction=eAction_RunLeaderboardsPSN;
// Determine why they're not "signed in live"
if (ProfileManager.IsSignedInPSN(iPad))
{
// Signed in to PSN but not connected (no internet access)
UINT uiIDA[1];
uiIDA[0] = IDS_PRO_NOTONLINE_ACCEPT;
ui.RequestMessageBox(IDS_PRO_CURRENTLY_NOT_ONLINE_TITLE, IDS_PRO_PSNOFFLINE_TEXT, uiIDA, 1, ProfileManager.GetPrimaryPad(), &UIScene_MainMenu::MustSignInReturnedPSN, this, app.GetStringTable());
}
else
{
// Not signed in to PSN
UINT uiIDA[1];
uiIDA[0] = IDS_PRO_NOTONLINE_ACCEPT;
ui.RequestMessageBox(IDS_PRO_NOTONLINE_TITLE, IDS_PRO_NOTONLINE_TEXT, uiIDA, 1, ProfileManager.GetPrimaryPad(), &UIScene_MainMenu::MustSignInReturnedPSN, this, app.GetStringTable());
return;
}*/
#elif defined __ORBIS__
m_eAction=eAction_RunLeaderboardsPSN;
// 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.RequestErrorMessage(IDS_PRO_NOTONLINE_TITLE, IDS_PRO_NOTONLINE_TEXT, uiIDA, 1, ProfileManager.GetPrimaryPad(), &UIScene_MainMenu::MustSignInReturnedPSN, this);
return;
}
#else
ui.RequestErrorMessage(IDS_PRO_NOTONLINE_TITLE, IDS_PRO_XBOXLIVE_NOTIFICATION, uiIDA, 1);
#endif
}
else
{
@@ -1675,58 +1459,6 @@ void UIScene_MainMenu::RunUnlockOrDLC(int iPad)
// Check if this means downloadable content
if(ProfileManager.IsFullVersion())
{
#ifdef __ORBIS__
// 4J-PB - Check if there is a patch for the game
m_errorCode = ProfileManager.getNPAvailability(ProfileManager.GetPrimaryPad());
bool bPatchAvailable;
switch(m_errorCode)
{
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)
{
m_bIgnorePress=false;
int32_t ret=sceErrorDialogInitialize();
m_bErrorDialogRunning=true;
if ( ret==SCE_OK )
{
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 );
}
}
// UINT uiIDA[1];
// uiIDA[0]=IDS_OK;
// ui.RequestMessageBox(IDS_PATCH_AVAILABLE_TITLE, IDS_PATCH_AVAILABLE_TEXT, uiIDA, 1, XUSER_INDEX_ANY,nullptr,this);
return;
}
// Check if PSN is unavailable because of age restriction
if (m_errorCode == SCE_NP_ERROR_AGE_RESTRICTION)
{
m_bIgnorePress=false;
UINT uiIDA[1];
uiIDA[0] = IDS_OK;
ui.RequestErrorMessage(IDS_ONLINE_SERVICE_TITLE, IDS_CONTENT_RESTRICTION, uiIDA, 1, ProfileManager.GetPrimaryPad(), nullptr, this);
return;
}
#endif
// downloadable content
if(ProfileManager.IsSignedInLive(iPad))
{
@@ -1800,39 +1532,9 @@ void UIScene_MainMenu::RunUnlockOrDLC(int iPad)
}
else
{
#if defined(__PS3__) || defined(__PSVITA__)
m_eAction=eAction_RunUnlockOrDLCPSN;
// get them to sign in to online
UINT uiIDA[1];
uiIDA[0]=IDS_PRO_NOTONLINE_ACCEPT;
//uiIDA[1]=IDS_PRO_NOTONLINE_DECLINE;
ui.RequestErrorMessage(IDS_PRO_NOTONLINE_TITLE, IDS_PRO_NOTONLINE_TEXT, uiIDA, 1, ProfileManager.GetPrimaryPad(),&UIScene_MainMenu::MustSignInReturnedPSN,this);
#elif defined __ORBIS__
m_eAction=eAction_RunUnlockOrDLCPSN;
// Determine why they're not "signed in live"
if (ProfileManager.isSignedInPSN(iPad))
{
m_bIgnorePress=false;
// 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.RequestErrorMessage(IDS_PRO_NOTONLINE_TITLE, IDS_PRO_NOTONLINE_TEXT, uiIDA, 1, ProfileManager.GetPrimaryPad(), &UIScene_MainMenu::MustSignInReturnedPSN, this);
return;
}
#else
UINT uiIDA[1];
uiIDA[0]=IDS_OK;
ui.RequestErrorMessage(IDS_PRO_NOTONLINE_TITLE, IDS_PRO_XBOXLIVE_NOTIFICATION, uiIDA, 1);
#endif
}
}
else
@@ -1845,39 +1547,9 @@ void UIScene_MainMenu::RunUnlockOrDLC(int iPad)
}
else if(!ProfileManager.IsSignedInLive(iPad))
{
#if defined(__PS3__) || defined(__PSVITA__)
m_eAction=eAction_RunUnlockOrDLCPSN;
// get them to sign in to online
UINT uiIDA[1];
uiIDA[0] = IDS_PRO_NOTONLINE_ACCEPT;
ui.RequestErrorMessage(IDS_PRO_NOTONLINE_TITLE, IDS_PRO_NOTONLINE_TEXT, uiIDA, 1, ProfileManager.GetPrimaryPad(),&UIScene_MainMenu::MustSignInReturnedPSN,this);
#elif defined __ORBIS__
m_eAction=eAction_RunUnlockOrDLCPSN;
// Determine why they're not "signed in live"
if (ProfileManager.isSignedInPSN(iPad))
{
m_bIgnorePress=false;
// 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.RequestErrorMessage(IDS_PRO_NOTONLINE_TITLE, IDS_PRO_NOTONLINE_TEXT, uiIDA, 1, ProfileManager.GetPrimaryPad(), &UIScene_MainMenu::MustSignInReturnedPSN, this);
return;
}
#else
UINT uiIDA[1];
uiIDA[0]=IDS_OK;
ui.RequestErrorMessage(IDS_PRO_NOTONLINE_TITLE, IDS_PRO_XBOXLIVE_NOTIFICATION, uiIDA, 1);
#endif
}
else
{
@@ -2173,25 +1845,4 @@ void UIScene_MainMenu::LoadTrial(void)
void UIScene_MainMenu::handleUnlockFullVersion()
{
m_buttons[static_cast<int>(eControl_UnlockOrDLC)].setLabel(IDS_DOWNLOADABLECONTENT,true);
}
#ifdef __PSVITA__
int UIScene_MainMenu::SelectNetworkModeReturned(void *pParam,int iPad,C4JStorage::EMessageResult result)
{
UIScene_MainMenu* pClass = (UIScene_MainMenu*)pParam;
if(result==C4JStorage::EMessage_ResultAccept)
{
app.DebugPrintf("Setting network mode to PSN\n");
app.SetGameSettings(0, eGameSetting_PSVita_NetworkModeAdhoc, 0);
}
else if(result==C4JStorage::EMessage_ResultDecline)
{
app.DebugPrintf("Setting network mode to Adhoc\n");
app.SetGameSettings(0, eGameSetting_PSVita_NetworkModeAdhoc, 1);
}
pClass->updateTooltips();
return 0;
}
#endif //__PSVITA__
}

View File

@@ -12,11 +12,7 @@ private:
eControl_Achievements,
eControl_HelpAndOptions,
eControl_UnlockOrDLC,
#ifndef _DURANGO
eControl_Exit,
#else
eControl_XboxHelp,
#endif
eControl_Count,
};
@@ -37,11 +33,8 @@ private:
UI_MAP_ELEMENT( m_buttons[(int)eControl_Achievements], "Button3")
UI_MAP_ELEMENT( m_buttons[(int)eControl_HelpAndOptions], "Button4")
UI_MAP_ELEMENT( m_buttons[(int)eControl_UnlockOrDLC], "Button5")
#ifndef _DURANGO
UI_MAP_ELEMENT( m_buttons[(int)eControl_Exit], "Button6")
#else
UI_MAP_ELEMENT( m_buttons[(int)eControl_XboxHelp], "Button6")
#endif
UI_MAP_ELEMENT( m_controlTimer, "Timer")
UI_END_MAP_ELEMENTS_AND_NAMES()
@@ -49,13 +42,6 @@ private:
bool m_bIgnorePress;
bool m_bTrialVersion;
bool m_bLoadTrialOnNetworkManagerReady;
#if defined(__PS3__) || defined(__ORBIS__) || defined(__PSVITA__)
bool m_bLaunchFullVersionPurchase;
#endif
#ifdef _XBOX_ONE
bool m_bWaitingForDLCInfo;
#endif
float m_fScreenWidth,m_fScreenHeight;
float m_fRawWidth,m_fRawHeight;
@@ -80,14 +66,6 @@ private:
eAction_RunAchievements,
eAction_RunHelpAndOptions,
eAction_RunUnlockOrDLC,
#if defined(__PS3__)|| defined(__PSVITA__) || defined(__ORBIS__)
eAction_RunLeaderboardsPSN,
eAction_RunGamePSN,
eAction_RunUnlockOrDLCPSN,
#elif defined _DURANGO
eAction_RunXboxHelp,
#endif
};
eActions m_eAction;
@@ -147,49 +125,12 @@ private:
static void LoadTrial();
#ifdef _XBOX_ONE
static int ChooseUser_SignInReturned(void *pParam,bool bContinue, int iPad, int iController);
static int CreateLoad_SignInReturned(void *pParam,bool bContinue, int iPad, int iController);
static int HelpAndOptions_SignInReturned(void *pParam,bool bContinue,int iPad, int iController);
static int Achievements_SignInReturned(void *pParam,bool bContinue,int iPad, int iController);
static int MustSignInReturned(void *pParam,int iPad,C4JStorage::EMessageResult result);
static int Leaderboards_SignInReturned(void* pParam, bool bContinue, int iPad, int iController);
static int UnlockFullGame_SignInReturned(void *pParam,bool bContinue,int iPad, int iController);
static int ExitGameReturned(void *pParam,int iPad,C4JStorage::EMessageResult result);
static int XboxHelp_SignInReturned(void *pParam, bool bContinue, int iPad, int iController);
#else
static int CreateLoad_SignInReturned(void *pParam,bool bContinue, int iPad);
static int HelpAndOptions_SignInReturned(void *pParam,bool bContinue,int iPad);
static int Achievements_SignInReturned(void *pParam,bool bContinue,int iPad);
static int MustSignInReturned(void *pParam,int iPad,C4JStorage::EMessageResult result);
#if defined(__PS3__) || defined(__PSVITA__) || defined(__ORBIS__)
static int MustSignInReturnedPSN(void *pParam,int iPad,C4JStorage::EMessageResult result);
#endif
static int Leaderboards_SignInReturned(void* pParam, bool bContinue, int iPad);
static int UnlockFullGame_SignInReturned(void *pParam,bool bContinue,int iPad);
static int ExitGameReturned(void *pParam,int iPad,C4JStorage::EMessageResult result);
#ifdef __ORBIS__
static void RefreshChatAndContentRestrictionsReturned_PlayGame(void *pParam);
static void RefreshChatAndContentRestrictionsReturned_Leaderboards(void *pParam);
static int PlayOfflineReturned(void *pParam, int iPad, C4JStorage::EMessageResult result);
#endif
#endif
#ifdef __PSVITA__
static int SelectNetworkModeReturned(void *pParam,int iPad,C4JStorage::EMessageResult result);
#endif
#ifdef __ORBIS__
//EPatchCheck m_ePatchCheckState;
bool m_bRunGameChosen;
int32_t m_errorCode;
bool m_bErrorDialogRunning;
#endif
};

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
}

View File

@@ -91,15 +91,6 @@ protected:
private:
void PerformActionSaveGame();
#if defined(__PS3__) || defined(__PSVITA__) || defined(__ORBIS__)
static int MustSignInReturnedPSN(void *pParam,int iPad,C4JStorage::EMessageResult result);
static int ViewLeaderboards_SignInReturned(void *pParam,bool bContinue, int iPad);
static int ViewInvites_SignInReturned(void *pParam,bool bContinue, int iPad);
static int BuyTexturePack_SignInReturned(void *pParam,bool bContinue, int iPad);
static int WarningTrialTexturePackReturned(void *pParam,int iPad,C4JStorage::EMessageResult result);
static int ExitGameSaveDialogReturned(void *pParam,int iPad,C4JStorage::EMessageResult result);
#endif
protected:
#ifdef _XBOX_ONE
static int BanGameDialogReturned(void *pParam,int iPad,C4JStorage::EMessageResult result);

View File

@@ -487,15 +487,6 @@ void UIScene_SkinSelectMenu::InputActionOK(unsigned int iPad)
UINT uiIDA[1];
uiIDA[0]=IDS_OK;
#ifdef __ORBIS__
// Check if PSN is unavailable because of age restriction
int npAvailability = ProfileManager.getNPAvailability(iPad);
if (npAvailability == SCE_NP_ERROR_AGE_RESTRICTION)
{
ui.RequestErrorMessage(IDS_ONLINE_SERVICE_TITLE, IDS_CONTENT_RESTRICTION, uiIDA, 1, iPad);
}
else
#endif
// We need to upsell the full version
if(ProfileManager.IsGuest(iPad))
{
@@ -1499,33 +1490,6 @@ void UIScene_SkinSelectMenu::HandleDLCMountingComplete()
void UIScene_SkinSelectMenu::showNotOnlineDialog(int iPad)
{
// need to be signed in to live. get them to sign in to online
#if defined(__PS3__)
SQRNetworkManager_PS3::AttemptPSNSignIn(nullptr, this);
#elif defined(__PSVITA__)
if(CGameNetworkManager::usingAdhocMode() && SQRNetworkManager_AdHoc_Vita::GetAdhocStatus())
{
// we're in adhoc mode, we really need to ask before disconnecting
UINT uiIDA[2];
uiIDA[0]=IDS_PRO_NOTONLINE_ACCEPT;
uiIDA[1]=IDS_CANCEL;
ui.RequestErrorMessage(IDS_PRO_NOTONLINE_TITLE, IDS_PRO_NOTONLINE_TEXT, uiIDA, 2, ProfileManager.GetPrimaryPad(),&UIScene_SkinSelectMenu::MustSignInReturned,nullptr);
}
else
{
SQRNetworkManager_Vita::AttemptPSNSignIn(nullptr, this);
}
#elif defined(__ORBIS__)
SQRNetworkManager_Orbis::AttemptPSNSignIn(nullptr, this, false, iPad);
#elif defined(_DURANGO)
UINT uiIDA[1] = { IDS_CONFIRM_OK };
ui.RequestErrorMessage(IDS_PRO_NOTONLINE_TITLE, IDS_PRO_XBOXLIVE_NOTIFICATION, uiIDA, 1, iPad );
#endif
}
int UIScene_SkinSelectMenu::UnlockSkinReturned(void *pParam,int iPad,C4JStorage::EMessageResult result)