mirror of
https://github.com/4jcraft/4jcraft.git
synced 2026-04-29 06:13:37 +00:00
fix build
This commit is contained in:
parent
a104252557
commit
e437a5f4be
|
|
@ -3255,7 +3255,6 @@ void ClientConnection::handleCustomPayload(
|
|||
UIScene* scene = ui.GetTopScene(m_userIndex, eUILayer_Scene);
|
||||
UIScene_TradingMenu* screen = (UIScene_TradingMenu*)scene;
|
||||
trader = screen->getMerchant();
|
||||
#endif
|
||||
#endif
|
||||
MerchantRecipeList* recipeList =
|
||||
MerchantRecipeList::createFromStream(&input);
|
||||
|
|
|
|||
|
|
@ -2154,171 +2154,3 @@ void UIScene_LoadOrJoinMenu::CancelSaveTransferCallback(void* lpParam) {
|
|||
}
|
||||
|
||||
#endif
|
||||
|
||||
#if defined(SONY_REMOTE_STORAGE_UPLOAD)
|
||||
|
||||
void UIScene_LoadOrJoinMenu::LaunchSaveUpload() {
|
||||
LoadingInputParams* loadingParams = new LoadingInputParams();
|
||||
loadingParams->func =
|
||||
&UIScene_LoadOrJoinMenu::UploadSonyCrossSaveThreadProc;
|
||||
loadingParams->lpParam = 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;
|
||||
|
||||
// 4J-PB - Waiting for Sony to fix canceling a save upload
|
||||
loadingParams->cancelFunc =
|
||||
&UIScene_LoadOrJoinMenu::CancelSaveUploadCallback;
|
||||
loadingParams->m_cancelFuncParam = this;
|
||||
loadingParams->cancelText = IDS_TOOLTIPS_CANCEL;
|
||||
|
||||
ui.NavigateToScene(m_iPad, eUIScene_FullscreenProgress, loadingParams);
|
||||
}
|
||||
|
||||
int UIScene_LoadOrJoinMenu::CrossSaveUploadFinishedCallback(
|
||||
void* pParam, int iPad, C4JStorage::EMessageResult result) {
|
||||
UIScene_LoadOrJoinMenu* pClass = (UIScene_LoadOrJoinMenu*)pParam;
|
||||
pClass->m_eSaveUploadState = eSaveUpload_Idle;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int UIScene_LoadOrJoinMenu::UploadSonyCrossSaveThreadProc(void* lpParameter) {
|
||||
UIScene_LoadOrJoinMenu* pClass = (UIScene_LoadOrJoinMenu*)lpParameter;
|
||||
pClass->m_saveTransferUploadCancelled = false;
|
||||
bool bAbortCalled = false;
|
||||
Minecraft* pMinecraft = Minecraft::GetInstance();
|
||||
|
||||
// get the save file size
|
||||
pMinecraft->progressRenderer->progressStagePercentage(0);
|
||||
pMinecraft->progressRenderer->progressStart(
|
||||
IDS_TOOLTIPS_SAVETRANSFER_UPLOAD);
|
||||
pMinecraft->progressRenderer->progressStage(
|
||||
IDS_TOOLTIPS_SAVETRANSFER_UPLOAD);
|
||||
|
||||
PSAVE_DETAILS pSaveDetails = StorageManager.ReturnSavesInfo();
|
||||
int idx = pClass->m_iSaveListIndex - pClass->m_iDefaultButtonsC;
|
||||
bool bSettingOK = app.getRemoteStorage()->setSaveData(
|
||||
&pSaveDetails->SaveInfoA[idx], SaveUploadReturned, pClass);
|
||||
|
||||
if (bSettingOK) {
|
||||
pClass->m_eSaveUploadState = eSaveUpload_UploadingFileData;
|
||||
pMinecraft->progressRenderer->progressStagePercentage(0);
|
||||
} else {
|
||||
pClass->m_eSaveUploadState = eSaveUpload_Error;
|
||||
}
|
||||
|
||||
while (pClass->m_eSaveUploadState != eSaveUpload_Idle) {
|
||||
switch (pClass->m_eSaveUploadState) {
|
||||
case eSaveUpload_Idle:
|
||||
break;
|
||||
case eSaveUpload_UploadingFileData: {
|
||||
wchar_t wcTemp[256];
|
||||
int dataProgress = app.getRemoteStorage()->getDataProgress();
|
||||
pMinecraft->progressRenderer->progressStagePercentage(
|
||||
dataProgress);
|
||||
|
||||
// swprintf(wcTemp, 256, L"Uploading data : %d",
|
||||
// dataProgress);//app.GetString(IDS_SAVETRANSFER_STAGE_GET_DATA),0,pClass->m_ulFileSize);
|
||||
swprintf(wcTemp, 256,
|
||||
app.GetString(IDS_SAVETRANSFER_STAGE_PUT_DATA),
|
||||
dataProgress);
|
||||
|
||||
m_wstrStageText = wcTemp;
|
||||
pMinecraft->progressRenderer->progressStage(m_wstrStageText);
|
||||
// 4J-PB - Waiting for Sony to fix canceling a save upload
|
||||
if (pClass->m_saveTransferUploadCancelled &&
|
||||
bAbortCalled == false) {
|
||||
// we only really want to be able to cancel during the
|
||||
// download of data, if it's taking a long time
|
||||
app.getRemoteStorage()->abort();
|
||||
bAbortCalled = true;
|
||||
}
|
||||
} break;
|
||||
case eSaveUpload_FileDataUploaded: {
|
||||
unsigned int uiIDA[1];
|
||||
uiIDA[0] = IDS_CONFIRM_OK;
|
||||
ui.RequestErrorMessage(IDS_TOOLTIPS_SAVETRANSFER_UPLOAD,
|
||||
IDS_SAVE_TRANSFER_UPLOADCOMPLETE, uiIDA,
|
||||
1, ProfileManager.GetPrimaryPad(),
|
||||
CrossSaveUploadFinishedCallback, pClass);
|
||||
pClass->m_eSaveUploadState = esaveUpload_Finished;
|
||||
} break;
|
||||
case eSaveUpload_Cancelled: // this is no longer used
|
||||
assert(0); // pClass->m_eSaveUploadState =
|
||||
// eSaveUpload_Idle;
|
||||
break;
|
||||
case eSaveUpload_Error: {
|
||||
if (pClass->m_saveTransferUploadCancelled) {
|
||||
pClass->m_eSaveUploadState = eSaveUpload_Idle;
|
||||
} else {
|
||||
unsigned int uiIDA[1];
|
||||
uiIDA[0] = IDS_CONFIRM_OK;
|
||||
ui.RequestErrorMessage(
|
||||
IDS_TOOLTIPS_SAVETRANSFER_UPLOAD,
|
||||
IDS_SAVE_TRANSFER_UPLOADFAILED, uiIDA, 1,
|
||||
ProfileManager.GetPrimaryPad(),
|
||||
CrossSaveUploadFinishedCallback, pClass);
|
||||
pClass->m_eSaveUploadState = esaveUpload_Finished;
|
||||
}
|
||||
} break;
|
||||
case esaveUpload_Finished:
|
||||
// waiting for dialog to be dismissed
|
||||
break;
|
||||
}
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(50));
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void UIScene_LoadOrJoinMenu::SaveUploadReturned(void* lpParam,
|
||||
SonyRemoteStorage::Status s,
|
||||
int error_code) {
|
||||
UIScene_LoadOrJoinMenu* pClass = (UIScene_LoadOrJoinMenu*)lpParam;
|
||||
|
||||
if (pClass->m_saveTransferUploadCancelled) {
|
||||
unsigned int uiIDA[1] = {IDS_CONFIRM_OK};
|
||||
ui.RequestErrorMessage(IDS_CANCEL_UPLOAD_TITLE, IDS_CANCEL_UPLOAD_TEXT,
|
||||
uiIDA, 1, ProfileManager.GetPrimaryPad(),
|
||||
CrossSaveUploadFinishedCallback, pClass);
|
||||
pClass->m_eSaveUploadState = esaveUpload_Finished;
|
||||
} else {
|
||||
if (s == SonyRemoteStorage::e_setDataSucceeded)
|
||||
pClass->m_eSaveUploadState = eSaveUpload_FileDataUploaded;
|
||||
else if (!pClass->m_saveTransferUploadCancelled)
|
||||
pClass->m_eSaveUploadState = eSaveUpload_Error;
|
||||
}
|
||||
}
|
||||
|
||||
void UIScene_LoadOrJoinMenu::CancelSaveUploadCallback(void* lpParam) {
|
||||
UIScene_LoadOrJoinMenu* pClass = (UIScene_LoadOrJoinMenu*)lpParam;
|
||||
pClass->m_saveTransferUploadCancelled = true;
|
||||
app.DebugPrintf("m_saveTransferUploadCancelled = true\n");
|
||||
ui.SetTooltips(
|
||||
DEFAULT_XUI_MENU_USER, -1, -1, -1, -1, -1, -1, -1,
|
||||
-1); // MGH - added - remove the "cancel" tooltip, so the player knows
|
||||
// it's underway (really needs a "cancelling" message)
|
||||
|
||||
pClass->m_bIgnoreInput = true;
|
||||
}
|
||||
|
||||
int UIScene_LoadOrJoinMenu::SaveTransferDialogReturned(
|
||||
void* pParam, int iPad, C4JStorage::EMessageResult result) {
|
||||
UIScene_LoadOrJoinMenu* pClass = (UIScene_LoadOrJoinMenu*)pParam;
|
||||
// results switched for this dialog
|
||||
if (result == C4JStorage::EMessage_ResultAccept) {
|
||||
// upload the save
|
||||
pClass->LaunchSaveUpload();
|
||||
|
||||
pClass->m_bIgnoreInput = false;
|
||||
} else {
|
||||
pClass->m_bIgnoreInput = false;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
#include "FileFilter.h"
|
||||
#include "../../Level/Storage/McRegionLevelStorageSource.h"
|
||||
#include "File.h"
|
||||
#include "PathHelper.h"
|
||||
#include "../../../Minecraft.World/Util/PathHelper.h"
|
||||
|
||||
#include <chrono>
|
||||
#include <filesystem>
|
||||
|
|
|
|||
Loading…
Reference in a new issue