mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/4jcraft.git
synced 2026-07-17 14:58:56 +00:00
TU19: merge Minecraft.Client/Platform/Common/UI
This commit is contained in:
@@ -42,11 +42,8 @@ UIScene_CreateWorldMenu::UIScene_CreateWorldMenu(int iPad, void* initData,
|
||||
m_iPad = iPad;
|
||||
|
||||
m_labelWorldName.init(app.GetString(IDS_WORLD_NAME));
|
||||
m_labelSeed.init(app.GetString(IDS_CREATE_NEW_WORLD_SEED));
|
||||
m_labelRandomSeed.init(app.GetString(IDS_CREATE_NEW_WORLD_RANDOM_SEED));
|
||||
|
||||
m_editWorldName.init(m_worldName, eControl_EditWorldName);
|
||||
m_editSeed.init(L"", eControl_EditSeed);
|
||||
|
||||
m_buttonGamemode.init(app.GetString(IDS_GAMEMODE_SURVIVAL),
|
||||
eControl_GameModeToggle);
|
||||
@@ -80,7 +77,16 @@ UIScene_CreateWorldMenu::UIScene_CreateWorldMenu(int iPad, void* initData,
|
||||
m_MoreOptionsParams.bTNT = true;
|
||||
m_MoreOptionsParams.iPad = iPad;
|
||||
|
||||
m_bGameModeSurvival = true;
|
||||
m_MoreOptionsParams.bMobGriefing = true;
|
||||
m_MoreOptionsParams.bKeepInventory = false;
|
||||
m_MoreOptionsParams.bDoMobSpawning = true;
|
||||
m_MoreOptionsParams.bDoMobLoot = true;
|
||||
m_MoreOptionsParams.bDoTileDrops = true;
|
||||
m_MoreOptionsParams.bNaturalRegeneration = true;
|
||||
m_MoreOptionsParams.bDoDaylightCycle = true;
|
||||
|
||||
m_bGameModeCreative = false;
|
||||
m_iGameModeId = GameType::SURVIVAL->getId();
|
||||
m_pDLCPack = NULL;
|
||||
m_bRebuildTouchBoxes = false;
|
||||
|
||||
@@ -126,26 +132,22 @@ UIScene_CreateWorldMenu::UIScene_CreateWorldMenu(int iPad, void* initData,
|
||||
}
|
||||
}
|
||||
|
||||
#if defined _XBOX_ONE || defined __ORBIS__ || defined _WINDOWS64
|
||||
if (getSceneResolution() == eSceneResolution_1080) {
|
||||
// Set up online game checkbox
|
||||
bool bOnlineGame = m_MoreOptionsParams.bOnlineGame;
|
||||
m_checkboxOnline.SetEnable(true);
|
||||
// Set up online game checkbox
|
||||
bool bOnlineGame = m_MoreOptionsParams.bOnlineGame;
|
||||
m_checkboxOnline.SetEnable(true);
|
||||
|
||||
// 4J-PB - to stop an offline game being able to select the online flag
|
||||
if (ProfileManager.IsSignedInLive(m_iPad) == false) {
|
||||
m_checkboxOnline.SetEnable(false);
|
||||
}
|
||||
|
||||
if (m_MoreOptionsParams.bOnlineSettingChangedBySystem) {
|
||||
m_checkboxOnline.SetEnable(false);
|
||||
bOnlineGame = false;
|
||||
}
|
||||
|
||||
m_checkboxOnline.init(app.GetString(IDS_ONLINE_GAME),
|
||||
eControl_OnlineGame, bOnlineGame);
|
||||
// 4J-PB - to stop an offline game being able to select the online flag
|
||||
if (ProfileManager.IsSignedInLive(m_iPad) == false) {
|
||||
m_checkboxOnline.SetEnable(false);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (m_MoreOptionsParams.bOnlineSettingChangedBySystem) {
|
||||
m_checkboxOnline.SetEnable(false);
|
||||
bOnlineGame = false;
|
||||
}
|
||||
|
||||
m_checkboxOnline.init(app.GetString(IDS_ONLINE_GAME), eControl_OnlineGame,
|
||||
bOnlineGame);
|
||||
|
||||
addTimer(GAME_CREATE_ONLINE_TIMER_ID, GAME_CREATE_ONLINE_TIMER_TIME);
|
||||
#if TO_BE_IMPLEMENTED
|
||||
@@ -176,6 +178,8 @@ UIScene_CreateWorldMenu::UIScene_CreateWorldMenu(int iPad, void* initData,
|
||||
swprintf(imageName, 64, L"tpack%08x", tp->getId());
|
||||
registerSubstitutionTexture(imageName, imageData, imageBytes);
|
||||
m_texturePackList.addPack(i, imageName);
|
||||
app.DebugPrintf("Adding texture pack %ls at %d\n", imageName,
|
||||
i);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -304,12 +308,11 @@ void UIScene_CreateWorldMenu::tick() {
|
||||
uiIDA[0] = IDS_PRO_NOTONLINE_DECLINE;
|
||||
|
||||
// Give the player a warning about the texture pack missing
|
||||
ui.RequestMessageBox(
|
||||
ui.RequestAlertMessage(
|
||||
IDS_PLAY_OFFLINE, IDS_NO_PLAYSTATIONPLUS, uiIDA, 1,
|
||||
ProfileManager.GetPrimaryPad(),
|
||||
&UIScene_CreateWorldMenu::ContinueOffline,
|
||||
dynamic_cast<UIScene_CreateWorldMenu*>(this),
|
||||
app.GetStringTable(), 0, 0, false);
|
||||
dynamic_cast<UIScene_CreateWorldMenu*>(this));
|
||||
}
|
||||
} break;
|
||||
default:
|
||||
@@ -357,9 +360,9 @@ void UIScene_CreateWorldMenu::handleInput(int iPad, int key, bool repeat,
|
||||
if (pressed && controlHasFocus(m_checkboxOnline.getId()) &&
|
||||
!m_checkboxOnline.IsEnabled()) {
|
||||
unsigned int uiIDA[1] = {IDS_CONFIRM_OK};
|
||||
ui.RequestMessageBox(IDS_PRO_NOTONLINE_TITLE,
|
||||
IDS_PRO_XBOXLIVE_NOTIFICATION, uiIDA, 1,
|
||||
iPad, NULL, NULL, app.GetStringTable());
|
||||
ui.RequestErrorMessage(IDS_PRO_NOTONLINE_TITLE,
|
||||
IDS_PRO_XBOXLIVE_NOTIFICATION, uiIDA, 1,
|
||||
iPad);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -371,16 +374,13 @@ void UIScene_CreateWorldMenu::handleInput(int iPad, int key, bool repeat,
|
||||
case ACTION_MENU_OTHER_STICK_DOWN:
|
||||
sendInputToMovie(key, repeat, pressed, released);
|
||||
|
||||
#if defined _XBOX_ONE || defined __ORBIS__ || defined _WINDOWS64
|
||||
if (getSceneResolution() == eSceneResolution_1080) {
|
||||
bool bOnlineGame = m_checkboxOnline.IsChecked();
|
||||
if (m_MoreOptionsParams.bOnlineGame != bOnlineGame) {
|
||||
m_MoreOptionsParams.bOnlineGame = bOnlineGame;
|
||||
bool bOnlineGame = m_checkboxOnline.IsChecked();
|
||||
if (m_MoreOptionsParams.bOnlineGame != bOnlineGame) {
|
||||
m_MoreOptionsParams.bOnlineGame = bOnlineGame;
|
||||
|
||||
if (!m_MoreOptionsParams.bOnlineGame) {
|
||||
m_MoreOptionsParams.bInviteOnly = false;
|
||||
m_MoreOptionsParams.bAllowFriendsOfFriends = false;
|
||||
}
|
||||
if (!m_MoreOptionsParams.bOnlineGame) {
|
||||
m_MoreOptionsParams.bInviteOnly = false;
|
||||
m_MoreOptionsParams.bAllowFriendsOfFriends = false;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -405,45 +405,21 @@ void UIScene_CreateWorldMenu::handlePress(F64 controlId, F64 childId) {
|
||||
&UIScene_CreateWorldMenu::KeyboardCompleteWorldNameCallback,
|
||||
this, C_4JInput::EKeyboardMode_Default);
|
||||
} break;
|
||||
case eControl_EditSeed: {
|
||||
m_bIgnoreInput = true;
|
||||
#ifdef __PS3__
|
||||
int language = XGetLanguage();
|
||||
switch (language) {
|
||||
case XC_LANGUAGE_JAPANESE:
|
||||
case XC_LANGUAGE_KOREAN:
|
||||
case XC_LANGUAGE_TCHINESE:
|
||||
InputManager.RequestKeyboard(
|
||||
app.GetString(IDS_CREATE_NEW_WORLD_SEED),
|
||||
m_editSeed.getLabel(), 0, 60,
|
||||
&UIScene_CreateWorldMenu::KeyboardCompleteSeedCallback,
|
||||
this, C_4JInput::EKeyboardMode_Default);
|
||||
break;
|
||||
default:
|
||||
// 4J Stu - Use a different keyboard for non-asian languages
|
||||
// so we don't have prediction on
|
||||
InputManager.RequestKeyboard(
|
||||
app.GetString(IDS_CREATE_NEW_WORLD_SEED),
|
||||
m_editSeed.getLabel(), 0, 60,
|
||||
&UIScene_CreateWorldMenu::KeyboardCompleteSeedCallback,
|
||||
this, C_4JInput::EKeyboardMode_Alphabet_Extended);
|
||||
break;
|
||||
}
|
||||
#else
|
||||
InputManager.RequestKeyboard(
|
||||
app.GetString(IDS_CREATE_NEW_WORLD_SEED), m_editSeed.getLabel(),
|
||||
0, 60, &UIScene_CreateWorldMenu::KeyboardCompleteSeedCallback,
|
||||
this, C_4JInput::EKeyboardMode_Default);
|
||||
#endif
|
||||
} break;
|
||||
case eControl_GameModeToggle:
|
||||
if (m_bGameModeSurvival) {
|
||||
m_buttonGamemode.setLabel(app.GetString(IDS_GAMEMODE_CREATIVE));
|
||||
m_bGameModeSurvival = false;
|
||||
} else {
|
||||
m_buttonGamemode.setLabel(app.GetString(IDS_GAMEMODE_SURVIVAL));
|
||||
m_bGameModeSurvival = true;
|
||||
}
|
||||
switch (m_iGameModeId) {
|
||||
case 0: // Survival
|
||||
m_buttonGamemode.setLabel(
|
||||
app.GetString(IDS_GAMEMODE_CREATIVE));
|
||||
m_iGameModeId = GameType::CREATIVE->getId();
|
||||
m_bGameModeCreative = true;
|
||||
break;
|
||||
case 1: // Creative
|
||||
m_buttonGamemode.setLabel(
|
||||
app.GetString(IDS_GAMEMODE_SURVIVAL));
|
||||
m_iGameModeId = GameType::SURVIVAL->getId();
|
||||
m_bGameModeCreative = false;
|
||||
break;
|
||||
};
|
||||
break;
|
||||
case eControl_MoreOptions:
|
||||
ui.NavigateToScene(m_iPad, eUIScene_LaunchMoreOptionsMenu,
|
||||
@@ -517,11 +493,10 @@ void UIScene_CreateWorldMenu::StartSharedLaunchFlow() {
|
||||
uiIDA[1] = IDS_CONFIRM_CANCEL;
|
||||
|
||||
// Give the player a warning about the texture pack missing
|
||||
ui.RequestMessageBox(IDS_DLC_TEXTUREPACK_NOT_PRESENT_TITLE,
|
||||
IDS_DLC_TEXTUREPACK_NOT_PRESENT, uiIDA, 2,
|
||||
ProfileManager.GetPrimaryPad(),
|
||||
&TexturePackDialogReturned, this,
|
||||
app.GetStringTable(), NULL, 0, false);
|
||||
ui.RequestAlertMessage(IDS_DLC_TEXTUREPACK_NOT_PRESENT_TITLE,
|
||||
IDS_DLC_TEXTUREPACK_NOT_PRESENT, uiIDA, 2,
|
||||
ProfileManager.GetPrimaryPad(),
|
||||
&TexturePackDialogReturned, this);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -598,21 +573,19 @@ void UIScene_CreateWorldMenu::StartSharedLaunchFlow() {
|
||||
// trial pack warning
|
||||
unsigned int uiIDA[1];
|
||||
uiIDA[0] = IDS_CONFIRM_OK;
|
||||
ui.RequestMessageBox(IDS_WARNING_DLC_TRIALTEXTUREPACK_TITLE,
|
||||
IDS_USING_TRIAL_TEXUREPACK_WARNING, uiIDA,
|
||||
1, m_iPad,
|
||||
&TrialTexturePackWarningReturned, this,
|
||||
app.GetStringTable(), NULL, 0, false);
|
||||
ui.RequestAlertMessage(IDS_WARNING_DLC_TRIALTEXTUREPACK_TITLE,
|
||||
IDS_USING_TRIAL_TEXUREPACK_WARNING,
|
||||
uiIDA, 1, m_iPad,
|
||||
&TrialTexturePackWarningReturned, this);
|
||||
#elif defined __PS3__ || defined __ORBIS__ || defined(__PSVITA__)
|
||||
// trial pack warning
|
||||
unsigned int uiIDA[2];
|
||||
uiIDA[0] = IDS_CONFIRM_OK;
|
||||
uiIDA[1] = IDS_CONFIRM_CANCEL;
|
||||
ui.RequestMessageBox(IDS_WARNING_DLC_TRIALTEXTUREPACK_TITLE,
|
||||
IDS_USING_TRIAL_TEXUREPACK_WARNING, uiIDA,
|
||||
2, m_iPad,
|
||||
&TrialTexturePackWarningReturned, this,
|
||||
app.GetStringTable(), NULL, 0, false);
|
||||
ui.RequestAlertMessage(IDS_WARNING_DLC_TRIALTEXTUREPACK_TITLE,
|
||||
IDS_USING_TRIAL_TEXUREPACK_WARNING,
|
||||
uiIDA, 2, m_iPad,
|
||||
&TrialTexturePackWarningReturned, this);
|
||||
#endif
|
||||
|
||||
#if defined _XBOX_ONE || defined __ORBIS__
|
||||
@@ -685,13 +658,9 @@ void UIScene_CreateWorldMenu::handleTimerComplete(int id) {
|
||||
m_MoreOptionsParams.bAllowFriendsOfFriends = false;
|
||||
}
|
||||
|
||||
#if defined _XBOX_ONE || defined __ORBIS__ || defined _WINDOWS64
|
||||
if (getSceneResolution() == eSceneResolution_1080) {
|
||||
m_checkboxOnline.SetEnable(bMultiplayerAllowed);
|
||||
m_checkboxOnline.setChecked(
|
||||
m_MoreOptionsParams.bOnlineGame);
|
||||
}
|
||||
#endif
|
||||
m_checkboxOnline.SetEnable(bMultiplayerAllowed);
|
||||
m_checkboxOnline.setChecked(m_MoreOptionsParams.bOnlineGame);
|
||||
|
||||
m_bMultiplayerAllowed = bMultiplayerAllowed;
|
||||
}
|
||||
} break;
|
||||
@@ -741,12 +710,7 @@ void UIScene_CreateWorldMenu::handleTimerComplete(int id) {
|
||||
|
||||
void UIScene_CreateWorldMenu::handleGainFocus(bool navBack) {
|
||||
if (navBack) {
|
||||
#if defined _XBOX_ONE || defined __ORBIS__ || defined _WINDOWS64
|
||||
if (getSceneResolution() == eSceneResolution_1080) {
|
||||
m_checkboxOnline.setChecked(m_MoreOptionsParams.bOnlineGame);
|
||||
}
|
||||
m_editSeed.setLabel(m_MoreOptionsParams.seed);
|
||||
#endif
|
||||
m_checkboxOnline.setChecked(m_MoreOptionsParams.bOnlineGame);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -756,8 +720,8 @@ int UIScene_CreateWorldMenu::KeyboardCompleteWorldNameCallback(void* lpParam,
|
||||
pClass->m_bIgnoreInput = false;
|
||||
// 4J HEG - No reason to set value if keyboard was cancelled
|
||||
if (bRes) {
|
||||
std::uint16_t pchText[128];
|
||||
ZeroMemory(pchText, 128 * sizeof(std::uint16_t));
|
||||
uint16_t pchText[128];
|
||||
ZeroMemory(pchText, 128 * sizeof(uint16_t));
|
||||
InputManager.GetText(pchText);
|
||||
|
||||
if (pchText[0] != 0) {
|
||||
@@ -826,19 +790,18 @@ void UIScene_CreateWorldMenu::checkStateAndStartGame() {
|
||||
// npAvailability isn't SCE_OK
|
||||
unsigned int uiIDA[1];
|
||||
uiIDA[0] = IDS_OK;
|
||||
ui.RequestMessageBox(
|
||||
IDS_ONLINE_SERVICE_TITLE, IDS_CONTENT_RESTRICTION, uiIDA, 1,
|
||||
iPadNotSignedInLive, NULL, NULL, app.GetStringTable());
|
||||
ui.RequestErrorMessage(IDS_ONLINE_SERVICE_TITLE,
|
||||
IDS_CONTENT_RESTRICTION, uiIDA, 1,
|
||||
iPadNotSignedInLive);
|
||||
} else {
|
||||
m_bIgnoreInput = true;
|
||||
unsigned int uiIDA[2];
|
||||
uiIDA[0] = IDS_PRO_NOTONLINE_ACCEPT;
|
||||
uiIDA[1] = IDS_CANCEL;
|
||||
ui.RequestMessageBox(
|
||||
ui.RequestAlertMessage(
|
||||
IDS_PRO_NOTONLINE_TITLE, IDS_PRO_NOTONLINE_TEXT, uiIDA, 2,
|
||||
iPadNotSignedInLive,
|
||||
&UIScene_CreateWorldMenu::MustSignInReturnedPSN, this,
|
||||
app.GetStringTable(), NULL, 0, false);
|
||||
&UIScene_CreateWorldMenu::MustSignInReturnedPSN, this);
|
||||
}
|
||||
return;
|
||||
/* 4J-PB - Add this after release
|
||||
@@ -849,27 +812,24 @@ void UIScene_CreateWorldMenu::checkStateAndStartGame() {
|
||||
(ProfileManager.IsSignedInPSN(ProfileManager.GetPrimaryPad()))
|
||||
{
|
||||
// Signed in to PSN but not connected (no internet
|
||||
access) unsigned int uiIDA[1]; uiIDA[0] = IDS_CONFIRM_OK;
|
||||
ui.RequestMessageBox(IDS_PRO_CURRENTLY_NOT_ONLINE_TITLE,
|
||||
IDS_PRO_PSNOFFLINE_TEXT, uiIDA, 1, ProfileManager.GetPrimaryPad(), NULL,NULL,
|
||||
app.GetStringTable());
|
||||
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
|
||||
unsigned int uiIDA[1];
|
||||
uiIDA[0] = IDS_CONFIRM_OK;
|
||||
ui.RequestMessageBox(IDS_PRO_NOTONLINE_TITLE,
|
||||
IDS_PRO_NOTONLINE_TEXT, uiIDA, 1, ProfileManager.GetPrimaryPad(), NULL,NULL,
|
||||
app.GetStringTable()); return;
|
||||
ui.RequestErrorMessage(IDS_PRO_NOTONLINE_TITLE,
|
||||
IDS_PRO_NOTONLINE_TEXT, uiIDA, 1, ProfileManager.GetPrimaryPad()); return;
|
||||
}*/
|
||||
#else
|
||||
m_bIgnoreInput = false;
|
||||
unsigned int uiIDA[1];
|
||||
uiIDA[0] = IDS_CONFIRM_OK;
|
||||
ui.RequestMessageBox(IDS_PRO_NOTONLINE_TITLE, IDS_PRO_NOTONLINE_TEXT,
|
||||
uiIDA, 1, ProfileManager.GetPrimaryPad(), NULL,
|
||||
NULL, app.GetStringTable(), NULL, 0, false);
|
||||
ui.RequestAlertMessage(IDS_PRO_NOTONLINE_TITLE, IDS_PRO_NOTONLINE_TEXT,
|
||||
uiIDA, 1, ProfileManager.GetPrimaryPad());
|
||||
return;
|
||||
#endif
|
||||
}
|
||||
@@ -893,6 +853,19 @@ app.GetStringTable()); return;
|
||||
if (bPlayStationPlus == false) {
|
||||
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(), NULL, NULL);
|
||||
return;
|
||||
}
|
||||
|
||||
// 4J-PB - we're not allowed to show the text Playstation Plus -
|
||||
// have to call the upsell all the time! upsell psplus
|
||||
std::int32_t iResult = sceNpCommerceDialogInitialize();
|
||||
@@ -917,20 +890,20 @@ app.GetStringTable()); return;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (m_bGameModeSurvival != true || m_MoreOptionsParams.bHostPrivileges) {
|
||||
unsigned int uiIDA[2];
|
||||
if (m_bGameModeCreative == true ||
|
||||
m_MoreOptionsParams.bHostPrivileges == TRUE) {
|
||||
uiIDA[0] = IDS_CONFIRM_OK;
|
||||
uiIDA[1] = IDS_CONFIRM_CANCEL;
|
||||
if (m_bGameModeSurvival != true) {
|
||||
ui.RequestMessageBox(
|
||||
if (m_bGameModeCreative == true) {
|
||||
ui.RequestAlertMessage(
|
||||
IDS_TITLE_START_GAME, IDS_CONFIRM_START_CREATIVE, uiIDA, 2,
|
||||
m_iPad, &UIScene_CreateWorldMenu::ConfirmCreateReturned, this,
|
||||
app.GetStringTable(), NULL, 0, false);
|
||||
m_iPad, &UIScene_CreateWorldMenu::ConfirmCreateReturned, this);
|
||||
} else {
|
||||
ui.RequestMessageBox(
|
||||
ui.RequestAlertMessage(
|
||||
IDS_TITLE_START_GAME, IDS_CONFIRM_START_HOST_PRIVILEGES, uiIDA,
|
||||
2, m_iPad, &UIScene_CreateWorldMenu::ConfirmCreateReturned,
|
||||
this, app.GetStringTable(), NULL, 0, false);
|
||||
this);
|
||||
}
|
||||
} else {
|
||||
// 4J Stu - If we only have one controller connected, then don't show
|
||||
@@ -980,6 +953,19 @@ app.GetStringTable()); return;
|
||||
else if (bPlayStationPlus == false) {
|
||||
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(), NULL, NULL);
|
||||
return;
|
||||
}
|
||||
|
||||
// 4J-PB - we're not allowed to show the text Playstation Plus -
|
||||
// have to call the upsell all the time! upsell psplus
|
||||
std::int32_t iResult = sceNpCommerceDialogInitialize();
|
||||
@@ -1026,6 +1012,19 @@ app.GetStringTable()); return;
|
||||
else if (isOnlineGame && isSignedInLive &&
|
||||
(bPlayStationPlus == false)) {
|
||||
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(), NULL, NULL);
|
||||
return;
|
||||
}
|
||||
|
||||
setVisible(true);
|
||||
|
||||
// 4J-PB - we're not allowed to show the text Playstation Plus -
|
||||
@@ -1176,10 +1175,7 @@ void UIScene_CreateWorldMenu::CreateGame(UIScene_CreateWorldMenu* pClass,
|
||||
eGameHostOption_BedrockFog,
|
||||
app.GetGameSettings(pClass->m_iPad, eGameSetting_BedrockFog) ? 1 : 0);
|
||||
|
||||
app.SetGameHostOption(eGameHostOption_GameType,
|
||||
pClass->m_bGameModeSurvival
|
||||
? GameType::SURVIVAL->getId()
|
||||
: GameType::CREATIVE->getId());
|
||||
app.SetGameHostOption(eGameHostOption_GameType, pClass->m_iGameModeId);
|
||||
app.SetGameHostOption(eGameHostOption_LevelType,
|
||||
pClass->m_MoreOptionsParams.bFlatWorld);
|
||||
app.SetGameHostOption(eGameHostOption_Structures,
|
||||
@@ -1202,7 +1198,33 @@ void UIScene_CreateWorldMenu::CreateGame(UIScene_CreateWorldMenu* pClass,
|
||||
app.SetGameHostOption(eGameHostOption_HostCanBeInvisible,
|
||||
pClass->m_MoreOptionsParams.bHostPrivileges);
|
||||
|
||||
g_NetworkManager.HostGame(localUsersMask, isClientSide, isPrivate,
|
||||
app.SetGameHostOption(eGameHostOption_MobGriefing,
|
||||
pClass->m_MoreOptionsParams.bMobGriefing);
|
||||
app.SetGameHostOption(eGameHostOption_KeepInventory,
|
||||
pClass->m_MoreOptionsParams.bKeepInventory);
|
||||
app.SetGameHostOption(eGameHostOption_DoMobSpawning,
|
||||
pClass->m_MoreOptionsParams.bDoMobSpawning);
|
||||
app.SetGameHostOption(eGameHostOption_DoMobLoot,
|
||||
pClass->m_MoreOptionsParams.bDoMobLoot);
|
||||
app.SetGameHostOption(eGameHostOption_DoTileDrops,
|
||||
pClass->m_MoreOptionsParams.bDoTileDrops);
|
||||
app.SetGameHostOption(eGameHostOption_NaturalRegeneration,
|
||||
pClass->m_MoreOptionsParams.bNaturalRegeneration);
|
||||
app.SetGameHostOption(eGameHostOption_DoDaylightCycle,
|
||||
pClass->m_MoreOptionsParams.bDoDaylightCycle);
|
||||
|
||||
app.SetGameHostOption(eGameHostOption_WasntSaveOwner, false);
|
||||
#ifdef _LARGE_WORLDS
|
||||
app.SetGameHostOption(eGameHostOption_WorldSize,
|
||||
pClass->m_MoreOptionsParams.worldSize +
|
||||
1); // 0 is GAME_HOST_OPTION_WORLDSIZE_UNKNOWN
|
||||
pClass->m_MoreOptionsParams.currentWorldSize =
|
||||
(EGameHostOptionWorldSize)(pClass->m_MoreOptionsParams.worldSize + 1);
|
||||
pClass->m_MoreOptionsParams.newWorldSize =
|
||||
(EGameHostOptionWorldSize)(pClass->m_MoreOptionsParams.worldSize + 1);
|
||||
#endif
|
||||
|
||||
g_NetworkManager.HostGame(dwLocalUsersMask, isClientSide, isPrivate,
|
||||
MINECRAFT_NET_MAX_PLAYERS, 0);
|
||||
|
||||
param->settings = app.GetGameHostOption(eGameHostOption_All);
|
||||
@@ -1211,26 +1233,27 @@ void UIScene_CreateWorldMenu::CreateGame(UIScene_CreateWorldMenu* pClass,
|
||||
switch (pClass->m_MoreOptionsParams.worldSize) {
|
||||
case 0:
|
||||
// Classic
|
||||
param->xzSize = 1 * 54;
|
||||
param->hellScale = 3;
|
||||
param->xzSize = LEVEL_WIDTH_CLASSIC;
|
||||
param->hellScale =
|
||||
HELL_LEVEL_SCALE_CLASSIC; // hellsize = 54/3 = 18
|
||||
break;
|
||||
case 1:
|
||||
// Small
|
||||
param->xzSize = 1 * 64;
|
||||
param->hellScale = 3;
|
||||
param->xzSize = LEVEL_WIDTH_SMALL;
|
||||
param->hellScale =
|
||||
HELL_LEVEL_SCALE_SMALL; // hellsize = ceil(64/3) = 22
|
||||
break;
|
||||
case 2:
|
||||
// Medium
|
||||
param->xzSize = 3 * 64;
|
||||
param->hellScale = 6;
|
||||
param->xzSize = LEVEL_WIDTH_MEDIUM;
|
||||
param->hellScale =
|
||||
HELL_LEVEL_SCALE_MEDIUM; // hellsize= ceil(3*64/6) = 32
|
||||
break;
|
||||
case 3:
|
||||
// param->xzSize = 5 * 64;
|
||||
// param->hellScale = 8;
|
||||
|
||||
// Large
|
||||
param->xzSize = LEVEL_MAX_WIDTH;
|
||||
param->hellScale = HELL_LEVEL_MAX_SCALE;
|
||||
param->xzSize = LEVEL_WIDTH_LARGE;
|
||||
param->hellScale =
|
||||
HELL_LEVEL_SCALE_LARGE; // hellsize = ceil(5*64/8) = 40
|
||||
break;
|
||||
};
|
||||
#else
|
||||
@@ -1314,30 +1337,28 @@ int UIScene_CreateWorldMenu::StartGame_SignInReturned(void* pParam,
|
||||
// npAvailability isn't SCE_OK
|
||||
unsigned int uiIDA[1];
|
||||
uiIDA[0] = IDS_OK;
|
||||
ui.RequestMessageBox(IDS_ONLINE_SERVICE_TITLE,
|
||||
IDS_CONTENT_RESTRICTION, uiIDA, 1,
|
||||
iPadNotSignedInLive, NULL, NULL,
|
||||
app.GetStringTable());
|
||||
ui.RequestAlertMessage(IDS_ONLINE_SERVICE_TITLE,
|
||||
IDS_CONTENT_RESTRICTION, uiIDA, 1,
|
||||
iPadNotSignedInLive);
|
||||
} else {
|
||||
pClass->m_bIgnoreInput = true;
|
||||
unsigned int uiIDA[2];
|
||||
uiIDA[0] = IDS_PRO_NOTONLINE_ACCEPT;
|
||||
uiIDA[1] = IDS_CANCEL;
|
||||
ui.RequestMessageBox(
|
||||
ui.RequestAlertMessage(
|
||||
IDS_PRO_NOTONLINE_TITLE, IDS_PRO_NOTONLINE_TEXT, uiIDA,
|
||||
2, iPadNotSignedInLive,
|
||||
&UIScene_CreateWorldMenu::MustSignInReturnedPSN, pClass,
|
||||
app.GetStringTable(), NULL, 0, false);
|
||||
&UIScene_CreateWorldMenu::MustSignInReturnedPSN,
|
||||
pClass);
|
||||
}
|
||||
return 0;
|
||||
#else
|
||||
pClass->m_bIgnoreInput = false;
|
||||
unsigned int uiIDA[1];
|
||||
uiIDA[0] = IDS_CONFIRM_OK;
|
||||
ui.RequestMessageBox(IDS_PRO_NOTONLINE_TITLE,
|
||||
IDS_PRO_NOTONLINE_TEXT, uiIDA, 1,
|
||||
ProfileManager.GetPrimaryPad(), NULL, NULL,
|
||||
app.GetStringTable(), NULL, 0, false);
|
||||
ui.RequestAlertMessage(IDS_PRO_NOTONLINE_TITLE,
|
||||
IDS_PRO_NOTONLINE_TEXT, uiIDA, 1,
|
||||
ProfileManager.GetPrimaryPad());
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
@@ -1358,20 +1379,18 @@ int UIScene_CreateWorldMenu::StartGame_SignInReturned(void* pParam,
|
||||
pClass->m_bIgnoreInput = false;
|
||||
unsigned int uiIDA[1];
|
||||
uiIDA[0] = IDS_CONFIRM_OK;
|
||||
ui.RequestMessageBox(
|
||||
ui.RequestAlertMessage(
|
||||
IDS_FAILED_TO_CREATE_GAME_TITLE,
|
||||
IDS_NO_USER_CREATED_CONTENT_PRIVILEGE_CREATE, uiIDA, 1,
|
||||
ProfileManager.GetPrimaryPad(), NULL, NULL,
|
||||
app.GetStringTable(), NULL, 0, false);
|
||||
ProfileManager.GetPrimaryPad());
|
||||
} else {
|
||||
pClass->m_bIgnoreInput = false;
|
||||
unsigned int uiIDA[1];
|
||||
uiIDA[0] = IDS_CONFIRM_OK;
|
||||
ui.RequestMessageBox(
|
||||
ui.RequestAlertMessage(
|
||||
IDS_NO_MULTIPLAYER_PRIVILEGE_TITLE,
|
||||
IDS_NO_MULTIPLAYER_PRIVILEGE_HOST_TEXT, uiIDA, 1,
|
||||
ProfileManager.GetPrimaryPad(), NULL, NULL,
|
||||
app.GetStringTable(), NULL, 0, false);
|
||||
ProfileManager.GetPrimaryPad());
|
||||
}
|
||||
} else {
|
||||
// This is NOT called from a storage manager thread, and is in
|
||||
@@ -1432,11 +1451,10 @@ int UIScene_CreateWorldMenu::ConfirmCreateReturned(
|
||||
pClass->m_bIgnoreInput = false;
|
||||
unsigned int uiIDA[1];
|
||||
uiIDA[0] = IDS_CONFIRM_OK;
|
||||
ui.RequestMessageBox(
|
||||
ui.RequestAlertMessage(
|
||||
IDS_FAILED_TO_CREATE_GAME_TITLE,
|
||||
IDS_NO_USER_CREATED_CONTENT_PRIVILEGE_CREATE, uiIDA, 1,
|
||||
ProfileManager.GetPrimaryPad(), NULL, NULL,
|
||||
app.GetStringTable(), NULL, 0, false);
|
||||
ProfileManager.GetPrimaryPad());
|
||||
} else {
|
||||
#if defined(__ORBIS__) || defined(__PSVITA__)
|
||||
bool isOnlineGame = ProfileManager.IsSignedInLive(
|
||||
|
||||
Reference in New Issue
Block a user