feat: tu43 parity changes + fixes (#165)

Reviewed-on: https://git.neolegacy.dev/neoStudiosLCE/neoLegacy/pulls/165
This commit is contained in:
Fireblade
2026-08-03 01:08:51 +01:00
205 changed files with 1513 additions and 495 deletions
@@ -27,6 +27,19 @@ int IUIScene_PauseMenu::ExitGameDialogReturned(void *pParam,int iPad,C4JStorage:
// Results switched for this dialog
if(result==C4JStorage::EMessage_ResultDecline)
{
const int controlType = app.GetGameSettings(iPad, eGameSetting_ControlType);
const bool consoleAutosave = (controlType == 0 || controlType == 1 || controlType == 4); // windows, xbox one and ps4
const bool autosaveEnabled = consoleAutosave && !StorageManager.GetSaveDisabled() && (app.GetGameHostOption(eGameHostOption_DisableSaving) == 0);
if(autosaveEnabled)
{
MinecraftServer::getInstance()->setSaveOnExit(true);
}
else
{
MinecraftServer::getInstance()->setSaveOnExit(false);
}
if(pScene) pScene->SetIgnoreInput(true);
app.SetAction(iPad,eAppAction_ExitWorld);
}
@@ -159,7 +172,7 @@ int IUIScene_PauseMenu::ExitGameAndSaveReturned(void *pParam,int iPad,C4JStorage
}
else
{
ui.RequestAlertMessage(IDS_EXIT_GAME, IDS_CONFIRM_EXIT_GAME, uiIDA, 3, ProfileManager.GetPrimaryPad(), &IUIScene_PauseMenu::ExitGameSaveDialogReturned, pParam);
ui.RequestAlertMessage(IDS_EXIT_GAME, app.GetCorrectExitKey(ProfileManager.GetPrimaryPad()), uiIDA, 3, ProfileManager.GetPrimaryPad(), &IUIScene_PauseMenu::ExitGameSaveDialogReturned, pParam);
}
}
}
@@ -205,7 +218,7 @@ int IUIScene_PauseMenu::ExitGameDeclineSaveReturned(void *pParam,int iPad,C4JSto
}
else
{
ui.RequestAlertMessage(IDS_EXIT_GAME, IDS_CONFIRM_EXIT_GAME, uiIDA, 3, ProfileManager.GetPrimaryPad(),&IUIScene_PauseMenu::ExitGameSaveDialogReturned, pParam);
ui.RequestAlertMessage(IDS_EXIT_GAME, app.GetCorrectExitKey(ProfileManager.GetPrimaryPad()), uiIDA, 3, ProfileManager.GetPrimaryPad(),&IUIScene_PauseMenu::ExitGameSaveDialogReturned, pParam);
}
}
@@ -373,14 +386,17 @@ int IUIScene_PauseMenu::SaveWorldThreadProc( LPVOID lpParameter )
if(ProfileManager.IsFullVersion())
{
app.SetGameStarted(false);
if(!bAutosave)
{
app.SetGameStarted(false);
}
while( app.GetXuiServerAction(ProfileManager.GetPrimaryPad() ) != eXuiServerAction_Idle && !MinecraftServer::serverHalted() )
{
Sleep(10);
}
if(!MinecraftServer::serverHalted() && !app.GetChangingSessionType() ) app.SetGameStarted(true);
if(!bAutosave && !MinecraftServer::serverHalted() && !app.GetChangingSessionType() ) app.SetGameStarted(true);
#if defined(_XBOX_ONE) || defined(__ORBIS__)
if(app.GetGameHostOption(eGameHostOption_DisableSaving)) StorageManager.SetSaveDisabled(true);
@@ -734,15 +750,19 @@ int IUIScene_PauseMenu::SaveGameDialogReturned(void *pParam,int iPad,C4JStorage:
// results switched for this dialog
if(result==C4JStorage::EMessage_ResultDecline)
{
#if defined(_XBOX_ONE) || defined(__ORBIS__)
UINT uiIDA[2];
uiIDA[0]=IDS_CONFIRM_CANCEL;
uiIDA[1]=IDS_CONFIRM_OK;
ui.RequestAlertMessage(IDS_TITLE_ENABLE_AUTOSAVE, IDS_CONFIRM_ENABLE_AUTOSAVE, uiIDA, 2, iPad,&IUIScene_PauseMenu::EnableAutosaveDialogReturned,pParam);
#else
// flag a app action of save game
app.SetAction(iPad,eAppAction_SaveGame);
#endif
const int controlType = app.GetGameSettings(iPad, eGameSetting_ControlType);
if (controlType == 0 || controlType == 1 || controlType == 4) // windows, xbox one, and ps4
{
UINT uiIDA[2];
uiIDA[0]=IDS_CONFIRM_CANCEL;
uiIDA[1]=IDS_CONFIRM_OK;
ui.RequestAlertMessage(IDS_TITLE_ENABLE_AUTOSAVE, IDS_CONFIRM_ENABLE_AUTOSAVE, uiIDA, 2, iPad,&IUIScene_PauseMenu::EnableAutosaveDialogReturned,pParam);
}
else
{
// flag a app action of save game
app.SetAction(iPad,eAppAction_SaveGame);
}
}
return 0;
}
@@ -6,6 +6,8 @@
#include "../../../Minecraft.World/net.minecraft.world.level.dimension.h"
#include "../../../Minecraft.World/net.minecraft.world.level.storage.h"
#include "Tesselator.h"
#include "TexturePackRepository.h"
#include "TexturePack.h"
#include "Textures.h"
#include "BufferedImage.h"
#include "../GameRules/LevelGenerationOptions.h"
@@ -197,6 +199,8 @@ static wstring GetPanoramaTexturePath()
const char *mountedPanoramaRoots[] =
{
"TPACK:/Data/ControlType/Panorama/",
"WPACK:/Data/ControlType/Panorama/",
"TPACK:Data/ControlType/Panorama/",
"WPACK:Data/ControlType/Panorama/",
};
@@ -206,6 +210,16 @@ static wstring GetPanoramaTexturePath()
wstring mountedPath = convStringToWstring(StorageManager.GetMountedPath(mountedRoot));
if(mountedPath.empty()) continue;
if(mountedPath.find(L"Data/ControlType/Panorama/") != wstring::npos)
{
// slash check cause for some reason its not always there
size_t pos = mountedPath.find(L"Data/ControlType/Panorama/");
if(pos != wstring::npos && pos > 0 && mountedPath[pos-1] != L'/' && mountedPath[pos-1] != L'\\')
{
mountedPath.insert(pos, 1, L'/');
}
}
wstring sampleDay = mountedPath + L"Panorama_S.png";
wstring sampleNight = mountedPath + L"Panorama_N.png";
if(GetFileAttributesW(sampleDay.c_str()) != INVALID_FILE_ATTRIBUTES ||
@@ -229,6 +243,25 @@ static wstring GetPanoramaTexturePath()
return PANORAMA_TEXTURE_RELPATH;
}
static wstring GetPanoramaTexturePathKey()
{
wstring key = GetPanoramaTexturePath();
Minecraft *pMinecraft = Minecraft::GetInstance();
if(pMinecraft != nullptr && pMinecraft->skins != nullptr)
{
TexturePack *selected = pMinecraft->skins->getSelected();
if(selected != nullptr)
{
wchar_t buffer[32];
swprintf(buffer, 32, L"|TPACKID=%u", static_cast<unsigned int>(selected->getId()));
key += buffer;
}
}
return key;
}
// opengl time :v
static int LoadPanoramaQuadTexture(const wstring &fileName, float blurSigma, int &outWidth, int &outHeight)
{
@@ -478,7 +511,8 @@ void UIComponent_Panorama::tick()
void UIComponent_Panorama::EnsurePanoramaTexturesLoaded()
{
wstring currentRoot = GetPanoramaTexturePath();
if(m_bPanoramaTexturesLoaded && currentRoot == m_panoramaTextureRoot) return;
wstring currentRootKey = GetPanoramaTexturePathKey();
if(m_bPanoramaTexturesLoaded && currentRoot == m_panoramaTextureRoot && currentRootKey == m_panoramaTextureRootKey) return;
if(m_texPanoramaDay >= 0)
{
@@ -492,6 +526,7 @@ void UIComponent_Panorama::EnsurePanoramaTexturesLoaded()
}
m_panoramaTextureRoot = currentRoot;
m_panoramaTextureRootKey = currentRootKey;
m_bPanoramaTexturesLoaded = false;
// search for panorama.xml
@@ -15,6 +15,7 @@ private:
bool m_bPanoramaTexturesLoaded = false;
wstring m_panoramaTextureRoot;
wstring m_panoramaTextureRootKey;
float m_panoramaAspect = 1.0f;
DWORD m_lastScrollTickMs = 0;
float m_panoramaScroll = 0.0f;
@@ -11,6 +11,7 @@ UIComponent_PressStartToPlay::UIComponent_PressStartToPlay(int iPad, void *initD
m_showingSaveIcon = false;
m_showingAutosaveTimer = false;
m_showingTrialTimer = false;
m_saveIconPositionAdjusted = false;
for(unsigned int i = 0; i < XUSER_MAX_COUNT; ++i)
{
m_showingPressStart[i] = false;
@@ -43,6 +44,12 @@ wstring UIComponent_PressStartToPlay::getMoviePath()
void UIComponent_PressStartToPlay::handleReload()
{
// 4J Stu - It's possible these could change during the reload, so can't use the normal controls refresh of it's state
if(!m_saveIconPositionAdjusted)
{
m_controlSaveIcon.setXPos(m_controlSaveIcon.getXPos() + 40);
m_controlSaveIcon.setYPos(m_controlSaveIcon.getYPos() - 70);
m_saveIconPositionAdjusted = true;
}
m_controlSaveIcon.setVisible(m_showingSaveIcon);
m_labelTrialTimer.setVisible(m_showingAutosaveTimer);
m_labelTrialTimer.setLabel(m_autosaveTimer);
@@ -126,6 +133,13 @@ void UIComponent_PressStartToPlay::handleTimerComplete(int id)
ui.toastOn = false;
}
}
if (id == 2)
{
showSaveIcon(false);
killTimer(id);
}
ui.ClearPressStart();
}
@@ -197,6 +211,16 @@ void UIComponent_PressStartToPlay::showSaveIcon(bool show)
{
if(show) app.DebugPrintf("Tried to show save icon while texture pack reload was in progress\n");
}
if(show)
{
killTimer(2);
addTimer(2, 1000);
}
else
{
killTimer(2);
}
}
void UIComponent_PressStartToPlay::showPlayerDisplayName(bool show)
@@ -8,6 +8,7 @@ private:
bool m_showingSaveIcon;
bool m_showingAutosaveTimer;
bool m_showingTrialTimer;
bool m_saveIconPositionAdjusted;
bool m_showingPressStart[XUSER_MAX_COUNT];
wstring m_trialTimer;
wstring m_autosaveTimer;
@@ -142,8 +142,8 @@ void UIComponent_Tooltips::updateSafeZone()
const F64 screenW = ui.getScreenWidth();
const F64 screenH = ui.getScreenHeight();
const bool largerThan720Window = (screenH > 720.0f) || (screenW > 1280.0f);
const bool menuContext = ui.GetMenuDisplayed(m_iPad);
if(getSceneResolution() == eSceneResolution_720 && largerThan720Window && menuContext)
// const bool menuContext = ui.GetMenuDisplayed(m_iPad);
if(getSceneResolution() == eSceneResolution_720 && largerThan720Window /*&& menuContext*/)
{
const F64 widthScale = screenW / 1920.0f;
const F64 heightScale = screenH / 1080.0f;
+13 -20
View File
@@ -222,23 +222,12 @@ static wstring GetControlTypeSkinPath(int controlType, bool hd)
break;
}
if(skinName == L"windows") {
if (hd)
{
return L"skinHDWin.swf";
}
return L"skinWin.swf";
}
else
if(hd)
{
if(hd)
{
return wstring(L"Graphics\\ControlType\\HD\\") + skinName + L"HD.swf";
}
return wstring(L"Graphics\\ControlType\\") + skinName + L".swf";
return wstring(L"Graphics\\ControlType\\HD\\") + skinName + L"HD.swf";
}
return wstring(L"Graphics\\ControlType\\") + skinName + L".swf";
}
#endif
@@ -3161,11 +3150,15 @@ void UIController::ShowAutosaveCountdownTimer(bool show)
void UIController::UpdateAutosaveCountdownTimer(unsigned int uiSeconds)
{
#if !(defined(_XBOX_ONE) || defined(__ORBIS__))
WCHAR wcAutosaveCountdown[100];
swprintf( wcAutosaveCountdown, 100, app.GetString(IDS_AUTOSAVE_COUNTDOWN),uiSeconds);
if(m_groups[static_cast<int>(eUIGroup_Fullscreen)]->getPressStartToPlay()) m_groups[static_cast<int>(eUIGroup_Fullscreen)]->getPressStartToPlay()->setTrialTimer(wcAutosaveCountdown);
#endif
const int primaryPad = ProfileManager.GetPrimaryPad();
const int controlType = app.GetGameSettings(primaryPad, eGameSetting_ControlType);
const bool consoleAutosave = (controlType == 0 || controlType == 1 || controlType == 4);
if (!consoleAutosave)
{
WCHAR wcAutosaveCountdown[100];
swprintf( wcAutosaveCountdown, 100, app.GetString(IDS_AUTOSAVE_COUNTDOWN),uiSeconds);
if(m_groups[static_cast<int>(eUIGroup_Fullscreen)]->getPressStartToPlay()) m_groups[static_cast<int>(eUIGroup_Fullscreen)]->getPressStartToPlay()->setTrialTimer(wcAutosaveCountdown);
}
}
void UIController::ShowSavingMessage(unsigned int iPad, C4JStorage::ESavingMessage eVal)
+10 -8
View File
@@ -18,16 +18,10 @@ bool UIScene::SceneShouldUse1080p(const std::wstring &moviePath)
if(primaryPad < 0 || primaryPad >= XUSER_MAX_COUNT)
primaryPad = 0;
const int controlType = app.GetGameSettings(primaryPad, eGameSetting_ControlType);
const bool force1080ForControlType = (controlType == 0);
const bool force720ForControlType = (controlType == 3 || controlType == 5);
const bool isTutorialPopupMovie = (moviePath.find(L"TutorialPopup") == 0);
// dont refresh gui elements when the player
// is in the settings menu [resolution mismatch creates artifacts]
if(moviePath.find(L"SettingsUIMenu") == 0)
{
return (ui.getScreenHeight() > 720.0f) && (!force720ForControlType || isTutorialPopupMovie);
}
Minecraft *pMinecraft = Minecraft::GetInstance();
TexturePack *selectedPack = nullptr;
if(pMinecraft && pMinecraft->skins)
@@ -35,7 +29,15 @@ bool UIScene::SceneShouldUse1080p(const std::wstring &moviePath)
selectedPack = pMinecraft->skins->getSelected();
}
const bool isMarioWorld = (selectedPack && selectedPack->getId() == 1034);
return !isMarioWorld && (ui.getScreenHeight() > 720.0f) && (!force720ForControlType || isTutorialPopupMovie);
// dont refresh gui elements when the player
// is in the settings menu [resolution mismatch creates artifacts]
if(moviePath.find(L"SettingsUIMenu") == 0)
{
return !isMarioWorld && (force1080ForControlType || ui.getScreenHeight() > 720.0f) && (!force720ForControlType || isTutorialPopupMovie);
}
return !isMarioWorld && (force1080ForControlType || ui.getScreenHeight() > 720.0f) && (!force720ForControlType || isTutorialPopupMovie);
#else
(void)moviePath;
return true;
@@ -52,15 +52,26 @@ UIScene_ControlsMenu::UIScene_ControlsMenu(int iPad, void *initData, UILayer *pa
m_buttonLayouts[0].init(L"1", eControl_Button0);
m_buttonLayouts[1].init(L"2", eControl_Button1);
m_buttonLayouts[2].init(L"3", eControl_Button2);
if (controlType == 0)
{
m_buttonLayouts[1].setEnable(false);
m_buttonLayouts[2].setEnable(false);
}
}
#endif
m_checkboxInvert.init(app.GetString(IDS_INVERT_LOOK), eControl_InvertLook, app.GetGameSettings(m_iPad,eGameSetting_ControlInvertLook));
m_checkboxSouthpaw.init(app.GetString(IDS_SOUTHPAW), eControl_Southpaw, app.GetGameSettings(m_iPad,eGameSetting_ControlSouthPaw));
m_checkboxSafeCam.init(app.GetString(IDS_SAFE_SPRINT), eControl_SafeCam, app.GetGameSettings(m_iPad,eGameSetting_SafeCam));
m_checkboxAbswap.init(app.GetString(IDS_SWAP), eControl_ABSwap, app.GetGameSettings(m_iPad,eGameSetting_Swap));
if (app.GetGameSettings(m_iPad, eGameSetting_ControlType) == 0)
{
m_checkboxAbswap.init(app.GetString(IDS_SWAP_KBM), eControl_ABSwap, app.GetGameSettings(m_iPad,eGameSetting_Swap));
}
else
{
m_checkboxAbswap.init(app.GetString(IDS_SWAP), eControl_ABSwap, app.GetGameSettings(m_iPad,eGameSetting_Swap));
IggyDataValue result;
IggyDataValue value[1];
value[0].type = IGGY_DATATYPE_boolean;
@@ -73,6 +84,11 @@ UIScene_ControlsMenu::UIScene_ControlsMenu(int iPad, void *initData, UILayer *pa
m_iSchemeTextA[2]=IDS_CONTROLS_SCHEME2;
int iSelected=app.GetGameSettings(m_iPad,eGameSetting_ControlScheme);
if (controlType == 0)
{
app.SetGameSettings(m_iPad,eGameSetting_ControlScheme,0);
iSelected = 0;
}
#ifndef __PSVITA__
LPWSTR layoutString = new wchar_t[ 128 ];
@@ -211,6 +227,14 @@ void UIScene_ControlsMenu::handleCheckboxToggled(F64 controlId, bool selected)
void UIScene_ControlsMenu::handlePress(F64 controlId, F64 childId)
{
int control = static_cast<int>(controlId);
if (app.GetGameSettings(m_iPad, eGameSetting_ControlType) == 0 && control != eControl_Button0)
{
app.SetGameSettings(m_iPad,eGameSetting_ControlScheme,0);
m_iCurrentNavigatedControlsLayout = 0;
m_bLayoutChanged = true;
return;
}
switch(control)
{
case eControl_Button0:
@@ -233,6 +257,13 @@ void UIScene_ControlsMenu::handlePress(F64 controlId, F64 childId)
void UIScene_ControlsMenu::handleFocusChange(F64 controlId, F64 childId)
{
int control = static_cast<int>(controlId);
if (app.GetGameSettings(m_iPad, eGameSetting_ControlType) == 0 && control != eControl_Button0)
{
m_iCurrentNavigatedControlsLayout = 0;
m_bLayoutChanged = true;
return;
}
switch(control)
{
case eControl_Button0:
@@ -246,6 +277,10 @@ void UIScene_ControlsMenu::handleFocusChange(F64 controlId, F64 childId)
void UIScene_ControlsMenu::PositionAllText(int iPad)
{
// disable for keyboard
int controlType = app.GetGameSettings(m_iPad,eGameSetting_ControlType);
if (controlType == 0) return;
IggyDataValue result;
IggyPlayerCallMethodRS(getMovie(), &result, IggyPlayerRootPath(getMovie()), m_funcClearAllKeyLines, 0, 0);
@@ -148,23 +148,28 @@ void UIScene_DeathMenu::handlePress(F64 controlId, F64 childId)
break;
}
#if defined (_XBOX_ONE) || defined(__ORBIS__)
const int controlType = app.GetGameSettings(m_iPad, eGameSetting_ControlType);
const bool consoleAutosave = (controlType == 0 || controlType == 1 || controlType == 4); // windows, xbox one and ps4
if (consoleAutosave)
{
if(g_NetworkManager.IsHost() && StorageManager.GetSaveDisabled())
{
uiIDA[0]=IDS_CONFIRM_CANCEL;
uiIDA[1]=IDS_EXIT_GAME_SAVE;
uiIDA[2]=IDS_EXIT_GAME_NO_SAVE;
ui.RequestAlertMessage(IDS_EXIT_GAME, IDS_CONFIRM_EXIT_GAME, uiIDA, 3, m_iPad,&IUIScene_PauseMenu::ExitGameSaveDialogReturned,(LPVOID)GetCallbackUniqueId());
ui.RequestAlertMessage(IDS_EXIT_GAME, app.GetCorrectExitKey(m_iPad), uiIDA, 3, m_iPad,&IUIScene_PauseMenu::ExitGameSaveDialogReturned,(LPVOID)GetCallbackUniqueId());
}
else
{
uiIDA[0]=IDS_CONFIRM_CANCEL;
uiIDA[1]=IDS_CONFIRM_OK;
ui.RequestAlertMessage(IDS_EXIT_GAME, IDS_CONFIRM_EXIT_GAME, uiIDA, 2, m_iPad,&IUIScene_PauseMenu::ExitGameDialogReturned,(LPVOID)GetCallbackUniqueId());
ui.RequestAlertMessage(IDS_EXIT_GAME, app.GetCorrectExitKey(m_iPad), uiIDA, 2, m_iPad,&IUIScene_PauseMenu::ExitGameDialogReturned,(LPVOID)GetCallbackUniqueId());
}
#else
}
else {
if(StorageManager.GetSaveDisabled())
{
uiIDA[0]=IDS_CONFIRM_CANCEL;
@@ -179,17 +184,17 @@ void UIScene_DeathMenu::handlePress(F64 controlId, F64 childId)
uiIDA[1]=IDS_EXIT_GAME_SAVE;
uiIDA[2]=IDS_EXIT_GAME_NO_SAVE;
ui.RequestAlertMessage(IDS_EXIT_GAME, IDS_CONFIRM_EXIT_GAME, uiIDA, 3, m_iPad,&IUIScene_PauseMenu::ExitGameSaveDialogReturned,(LPVOID)GetCallbackUniqueId());
ui.RequestAlertMessage(IDS_EXIT_GAME, app.GetCorrectExitKey(m_iPad), uiIDA, 3, m_iPad,&IUIScene_PauseMenu::ExitGameSaveDialogReturned,(LPVOID)GetCallbackUniqueId());
}
else
{
uiIDA[0]=IDS_CONFIRM_CANCEL;
uiIDA[1]=IDS_CONFIRM_OK;
ui.RequestAlertMessage(IDS_EXIT_GAME, IDS_CONFIRM_EXIT_GAME, uiIDA, 2, m_iPad,&IUIScene_PauseMenu::ExitGameDialogReturned,(LPVOID)GetCallbackUniqueId());
ui.RequestAlertMessage(IDS_EXIT_GAME, app.GetCorrectExitKey(m_iPad), uiIDA, 2, m_iPad,&IUIScene_PauseMenu::ExitGameDialogReturned,(LPVOID)GetCallbackUniqueId());
}
}
#endif
}
}
else
{
+101 -73
View File
@@ -28,6 +28,9 @@ UIScene_PauseMenu::UIScene_PauseMenu(int iPad, void *initData, UILayer *parentLa
// Setup all the Iggy references we need for this scene
initialiseMovie();
m_bIgnoreInput=false;
m_savesDisabled=false;
m_bTrialTexturePack=false;
m_bErrorDialogRunning=false;
m_eAction=eAction_None;
m_buttons[BUTTON_PAUSE_RESUMEGAME].init(app.GetString(IDS_RESUME_GAME),BUTTON_PAUSE_RESUMEGAME);
@@ -52,27 +55,36 @@ UIScene_PauseMenu::UIScene_PauseMenu(int iPad, void *initData, UILayer *parentLa
m_bTrialTexturePack = true;
}
}
// 4J-TomK - check for all possible labels being fed into BUTTON_PAUSE_SAVEGAME (Bug 163775)
// this has to be done before button initialisation!
wchar_t saveButtonLabels[2][256];
swprintf( saveButtonLabels[0], 256, L"%ls", app.GetString( IDS_SAVE_GAME ));
swprintf( saveButtonLabels[1], 256, L"%ls", app.GetString( IDS_DISABLE_AUTOSAVE ));
m_buttons[BUTTON_PAUSE_SAVEGAME].setAllPossibleLabels(2,saveButtonLabels);
if(app.GetGameHostOption(eGameHostOption_DisableSaving) || m_bTrialTexturePack)
{
m_savesDisabled = true;
m_buttons[BUTTON_PAUSE_SAVEGAME].init(app.GetString(IDS_SAVE_GAME),BUTTON_PAUSE_SAVEGAME);
}
else
{
m_savesDisabled = false;
m_buttons[BUTTON_PAUSE_SAVEGAME].init(app.GetString(IDS_DISABLE_AUTOSAVE),BUTTON_PAUSE_SAVEGAME);
}
#else
m_buttons[BUTTON_PAUSE_SAVEGAME].init(app.GetString(IDS_SAVE_GAME),BUTTON_PAUSE_SAVEGAME);
#endif
const int controlType = app.GetGameSettings(m_iPad, eGameSetting_ControlType);
const bool consoleAutosave = (controlType == 0 || controlType == 1 || controlType == 4); // windows, xbox one and ps4
if (consoleAutosave)
{
// 4J-TomK - check for all possible labels being fed into BUTTON_PAUSE_SAVEGAME (Bug 163775)
// this has to be done before button initialisation!
wchar_t saveButtonLabels[2][256];
swprintf( saveButtonLabels[0], 256, L"%ls", app.GetString( IDS_SAVE_GAME ));
swprintf( saveButtonLabels[1], 256, L"%ls", app.GetString( IDS_DISABLE_AUTOSAVE ));
m_buttons[BUTTON_PAUSE_SAVEGAME].setAllPossibleLabels(2,saveButtonLabels);
if(app.GetGameHostOption(eGameHostOption_DisableSaving) || m_bTrialTexturePack)
{
m_savesDisabled = true;
m_buttons[BUTTON_PAUSE_SAVEGAME].init(app.GetString(IDS_SAVE_GAME),BUTTON_PAUSE_SAVEGAME);
}
else
{
m_savesDisabled = false;
m_buttons[BUTTON_PAUSE_SAVEGAME].init(app.GetString(IDS_DISABLE_AUTOSAVE),BUTTON_PAUSE_SAVEGAME);
}
}
else
{
m_buttons[BUTTON_PAUSE_SAVEGAME].init(app.GetString(IDS_SAVE_GAME),BUTTON_PAUSE_SAVEGAME);
}
m_buttons[BUTTON_PAUSE_EXITGAME].init(app.GetString(IDS_EXIT_GAME),BUTTON_PAUSE_EXITGAME);
if(!ProfileManager.IsFullVersion())
@@ -143,41 +155,46 @@ void UIScene_PauseMenu::tick()
{
UIScene::tick();
#ifdef __PSVITA__
// 4J-MGH - Need to check for installed DLC here, as we delay the installation of the key file on Vita
if(!app.DLCInstallProcessCompleted()) app.StartInstallDLCProcess(0);
#endif
#ifdef __PSVITA__
// 4J-MGH - Need to check for installed DLC here, as we delay the installation of the key file on Vita
if(!app.DLCInstallProcessCompleted()) app.StartInstallDLCProcess(0);
#endif
const int controlType = app.GetGameSettings(m_iPad, eGameSetting_ControlType);
const bool consoleAutosave = (controlType == 0 || controlType == 1 || controlType == 4); // windows, xbox one and ps4
#if defined _XBOX_ONE || defined __ORBIS__
if(!m_bTrialTexturePack && m_savesDisabled != (app.GetGameHostOption(eGameHostOption_DisableSaving) != 0) && ProfileManager.GetPrimaryPad() == m_iPad )
if (consoleAutosave)
{
// We show the save button if saves are disabled as this lets us show a prompt to enable them (via purchasing a texture pack)
if( app.GetGameHostOption(eGameHostOption_DisableSaving) )
if(!m_bTrialTexturePack && m_savesDisabled != (app.GetGameHostOption(eGameHostOption_DisableSaving) != 0) && ProfileManager.GetPrimaryPad() == m_iPad )
{
m_savesDisabled = true;
m_buttons[BUTTON_PAUSE_SAVEGAME].setLabel( app.GetString(IDS_SAVE_GAME) );
}
else
{
m_savesDisabled = false;
m_buttons[BUTTON_PAUSE_SAVEGAME].setLabel( app.GetString(IDS_DISABLE_AUTOSAVE) );
// We show the save button if saves are disabled as this lets us show a prompt to enable them (via purchasing a texture pack)
if( app.GetGameHostOption(eGameHostOption_DisableSaving) )
{
m_savesDisabled = true;
printf("PauseMenu::tick: setLabel IDS_SAVE_GAME (%ls)\n", app.GetString(IDS_SAVE_GAME));
m_buttons[BUTTON_PAUSE_SAVEGAME].setLabel( app.GetString(IDS_SAVE_GAME) );
}
else
{
m_savesDisabled = false;
printf("PauseMenu::tick: setLabel IDS_DISABLE_AUTOSAVE (%ls)\n", app.GetString(IDS_DISABLE_AUTOSAVE));
m_buttons[BUTTON_PAUSE_SAVEGAME].setLabel( app.GetString(IDS_DISABLE_AUTOSAVE) );
}
}
}
#endif
#ifdef __ORBIS__
// Process the error dialog (for a patch being available)
if(m_bErrorDialogRunning)
{
SceErrorDialogStatus stat = sceErrorDialogUpdateStatus();
if( stat == SCE_ERROR_DIALOG_STATUS_FINISHED )
{
sceErrorDialogTerminate();
m_bErrorDialogRunning=false;
#ifdef __ORBIS__
// Process the error dialog (for a patch being available)
if(m_bErrorDialogRunning)
{
SceErrorDialogStatus stat = sceErrorDialogUpdateStatus();
if( stat == SCE_ERROR_DIALOG_STATUS_FINISHED )
{
sceErrorDialogTerminate();
m_bErrorDialogRunning=false;
}
}
}
#endif
#endif
}
void UIScene_PauseMenu::updateTooltips()
@@ -239,8 +256,9 @@ void UIScene_PauseMenu::updateComponents()
void UIScene_PauseMenu::handlePreReload()
{
#if defined _XBOX_ONE || defined __ORBIS__
if(ProfileManager.GetPrimaryPad() == m_iPad)
const int controlType = app.GetGameSettings(m_iPad, eGameSetting_ControlType);
const bool consoleAutosave = (controlType == 0 || controlType == 1 || controlType == 4); // windows, xbox one and ps4
if(consoleAutosave && (ProfileManager.GetPrimaryPad() == m_iPad))
{
// 4J-TomK - check for all possible labels being fed into BUTTON_PAUSE_SAVEGAME (Bug 163775)
// this has to be done before button initialisation!
@@ -249,7 +267,6 @@ void UIScene_PauseMenu::handlePreReload()
swprintf( saveButtonLabels[1], 256, L"%ls", app.GetString( IDS_DISABLE_AUTOSAVE ));
m_buttons[BUTTON_PAUSE_SAVEGAME].setAllPossibleLabels(2,saveButtonLabels);
}
#endif
}
void UIScene_PauseMenu::handleReload()
@@ -257,8 +274,10 @@ void UIScene_PauseMenu::handleReload()
updateTooltips();
updateControlsVisibility();
#if defined _XBOX_ONE || defined __ORBIS__
if(ProfileManager.GetPrimaryPad() == m_iPad)
const int controlType = app.GetGameSettings(m_iPad, eGameSetting_ControlType);
const bool consoleAutosave = (controlType == 0 || controlType == 1 || controlType == 4); // windows, xbox one and ps4
if(consoleAutosave && ProfileManager.GetPrimaryPad() == m_iPad)
{
// We show the save button if saves are disabled as this lets us show a prompt to enable them (via purchasing a texture pack)
if( app.GetGameHostOption(eGameHostOption_DisableSaving) || m_bTrialTexturePack )
@@ -272,7 +291,6 @@ void UIScene_PauseMenu::handleReload()
m_buttons[BUTTON_PAUSE_SAVEGAME].setLabel( app.GetString(IDS_DISABLE_AUTOSAVE) );
}
}
#endif
doHorizontalResizeCheck();
}
@@ -660,8 +678,12 @@ void UIScene_PauseMenu::handlePress(F64 controlId, F64 childId)
playTime = static_cast<int>(pMinecraft->localplayers[m_iPad]->getSessionTimer());
}
#if defined(_XBOX_ONE) || defined(__ORBIS__)
uiIDA[0]=IDS_CONFIRM_CANCEL;
const int controlType = app.GetGameSettings(m_iPad, eGameSetting_ControlType);
const bool consoleAutosave = (controlType == 0 || controlType == 1 || controlType == 4); // windows, xbox one and ps4
if (consoleAutosave)
{
uiIDA[0]=IDS_CONFIRM_CANCEL;
uiIDA[1]=IDS_CONFIRM_OK;
if(g_NetworkManager.IsHost() && StorageManager.GetSaveDisabled())
@@ -676,7 +698,7 @@ void UIScene_PauseMenu::handlePress(F64 controlId, F64 childId)
}
else
{
ui.RequestAlertMessage(IDS_EXIT_GAME, IDS_CONFIRM_EXIT_GAME, uiIDA, 3, m_iPad,&UIScene_PauseMenu::ExitGameSaveDialogReturned, (LPVOID)GetCallbackUniqueId());
ui.RequestAlertMessage(IDS_EXIT_GAME, app.GetCorrectExitKey(m_iPad), uiIDA, 3, m_iPad,&UIScene_PauseMenu::ExitGameSaveDialogReturned, (LPVOID)GetCallbackUniqueId());
}
}
else if(g_NetworkManager.IsHost() && g_NetworkManager.GetPlayerCount()>1)
@@ -685,9 +707,11 @@ void UIScene_PauseMenu::handlePress(F64 controlId, F64 childId)
}
else
{
ui.RequestAlertMessage(IDS_EXIT_GAME, IDS_CONFIRM_EXIT_GAME, uiIDA, 2, m_iPad,&IUIScene_PauseMenu::ExitGameDialogReturned, (LPVOID)GetCallbackUniqueId());
ui.RequestAlertMessage(IDS_EXIT_GAME, app.GetCorrectExitKey(m_iPad), uiIDA, 2, m_iPad,&IUIScene_PauseMenu::ExitGameDialogReturned, (LPVOID)GetCallbackUniqueId());
}
#else
}
else
{
if(StorageManager.GetSaveDisabled())
{
uiIDA[0]=IDS_CONFIRM_CANCEL;
@@ -708,7 +732,7 @@ void UIScene_PauseMenu::handlePress(F64 controlId, F64 childId)
}
else
{
ui.RequestAlertMessage(IDS_EXIT_GAME, IDS_CONFIRM_EXIT_GAME, uiIDA, 3, m_iPad,&UIScene_PauseMenu::ExitGameSaveDialogReturned, (LPVOID)GetCallbackUniqueId());
ui.RequestAlertMessage(IDS_EXIT_GAME, app.GetCorrectExitKey(m_iPad), uiIDA, 3, m_iPad,&UIScene_PauseMenu::ExitGameSaveDialogReturned, (LPVOID)GetCallbackUniqueId());
}
}
else
@@ -716,10 +740,10 @@ void UIScene_PauseMenu::handlePress(F64 controlId, F64 childId)
uiIDA[0]=IDS_CONFIRM_CANCEL;
uiIDA[1]=IDS_CONFIRM_OK;
ui.RequestAlertMessage(IDS_EXIT_GAME, IDS_CONFIRM_EXIT_GAME, uiIDA, 2, m_iPad,&IUIScene_PauseMenu::ExitGameDialogReturned, (LPVOID)GetCallbackUniqueId());
ui.RequestAlertMessage(IDS_EXIT_GAME, app.GetCorrectExitKey(m_iPad), uiIDA, 2, m_iPad,&IUIScene_PauseMenu::ExitGameDialogReturned, (LPVOID)GetCallbackUniqueId());
}
}
#endif
}
}
else
{
@@ -894,8 +918,10 @@ void UIScene_PauseMenu::PerformActionSaveGame()
else
#endif
{
#if defined(_XBOX_ONE) || defined(__ORBIS__)
if(!m_savesDisabled)
const int controlType = app.GetGameSettings(m_iPad, eGameSetting_ControlType);
const bool consoleAutosave = (controlType == 0 || controlType == 1 || controlType == 4); // windows, xbox one and ps4
if(consoleAutosave && !m_savesDisabled)
{
UINT uiIDA[2];
uiIDA[0]=IDS_CANCEL;
@@ -903,7 +929,6 @@ void UIScene_PauseMenu::PerformActionSaveGame()
ui.RequestAlertMessage(IDS_TITLE_DISABLE_AUTOSAVE, IDS_CONFIRM_DISABLE_AUTOSAVE, uiIDA, 2, m_iPad,&IUIScene_PauseMenu::DisableAutosaveDialogReturned,(LPVOID)GetCallbackUniqueId());
}
else
#endif
// we need to ask if they are sure they want to overwrite the existing game
if(bSaveExists)
{
@@ -914,15 +939,18 @@ void UIScene_PauseMenu::PerformActionSaveGame()
}
else
{
#if defined(_XBOX_ONE) || defined(__ORBIS__)
UINT uiIDA[2];
uiIDA[0]=IDS_CONFIRM_CANCEL;
uiIDA[1]=IDS_CONFIRM_OK;
ui.RequestAlertMessage(IDS_TITLE_ENABLE_AUTOSAVE, IDS_CONFIRM_ENABLE_AUTOSAVE, uiIDA, 2, m_iPad,&IUIScene_PauseMenu::EnableAutosaveDialogReturned,(LPVOID)GetCallbackUniqueId());
#else
// flag a app action of save game
app.SetAction(m_iPad,eAppAction_SaveGame);
#endif
if(consoleAutosave)
{
UINT uiIDA[2];
uiIDA[0]=IDS_CONFIRM_CANCEL;
uiIDA[1]=IDS_CONFIRM_OK;
ui.RequestAlertMessage(IDS_TITLE_ENABLE_AUTOSAVE, IDS_CONFIRM_ENABLE_AUTOSAVE, uiIDA, 2, m_iPad,&IUIScene_PauseMenu::EnableAutosaveDialogReturned,(LPVOID)GetCallbackUniqueId());
}
else
{
// flag a app action of save game
app.SetAction(m_iPad,eAppAction_SaveGame);
}
}
}
}
@@ -2,6 +2,25 @@
#include "UI.h"
#include "UIScene_SettingsOptionsMenu.h"
namespace
{
void FormatAutosaveSliderLabel(WCHAR *buffer, size_t bufferSize, int value, int controlType)
{
const bool fasterAutosave = (controlType == 0 || controlType == 1 || controlType == 4); // windows, xbox one and ps4
if(value == 0)
{
swprintf(buffer, bufferSize, L"%ls", app.GetString(IDS_SLIDER_AUTOSAVE_OFF));
}
else
{
const int displayValue = fasterAutosave ? value : value * 15;
const wstring unitText = (displayValue == 1) ? L"Min" : app.GetString(IDS_MINUTES);
swprintf(buffer, bufferSize, L"%ls: %d %ls", app.GetString(IDS_SLIDER_AUTOSAVE), displayValue, unitText.c_str());
}
}
}
int UIScene_SettingsOptionsMenu::m_iDifficultyTitleSettingA[4]=
{
IDS_DIFFICULTY_TITLE_PEACEFUL,
@@ -65,6 +84,7 @@ void UIScene_SettingsOptionsMenu::tick()
m_multiList.AddNewCheckbox(app.GetString(IDS_VIEW_BOBBING), eControl_ViewBob, (app.GetGameSettings(m_iPad,eGameSetting_ViewBob)!=0));
m_multiList.AddNewCheckbox(app.GetString(IDS_HINTS), eControl_Hints, (app.GetGameSettings(m_iPad,eGameSetting_Hints)!=0));
m_multiList.AddNewCheckbox(app.GetString(IDS_CHECKBOX_DEATH_MESSAGES), eControl_DeathMessages, (app.GetGameSettings(m_iPad,eGameSetting_DeathMessages)!=0));
m_multiList.AddNewCheckbox(L"Passive Chunk Loading", eControl_PassiveChunkLoading, (app.GetGameSettings(m_iPad,eGameSetting_PassiveChunkLoading)!=0));
if(m_bNotInGame)
{
@@ -74,10 +94,7 @@ void UIScene_SettingsOptionsMenu::tick()
WCHAR TempString[256];
int autosaveVal = app.GetGameSettings(m_iPad,eGameSetting_Autosave);
if(autosaveVal == 0)
swprintf(TempString, 256, L"%ls", app.GetString(IDS_SLIDER_AUTOSAVE_OFF));
else
swprintf(TempString, 256, L"%ls: %d %ls", app.GetString(IDS_SLIDER_AUTOSAVE), autosaveVal*15, app.GetString(IDS_MINUTES));
FormatAutosaveSliderLabel(TempString, 256, autosaveVal, app.GetGameSettings(m_iPad, eGameSetting_ControlType));
m_multiList.AddNewSlider(TempString, eControl_Autosave, 0, 8, 1, autosaveVal);
swprintf(TempString, 256, L"%ls: %d%%", app.GetString(IDS_SLIDER_SENSITIVITY_INGAME), app.GetGameSettings(m_iPad,eGameSetting_Sensitivity_InGame));
@@ -115,10 +132,7 @@ void UIScene_SettingsOptionsMenu::tick()
case eControl_Autosave:
app.SetGameSettings(m_iPad, eGameSetting_Autosave, m_iPendingSliderValue);
app.SetAutosaveTimerTime();
if(m_iPendingSliderValue == 0)
swprintf(TempString, 256, L"%ls", app.GetString(IDS_SLIDER_AUTOSAVE_OFF));
else
swprintf(TempString, 256, L"%ls: %d %ls", app.GetString(IDS_SLIDER_AUTOSAVE), m_iPendingSliderValue*15, app.GetString(IDS_MINUTES));
FormatAutosaveSliderLabel(TempString, 256, m_iPendingSliderValue, app.GetGameSettings(m_iPad, eGameSetting_ControlType));
m_multiList.SetSliderLabel(eControl_Autosave, TempString);
break;
case eControl_Sensitivity_InGame:
@@ -233,6 +247,7 @@ void UIScene_SettingsOptionsMenu::setGameSettings()
app.SetGameSettings(m_iPad,eGameSetting_ViewBob,m_multiList.GetCheckboxValue(eControl_ViewBob)?1:0);
app.SetGameSettings(m_iPad,eGameSetting_Hints,m_multiList.GetCheckboxValue(eControl_Hints)?1:0);
app.SetGameSettings(m_iPad,eGameSetting_DeathMessages,m_multiList.GetCheckboxValue(eControl_DeathMessages)?1:0);
app.SetGameSettings(m_iPad,eGameSetting_PassiveChunkLoading,m_multiList.GetCheckboxValue(eControl_PassiveChunkLoading)?1:0);
app.SetGameSettings(m_iPad,eGameSetting_Autosave,m_multiList.GetSliderValue(eControl_Autosave));
app.SetGameSettings(m_iPad,eGameSetting_Sensitivity_InGame,m_multiList.GetSliderValue(eControl_Sensitivity_InGame));
app.SetGameSettings(m_iPad,eGameSetting_Difficulty,m_multiList.GetSliderValue(eControl_Difficulty));
@@ -13,10 +13,11 @@ private:
eControl_ViewBob = 2,
eControl_Hints = 3,
eControl_DeathMessages = 4,
eControl_Languages = 5,
eControl_Autosave = 6,
eControl_Sensitivity_InGame = 7,
eControl_Difficulty = 8,
eControl_PassiveChunkLoading = 5,
eControl_Languages = 6,
eControl_Autosave = 7,
eControl_Sensitivity_InGame = 8,
eControl_Difficulty = 9,
};
UIControl_MultiList m_multiList;