From 18871ed84d3bbb391feeef16cdda2e8793f810f7 Mon Sep 17 00:00:00 2001 From: GabsPuNs Date: Wed, 17 Jun 2026 22:47:42 -0400 Subject: [PATCH] Attempt to make LCJ Menu look more like the OG Also some code cleanup for it --- .../Assets/UI/LoadCreateJoinMenu.rcss | 40 +- .../Common/UI/UIScene_LoadCreateJoinMenu.cpp | 1039 +---------------- .../Common/UI/UIScene_LoadCreateJoinMenu.h | 160 +-- 3 files changed, 44 insertions(+), 1195 deletions(-) diff --git a/Minecraft.Client/Assets/UI/LoadCreateJoinMenu.rcss b/Minecraft.Client/Assets/UI/LoadCreateJoinMenu.rcss index e67d8a9e..e925efec 100644 --- a/Minecraft.Client/Assets/UI/LoadCreateJoinMenu.rcss +++ b/Minecraft.Client/Assets/UI/LoadCreateJoinMenu.rcss @@ -3,7 +3,7 @@ body width: 100%; height: 100%; font-family: Minecraft Default; - font-size: 14dp; + font-size: 36dp; font-effect: shadow(1dp 1dp #000000); color: #ffffff; background: transparent; @@ -14,8 +14,8 @@ body div#lcj_menu { - width: 650dp; - height: 600dp; + width: 898dp; + height: 774dp; margin: auto; display: flex; flex-direction: column; @@ -24,8 +24,8 @@ div#lcj_menu div#tab_bar { - width: 682dp; - height: 56dp; + width: 930dp; + height: 92dp; display: flex; flex-direction: row; margin-bottom: 0; @@ -36,13 +36,14 @@ div#tab_bar button.tab { display: block; - height: 56dp; + height: 92dp; flex: 0; - color: #ffffff; - font-size: 22dp; + color: #000000; + font-size: 36dp; + font-effect: none; font-weight: normal; text-align: center; - line-height: 63dp; + line-height: 100dp; cursor: pointer; background: transparent; border-width: 0px; @@ -55,7 +56,7 @@ button.tab button.tab:hover, button.tab.selected { - line-height: 58dp; + line-height: 80dp; } button.tab_left @@ -124,8 +125,7 @@ div.list_container div.list_item { width: 100%; - height: 48dp; - margin-bottom: 4dp; + height: 90dp; display: flex; flex-direction: row; align-items: center; @@ -144,12 +144,12 @@ div.list_item button display: flex; align-items: center; justify-content: flex-start; - padding-left: 16dp; + padding-left: 20dp; padding-right: 16dp; - margin: 0 20dp; - gap: 8dp; + margin: 0 44dp; + gap: 30dp; color: #ffffff; - font-size: 20dp; + font-size: 36dp; background: transparent; border-width: 0px; cursor: pointer; @@ -165,15 +165,15 @@ div.list_item button.selected div.list_item button img.thumb { - width: 32dp; - height: 32dp; + width: 64dp; + height: 64dp; } div.timer { width: 100%; text-align: center; - font-size: 18dp; + font-size: 36dp; color: #aaaaaa; padding: 20dp 0; display: none; @@ -183,7 +183,7 @@ div.no_games { width: 100%; text-align: center; - font-size: 18dp; + font-size: 36dp; color: #aaaaaa; padding: 40dp 0; display: none; diff --git a/Minecraft.Client/Common/UI/UIScene_LoadCreateJoinMenu.cpp b/Minecraft.Client/Common/UI/UIScene_LoadCreateJoinMenu.cpp index 3506b3a5..8eec9d85 100644 --- a/Minecraft.Client/Common/UI/UIScene_LoadCreateJoinMenu.cpp +++ b/Minecraft.Client/Common/UI/UIScene_LoadCreateJoinMenu.cpp @@ -2,8 +2,6 @@ #include "UI.h" #include "UIScene_LoadCreateJoinMenu.h" -// By Rockefort O Rockefeler - #include "../../../Minecraft.World/StringHelpers.h" #include "../../../Minecraft.World/net.minecraft.world.item.h" #include "../../../Minecraft.World/net.minecraft.world.level.h" @@ -16,27 +14,11 @@ #include "../../TexturePack.h" #include "../Network/SessionInfo.h" -#if defined(__PS3__) || defined(__ORBIS__) || defined(__PSVITA__) -#include "Common\Network\Sony\SonyHttp.h" -#include "Common\Network\Sony\SonyRemoteStorage.h" -#include "DLCTexturePack.h" -#endif - -#if defined(__ORBIS__) || defined(__PSVITA__) -#include -#endif - -#ifdef __PSVITA__ -#include "message_dialog.h" -#endif - -#ifdef _WINDOWS64 #include "../../../Minecraft.World/NbtIo.h" #include "../../../Minecraft.World/compression.h" #include "../../Windows64/KeyboardMouseInput.h" #include "UISplitScreenHelpers.h" #include -#endif // RmlUi includes (Windows macros temporarily suppressed) #pragma push_macro("byte") @@ -169,32 +151,10 @@ static wstring ReadLevelNameFromSaveFile(const wstring& filePath) } #endif -#ifdef SONY_REMOTE_STORAGE_DOWNLOAD -unsigned long UIScene_LoadCreateJoinMenu::m_ulFileSize = 0L; -wstring UIScene_LoadCreateJoinMenu::m_wstrStageText = L""; -bool UIScene_LoadCreateJoinMenu::m_bSaveTransferRunning = false; -#endif - #define JOIN_LOAD_ONLINE_TIMER_ID 0 #define JOIN_LOAD_ONLINE_TIMER_TIME 100 -#ifdef _XBOX -#define CHECKFORAVAILABLETEXTUREPACKS_TIMER_ID 3 -#define CHECKFORAVAILABLETEXTUREPACKS_TIMER_TIME 50 -#endif - -#ifdef _XBOX_ONE -UIScene_LoadCreateJoinMenu::ESaveTransferFiles UIScene_LoadCreateJoinMenu::s_eSaveTransferFile; -unsigned long UIScene_LoadCreateJoinMenu::s_ulFileSize = 0L; -byteArray UIScene_LoadCreateJoinMenu::s_transferData = byteArray(); -wstring UIScene_LoadCreateJoinMenu::m_wstrStageText = L""; - -#ifdef _DEBUG_MENUS_ENABLED -C4JStorage::SAVETRANSFER_FILE_DETAILS UIScene_LoadCreateJoinMenu::m_debugTransferDetails; -#endif -#endif - -// ─── RmlUi helper methods ────────────────────────────────────────────── +// -- RmlUi helper methods -- void UIScene_LoadCreateJoinMenu::ShowTabPanel(const char* panelId, bool show) { @@ -289,7 +249,7 @@ void UIScene_LoadCreateJoinMenu::SetListTexture(int itemIndex, const char* listI (void)itemIndex; (void)listId; (void)textureName; } -// ─── Construction / Destruction ───────────────────────────────────────── +// -- Construction / Destruction -- UIScene_LoadCreateJoinMenu::UIScene_LoadCreateJoinMenu(int iPad, void* initData, UILayer* parentLayer) : UIScene(iPad, parentLayer) { @@ -330,10 +290,6 @@ UIScene_LoadCreateJoinMenu::UIScene_LoadCreateJoinMenu(int iPad, void* initData, m_iTexturePacksNotInstalled = 0; m_bCopying = false; m_bCopyingCancelled = false; -#ifndef _XBOX_ONE - m_bSaveTransferCancelled = false; - m_bSaveTransferInProgress = false; -#endif m_eAction = eAction_None; // Load RmlUi document @@ -371,38 +327,11 @@ UIScene_LoadCreateJoinMenu::UIScene_LoadCreateJoinMenu(int iPad, void* initData, m_bMultiplayerAllowed = ProfileManager.IsSignedInLive(m_iPad) && ProfileManager.AllowedToPlayMultiplayer(m_iPad); -#ifdef _XBOX_ONE - app.AddDLCRequest(e_Marketplace_Content); -#endif - int iLB = -1; -#ifdef _XBOX - - XPARTY_USER_LIST partyList; - if ((XPartyGetUserList(&partyList) != XPARTY_E_NOT_IN_PARTY) && (partyList.dwUserCount > 1)) - m_bInParty = true; - else - m_bInParty = false; -#endif - -#if defined(__PS3__) || defined(__ORBIS__) || defined(__PSVITA__) || defined(_DURANGO) || defined(_WINDOWS64) StorageManager.ClearSavesInfo(); -#endif -#if defined(_WINDOWS64) Initialise(); -#else - if (app.StartInstallDLCProcess(m_iPad) == true || app.DLCInstallPending()) - m_bIgnoreInput = true; - else - Initialise(); -#endif - -#ifdef __PSVITA__ - if (CGameNetworkManager::usingAdhocMode() && SQRNetworkManager_AdHoc_Vita::GetAdhocStatus()) - g_NetworkManager.startAdhocMatching(); -#endif UpdateGamesList(); @@ -414,75 +343,6 @@ UIScene_LoadCreateJoinMenu::UIScene_LoadCreateJoinMenu(int iPad, void* initData, if (!m_bIgnoreInput) app.m_dlcManager.checkForCorruptDLCAndAlert(); - -#ifdef _XBOX - - DLC_INFO* pDLCInfo = nullptr; - bool bTexturePackAlreadyListed; - bool bNeedToGetTPD = false; - - Minecraft* pMinecraft = Minecraft::GetInstance(); - int texturePacksCount = pMinecraft->skins->getTexturePackCount(); - - for (unsigned int i = 0; i < app.GetDLCInfoTexturesOffersCount(); ++i) - { - bTexturePackAlreadyListed = false; - -#if defined(__PS3__) || defined(__ORBIS__) - char* pchDLCName = app.GetDLCInfoTextures(i); - pDLCInfo = app.GetDLCInfo(pchDLCName); -#else - ULONGLONG ull = app.GetDLCInfoTexturesFullOffer(i); - pDLCInfo = app.GetDLCInfoForFullOfferID(ull); -#endif - - for (unsigned int i = 0; i < texturePacksCount; ++i) - { - TexturePack* tp = pMinecraft->skins->getTexturePackByIndex(i); - if (pDLCInfo && pDLCInfo->iConfig == tp->getDLCParentPackId()) - bTexturePackAlreadyListed = true; - } - - if (bTexturePackAlreadyListed == false) - { - bNeedToGetTPD = true; - m_iTexturePacksNotInstalled++; - } - } - - if (bNeedToGetTPD == true) - { - app.AddTMSPPFileTypeRequest(e_DLC_TexturePackData); - - m_iTexturePacksNotInstalled = 0; - for (unsigned int i = 0; i < app.GetDLCInfoTexturesOffersCount(); ++i) - { - bTexturePackAlreadyListed = false; - -#if defined(__PS3__) || defined(__ORBIS__) - char* pchDLCName = app.GetDLCInfoTextures(i); - pDLCInfo = app.GetDLCInfo(pchDLCName); -#else - ULONGLONG ull = app.GetDLCInfoTexturesFullOffer(i); - pDLCInfo = app.GetDLCInfoForFullOfferID(ull); -#endif - for (unsigned int i = 0; i < texturePacksCount; ++i) - { - TexturePack* tp = pMinecraft->skins->getTexturePackByIndex(i); - if (pDLCInfo->iConfig == tp->getDLCParentPackId()) - bTexturePackAlreadyListed = true; - } - if (bTexturePackAlreadyListed == false) - m_iTexturePacksNotInstalled++; - } - } - - addTimer(CHECKFORAVAILABLETEXTUREPACKS_TIMER_ID, CHECKFORAVAILABLETEXTUREPACKS_TIMER_TIME); -#endif - -#ifdef SONY_REMOTE_STORAGE_DOWNLOAD - m_eSaveTransferState = eSaveTransfer_Idle; -#endif } @@ -523,7 +383,7 @@ UIScene_LoadCreateJoinMenu::~UIScene_LoadCreateJoinMenu() } } -// ─── RmlUi lifecycle overrides ────────────────────────────────────────── +// -- RmlUi lifecycle overrides -- void UIScene_LoadCreateJoinMenu::gainFocus() { @@ -598,15 +458,10 @@ void UIScene_LoadCreateJoinMenu::ProcessEvent(Rml::Event& event) } } -// ─── Update / Tooltips / Components ──────────────────────────────────── +// -- Update / Tooltips / Components -- void UIScene_LoadCreateJoinMenu::updateTooltips() { -#if defined __PS3__ || defined __ORBIS__ || defined __PSVITA__ - if (m_eSaveTransferState != eSaveTransfer_Idle) - return; -#endif - int iRB = -1; int iY = -1; int iLB = -1; @@ -628,11 +483,6 @@ void UIScene_LoadCreateJoinMenu::updateTooltips() else if (DoesMashUpWorldHaveFocus()) iY = IDS_TOOLTIPS_HIDE; -#if defined(__PS3__) || defined(__ORBIS__) || defined(__PSVITA__) - if (m_iPad == ProfileManager.GetPrimaryPad()) - iY = IDS_TOOLTIPS_GAME_INVITES; -#endif - if (ProfileManager.IsFullVersion() == false) iRB = -1; else if (StorageManager.GetSaveDisabled()) @@ -642,18 +492,7 @@ void UIScene_LoadCreateJoinMenu::updateTooltips() #endif } else - { -#if defined _XBOX_ONE - if (ProfileManager.IsSignedInLive(m_iPad)) - iX = IDS_TOOLTIPS_SAVETRANSFER_DOWNLOAD; -#elif defined SONY_REMOTE_STORAGE_DOWNLOAD - bool bSignedInLive = ProfileManager.IsSignedInLive(m_iPad); - if (bSignedInLive) - iX = IDS_TOOLTIPS_SAVETRANSFER_DOWNLOAD; -#else iX = IDS_TOOLTIPS_CHANGEDEVICE; -#endif - } ui.SetTooltips(DEFAULT_XUI_MENU_USER, IDS_TOOLTIPS_SELECT, IDS_TOOLTIPS_BACK, iX, iY, -1, -1, iLB, iRB, iLS, -1, -1, true); @@ -696,21 +535,7 @@ void UIScene_LoadCreateJoinMenu::handleGainFocus(bool navBack) m_bIgnoreInput = false; -#if !defined(_WINDOWS64) - if (app.StartInstallDLCProcess(m_iPad) == false) - m_bIgnoreInput = false; - else - { - m_bIgnoreInput = true; - ClearList("load_list"); - ShowTabPanel("load_timer", true); - } -#endif - - if (m_bMultiplayerAllowed) - { - } - else + if (!m_bMultiplayerAllowed) { ClearList("join_list"); ShowTabPanel("join_timer", false); @@ -724,7 +549,7 @@ void UIScene_LoadCreateJoinMenu::handleGainFocus(bool navBack) } } -// ─── Initialise ───────────────────────────────────────────────────────── +// -- Initialise -- void UIScene_LoadCreateJoinMenu::Initialise() { @@ -744,15 +569,10 @@ void UIScene_LoadCreateJoinMenu::Initialise() } else if (StorageManager.GetSaveDisabled()) { -#if defined(__PS3__) || defined(__ORBIS__) || defined (__PSVITA__) - GetSaveInfo(); - ShowTabPanel("load_timer", true); -#else { GetSaveInfo(); ShowTabPanel("load_timer", true); } -#endif } else { @@ -765,7 +585,7 @@ void UIScene_LoadCreateJoinMenu::Initialise() app.m_dlcManager.checkForCorruptDLCAndAlert(); } -// ─── Thumbnail / Save callbacks ───────────────────────────────────────── +// -- Thumbnail / Save callbacks -- int UIScene_LoadCreateJoinMenu::LoadSaveDataThumbnailReturned(LPVOID lpParam, PBYTE pbThumbnail, DWORD dwThumbnailBytes) { @@ -788,7 +608,7 @@ int UIScene_LoadCreateJoinMenu::LoadSaveCallback(LPVOID lpParam, bool bRes) return 0; } -// ─── Timer ────────────────────────────────────────────────────────────── +// -- Timer -- void UIScene_LoadCreateJoinMenu::handleTimerComplete(int id) { @@ -796,14 +616,6 @@ void UIScene_LoadCreateJoinMenu::handleTimerComplete(int id) { case JOIN_LOAD_ONLINE_TIMER_ID: { -#ifdef _XBOX - XPARTY_USER_LIST partyList; - if ((XPartyGetUserList(&partyList) != XPARTY_E_NOT_IN_PARTY) && (partyList.dwUserCount > 1)) - m_bInParty = true; - else - m_bInParty = false; -#endif - bool bMultiplayerAllowed = ProfileManager.IsSignedInLive(m_iPad) && ProfileManager. AllowedToPlayMultiplayer(m_iPad); @@ -823,17 +635,10 @@ void UIScene_LoadCreateJoinMenu::handleTimerComplete(int id) } } break; - -#ifdef _XBOX - case CHECKFORAVAILABLETEXTUREPACKS_TIMER_ID: { - // Texture pack checking logic preserved - } - break; -#endif } } -// ─── Input Handling ───────────────────────────────────────────────────── +// -- Input Handling -- void UIScene_LoadCreateJoinMenu::handleInput(int iPad, int key, bool repeat, bool pressed, bool released, bool& handled) { @@ -921,24 +726,11 @@ void UIScene_LoadCreateJoinMenu::handleInput(int iPad, int key, bool repeat, boo case ACTION_MENU_CANCEL: if (pressed) { -#if defined(__PS3__) || defined(__ORBIS__) || defined(__PSVITA__) - m_bExitScene = true; -#else navigateBack(); -#endif handled = true; } break; - case ACTION_MENU_X: - // Save transfer logic preserved - { -#ifdef __PSVITA__ - hideFocusedMashupWorld(); -#endif - } - break; - case ACTION_MENU_Y: #ifdef _WINDOWS64 if (hideFocusedMashupWorld()) @@ -1021,7 +813,7 @@ void UIScene_LoadCreateJoinMenu::handleInput(int iPad, int key, bool repeat, boo } } -// ─── Focus ────────────────────────────────────────────────────────────── +// -- Focus -- void UIScene_LoadCreateJoinMenu::handleFocusChange(F64 controlId, F64 childId) { @@ -1112,7 +904,7 @@ void UIScene_LoadCreateJoinMenu::handleInitFocus(F64 controlId, F64 childId) m_bPendingJoinTabAvailabilityRefresh = true; } -// ─── Games List ───────────────────────────────────────────────────────── +// -- Games List -- void UIScene_LoadCreateJoinMenu::UpdateGamesListCallback(LPVOID pParam) { @@ -1149,20 +941,12 @@ void UIScene_LoadCreateJoinMenu::tick() rmlCtx->Update(); } -#if (defined __PS3__ || defined __ORBIS__ || defined _DURANGO || defined _WINDOWS64 || defined __PSVITA__) - if (m_bExitScene) if (!m_bRetrievingSaveThumbnails) navigateBack(); if (hasFocus(m_iPad)) { -#ifdef SONY_REMOTE_STORAGE_DOWNLOAD - if (m_eSaveTransferState == eSaveTransfer_Idle) - m_bSaveTransferRunning = false; -#endif - -#if defined(_XBOX_ONE) || defined(__ORBIS__) || defined(_WINDOWS64) if (m_bUpdateSaveSize) { UpdateSaveSizeBarVisibility(); @@ -1180,7 +964,6 @@ void UIScene_LoadCreateJoinMenu::tick() UpdateJoinTabAvailability(); m_bPendingJoinTabAvailabilityRefresh = false; } -#endif if (!m_bSavesDisplayed) { @@ -1261,11 +1044,6 @@ void UIScene_LoadCreateJoinMenu::tick() m_saveDetails[i].saveId = origIdx; memcpy(m_saveDetails[i].UTF8SaveFilename, m_pSaveDetails->SaveInfoA[origIdx].UTF8SaveFilename, MAX_SAVEFILENAME_LENGTH); } -#else - AddListItem("load_list", wstring(m_pSaveDetails->SaveInfoA[i].UTF8SaveTitle, m_pSaveDetails->SaveInfoA[i].UTF8SaveTitle + 127)); - memcpy(m_saveDetails[i].UTF8SaveName, m_pSaveDetails->SaveInfoA[i].UTF8SaveTitle, 128); - m_saveDetails[i].saveId = i; - memcpy(m_saveDetails[i].UTF8SaveFilename, m_pSaveDetails->SaveInfoA[i].UTF8SaveFilename, MAX_SAVEFILENAME_LENGTH); #endif } #ifdef _WINDOWS64 @@ -1282,11 +1060,8 @@ void UIScene_LoadCreateJoinMenu::tick() { m_bRetrievingSaveThumbnails = true; PSAVE_DETAILS pSaveDetails = StorageManager.ReturnSavesInfo(); -#ifdef _WINDOWS64 C4JStorage::ESaveGameState eLoadStatus = StorageManager.LoadSaveDataThumbnail(&pSaveDetails->SaveInfoA[m_saveDetails[m_iRequestingThumbnailId].saveId],&LoadSaveDataThumbnailReturned,this); -#else - C4JStorage::ESaveGameState eLoadStatus = StorageManager.LoadSaveDataThumbnail(&pSaveDetails->SaveInfoA[(int)m_iRequestingThumbnailId],&LoadSaveDataThumbnailReturned,this); -#endif + if (eLoadStatus != C4JStorage::ESaveGame_GetSaveThumbnail) { m_bRetrievingSaveThumbnails = false; @@ -1308,11 +1083,8 @@ void UIScene_LoadCreateJoinMenu::tick() if (m_iRequestingThumbnailId < GetListItemCount("load_list")) { PSAVE_DETAILS pSaveDetails = StorageManager.ReturnSavesInfo(); -#ifdef _WINDOWS64 C4JStorage::ESaveGameState eLoadStatus = StorageManager.LoadSaveDataThumbnail(&pSaveDetails->SaveInfoA[m_saveDetails[m_iRequestingThumbnailId].saveId],&LoadSaveDataThumbnailReturned,this); -#else - C4JStorage::ESaveGameState eLoadStatus = StorageManager.LoadSaveDataThumbnail(&pSaveDetails->SaveInfoA[(int)m_iRequestingThumbnailId],&LoadSaveDataThumbnailReturned,this); -#endif + if (eLoadStatus != C4JStorage::ESaveGame_GetSaveThumbnail) { m_bRetrievingSaveThumbnails = false; @@ -1372,49 +1144,9 @@ void UIScene_LoadCreateJoinMenu::tick() m_iState = e_SavesIdle; break; } - -#else - - if (!m_bSavesDisplayed) - { - AddDefaultButtons(); - m_bSavesDisplayed = true; - ShowTabPanel("load_timer", false); - } - -#endif - -#ifdef _XBOX_ONE - if (g_NetworkManager.ShouldMessageForFullSession()) - { - UINT uiIDA[1]; - uiIDA[0] = IDS_CONFIRM_OK; - ui.RequestErrorMessage(IDS_CONNECTION_FAILED, IDS_IN_PARTY_SESSION_FULL, uiIDA, 1, - ProfileManager.GetPrimaryPad()); - } -#endif - -#ifdef __ORBIS__ - switch (sceNpCommerceDialogUpdateStatus()) - { - case SCE_COMMON_DIALOG_STATUS_FINISHED: - { - SceNpCommerceDialogResult Result; - sceNpCommerceDialogGetResult(&Result); - sceNpCommerceDialogTerminate(); - if (Result.authorized) - ProfileManager.PsPlusUpdate(ProfileManager.GetPrimaryPad(), &Result); - else {} - m_bIgnoreInput = false; - } - break; - default: - break; - } -#endif } -// ─── Get Save Info ────────────────────────────────────────────────────── +// -- Get Save Info -- void UIScene_LoadCreateJoinMenu::GetSaveInfo() { @@ -1422,21 +1154,9 @@ void UIScene_LoadCreateJoinMenu::GetSaveInfo() if (app.DebugSettingsOn() && app.GetLoadSavesFromFolderEnabled()) { -#ifdef __ORBIS__ - m_pSaveDetails = StorageManager.ReturnSavesInfo(); - if (m_pSaveDetails == nullptr) - { - C4JStorage::ESaveGameState eSGIStatus = StorageManager.GetSavesInfo(m_iPad, nullptr, this, "save"); - } -#endif - uiSaveC = 0; -#ifdef _XBOX - File savesDir(L"GAME:\\Saves"); -#else File savesDir(L"Saves"); -#endif if (savesDir.exists()) { @@ -1474,7 +1194,7 @@ void UIScene_LoadCreateJoinMenu::GetSaveInfo() } } -// ─── Update Games List ────────────────────────────────────────────────── +// -- Update Games List -- void UIScene_LoadCreateJoinMenu::UpdateGamesList() { @@ -1550,7 +1270,7 @@ void UIScene_LoadCreateJoinMenu::UpdateGamesList() m_bPendingJoinTabAvailabilityRefresh = true; } -// ─── Add Default Buttons ──────────────────────────────────────────────── +// -- Add Default Buttons -- void UIScene_LoadCreateJoinMenu::AddDefaultButtons() { @@ -1592,7 +1312,7 @@ void UIScene_LoadCreateJoinMenu::AddDefaultButtons() m_iDefaultButtonsC += i; } -// ─── Focus queries ────────────────────────────────────────────────────── +// -- Focus queries -- bool UIScene_LoadCreateJoinMenu::DoesSavesListHaveFocus() { @@ -1737,7 +1457,7 @@ wstring UIScene_LoadCreateJoinMenu::getMoviePath() return L""; } -// ─── Keyboard / Press / LevelGen ──────────────────────────────────────── +// -- Keyboard / Press / LevelGen -- int UIScene_LoadCreateJoinMenu::KeyboardCompleteWorldNameCallback(LPVOID lpParam, bool bRes) { @@ -1981,7 +1701,7 @@ void UIScene_LoadCreateJoinMenu::LoadSaveFromDisk(File* saveFile, ui.NavigateToScene(ProfileManager.GetPrimaryPad(), eUIScene_FullscreenProgress, loadingParams); } -// ─── DLC / Join / Save callbacks ──────────────────────────────────────── +// -- DLC / Join / Save callbacks -- void UIScene_LoadCreateJoinMenu::HandleDLCMountingComplete() { @@ -1992,107 +1712,6 @@ void UIScene_LoadCreateJoinMenu::CheckAndJoinGame(int gameIndex) { if (GetListItemCount("join_list") > 0 && gameIndex < m_currentSessions->size()) { -#if defined(__PS3__) || defined(__ORBIS__) || defined(__PSVITA__) - bool noUGC = false; - bool bContentRestricted = false; - ProfileManager.GetChatAndContentRestrictions(m_iPad, true, &noUGC, &bContentRestricted, nullptr); - -#ifdef __ORBIS__ - noUGC = false; - bool bPlayStationPlus = true; - int iPadWithNoPlaystationPlus = 0; - bool isSignedInLive = true; - int iPadNotSignedInLive = -1; - - for (unsigned int i = 0; i < XUSER_MAX_COUNT; ++i) - { - if (InputManager.IsPadConnected(i) || ProfileManager.IsSignedIn(i)) - { - if (isSignedInLive && !ProfileManager.IsSignedInLive(i)) - iPadNotSignedInLive = i; - - isSignedInLive = isSignedInLive && ProfileManager.IsSignedInLive(i); - - if (ProfileManager.HasPlayStationPlus(i) == false) - { - bPlayStationPlus = false; - break; - } - } - } -#endif - -#ifdef __PSVITA__ - if (CGameNetworkManager::usingAdhocMode()) - { - bContentRestricted = false; - noUGC = false; - } -#endif - - if (noUGC) - { -#ifndef __PSVITA__ - UINT uiIDA[1]; - uiIDA[0] = IDS_CONFIRM_OK; - ui.RequestAlertMessage(IDS_ONLINE_GAME, IDS_CHAT_RESTRICTION_UGC, uiIDA, 1, m_iPad, nullptr, this); -#else - ProfileManager.ShowSystemMessage(SCE_MSG_DIALOG_SYSMSG_TYPE_TRC_PSN_CHAT_RESTRICTION, 0); -#endif - m_bIgnoreInput = false; - return; - } - else if (bContentRestricted) - { - ui.RequestContentRestrictedMessageBox(); - m_bIgnoreInput = false; - return; - } - -#ifdef __ORBIS__ - else if (!isSignedInLive) - { - UINT uiIDA[1]; - uiIDA[0] = IDS_CONFIRM_OK; - int npAvailability = ProfileManager.getNPAvailability(iPadNotSignedInLive); - if (npAvailability == SCE_NP_ERROR_AGE_RESTRICTION) - { - m_bIgnoreInput = false; - ui.RequestErrorMessage(IDS_ONLINE_SERVICE_TITLE, IDS_CONTENT_RESTRICTION, uiIDA, 1, iPadNotSignedInLive); - } - else - { - ui.RequestErrorMessage(IDS_PRO_NOTONLINE_TITLE, IDS_PRO_NOTONLINE_TEXT, uiIDA, 1, iPadNotSignedInLive, - &UIScene_LoadCreateJoinMenu::MustSignInReturnedPSN, this); - } - return; - } - else if (bPlayStationPlus == false) - { - if (ProfileManager.RequestingPlaystationPlus(iPadWithNoPlaystationPlus)) - { - UINT uiIDA[1]; - uiIDA[0] = IDS_OK; - ui.RequestAlertMessage(IDS_ERROR_NETWORK_TITLE, IDS_ERROR_NETWORK, uiIDA, 1, - ProfileManager.GetPrimaryPad(), nullptr, nullptr); - return; - } - - int32_t iResult = sceNpCommerceDialogInitialize(); - SceNpCommerceDialogParam param; - sceNpCommerceDialogParamInitialize(¶m); - param.mode = SCE_NP_COMMERCE_DIALOG_MODE_PLUS; - param.features = SCE_NP_PLUS_FEATURE_REALTIME_MULTIPLAY; - param.userId = ProfileManager.getUserID(iPadWithNoPlaystationPlus); - iResult = sceNpCommerceDialogOpen(¶m); - - m_bIgnoreInput = false; - return; - } -#endif - -#endif - m_initData->iPad = 0; m_initData->selectedSession = m_currentSessions->at(gameIndex); @@ -2138,94 +1757,16 @@ void UIScene_LoadCreateJoinMenu::CheckAndJoinGame(int gameIndex) if (bHasTexturePackInstalled == false) return; - -#ifdef __PSVITA__ - if (CGameNetworkManager::usingAdhocMode() && !SQRNetworkManager_AdHoc_Vita::GetAdhocStatus()) - { - SQRNetworkManager_AdHoc_Vita::AttemptAdhocSignIn(&UIScene_LoadCreateJoinMenu::SignInAdhocReturned, this); - return; - } -#endif } ShowTabPanel("join_timer", false); -#ifdef _XBOX - XBackgroundDownloadSetMode(XBACKGROUND_DOWNLOAD_MODE_AUTO); -#endif - m_bIgnoreInput = true; ui.NavigateToScene(ProfileManager.GetPrimaryPad(), eUIScene_JoinMenu, m_initData); } } -// ─── Remote storage / Save transfer ───────────────────────────────────── - -#ifdef SONY_REMOTE_STORAGE_DOWNLOAD - -void UIScene_LoadCreateJoinMenu::LoadSaveFromCloud() -{ - wchar_t wFileName[128]; - mbstowcs(wFileName, app.getRemoteStorage()->getLocalFilename(), - strlen(app.getRemoteStorage()->getLocalFilename()) + 1); - - File cloudFile(wFileName); - StorageManager.ResetSaveData(); - - wchar_t wSaveName[128]; - mbstowcs(wSaveName, app.getRemoteStorage()->getSaveNameUTF8(), - strlen(app.getRemoteStorage()->getSaveNameUTF8()) + 1); - - StorageManager.SetSaveTitle(wSaveName); - - int64_t fileSize = cloudFile.length(); - FileInputStream fis(cloudFile); - byteArray ba(fileSize); - fis.read(ba); - fis.close(); - - bool isClientSide = false; - bool isPrivate = false; - int maxPlayers = MINECRAFT_NET_MAX_PLAYERS; - - if (app.GetTutorialMode()) - { - isClientSide = false; - maxPlayers = 4; - } - - app.SetGameHostOption(eGameHostOption_All, app.getRemoteStorage()->getSaveHostOptions()); - g_NetworkManager.HostGame(0, isClientSide, isPrivate, maxPlayers, 0); - - LoadSaveDataThreadParam* saveData = new LoadSaveDataThreadParam(ba.data, ba.length, cloudFile.getName()); - NetworkGameInitData* param = new NetworkGameInitData(); - param->seed = app.getRemoteStorage()->getSaveSeed(); - param->saveData = saveData; - param->settings = app.GetGameHostOption(eGameHostOption_All); - param->savePlatform = app.getRemoteStorage()->getSavePlatform(); - param->texturePackId = app.getRemoteStorage()->getSaveTexturePack(); - -#ifndef _XBOX - g_NetworkManager.FakeLocalPlayerJoined(); -#endif - - LoadingInputParams* loadingParams = new LoadingInputParams(); - loadingParams->func = &CGameNetworkManager::RunNetworkGameThreadProc; - loadingParams->lpParam = (LPVOID)param; - - UIFullscreenProgressCompletionData* completionData = new UIFullscreenProgressCompletionData(); - completionData->bShowBackground = TRUE; - completionData->bShowLogo = TRUE; - completionData->type = e_ProgressCompletion_CloseAllPlayersUIScenes; - completionData->iPad = DEFAULT_XUI_MENU_USER; - - loadingParams->completionData = completionData; - ui.NavigateToScene(ProfileManager.GetPrimaryPad(), eUIScene_FullscreenProgress, loadingParams); -} - -#endif //SONY_REMOTE_STORAGE_DOWNLOAD - -// ─── Dialog callbacks ────────────────────────────────────────────────── +// -- Dialog callbacks -- int UIScene_LoadCreateJoinMenu::DeleteSaveDialogReturned(void *pParam,int iPad,C4JStorage::EMessageResult result) { @@ -2288,16 +1829,6 @@ int UIScene_LoadCreateJoinMenu::RenameSaveDataReturned(LPVOID lpParam, bool bRes return 0; } -#ifdef __ORBIS__ -void UIScene_LoadCreateJoinMenu::LoadRemoteFileFromDisk(char* remoteFilename) -{ - wchar_t wSaveName[128]; - mbstowcs(wSaveName, remoteFilename, strlen(remoteFilename)+1); - File remoteFile(wSaveName); - LoadSaveFromDisk(&remoteFile, SAVE_FILE_PLATFORM_PS3); -} -#endif - int UIScene_LoadCreateJoinMenu::SaveOptionsDialogReturned(void* pParam, int iPad, C4JStorage::EMessageResult result) { auto pClass = static_cast(pParam); @@ -2323,26 +1854,6 @@ int UIScene_LoadCreateJoinMenu::SaveOptionsDialogReturned(void* pParam, int iPad kbData.pcMode = g_KBMInput.IsKBMActive(); ui.NavigateToScene(pClass->m_iPad, eUIScene_Keyboard, &kbData); } - -#elif defined _DURANGO - - InputManager.RequestKeyboard(app.GetString(IDS_RENAME_WORLD_TITLE), - (pClass->m_saveDetails[pClass->m_iSaveListIndex]).UTF16SaveName, (DWORD)0, 25, - &UIScene_LoadCreateJoinMenu::KeyboardCompleteWorldNameCallback, pClass, - C_4JInput::EKeyboardMode_Default); - -#else - - wchar_t wSaveName[128]; - ZeroMemory(wSaveName, 128 * sizeof(wchar_t)); - mbstowcs(wSaveName, pClass->m_saveDetails[pClass->m_iSaveListIndex].UTF8SaveName, - strlen(pClass->m_saveDetails->UTF8SaveName) + 1); - - LPWSTR ptr = wSaveName; - InputManager.RequestKeyboard(app.GetString(IDS_RENAME_WORLD_TITLE), wSaveName, (DWORD)0, 25, - &UIScene_LoadCreateJoinMenu::KeyboardCompleteWorldNameCallback, pClass, - C_4JInput::EKeyboardMode_Default); - #endif } break; @@ -2357,30 +1868,6 @@ int UIScene_LoadCreateJoinMenu::SaveOptionsDialogReturned(void* pParam, int iPad } break; -#ifdef SONY_REMOTE_STORAGE_UPLOAD - case C4JStorage::EMessage_ResultFourthOption: // upload to cloud - { - UINT uiIDA[2]; - uiIDA[0] = IDS_CONFIRM_OK; - uiIDA[1] = IDS_CONFIRM_CANCEL; - ui.RequestAlertMessage(IDS_TOOLTIPS_SAVETRANSFER_UPLOAD, IDS_SAVE_TRANSFER_TEXT, uiIDA, 2, iPad, - &UIScene_LoadCreateJoinMenu::SaveTransferDialogReturned, pClass); - } - break; -#endif - -#if defined _XBOX_ONE || defined __ORBIS__ - case C4JStorage::EMessage_ResultFourthOption: // copy save - { - UINT uiIDA[2]; - uiIDA[0] = IDS_CONFIRM_OK; - uiIDA[1] = IDS_CONFIRM_CANCEL; - ui.RequestAlertMessage(IDS_COPYSAVE, IDS_TEXT_COPY_SAVE, uiIDA, 2, iPad, - &UIScene_LoadCreateJoinMenu::CopySaveDialogReturned, pClass); - } - break; -#endif - case C4JStorage::EMessage_Cancelled: default: { @@ -2393,501 +1880,17 @@ int UIScene_LoadCreateJoinMenu::SaveOptionsDialogReturned(void* pParam, int iPad return 0; } -// ─── Platform-specific callbacks (preserved from original) ────────────── - -#if defined (__PSVITA__) - -int UIScene_LoadCreateJoinMenu::SignInAdhocReturned(void* pParam, bool bContinue, int iPad) -{ - UIScene_LoadCreateJoinMenu* pClass = (UIScene_LoadCreateJoinMenu*)pParam; - pClass->m_bIgnoreInput = false; - return 0; -} - -int UIScene_LoadCreateJoinMenu::MustSignInTexturePack(void* pParam, int iPad, C4JStorage::EMessageResult result) -{ - UIScene_LoadCreateJoinMenu* pClass = (UIScene_LoadCreateJoinMenu*)pParam; - if (result == C4JStorage::EMessage_ResultAccept) - { - SQRNetworkManager_Vita::AttemptPSNSignIn(&UIScene_LoadCreateJoinMenu::MustSignInReturnedTexturePack, pClass); - } - else - { - pClass->m_bIgnoreInput = false; - } - return 0; -} - -int UIScene_LoadCreateJoinMenu::MustSignInReturnedTexturePack(void* pParam, bool bContinue, int iPad) -{ - UIScene_LoadCreateJoinMenu* pClass = (UIScene_LoadCreateJoinMenu*)pParam; - int commerceState = app.GetCommerceState(); - while (commerceState != CConsoleMinecraftApp::eCommerce_State_Offline && - commerceState != CConsoleMinecraftApp::eCommerce_State_Online && - commerceState != CConsoleMinecraftApp::eCommerce_State_Error) - { - Sleep(10); - commerceState = app.GetCommerceState(); - } - if (bContinue == true) - { - SONYDLC* pSONYDLCInfo = app.GetSONYDLCInfo(pClass->m_initData->selectedSession->data.texturePackParentId); - 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); - 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); - - if (app.CheckForEmptyStore(iPad) == false) - { - if (app.DLCAlreadyPurchased(chSkuID)) - app.DownloadAlreadyPurchased(chSkuID); - else - app.Checkout(chSkuID); - } - } - } - pClass->m_bIgnoreInput = false; - return 0; -} - -#endif - int UIScene_LoadCreateJoinMenu::TexturePackDialogReturned(void* pParam, int iPad, C4JStorage::EMessageResult result) { auto pClass = static_cast(pParam); if (result == C4JStorage::EMessage_ResultAccept) - { XBackgroundDownloadSetMode(XBACKGROUND_DOWNLOAD_MODE_ALWAYS_ALLOW); -#if defined __PSVITA__ || defined __PS3__ || defined __ORBIS__ - -#ifdef __PSVITA__ - if (!ProfileManager.IsSignedInLive(ProfileManager.GetPrimaryPad()) && CGameNetworkManager::usingAdhocMode()) - { - 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, - ProfileManager.GetPrimaryPad(), &UIScene_LoadCreateJoinMenu::MustSignInTexturePack, pClass); - return; - } -#endif - - SONYDLC* pSONYDLCInfo = app.GetSONYDLCInfo(pClass->m_initData->selectedSession->data.texturePackParentId); - 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); - 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); - - if (app.CheckForEmptyStore(iPad) == false) - { - if (app.DLCAlreadyPurchased(chSkuID)) - app.DownloadAlreadyPurchased(chSkuID); - else - app.Checkout(chSkuID); - } - } -#endif - -#if defined _XBOX_ONE - if (ProfileManager.IsSignedIn(iPad)) - { - if (ProfileManager.IsSignedInLive(iPad)) - { - wstring ProductId; - app.GetDLCFullOfferIDForPackID(pClass->m_initData->selectedSession->data.texturePackParentId, ProductId); - StorageManager.InstallOffer(1, (WCHAR*)ProductId.c_str(), nullptr, nullptr); - } - else - { - UINT uiIDA[1] = {IDS_CONFIRM_OK}; - ui.RequestErrorMessage(IDS_PRO_NOTONLINE_TITLE, IDS_PRO_XBOXLIVE_NOTIFICATION, uiIDA, 1, iPad); - } - } -#endif - } - pClass->m_bIgnoreInput = false; return 0; } -#if defined __PS3__ || defined __PSVITA__ || defined __ORBIS__ - -int UIScene_LoadCreateJoinMenu::MustSignInReturnedPSN(void* pParam, int iPad, C4JStorage::EMessageResult result) -{ - UIScene_LoadCreateJoinMenu* pClass = (UIScene_LoadCreateJoinMenu*)pParam; - - if (result == C4JStorage::EMessage_ResultAccept) - { -#if defined(__PS3__) - SQRNetworkManager_PS3::AttemptPSNSignIn(&UIScene_LoadCreateJoinMenu::PSN_SignInReturned, pClass); -#elif defined __PSVITA__ - SQRNetworkManager_Vita::AttemptPSNSignIn(&UIScene_LoadCreateJoinMenu::PSN_SignInReturned, pClass); -#else - SQRNetworkManager_Orbis::AttemptPSNSignIn(&UIScene_LoadCreateJoinMenu::PSN_SignInReturned, pClass, false, iPad); -#endif - } - else - { - pClass->m_bIgnoreInput = false; - } - return 0; -} - -int UIScene_LoadCreateJoinMenu::PSN_SignInReturned(void* pParam, bool bContinue, int iPad) -{ - UIScene_LoadCreateJoinMenu* pClass = (UIScene_LoadCreateJoinMenu*)pParam; - - if (bContinue == true) - { - switch (pClass->m_eAction) - { - case eAction_ViewInvites: - if (ProfileManager.IsSignedInLive(iPad)) - { -#if 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); - (void)ret; -#elif defined __PSVITA__ - SQRNetworkManager_Vita::RecvInviteGUI(); -#else - SQRNetworkManager_Orbis::RecvInviteGUI(); -#endif - } - break; - - case eAction_JoinGame: - pClass->CheckAndJoinGame(pClass->m_iGameListIndex); - break; - } - } - else - { - pClass->m_bIgnoreInput = false; - } - return 0; -} - -#endif - -// ─── Save Transfer (Sony / Xbox) ──────────────────────────────────────── - -#ifdef SONY_REMOTE_STORAGE_DOWNLOAD - -void UIScene_LoadCreateJoinMenu::LaunchSaveTransfer() -{ - LoadingInputParams* loadingParams = new LoadingInputParams(); - loadingParams->func = &UIScene_LoadCreateJoinMenu::DownloadSonyCrossSaveThreadProc; - loadingParams->lpParam = (LPVOID)this; - - UIFullscreenProgressCompletionData* completionData = new UIFullscreenProgressCompletionData(); - completionData->bShowBackground = TRUE; - completionData->bShowLogo = TRUE; - completionData->type = e_ProgressCompletion_NavigateBackToScene; - completionData->iPad = DEFAULT_XUI_MENU_USER; - - loadingParams->completionData = completionData; - loadingParams->cancelFunc = &UIScene_LoadCreateJoinMenu::CancelSaveTransferCallback; - loadingParams->m_cancelFuncParam = this; - loadingParams->cancelText = IDS_TOOLTIPS_CANCEL; - - ui.NavigateToScene(m_iPad, eUIScene_FullscreenProgress, loadingParams); -} - -int UIScene_LoadCreateJoinMenu::CreateDummySaveDataCallback(LPVOID lpParam, bool bRes) -{ - UIScene_LoadCreateJoinMenu* pClass = (UIScene_LoadCreateJoinMenu*)lpParam; - if (bRes) - pClass->m_eSaveTransferState = eSaveTransfer_GetSavesInfo; - else - { - pClass->m_eSaveTransferState = eSaveTransfer_Error; - } - return 0; -} - -int UIScene_LoadCreateJoinMenu::CrossSaveGetSavesInfoCallback(LPVOID lpParam, SAVE_DETAILS* pSaveDetails, bool bRes) -{ - UIScene_LoadCreateJoinMenu* pClass = (UIScene_LoadCreateJoinMenu*)lpParam; - if (bRes) - pClass->m_eSaveTransferState = eSaveTransfer_GetFileData; - else - { - pClass->m_eSaveTransferState = eSaveTransfer_Error; - } - return 0; -} - -int UIScene_LoadCreateJoinMenu::LoadCrossSaveDataCallback(void* pParam, bool bIsCorrupt, bool bIsOwner) -{ - UIScene_LoadCreateJoinMenu* pClass = (UIScene_LoadCreateJoinMenu*)pParam; - if (bIsCorrupt == false && bIsOwner) - pClass->m_eSaveTransferState = eSaveTransfer_CreatingNewSave; - else - { - pClass->m_eSaveTransferState = eSaveTransfer_Error; - } - return 0; -} - -int UIScene_LoadCreateJoinMenu::CrossSaveFinishedCallback(void* pParam, int iPad, C4JStorage::EMessageResult result) -{ - UIScene_LoadCreateJoinMenu* pClass = (UIScene_LoadCreateJoinMenu*)pParam; - pClass->m_eSaveTransferState = eSaveTransfer_Idle; - return 0; -} - -int UIScene_LoadCreateJoinMenu::CrossSaveDeleteOnErrorReturned(LPVOID lpParam, bool bRes) -{ - UIScene_LoadCreateJoinMenu* pClass = (UIScene_LoadCreateJoinMenu*)lpParam; - pClass->m_eSaveTransferState = eSaveTransfer_ErrorMesssage; - return 0; -} - -int UIScene_LoadCreateJoinMenu::RemoteSaveNotFoundCallback(void* pParam, int iPad, C4JStorage::EMessageResult result) -{ - UIScene_LoadCreateJoinMenu* pClass = (UIScene_LoadCreateJoinMenu*)pParam; - pClass->m_eSaveTransferState = eSaveTransfer_Idle; - return 0; -} - -bool g_bForceVitaSaveWipe = false; - -int UIScene_LoadCreateJoinMenu::DownloadSonyCrossSaveThreadProc(LPVOID lpParameter) -{ - m_bSaveTransferRunning = true; - -#ifdef __PS3__ - StorageManager.SetSaveTransferInProgress(true); -#endif - - Compression::UseDefaultThreadStorage(); - UIScene_LoadCreateJoinMenu* pClass = (UIScene_LoadCreateJoinMenu*)lpParameter; - pClass->m_saveTransferDownloadCancelled = false; - - // Download logic preserved from original - // (full Sony cross-save download thread implementation) - // Note: original 2000+ lines of transfer logic omitted for brevity; - // the full implementation should be copied from the original file. - // This placeholder maintains the function signature and entry point. - - return 0; -} - -void UIScene_LoadCreateJoinMenu::SaveTransferReturned(LPVOID lpParam, SonyRemoteStorage::Status s, int error_code) -{ - UIScene_LoadCreateJoinMenu* pClass = (UIScene_LoadCreateJoinMenu*)lpParam; - if (s == SonyRemoteStorage::eSRS_Success) - { - if (pClass->m_eSaveTransferState == eSaveTransfer_GetFileData) - { - // Process received file data - } - } - else - { - pClass->m_eSaveTransferState = eSaveTransfer_Error; - } -} - -ConsoleSaveFile* UIScene_LoadCreateJoinMenu::SonyCrossSaveConvert() -{ - return nullptr; // Preserved from original -} - -void UIScene_LoadCreateJoinMenu::CancelSaveTransferCallback(LPVOID lpParam) -{ - UIScene_LoadCreateJoinMenu* pClass = (UIScene_LoadCreateJoinMenu*)lpParam; - pClass->m_saveTransferDownloadCancelled = true; - pClass->m_eSaveTransferState = eSaveTransfer_Cancelled; -} - -#endif - -#ifdef SONY_REMOTE_STORAGE_UPLOAD - -void UIScene_LoadCreateJoinMenu::LaunchSaveUpload() -{ - LoadingInputParams* loadingParams = new LoadingInputParams(); - loadingParams->func = &UIScene_LoadCreateJoinMenu::UploadSonyCrossSaveThreadProc; - loadingParams->lpParam = (LPVOID)this; - - UIFullscreenProgressCompletionData* completionData = new UIFullscreenProgressCompletionData(); - completionData->bShowBackground = TRUE; - completionData->bShowLogo = TRUE; - completionData->type = e_ProgressCompletion_NavigateBackToScene; - completionData->iPad = DEFAULT_XUI_MENU_USER; - - loadingParams->completionData = completionData; - loadingParams->cancelFunc = &UIScene_LoadCreateJoinMenu::CancelSaveUploadCallback; - loadingParams->m_cancelFuncParam = this; - loadingParams->cancelText = IDS_TOOLTIPS_CANCEL; - - ui.NavigateToScene(m_iPad, eUIScene_FullscreenProgress, loadingParams); -} - -int UIScene_LoadCreateJoinMenu::UploadSonyCrossSaveThreadProc(LPVOID lpParameter) -{ - return 0; -} - -void UIScene_LoadCreateJoinMenu::SaveUploadReturned(LPVOID lpParam, SonyRemoteStorage::Status s, int error_code) -{ -} - -void UIScene_LoadCreateJoinMenu::CancelSaveUploadCallback(LPVOID lpParam) -{ - UIScene_LoadCreateJoinMenu* pClass = (UIScene_LoadCreateJoinMenu*)lpParam; - pClass->m_saveTransferUploadCancelled = true; -} - -int UIScene_LoadCreateJoinMenu::SaveTransferDialogReturned(void* pParam, int iPad, C4JStorage::EMessageResult result) -{ - UIScene_LoadCreateJoinMenu* pClass = (UIScene_LoadCreateJoinMenu*)pParam; - if (result == C4JStorage::EMessage_ResultAccept) - pClass->LaunchSaveUpload(); - else - pClass->m_bIgnoreInput = false; - return 0; -} - -int UIScene_LoadCreateJoinMenu::CrossSaveUploadFinishedCallback(void* pParam, int iPad, C4JStorage::EMessageResult result) -{ - UIScene_LoadCreateJoinMenu* pClass = (UIScene_LoadCreateJoinMenu*)pParam; - pClass->m_eSaveUploadState = eSaveUpload_Idle; - return 0; -} - -#endif - -#if defined _XBOX_ONE || defined __ORBIS__ - -int UIScene_LoadCreateJoinMenu::CopySaveDialogReturned(void* pParam, int iPad, C4JStorage::EMessageResult result) -{ - UIScene_LoadCreateJoinMenu* pClass = (UIScene_LoadCreateJoinMenu*)pParam; - if (result == C4JStorage::EMessage_ResultAccept) - { - LoadingInputParams* loadingParams = new LoadingInputParams(); - loadingParams->func = &UIScene_LoadCreateJoinMenu::CopySaveThreadProc; - loadingParams->lpParam = pClass; - - UIFullscreenProgressCompletionData* completionData = new UIFullscreenProgressCompletionData(); - completionData->bShowBackground = TRUE; - completionData->bShowLogo = TRUE; - completionData->type = e_ProgressCompletion_NavigateBackToScene; - completionData->iPad = DEFAULT_XUI_MENU_USER; - loadingParams->completionData = completionData; - loadingParams->cancelFunc = &UIScene_LoadCreateJoinMenu::CancelCopySaveCallback; - loadingParams->m_cancelFuncParam = pClass; - loadingParams->cancelText = IDS_TOOLTIPS_CANCEL; - - ui.NavigateToScene(iPad, eUIScene_FullscreenProgress, loadingParams); - } - else - pClass->m_bIgnoreInput = false; - return 0; -} - -int UIScene_LoadCreateJoinMenu::CopySaveThreadProc(LPVOID lpParameter) -{ - return 0; -} - -int UIScene_LoadCreateJoinMenu::CopySaveDataReturned(LPVOID lpParameter, bool success, C4JStorage::ESaveGameState state) -{ - return 0; -} - -bool UIScene_LoadCreateJoinMenu::CopySaveDataProgress(LPVOID lpParam, int percent) -{ - return true; -} - -void UIScene_LoadCreateJoinMenu::CancelCopySaveCallback(LPVOID lpParam) -{ -} - -int UIScene_LoadCreateJoinMenu::CopySaveErrorDialogFinishedCallback(void* pParam, int iPad, C4JStorage::EMessageResult result) -{ - return 0; -} - -#endif - -#ifdef _XBOX_ONE - -void UIScene_LoadCreateJoinMenu::HandleDLCLicenseChange() -{ -} - -void UIScene_LoadCreateJoinMenu::LaunchSaveTransfer() -{ -} - -int UIScene_LoadCreateJoinMenu::DownloadXbox360SaveThreadProc(LPVOID lpParameter) -{ - return 0; -} - -void UIScene_LoadCreateJoinMenu::RequestFileSize(SaveTransferStateContainer* pClass, wchar_t* filename) -{ -} - -void UIScene_LoadCreateJoinMenu::RequestFileData(SaveTransferStateContainer* pClass, wchar_t* filename) -{ -} - -int UIScene_LoadCreateJoinMenu::SaveTransferReturned(LPVOID lpParam, C4JStorage::SAVETRANSFER_FILE_DETAILS* pSaveTransferDetails) -{ - return 0; -} - -int UIScene_LoadCreateJoinMenu::SaveTransferUpdateProgress(LPVOID lpParam, unsigned long ulBytesReceived) -{ - return 0; -} - -void UIScene_LoadCreateJoinMenu::CancelSaveTransferCallback(LPVOID lpParam) -{ -} - -int UIScene_LoadCreateJoinMenu::NeedSyncMessageReturned(void* pParam, int iPad, C4JStorage::EMessageResult result) -{ - return 0; -} - -int UIScene_LoadCreateJoinMenu::CancelSaveTransferCompleteCallback(LPVOID lpParam) -{ - return 0; -} - -#endif - #ifdef _WINDOWS64 void UIScene_LoadCreateJoinMenu::BeginAddServer() @@ -2989,4 +1992,4 @@ int UIScene_LoadCreateJoinMenu::AddServerKeyboardCallback(LPVOID lpParam, bool b return 0; } -#endif +#endif \ No newline at end of file diff --git a/Minecraft.Client/Common/UI/UIScene_LoadCreateJoinMenu.h b/Minecraft.Client/Common/UI/UIScene_LoadCreateJoinMenu.h index 316ba066..67a577f7 100644 --- a/Minecraft.Client/Common/UI/UIScene_LoadCreateJoinMenu.h +++ b/Minecraft.Client/Common/UI/UIScene_LoadCreateJoinMenu.h @@ -16,13 +16,6 @@ class LevelGenerationOptions; class C4JThread; -#if defined __PS3__ || defined __ORBIS__ || defined(__PSVITA__) -#define SONY_REMOTE_STORAGE_DOWNLOAD -#endif -#if defined __PS3__ || __PSVITA__ -#define SONY_REMOTE_STORAGE_UPLOAD -#endif - class UIScene_LoadCreateJoinMenu : public UIScene, public Rml::EventListener { private: @@ -34,9 +27,7 @@ private: eControl_TabLoad, eControl_TabCreate, eControl_TabJoin, -#if defined(_XBOX_ONE) || defined(__ORBIS__) || defined(_WINDOWS64) eControl_SpaceIndicator, -#endif }; enum ELoadCreateJoinTab @@ -137,9 +128,7 @@ public: virtual EUIScene getSceneType() { return eUIScene_LoadCreateJoinMenu; } static void UpdateGamesListCallback(LPVOID pParam); -#ifdef _XBOX_ONE - void HandleDLCLicenseChange(); -#endif + virtual void tick(); // Override focus/movie lifecycle for RmlUi (no Iggy movie) @@ -188,26 +177,15 @@ public: static int DeleteSaveDataReturned(LPVOID lpParam,bool bRes); static int RenameSaveDataReturned(LPVOID lpParam,bool bRes); static int KeyboardCompleteWorldNameCallback(LPVOID lpParam,bool bRes); -#ifdef __PSVITA__ - static int MustSignInTexturePack(void *pParam,int iPad,C4JStorage::EMessageResult result); - static int MustSignInReturnedTexturePack(void *pParam,bool bContinue, int iPad); - static int SignInAdhocReturned(void *pParam,bool bContinue, int iPad); -#endif protected: void handlePress(F64 controlId, F64 childId); void LoadLevelGen(LevelGenerationOptions *levelGen); void LoadSaveFromDisk(File *saveFile, ESavePlatform savePlatform = SAVE_FILE_PLATFORM_LOCAL); -#if defined(__PS3__) || defined(__PSVITA__) || defined(__ORBIS__) - void LoadSaveFromCloud(); -#endif + public: virtual void HandleDLCMountingComplete(); -#ifdef __ORBIS__ - void LoadRemoteFileFromDisk(char* remoteFilename); -#endif - private: void CheckAndJoinGame(int gameIndex); @@ -223,138 +201,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 - { - int m_iProgress; - bool m_bSaveTransferInProgress; - bool m_bSaveTransferCancelled; - int m_iPad; - C4JStorage::eSaveTransferState m_eSaveTransferState; - UIScene_LoadCreateJoinMenu *m_pClass; - } SaveTransferStateContainer; - enum ESaveTransferFiles - { - eSaveTransferFile_Marker, - eSaveTransferFile_Metadata, - eSaveTransferFile_SaveData, - }; - static ESaveTransferFiles s_eSaveTransferFile; - static unsigned long s_ulFileSize; - static byteArray s_transferData; - static wstring m_wstrStageText; - LoadMenuInitData *m_loadMenuInitData; - -#ifdef _DEBUG_MENUS_ENABLED - static C4JStorage::SAVETRANSFER_FILE_DETAILS m_debugTransferDetails; -#endif - - void LaunchSaveTransfer(); - static int DownloadXbox360SaveThreadProc( LPVOID lpParameter ); - static void RequestFileSize( SaveTransferStateContainer *pClass, wchar_t *filename ); - static void RequestFileData( SaveTransferStateContainer *pClass, wchar_t *filename ); - static int SaveTransferReturned(LPVOID lpParam,C4JStorage::SAVETRANSFER_FILE_DETAILS *pSaveTransferDetails); - static int SaveTransferUpdateProgress(LPVOID lpParam,unsigned long ulBytesReceived); - static void CancelSaveTransferCallback(LPVOID lpParam); - static int NeedSyncMessageReturned(void *pParam,int iPad,C4JStorage::EMessageResult result); - static int CancelSaveTransferCompleteCallback(LPVOID lpParam); - -#endif - -#ifdef SONY_REMOTE_STORAGE_DOWNLOAD - enum eSaveTransferState - { - eSaveTransfer_Idle, - eSaveTransfer_Busy, - eSaveTransfer_GetRemoteSaveInfo, - eSaveTransfer_GettingRemoteSaveInfo, - eSaveTransfer_CreateDummyFile, - eSaveTransfer_CreatingDummyFile, - eSaveTransfer_GettingFileSize, - eSaveTransfer_FileSizeRetrieved, - eSaveTransfer_GetFileData, - eSaveTransfer_GettingFileData, - eSaveTransfer_FileDataRetrieved, - eSaveTransfer_GetSavesInfo, - eSaveTransfer_GettingSavesInfo, - eSaveTransfer_LoadSaveFromDisc, - eSaveTransfer_LoadingSaveFromDisc, - eSaveTransfer_CreatingNewSave, - eSaveTransfer_Converting, - eSaveTransfer_Saving, - eSaveTransfer_Succeeded, - eSaveTransfer_Cancelled, - eSaveTransfer_Error, - eSaveTransfer_ErrorDeletingSave, - eSaveTransfer_ErrorMesssage, - eSaveTransfer_Finished, - - }; - eSaveTransferState m_eSaveTransferState; - static unsigned long m_ulFileSize; - static wstring m_wstrStageText; - static bool m_bSaveTransferRunning; - int m_iProgress; - char m_downloadedUniqueFilename[64];//SCE_SAVE_DATA_DIRNAME_DATA_MAXSIZE]; - bool m_saveTransferDownloadCancelled; - void LaunchSaveTransfer(); - static int CreateDummySaveDataCallback(LPVOID lpParam,bool bRes); - static int CrossSaveGetSavesInfoCallback(LPVOID lpParam, SAVE_DETAILS *pSaveDetails,bool bRes); - static int LoadCrossSaveDataCallback(void *pParam,bool bIsCorrupt, bool bIsOwner); - static int CrossSaveFinishedCallback(void *pParam,int iPad,C4JStorage::EMessageResult result); - static int CrossSaveDeleteOnErrorReturned(LPVOID lpParam,bool bRes); - static int RemoteSaveNotFoundCallback(void *pParam,int iPad,C4JStorage::EMessageResult result); - static int DownloadSonyCrossSaveThreadProc( LPVOID lpParameter ); - static void SaveTransferReturned(LPVOID lpParam, SonyRemoteStorage::Status s, int error_code); - static ConsoleSaveFile* SonyCrossSaveConvert(); - - static void CancelSaveTransferCallback(LPVOID lpParam); -public: - static bool isSaveTransferRunning() { return m_bSaveTransferRunning; } -private: -#endif - -#ifdef SONY_REMOTE_STORAGE_UPLOAD - enum eSaveUploadState - { - eSaveUpload_Idle, - eSaveUpload_UploadingFileData, - eSaveUpload_FileDataUploaded, - eSaveUpload_Cancelled, - eSaveUpload_Error, - esaveUpload_Finished - }; - - eSaveUploadState m_eSaveUploadState; - bool m_saveTransferUploadCancelled; - - void LaunchSaveUpload(); - static int UploadSonyCrossSaveThreadProc( LPVOID lpParameter ); - static void SaveUploadReturned(LPVOID lpParam, SonyRemoteStorage::Status s, int error_code); - static void CancelSaveUploadCallback(LPVOID lpParam); - static int SaveTransferDialogReturned(void *pParam,int iPad,C4JStorage::EMessageResult result); - static int CrossSaveUploadFinishedCallback(void *pParam,int iPad,C4JStorage::EMessageResult result); -#endif - -#if defined _XBOX_ONE || defined __ORBIS__ - static int CopySaveDialogReturned(void *pParam,int iPad,C4JStorage::EMessageResult result); - static int CopySaveThreadProc( LPVOID lpParameter ); - static int CopySaveDataReturned( LPVOID lpParameter, bool success, C4JStorage::ESaveGameState state ); - static bool CopySaveDataProgress(LPVOID lpParam, int percent); - static void CancelCopySaveCallback(LPVOID lpParam); - static int CopySaveErrorDialogFinishedCallback(void *pParam,int iPad,C4JStorage::EMessageResult result); -#endif - // RmlUi document private: Rml::ElementDocument* m_document; @@ -362,4 +208,4 @@ private: #pragma pop_macro("GetFirstChild") #pragma pop_macro("GetNextSibling") -#pragma pop_macro("byte") +#pragma pop_macro("byte") \ No newline at end of file