mirror of
https://github.com/4jcraft/4jcraft.git
synced 2026-05-24 05:42:54 +00:00
refactor: migrate platform interface callbacks from C-style to std::function
This commit is contained in:
parent
f11473776c
commit
7ecb17596a
|
|
@ -2189,11 +2189,8 @@ void CMinecraftApp::ActionDebugMask(int iPad, bool bSetAllClear) {
|
|||
}
|
||||
#endif
|
||||
|
||||
int CMinecraftApp::DisplaySavingMessage(void* pParam,
|
||||
C4JStorage::ESavingMessage eVal,
|
||||
int CMinecraftApp::displaySavingMessage(C4JStorage::ESavingMessage eVal,
|
||||
int iPad) {
|
||||
// CMinecraftApp* pClass = (CMinecraftApp*)pParam;
|
||||
|
||||
ui.ShowSavingMessage(iPad, eVal);
|
||||
|
||||
return 0;
|
||||
|
|
@ -4134,24 +4131,21 @@ bool CMinecraftApp::DebugArtToolsOn() {
|
|||
#endif
|
||||
|
||||
void CMinecraftApp::SetDebugSequence(const char* pchSeq) {
|
||||
InputManager.SetDebugSequence(pchSeq, &CMinecraftApp::DebugInputCallback,
|
||||
this);
|
||||
}
|
||||
int CMinecraftApp::DebugInputCallback(void* pParam) {
|
||||
CMinecraftApp* pClass = (CMinecraftApp*)pParam;
|
||||
// printf("sequence matched\n");
|
||||
pClass->m_bDebugOptions = !pClass->m_bDebugOptions;
|
||||
InputManager.SetDebugSequence(pchSeq, [this]() -> int {
|
||||
// printf("sequence matched\n");
|
||||
m_bDebugOptions = !m_bDebugOptions;
|
||||
|
||||
for (int i = 0; i < XUSER_MAX_COUNT; i++) {
|
||||
if (app.DebugSettingsOn()) {
|
||||
app.ActionDebugMask(i);
|
||||
} else {
|
||||
// force debug mask off
|
||||
app.ActionDebugMask(i, true);
|
||||
for (int i = 0; i < XUSER_MAX_COUNT; i++) {
|
||||
if (app.DebugSettingsOn()) {
|
||||
app.ActionDebugMask(i);
|
||||
} else {
|
||||
// force debug mask off
|
||||
app.ActionDebugMask(i, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
return 0;
|
||||
});
|
||||
}
|
||||
|
||||
int CMinecraftApp::GetLocalPlayerCount(void) {
|
||||
|
|
@ -4201,7 +4195,9 @@ bool CMinecraftApp::StartInstallDLCProcess(int iPad) {
|
|||
"StorageManager.GetInstalledDLC\n");
|
||||
|
||||
StorageManager.GetInstalledDLC(
|
||||
iPad, &CMinecraftApp::DLCInstalledCallback, this);
|
||||
iPad, [this](int iInstalledC, int pad) {
|
||||
return dlcInstalledCallback(iInstalledC, pad);
|
||||
});
|
||||
return true;
|
||||
} else {
|
||||
app.DebugPrintf(
|
||||
|
|
@ -4212,13 +4208,12 @@ bool CMinecraftApp::StartInstallDLCProcess(int iPad) {
|
|||
}
|
||||
|
||||
// Installed DLC callback
|
||||
int CMinecraftApp::DLCInstalledCallback(void* pParam, int iInstalledC,
|
||||
int iPad) {
|
||||
app.DebugPrintf(
|
||||
"--- CMinecraftApp::DLCInstalledCallback: totalDLC=%i, pad=%i.\n",
|
||||
int CMinecraftApp::dlcInstalledCallback(int iInstalledC, int iPad) {
|
||||
DebugPrintf(
|
||||
"--- CMinecraftApp::dlcInstalledCallback: totalDLC=%i, pad=%i.\n",
|
||||
iInstalledC, iPad);
|
||||
app.m_iTotalDLC = iInstalledC;
|
||||
app.MountNextDLC(iPad);
|
||||
m_iTotalDLC = iInstalledC;
|
||||
MountNextDLC(iPad);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -4230,9 +4225,12 @@ void CMinecraftApp::MountNextDLC(int iPad) {
|
|||
// installed DLC We're supposed to use a generic save game as a cache of
|
||||
// these to do this, with XUSER_ANY
|
||||
|
||||
if (StorageManager.MountInstalledDLC(iPad, m_iTotalDLCInstalled,
|
||||
&CMinecraftApp::DLCMountedCallback,
|
||||
this) != ERROR_IO_PENDING) {
|
||||
if (StorageManager.MountInstalledDLC(
|
||||
iPad, m_iTotalDLCInstalled,
|
||||
[this](int pad, std::uint32_t dwErr,
|
||||
std::uint32_t dwLicenceMask) {
|
||||
return dlcMountedCallback(pad, dwErr, dwLicenceMask);
|
||||
}) != ERROR_IO_PENDING) {
|
||||
// corrupt DLC
|
||||
app.DebugPrintf("Failed to mount DLC %d for pad %d\n",
|
||||
m_iTotalDLCInstalled, iPad);
|
||||
|
|
@ -4264,11 +4262,10 @@ void CMinecraftApp::MountNextDLC(int iPad) {
|
|||
#define CONTENT_DATA_DISPLAY_NAME(a) (a.wszDisplayName)
|
||||
#endif
|
||||
|
||||
int CMinecraftApp::DLCMountedCallback(void* pParam, int iPad,
|
||||
std::uint32_t dwErr,
|
||||
int CMinecraftApp::dlcMountedCallback(int iPad, std::uint32_t dwErr,
|
||||
std::uint32_t dwLicenceMask) {
|
||||
#if defined(_WINDOWS64)
|
||||
app.DebugPrintf("--- CMinecraftApp::DLCMountedCallback\n");
|
||||
DebugPrintf("--- CMinecraftApp::dlcMountedCallback\n");
|
||||
|
||||
if (dwErr != ERROR_SUCCESS) {
|
||||
// corrupt DLC
|
||||
|
|
@ -6762,7 +6759,10 @@ bool CMinecraftApp::RetrieveNextDLCContent() {
|
|||
|
||||
C4JStorage::EDLCStatus status = StorageManager.GetDLCOffers(
|
||||
ProfileManager.GetPrimaryPad(),
|
||||
&CMinecraftApp::DLCOffersReturned, this, pCurrent->dwType);
|
||||
[this](int iOfferC, std::uint32_t dwType, int pad) {
|
||||
return dlcOffersReturned(iOfferC, dwType, pad);
|
||||
},
|
||||
pCurrent->dwType);
|
||||
if (status == C4JStorage::EDLC_Pending) {
|
||||
pCurrent->eState = e_DLC_ContentState_Retrieving;
|
||||
} else {
|
||||
|
|
@ -6882,22 +6882,20 @@ void CMinecraftApp::ClearTMSPPFilesRetrieved() {
|
|||
}
|
||||
}
|
||||
|
||||
int CMinecraftApp::DLCOffersReturned(void* pParam, int iOfferC,
|
||||
std::uint32_t dwType, int iPad) {
|
||||
CMinecraftApp* pClass = (CMinecraftApp*)pParam;
|
||||
|
||||
int CMinecraftApp::dlcOffersReturned(int iOfferC, std::uint32_t dwType,
|
||||
int iPad) {
|
||||
// find the right one in the vector
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(pClass->csTMSPPDownloadQueue);
|
||||
for (auto it = pClass->m_DLCDownloadQueue.begin();
|
||||
it != pClass->m_DLCDownloadQueue.end(); ++it) {
|
||||
std::lock_guard<std::mutex> lock(csTMSPPDownloadQueue);
|
||||
for (auto it = m_DLCDownloadQueue.begin();
|
||||
it != m_DLCDownloadQueue.end(); ++it) {
|
||||
DLCRequest* pCurrent = *it;
|
||||
|
||||
// avatar items are coming back as type Content, so we can't trust
|
||||
// the type setting
|
||||
if (pCurrent->dwType == static_cast<std::uint32_t>(dwType)) {
|
||||
pClass->m_iDLCOfferC = iOfferC;
|
||||
app.DebugPrintf(
|
||||
m_iDLCOfferC = iOfferC;
|
||||
DebugPrintf(
|
||||
"DLCOffersReturned - type %u, count %d - setting to "
|
||||
"retrieved\n",
|
||||
dwType, iOfferC);
|
||||
|
|
|
|||
|
|
@ -130,9 +130,7 @@ public:
|
|||
|
||||
bool IsAppPaused();
|
||||
void SetAppPaused(bool val);
|
||||
static int DisplaySavingMessage(void* pParam,
|
||||
const C4JStorage::ESavingMessage eMsg,
|
||||
int iPad);
|
||||
int displaySavingMessage(const C4JStorage::ESavingMessage eMsg, int iPad);
|
||||
bool GetGameStarted() { return m_bGameStarted; }
|
||||
void SetGameStarted(bool bVal) {
|
||||
if (bVal)
|
||||
|
|
@ -372,16 +370,15 @@ public:
|
|||
bool DebugArtToolsOn() { return false; }
|
||||
#endif
|
||||
void SetDebugSequence(const char* pchSeq);
|
||||
static int DebugInputCallback(void* pParam);
|
||||
// bool UploadFileToGlobalStorage(int iQuadrant,
|
||||
// C4JStorage::eGlobalStorage eStorageFacility, std::wstring *wsFile );
|
||||
|
||||
// Installed DLC
|
||||
bool StartInstallDLCProcess(int iPad);
|
||||
static int DLCInstalledCallback(void* pParam, int iOfferC, int iPad);
|
||||
int dlcInstalledCallback(int iOfferC, int iPad);
|
||||
void HandleDLCLicenseChange();
|
||||
static int DLCMountedCallback(void* pParam, int iPad, std::uint32_t dwErr,
|
||||
std::uint32_t dwLicenceMask);
|
||||
int dlcMountedCallback(int iPad, std::uint32_t dwErr,
|
||||
std::uint32_t dwLicenceMask);
|
||||
void MountNextDLC(int iPad);
|
||||
// static int DLCReadCallback(void* pParam,C4JStorage::DLC_FILE_DETAILS
|
||||
// *pDLCData);
|
||||
|
|
@ -842,8 +839,7 @@ public:
|
|||
bool bPromote = false);
|
||||
bool RetrieveNextDLCContent();
|
||||
bool CheckTMSDLCCanStop();
|
||||
static int DLCOffersReturned(void* pParam, int iOfferC,
|
||||
std::uint32_t dwType, int iPad);
|
||||
int dlcOffersReturned(int iOfferC, std::uint32_t dwType, int iPad);
|
||||
std::uint32_t GetDLCContentType(eDLCContentType eType) {
|
||||
return m_dwContentTypeA[eType];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -553,7 +553,9 @@ void LevelGenerationOptions::loadBaseSaveData() {
|
|||
if (mountIndex > -1) {
|
||||
if (StorageManager.MountInstalledDLC(
|
||||
ProfileManager.GetPrimaryPad(), mountIndex,
|
||||
&LevelGenerationOptions::packMounted, this,
|
||||
[this](int pad, std::uint32_t err, std::uint32_t lic) {
|
||||
return onPackMounted(pad, err, lic);
|
||||
},
|
||||
"WPACK") != ERROR_IO_PENDING) {
|
||||
// corrupt DLC
|
||||
setLoadedData();
|
||||
|
|
@ -571,9 +573,9 @@ void LevelGenerationOptions::loadBaseSaveData() {
|
|||
}
|
||||
}
|
||||
|
||||
int LevelGenerationOptions::packMounted(void* pParam, int iPad, uint32_t dwErr,
|
||||
uint32_t dwLicenceMask) {
|
||||
LevelGenerationOptions* lgo = (LevelGenerationOptions*)pParam;
|
||||
int LevelGenerationOptions::onPackMounted(int iPad, uint32_t dwErr,
|
||||
uint32_t dwLicenceMask) {
|
||||
LevelGenerationOptions* lgo = this;
|
||||
lgo->m_bLoadingData = false;
|
||||
if (dwErr != ERROR_SUCCESS) {
|
||||
// corrupt DLC
|
||||
|
|
|
|||
|
|
@ -256,8 +256,7 @@ public:
|
|||
getUnfinishedSchematicFiles();
|
||||
|
||||
void loadBaseSaveData();
|
||||
static int packMounted(void* pParam, int iPad, uint32_t dwErr,
|
||||
uint32_t dwLicenceMask);
|
||||
int onPackMounted(int iPad, uint32_t dwErr, uint32_t dwLicenceMask);
|
||||
|
||||
// 4J-JEV:
|
||||
// ApplySchematicRules contain limited state
|
||||
|
|
|
|||
|
|
@ -529,20 +529,13 @@ INetworkPlayer* CGameNetworkManager::GetHostPlayer() {
|
|||
|
||||
void CGameNetworkManager::RegisterPlayerChangedCallback(
|
||||
int iPad,
|
||||
void (*callback)(void* callbackParam, INetworkPlayer* pPlayer,
|
||||
bool leaving),
|
||||
void* callbackParam) {
|
||||
s_pPlatformNetworkManager->RegisterPlayerChangedCallback(iPad, callback,
|
||||
callbackParam);
|
||||
std::function<void(INetworkPlayer* pPlayer, bool leaving)> callback) {
|
||||
s_pPlatformNetworkManager->RegisterPlayerChangedCallback(
|
||||
iPad, std::move(callback));
|
||||
}
|
||||
|
||||
void CGameNetworkManager::UnRegisterPlayerChangedCallback(
|
||||
int iPad,
|
||||
void (*callback)(void* callbackParam, INetworkPlayer* pPlayer,
|
||||
bool leaving),
|
||||
void* callbackParam) {
|
||||
s_pPlatformNetworkManager->UnRegisterPlayerChangedCallback(iPad, callback,
|
||||
callbackParam);
|
||||
void CGameNetworkManager::UnRegisterPlayerChangedCallback(int iPad) {
|
||||
s_pPlatformNetworkManager->UnRegisterPlayerChangedCallback(iPad);
|
||||
}
|
||||
|
||||
void CGameNetworkManager::HandleSignInChange() {
|
||||
|
|
@ -620,16 +613,15 @@ bool CGameNetworkManager::GetGameSessionInfo(int iPad, SessionID sessionId,
|
|||
}
|
||||
|
||||
void CGameNetworkManager::SetSessionsUpdatedCallback(
|
||||
void (*SessionsUpdatedCallback)(void* pParam), void* pSearchParam) {
|
||||
s_pPlatformNetworkManager->SetSessionsUpdatedCallback(
|
||||
SessionsUpdatedCallback, pSearchParam);
|
||||
std::function<void()> callback) {
|
||||
s_pPlatformNetworkManager->SetSessionsUpdatedCallback(std::move(callback));
|
||||
}
|
||||
|
||||
void CGameNetworkManager::GetFullFriendSessionInfo(
|
||||
FriendSessionInfo* foundSession,
|
||||
void (*FriendSessionUpdatedFn)(bool success, void* pParam), void* pParam) {
|
||||
std::function<void(bool success)> callback) {
|
||||
s_pPlatformNetworkManager->GetFullFriendSessionInfo(
|
||||
foundSession, FriendSessionUpdatedFn, pParam);
|
||||
foundSession, std::move(callback));
|
||||
}
|
||||
|
||||
void CGameNetworkManager::ForceFriendsSessionRefresh() {
|
||||
|
|
@ -1400,8 +1392,10 @@ void CGameNetworkManager::HandleInviteWhenInMenus(
|
|||
// the FromInvite will make the lib decide how many panes to display
|
||||
// based on connected pads/signed in players
|
||||
SignInInfo info;
|
||||
info.Func = &CGameNetworkManager::JoinFromInvite_SignInReturned;
|
||||
info.lpParam = (void*)pInviteInfo;
|
||||
info.Func = [pInviteInfo](bool bContinue, int pad) {
|
||||
return JoinFromInvite_SignInReturned(
|
||||
const_cast<INVITE_INFO*>(pInviteInfo), bContinue, pad);
|
||||
};
|
||||
info.requireOnline = true;
|
||||
app.DebugPrintf("Using fullscreen layer\n");
|
||||
ui.NavigateToScene(ProfileManager.GetPrimaryPad(),
|
||||
|
|
|
|||
|
|
@ -62,16 +62,10 @@ public:
|
|||
INetworkPlayer* GetPlayerBySmallId(unsigned char smallId);
|
||||
std::wstring GetDisplayNameByGamertag(std::wstring gamertag);
|
||||
INetworkPlayer* GetHostPlayer();
|
||||
void RegisterPlayerChangedCallback(int iPad,
|
||||
void (*callback)(void* callbackParam,
|
||||
INetworkPlayer* pPlayer,
|
||||
bool leaving),
|
||||
void* callbackParam);
|
||||
void UnRegisterPlayerChangedCallback(
|
||||
void RegisterPlayerChangedCallback(
|
||||
int iPad,
|
||||
void (*callback)(void* callbackParam, INetworkPlayer* pPlayer,
|
||||
bool leaving),
|
||||
void* callbackParam);
|
||||
std::function<void(INetworkPlayer* pPlayer, bool leaving)> callback);
|
||||
void UnRegisterPlayerChangedCallback(int iPad);
|
||||
void HandleSignInChange();
|
||||
bool ShouldMessageForFullSession();
|
||||
|
||||
|
|
@ -101,12 +95,10 @@ public:
|
|||
bool partyOnly);
|
||||
bool GetGameSessionInfo(int iPad, SessionID sessionId,
|
||||
FriendSessionInfo* foundSession);
|
||||
void SetSessionsUpdatedCallback(
|
||||
void (*SessionsUpdatedCallback)(void* pParam), void* pSearchParam);
|
||||
void GetFullFriendSessionInfo(FriendSessionInfo* foundSession,
|
||||
void (*FriendSessionUpdatedFn)(bool success,
|
||||
void* pParam),
|
||||
void* pParam);
|
||||
void SetSessionsUpdatedCallback(std::function<void()> callback);
|
||||
void GetFullFriendSessionInfo(
|
||||
FriendSessionInfo* foundSession,
|
||||
std::function<void(bool success)> callback);
|
||||
void ForceFriendsSessionRefresh();
|
||||
|
||||
// Session joining and leaving
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
#pragma once
|
||||
// using namespace std;
|
||||
#include <functional>
|
||||
#include <vector>
|
||||
#if !defined(__linux__)
|
||||
#include <qnet.h>
|
||||
|
|
@ -88,14 +89,9 @@ public:
|
|||
|
||||
virtual void RegisterPlayerChangedCallback(
|
||||
int iPad,
|
||||
void (*callback)(void* callbackParam, INetworkPlayer* pPlayer,
|
||||
bool leaving),
|
||||
void* callbackParam) = 0;
|
||||
virtual void UnRegisterPlayerChangedCallback(
|
||||
int iPad,
|
||||
void (*callback)(void* callbackParam, INetworkPlayer* pPlayer,
|
||||
bool leaving),
|
||||
void* callbackParam) = 0;
|
||||
std::function<void(INetworkPlayer* pPlayer, bool leaving)>
|
||||
callback) = 0;
|
||||
virtual void UnRegisterPlayerChangedCallback(int iPad) = 0;
|
||||
|
||||
virtual void HandleSignInChange() = 0;
|
||||
|
||||
|
|
@ -134,11 +130,10 @@ public:
|
|||
virtual bool GetGameSessionInfo(int iPad, SessionID sessionId,
|
||||
FriendSessionInfo* foundSession) = 0;
|
||||
virtual void SetSessionsUpdatedCallback(
|
||||
void (*SessionsUpdatedCallback)(void* pParam), void* pSearchParam) = 0;
|
||||
std::function<void()> callback) = 0;
|
||||
virtual void GetFullFriendSessionInfo(
|
||||
FriendSessionInfo* foundSession,
|
||||
void (*FriendSessionUpdatedFn)(bool success, void* pParam),
|
||||
void* pParam) = 0;
|
||||
std::function<void(bool success)> callback) = 0;
|
||||
virtual void ForceFriendsSessionRefresh() = 0;
|
||||
|
||||
virtual void FakeLocalPlayerJoined() {
|
||||
|
|
|
|||
|
|
@ -90,9 +90,8 @@ void IPlatformNetworkStub::NotifyPlayerJoined(IQNetPlayer* pQNetPlayer) {
|
|||
}
|
||||
|
||||
for (int idx = 0; idx < XUSER_MAX_COUNT; ++idx) {
|
||||
if (playerChangedCallback[idx] != nullptr)
|
||||
playerChangedCallback[idx](playerChangedCallbackParam[idx],
|
||||
networkPlayer, false);
|
||||
if (playerChangedCallback[idx])
|
||||
playerChangedCallback[idx](networkPlayer, false);
|
||||
}
|
||||
|
||||
if (m_pIQNet->GetState() == QNET_STATE_GAME_PLAY) {
|
||||
|
|
@ -128,7 +127,6 @@ bool IPlatformNetworkStub::Initialise(
|
|||
m_bSearchPending = false;
|
||||
|
||||
m_bIsOfflineGame = false;
|
||||
m_pSearchParam = nullptr;
|
||||
m_SessionsUpdatedCallback = nullptr;
|
||||
|
||||
for (unsigned int i = 0; i < XUSER_MAX_COUNT; ++i) {
|
||||
|
|
@ -263,22 +261,12 @@ void IPlatformNetworkStub::SetPrivateGame(bool isPrivate) {
|
|||
|
||||
void IPlatformNetworkStub::RegisterPlayerChangedCallback(
|
||||
int iPad,
|
||||
void (*callback)(void* callbackParam, INetworkPlayer* pPlayer,
|
||||
bool leaving),
|
||||
void* callbackParam) {
|
||||
playerChangedCallback[iPad] = callback;
|
||||
playerChangedCallbackParam[iPad] = callbackParam;
|
||||
std::function<void(INetworkPlayer* pPlayer, bool leaving)> callback) {
|
||||
playerChangedCallback[iPad] = std::move(callback);
|
||||
}
|
||||
|
||||
void IPlatformNetworkStub::UnRegisterPlayerChangedCallback(
|
||||
int iPad,
|
||||
void (*callback)(void* callbackParam, INetworkPlayer* pPlayer,
|
||||
bool leaving),
|
||||
void* callbackParam) {
|
||||
if (playerChangedCallbackParam[iPad] == callbackParam) {
|
||||
playerChangedCallback[iPad] = nullptr;
|
||||
playerChangedCallbackParam[iPad] = nullptr;
|
||||
}
|
||||
void IPlatformNetworkStub::UnRegisterPlayerChangedCallback(int iPad) {
|
||||
playerChangedCallback[iPad] = nullptr;
|
||||
}
|
||||
|
||||
void IPlatformNetworkStub::HandleSignInChange() { return; }
|
||||
|
|
@ -489,15 +477,14 @@ bool IPlatformNetworkStub::GetGameSessionInfo(
|
|||
}
|
||||
|
||||
void IPlatformNetworkStub::SetSessionsUpdatedCallback(
|
||||
void (*SessionsUpdatedCallback)(void* pParam), void* pSearchParam) {
|
||||
m_SessionsUpdatedCallback = SessionsUpdatedCallback;
|
||||
m_pSearchParam = pSearchParam;
|
||||
std::function<void()> callback) {
|
||||
m_SessionsUpdatedCallback = std::move(callback);
|
||||
}
|
||||
|
||||
void IPlatformNetworkStub::GetFullFriendSessionInfo(
|
||||
FriendSessionInfo* foundSession,
|
||||
void (*FriendSessionUpdatedFn)(bool success, void* pParam), void* pParam) {
|
||||
FriendSessionUpdatedFn(true, pParam);
|
||||
std::function<void(bool success)> callback) {
|
||||
callback(true);
|
||||
}
|
||||
|
||||
void IPlatformNetworkStub::ForceFriendsSessionRefresh() {
|
||||
|
|
|
|||
|
|
@ -67,14 +67,9 @@ public:
|
|||
|
||||
virtual void RegisterPlayerChangedCallback(
|
||||
int iPad,
|
||||
void (*callback)(void* callbackParam, INetworkPlayer* pPlayer,
|
||||
bool leaving),
|
||||
void* callbackParam);
|
||||
virtual void UnRegisterPlayerChangedCallback(
|
||||
int iPad,
|
||||
void (*callback)(void* callbackParam, INetworkPlayer* pPlayer,
|
||||
bool leaving),
|
||||
void* callbackParam);
|
||||
std::function<void(INetworkPlayer* pPlayer, bool leaving)>
|
||||
callback);
|
||||
virtual void UnRegisterPlayerChangedCallback(int iPad);
|
||||
|
||||
virtual void HandleSignInChange();
|
||||
|
||||
|
|
@ -114,11 +109,8 @@ public:
|
|||
INetworkPlayer* pNetworkPlayerLeaving = nullptr);
|
||||
|
||||
private:
|
||||
// TODO 4J Stu - Do we need to be able to have more than one of these?
|
||||
void (*playerChangedCallback[XUSER_MAX_COUNT])(void* callbackParam,
|
||||
INetworkPlayer* pPlayer,
|
||||
bool leaving);
|
||||
void* playerChangedCallbackParam[XUSER_MAX_COUNT];
|
||||
std::function<void(INetworkPlayer* pPlayer, bool leaving)>
|
||||
playerChangedCallback[XUSER_MAX_COUNT];
|
||||
|
||||
static int RemovePlayerOnSocketClosedThreadProc(void* lpParam);
|
||||
virtual bool RemoveLocalPlayer(INetworkPlayer* pNetworkPlayer);
|
||||
|
|
@ -167,8 +159,7 @@ private:
|
|||
int m_lastSearchPad;
|
||||
bool m_bSearchResultsReady;
|
||||
bool m_bSearchPending;
|
||||
void* m_pSearchParam;
|
||||
void (*m_SessionsUpdatedCallback)(void* pParam);
|
||||
std::function<void()> m_SessionsUpdatedCallback;
|
||||
|
||||
C4JThread* m_SearchingThread;
|
||||
|
||||
|
|
@ -194,11 +185,10 @@ public:
|
|||
virtual bool GetGameSessionInfo(int iPad, SessionID sessionId,
|
||||
FriendSessionInfo* foundSession);
|
||||
virtual void SetSessionsUpdatedCallback(
|
||||
void (*SessionsUpdatedCallback)(void* pParam), void* pSearchParam);
|
||||
std::function<void()> callback);
|
||||
virtual void GetFullFriendSessionInfo(
|
||||
FriendSessionInfo* foundSession,
|
||||
void (*FriendSessionUpdatedFn)(bool success, void* pParam),
|
||||
void* pParam);
|
||||
std::function<void(bool success)> callback);
|
||||
virtual void ForceFriendsSessionRefresh();
|
||||
|
||||
private:
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
|
||||
#include <cstdint>
|
||||
#include <cstring>
|
||||
#include <functional>
|
||||
|
||||
#include "platform/sdl2/Storage.h"
|
||||
#include "app/common/App_Defines.h"
|
||||
|
|
@ -376,8 +377,7 @@ typedef struct _TutorialPopupInfo {
|
|||
|
||||
// Quadrant sign in
|
||||
typedef struct _SignInInfo {
|
||||
int (*Func)(void*, const bool, const int iPad);
|
||||
void* lpParam;
|
||||
std::function<int(bool, int)> Func;
|
||||
bool requireOnline;
|
||||
} SignInInfo;
|
||||
|
||||
|
|
|
|||
|
|
@ -132,7 +132,9 @@ void UIScene_DebugCreateSchematic::handlePress(F64 controlId, F64 childId) {
|
|||
m_keyboardCallbackControl = (eControls)((int)controlId);
|
||||
InputManager.RequestKeyboard(
|
||||
L"Enter something", L"", 0, 25,
|
||||
&UIScene_DebugCreateSchematic::KeyboardCompleteCallback, this,
|
||||
[this](bool bRes) -> int {
|
||||
return handleKeyboardComplete(bRes);
|
||||
},
|
||||
C_4JInput::EKeyboardMode_Default);
|
||||
break;
|
||||
};
|
||||
|
|
@ -153,71 +155,67 @@ void UIScene_DebugCreateSchematic::handleCheckboxToggled(F64 controlId,
|
|||
}
|
||||
}
|
||||
|
||||
int UIScene_DebugCreateSchematic::KeyboardCompleteCallback(void* lpParam,
|
||||
bool bRes) {
|
||||
UIScene_DebugCreateSchematic* pClass =
|
||||
(UIScene_DebugCreateSchematic*)lpParam;
|
||||
|
||||
int UIScene_DebugCreateSchematic::handleKeyboardComplete(bool bRes) {
|
||||
const char* text = InputManager.GetText();
|
||||
if (text[0] != '\0') {
|
||||
std::wstring value = convStringToWstring(text);
|
||||
int iVal = 0;
|
||||
if (!value.empty()) iVal = fromWString<int>(value);
|
||||
switch (pClass->m_keyboardCallbackControl) {
|
||||
switch (m_keyboardCallbackControl) {
|
||||
case eControl_Name:
|
||||
pClass->m_textInputName.setLabel(value);
|
||||
m_textInputName.setLabel(value);
|
||||
if (!value.empty()) {
|
||||
swprintf(pClass->m_data->name, 64, L"%ls", value.c_str());
|
||||
swprintf(m_data->name, 64, L"%ls", value.c_str());
|
||||
} else {
|
||||
swprintf(pClass->m_data->name, 64, L"schematic");
|
||||
swprintf(m_data->name, 64, L"schematic");
|
||||
}
|
||||
break;
|
||||
case eControl_StartX:
|
||||
pClass->m_textInputStartX.setLabel(value);
|
||||
m_textInputStartX.setLabel(value);
|
||||
|
||||
if (iVal >= (LEVEL_MAX_WIDTH * -16) ||
|
||||
iVal < (LEVEL_MAX_WIDTH * 16)) {
|
||||
pClass->m_data->startX = iVal;
|
||||
m_data->startX = iVal;
|
||||
}
|
||||
break;
|
||||
case eControl_StartY:
|
||||
pClass->m_textInputStartY.setLabel(value);
|
||||
m_textInputStartY.setLabel(value);
|
||||
|
||||
if (iVal >= (LEVEL_MAX_WIDTH * -16) ||
|
||||
iVal < (LEVEL_MAX_WIDTH * 16)) {
|
||||
pClass->m_data->startY = iVal;
|
||||
m_data->startY = iVal;
|
||||
}
|
||||
break;
|
||||
case eControl_StartZ:
|
||||
pClass->m_textInputStartZ.setLabel(value);
|
||||
m_textInputStartZ.setLabel(value);
|
||||
|
||||
if (iVal >= (LEVEL_MAX_WIDTH * -16) ||
|
||||
iVal < (LEVEL_MAX_WIDTH * 16)) {
|
||||
pClass->m_data->startZ = iVal;
|
||||
m_data->startZ = iVal;
|
||||
}
|
||||
break;
|
||||
case eControl_EndX:
|
||||
pClass->m_textInputEndX.setLabel(value);
|
||||
m_textInputEndX.setLabel(value);
|
||||
|
||||
if (iVal >= (LEVEL_MAX_WIDTH * -16) ||
|
||||
iVal < (LEVEL_MAX_WIDTH * 16)) {
|
||||
pClass->m_data->endX = iVal;
|
||||
m_data->endX = iVal;
|
||||
}
|
||||
break;
|
||||
case eControl_EndY:
|
||||
pClass->m_textInputEndY.setLabel(value);
|
||||
m_textInputEndY.setLabel(value);
|
||||
|
||||
if (iVal >= (LEVEL_MAX_WIDTH * -16) ||
|
||||
iVal < (LEVEL_MAX_WIDTH * 16)) {
|
||||
pClass->m_data->endY = iVal;
|
||||
m_data->endY = iVal;
|
||||
}
|
||||
break;
|
||||
case eControl_EndZ:
|
||||
pClass->m_textInputEndZ.setLabel(value);
|
||||
m_textInputEndZ.setLabel(value);
|
||||
|
||||
if (iVal >= (LEVEL_MAX_WIDTH * -16) ||
|
||||
iVal < (LEVEL_MAX_WIDTH * 16)) {
|
||||
pClass->m_data->endZ = iVal;
|
||||
m_data->endZ = iVal;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
|
|
|||
|
|
@ -80,6 +80,6 @@ protected:
|
|||
virtual void handleCheckboxToggled(F64 controlId, bool selected);
|
||||
|
||||
private:
|
||||
static int KeyboardCompleteCallback(void* lpParam, const bool bRes);
|
||||
int handleKeyboardComplete(bool bRes);
|
||||
};
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -121,7 +121,9 @@ void UIScene_DebugSetCamera::handlePress(F64 controlId, F64 childId) {
|
|||
m_keyboardCallbackControl = (eControls)((int)controlId);
|
||||
InputManager.RequestKeyboard(
|
||||
L"Enter something", L"", 0, 25,
|
||||
&UIScene_DebugSetCamera::KeyboardCompleteCallback, this,
|
||||
[this](bool bRes) -> int {
|
||||
return handleKeyboardComplete(bRes);
|
||||
},
|
||||
C_4JInput::EKeyboardMode_Default);
|
||||
break;
|
||||
};
|
||||
|
|
@ -136,33 +138,32 @@ void UIScene_DebugSetCamera::handleCheckboxToggled(F64 controlId,
|
|||
}
|
||||
}
|
||||
|
||||
int UIScene_DebugSetCamera::KeyboardCompleteCallback(void* lpParam, bool bRes) {
|
||||
UIScene_DebugSetCamera* pClass = (UIScene_DebugSetCamera*)lpParam;
|
||||
int UIScene_DebugSetCamera::handleKeyboardComplete(bool bRes) {
|
||||
const char* text = InputManager.GetText();
|
||||
if (text[0] != '\0') {
|
||||
std::wstring value = convStringToWstring(text);
|
||||
double val = 0;
|
||||
if (!value.empty()) val = fromWString<double>(value);
|
||||
switch (pClass->m_keyboardCallbackControl) {
|
||||
switch (m_keyboardCallbackControl) {
|
||||
case eControl_CamX:
|
||||
pClass->m_textInputX.setLabel(value);
|
||||
pClass->currentPosition->m_camX = val;
|
||||
m_textInputX.setLabel(value);
|
||||
currentPosition->m_camX = val;
|
||||
break;
|
||||
case eControl_CamY:
|
||||
pClass->m_textInputY.setLabel(value);
|
||||
pClass->currentPosition->m_camY = val;
|
||||
m_textInputY.setLabel(value);
|
||||
currentPosition->m_camY = val;
|
||||
break;
|
||||
case eControl_CamZ:
|
||||
pClass->m_textInputZ.setLabel(value);
|
||||
pClass->currentPosition->m_camZ = val;
|
||||
m_textInputZ.setLabel(value);
|
||||
currentPosition->m_camZ = val;
|
||||
break;
|
||||
case eControl_YRot:
|
||||
pClass->m_textInputYRot.setLabel(value);
|
||||
pClass->currentPosition->m_yRot = val;
|
||||
m_textInputYRot.setLabel(value);
|
||||
currentPosition->m_yRot = val;
|
||||
break;
|
||||
case eControl_Elevation:
|
||||
pClass->m_textInputElevation.setLabel(value);
|
||||
pClass->currentPosition->m_elev = val;
|
||||
m_textInputElevation.setLabel(value);
|
||||
currentPosition->m_elev = val;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -75,6 +75,6 @@ protected:
|
|||
virtual void handleCheckboxToggled(F64 controlId, bool selected);
|
||||
|
||||
private:
|
||||
static int KeyboardCompleteCallback(void* lpParam, const bool bRes);
|
||||
int handleKeyboardComplete(bool bRes);
|
||||
};
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -356,8 +356,21 @@ void UIScene_CreateWorldMenu::handlePress(F64 controlId, F64 childId) {
|
|||
InputManager.RequestKeyboard(
|
||||
app.GetString(IDS_CREATE_NEW_WORLD), m_editWorldName.getLabel(),
|
||||
0, 25,
|
||||
&UIScene_CreateWorldMenu::KeyboardCompleteWorldNameCallback,
|
||||
this, C_4JInput::EKeyboardMode_Default);
|
||||
[this](bool bRes) -> int {
|
||||
m_bIgnoreInput = false;
|
||||
// 4J HEG - No reason to set value if keyboard was cancelled
|
||||
if (bRes) {
|
||||
std::wstring str =
|
||||
convStringToWstring(InputManager.GetText());
|
||||
if (!str.empty()) {
|
||||
m_editWorldName.setLabel(str);
|
||||
m_worldName = std::move(str);
|
||||
}
|
||||
m_buttonCreateWorld.setEnable(!m_worldName.empty());
|
||||
}
|
||||
return 0;
|
||||
},
|
||||
C_4JInput::EKeyboardMode_Default);
|
||||
} break;
|
||||
case eControl_GameModeToggle:
|
||||
switch (m_iGameModeId) {
|
||||
|
|
@ -559,22 +572,6 @@ void UIScene_CreateWorldMenu::handleGainFocus(bool navBack) {
|
|||
}
|
||||
}
|
||||
|
||||
int UIScene_CreateWorldMenu::KeyboardCompleteWorldNameCallback(void* lpParam,
|
||||
bool bRes) {
|
||||
UIScene_CreateWorldMenu* pClass = (UIScene_CreateWorldMenu*)lpParam;
|
||||
pClass->m_bIgnoreInput = false;
|
||||
// 4J HEG - No reason to set value if keyboard was cancelled
|
||||
if (bRes) {
|
||||
std::wstring str = convStringToWstring(InputManager.GetText());
|
||||
if (!str.empty()) {
|
||||
pClass->m_editWorldName.setLabel(str);
|
||||
pClass->m_worldName = std::move(str);
|
||||
}
|
||||
|
||||
pClass->m_buttonCreateWorld.setEnable(!pClass->m_worldName.empty());
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void UIScene_CreateWorldMenu::checkStateAndStartGame() {
|
||||
int primaryPad = ProfileManager.GetPrimaryPad();
|
||||
|
|
@ -662,8 +659,9 @@ void UIScene_CreateWorldMenu::checkStateAndStartGame() {
|
|||
// false,&CScene_MultiGameCreate::StartGame_SignInReturned,
|
||||
// this,ProfileManager.GetPrimaryPad());
|
||||
SignInInfo info;
|
||||
info.Func = &UIScene_CreateWorldMenu::StartGame_SignInReturned;
|
||||
info.lpParam = this;
|
||||
info.Func = [this](bool bContinue, int pad) {
|
||||
return StartGame_SignInReturned(this, bContinue, pad);
|
||||
};
|
||||
info.requireOnline = m_MoreOptionsParams.bOnlineGame;
|
||||
ui.NavigateToScene(ProfileManager.GetPrimaryPad(),
|
||||
eUIScene_QuadrantSignin, &info);
|
||||
|
|
@ -1001,8 +999,9 @@ int UIScene_CreateWorldMenu::ConfirmCreateReturned(
|
|||
// false,&UIScene_CreateWorldMenu::StartGame_SignInReturned,
|
||||
// pClass,ProfileManager.GetPrimaryPad());
|
||||
SignInInfo info;
|
||||
info.Func = &UIScene_CreateWorldMenu::StartGame_SignInReturned;
|
||||
info.lpParam = pClass;
|
||||
info.Func = [pClass](bool bContinue, int pad) {
|
||||
return StartGame_SignInReturned(pClass, bContinue, pad);
|
||||
};
|
||||
info.requireOnline = pClass->m_MoreOptionsParams.bOnlineGame;
|
||||
ui.NavigateToScene(ProfileManager.GetPrimaryPad(),
|
||||
eUIScene_QuadrantSignin, &info);
|
||||
|
|
|
|||
|
|
@ -101,8 +101,6 @@ private:
|
|||
bool IsLocalMultiplayerAvailable();
|
||||
|
||||
protected:
|
||||
static int KeyboardCompleteWorldNameCallback(void* lpParam,
|
||||
const bool bRes);
|
||||
void handlePress(F64 controlId, F64 childId);
|
||||
void handleSliderMove(F64 sliderId, F64 currentValue);
|
||||
|
||||
|
|
|
|||
|
|
@ -188,7 +188,7 @@ void UIScene_DLCOffersMenu::handlePress(F64 controlId, F64 childId) {
|
|||
|
||||
uint64_t ullIndexA[1];
|
||||
ullIndexA[0] = StorageManager.GetOffer(iIndex).qwOfferID;
|
||||
StorageManager.InstallOffer(1, ullIndexA, nullptr, nullptr);
|
||||
StorageManager.InstallOffer(1, ullIndexA, nullptr);
|
||||
} break;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -54,8 +54,10 @@ void UIScene_JoinMenu::updateTooltips() {
|
|||
void UIScene_JoinMenu::tick() {
|
||||
if (!m_friendInfoRequestIssued) {
|
||||
ui.NavigateToScene(m_iPad, eUIScene_Timer);
|
||||
g_NetworkManager.GetFullFriendSessionInfo(m_selectedSession,
|
||||
&friendSessionUpdated, this);
|
||||
g_NetworkManager.GetFullFriendSessionInfo(
|
||||
m_selectedSession, [this](bool success) {
|
||||
friendSessionUpdated(success, this);
|
||||
});
|
||||
m_friendInfoRequestIssued = true;
|
||||
}
|
||||
|
||||
|
|
@ -295,8 +297,9 @@ void UIScene_JoinMenu::StartSharedLaunchFlow() {
|
|||
// false,&UIScene_JoinMenu::StartGame_SignInReturned,
|
||||
// this,ProfileManager.GetPrimaryPad());
|
||||
SignInInfo info;
|
||||
info.Func = &UIScene_JoinMenu::StartGame_SignInReturned;
|
||||
info.lpParam = this;
|
||||
info.Func = [this](bool bContinue, int pad) {
|
||||
return StartGame_SignInReturned(this, bContinue, pad);
|
||||
};
|
||||
info.requireOnline = true;
|
||||
ui.NavigateToScene(ProfileManager.GetPrimaryPad(),
|
||||
eUIScene_QuadrantSignin, &info);
|
||||
|
|
|
|||
|
|
@ -541,20 +541,6 @@ void UIScene_LaunchMoreOptionsMenu::handleTimerComplete(int id) {
|
|||
};*/
|
||||
}
|
||||
|
||||
int UIScene_LaunchMoreOptionsMenu::KeyboardCompleteSeedCallback(void* lpParam,
|
||||
bool bRes) {
|
||||
UIScene_LaunchMoreOptionsMenu* pClass =
|
||||
(UIScene_LaunchMoreOptionsMenu*)lpParam;
|
||||
// 4J HEG - No reason to set value if keyboard was cancelled
|
||||
if (bRes) {
|
||||
std::wstring str = convStringToWstring(InputManager.GetText());
|
||||
pClass->m_editSeed.setLabel(str);
|
||||
pClass->m_params->seed = std::move(str);
|
||||
}
|
||||
pClass->m_bIgnoreInput = false;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void UIScene_LaunchMoreOptionsMenu::handlePress(F64 controlId, F64 childId) {
|
||||
if (m_bIgnoreInput) return;
|
||||
|
||||
|
|
@ -564,8 +550,18 @@ void UIScene_LaunchMoreOptionsMenu::handlePress(F64 controlId, F64 childId) {
|
|||
InputManager.RequestKeyboard(
|
||||
app.GetString(IDS_CREATE_NEW_WORLD_SEED), m_editSeed.getLabel(),
|
||||
0, 60,
|
||||
&UIScene_LaunchMoreOptionsMenu::KeyboardCompleteSeedCallback,
|
||||
this, C_4JInput::EKeyboardMode_Default);
|
||||
[this](bool bRes) -> int {
|
||||
// 4J HEG - No reason to set value if keyboard was cancelled
|
||||
if (bRes) {
|
||||
std::wstring str =
|
||||
convStringToWstring(InputManager.GetText());
|
||||
m_editSeed.setLabel(str);
|
||||
m_params->seed = std::move(str);
|
||||
}
|
||||
m_bIgnoreInput = false;
|
||||
return 0;
|
||||
},
|
||||
C_4JInput::EKeyboardMode_Default);
|
||||
} break;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -161,7 +161,6 @@ public:
|
|||
bool released, bool& handled);
|
||||
virtual void handleFocusChange(F64 controlId, F64 childId);
|
||||
virtual void handleTimerComplete(int id);
|
||||
static int KeyboardCompleteSeedCallback(void* lpParam, const bool bRes);
|
||||
virtual void handlePress(F64 controlId, F64 childId);
|
||||
virtual void handleSliderMove(F64 sliderId, F64 currentValue);
|
||||
|
||||
|
|
|
|||
|
|
@ -39,36 +39,26 @@
|
|||
#define GAME_CREATE_ONLINE_TIMER_TIME 100
|
||||
// 4J-PB - Only Xbox will not have trial DLC patched into the game
|
||||
|
||||
namespace {
|
||||
int LoadMenuThumbnailReturnedThunk(void* lpParam, std::uint8_t* thumbnailData,
|
||||
unsigned int thumbnailBytes) {
|
||||
return UIScene_LoadMenu::LoadSaveDataThumbnailReturned(
|
||||
lpParam, thumbnailData, thumbnailBytes);
|
||||
}
|
||||
} // namespace
|
||||
|
||||
int UIScene_LoadMenu::m_iDifficultyTitleSettingA[4] = {
|
||||
IDS_DIFFICULTY_TITLE_PEACEFUL, IDS_DIFFICULTY_TITLE_EASY,
|
||||
IDS_DIFFICULTY_TITLE_NORMAL, IDS_DIFFICULTY_TITLE_HARD};
|
||||
|
||||
int UIScene_LoadMenu::LoadSaveDataThumbnailReturned(
|
||||
void* lpParam, std::uint8_t* pbThumbnail, unsigned int dwThumbnailBytes) {
|
||||
UIScene_LoadMenu* pClass = (UIScene_LoadMenu*)lpParam;
|
||||
|
||||
int UIScene_LoadMenu::loadSaveDataThumbnailReturned(
|
||||
std::uint8_t* pbThumbnail, unsigned int dwThumbnailBytes) {
|
||||
app.DebugPrintf("Received data for a thumbnail\n");
|
||||
|
||||
if (pbThumbnail && dwThumbnailBytes) {
|
||||
pClass->registerSubstitutionTexture(pClass->m_thumbnailName,
|
||||
pbThumbnail, dwThumbnailBytes);
|
||||
registerSubstitutionTexture(m_thumbnailName, pbThumbnail,
|
||||
dwThumbnailBytes);
|
||||
|
||||
pClass->m_pbThumbnailData = pbThumbnail;
|
||||
pClass->m_uiThumbnailSize = dwThumbnailBytes;
|
||||
pClass->m_bSaveThumbnailReady = true;
|
||||
m_pbThumbnailData = pbThumbnail;
|
||||
m_uiThumbnailSize = dwThumbnailBytes;
|
||||
m_bSaveThumbnailReady = true;
|
||||
} else {
|
||||
app.DebugPrintf("Thumbnail data is nullptr, or has size 0\n");
|
||||
pClass->m_bThumbnailGetFailed = true;
|
||||
m_bThumbnailGetFailed = true;
|
||||
}
|
||||
pClass->m_bRetrievingSaveThumbnail = false;
|
||||
m_bRetrievingSaveThumbnail = false;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -453,8 +443,9 @@ void UIScene_LoadMenu::tick() {
|
|||
if (m_bRequestQuadrantSignin) {
|
||||
m_bRequestQuadrantSignin = false;
|
||||
SignInInfo info;
|
||||
info.Func = &UIScene_LoadMenu::StartGame_SignInReturned;
|
||||
info.lpParam = this;
|
||||
info.Func = [this](bool bContinue, int pad) {
|
||||
return StartGame_SignInReturned(this, bContinue, pad);
|
||||
};
|
||||
info.requireOnline = m_MoreOptionsParams.bOnlineGame;
|
||||
ui.NavigateToScene(ProfileManager.GetPrimaryPad(),
|
||||
eUIScene_QuadrantSignin, &info);
|
||||
|
|
@ -785,7 +776,9 @@ void UIScene_LoadMenu::LaunchGame(void) {
|
|||
StorageManager.LoadSaveData(
|
||||
&pSaveDetails
|
||||
->SaveInfoA[(int)m_iSaveGameInfoIndex],
|
||||
&LoadSaveDataReturned, this);
|
||||
[this](bool bCorrupt, bool bOwner) {
|
||||
return loadSaveDataReturned(bCorrupt, bOwner);
|
||||
});
|
||||
|
||||
#if TO_BE_IMPLEMENTED
|
||||
if (eLoadStatus ==
|
||||
|
|
@ -833,7 +826,9 @@ void UIScene_LoadMenu::LaunchGame(void) {
|
|||
C4JStorage::ESaveGameState eLoadStatus =
|
||||
StorageManager.LoadSaveData(
|
||||
&pSaveDetails->SaveInfoA[(int)m_iSaveGameInfoIndex],
|
||||
&LoadSaveDataReturned, this);
|
||||
[this](bool bCorrupt, bool bOwner) {
|
||||
return loadSaveDataReturned(bCorrupt, bOwner);
|
||||
});
|
||||
|
||||
#if TO_BE_IMPLEMENTED
|
||||
if (eLoadStatus == C4JStorage::ELoadGame_DeviceRemoved) {
|
||||
|
|
@ -893,7 +888,9 @@ int UIScene_LoadMenu::ConfirmLoadReturned(void* pParam, int iPad,
|
|||
C4JStorage::ESaveGameState eLoadStatus =
|
||||
StorageManager.LoadSaveData(
|
||||
&pSaveDetails->SaveInfoA[(int)pClass->m_iSaveGameInfoIndex],
|
||||
&LoadSaveDataReturned, pClass);
|
||||
[pClass](const bool bCorrupt, const bool bOwner) {
|
||||
return pClass->loadSaveDataReturned(bCorrupt, bOwner);
|
||||
});
|
||||
|
||||
#if TO_BE_IMPLEMENTED
|
||||
if (eLoadStatus == C4JStorage::ELoadGame_DeviceRemoved) {
|
||||
|
|
@ -1016,17 +1013,14 @@ int UIScene_LoadMenu::LoadDataComplete(void* pParam) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int UIScene_LoadMenu::LoadSaveDataReturned(void* pParam, bool bIsCorrupt,
|
||||
bool bIsOwner) {
|
||||
UIScene_LoadMenu* pClass = (UIScene_LoadMenu*)pParam;
|
||||
|
||||
pClass->m_bIsCorrupt = bIsCorrupt;
|
||||
int UIScene_LoadMenu::loadSaveDataReturned(bool bIsCorrupt, bool bIsOwner) {
|
||||
m_bIsCorrupt = bIsCorrupt;
|
||||
|
||||
if (bIsOwner) {
|
||||
LoadDataComplete(pClass);
|
||||
LoadDataComplete(this);
|
||||
} else {
|
||||
// messagebox
|
||||
pClass->m_bIgnoreInput = false;
|
||||
m_bIgnoreInput = false;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
@ -1047,18 +1041,18 @@ int UIScene_LoadMenu::DeleteSaveDialogReturned(
|
|||
PSAVE_DETAILS pSaveDetails = StorageManager.ReturnSavesInfo();
|
||||
StorageManager.DeleteSaveData(
|
||||
&pSaveDetails->SaveInfoA[(int)pClass->m_iSaveGameInfoIndex],
|
||||
UIScene_LoadMenu::DeleteSaveDataReturned, pClass);
|
||||
[pClass](const bool bSuccess) {
|
||||
return pClass->deleteSaveDataReturned(bSuccess);
|
||||
});
|
||||
} else {
|
||||
pClass->m_bIgnoreInput = false;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int UIScene_LoadMenu::DeleteSaveDataReturned(void* pParam, bool bSuccess) {
|
||||
UIScene_LoadMenu* pClass = (UIScene_LoadMenu*)pParam;
|
||||
|
||||
int UIScene_LoadMenu::deleteSaveDataReturned(bool bSuccess) {
|
||||
app.SetCorruptSaveDeleted(true);
|
||||
pClass->navigateBack();
|
||||
navigateBack();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -122,8 +122,7 @@ private:
|
|||
static int ConfirmLoadReturned(void* pParam, int iPad,
|
||||
C4JStorage::EMessageResult result);
|
||||
static void StartGameFromSave(UIScene_LoadMenu* pClass, int localUsersMask);
|
||||
static int LoadSaveDataReturned(void* pParam, bool bIsCorrupt,
|
||||
bool bIsOwner);
|
||||
int loadSaveDataReturned(bool bIsCorrupt, bool bIsOwner);
|
||||
static int TrophyDialogReturned(void* pParam, int iPad,
|
||||
C4JStorage::EMessageResult result);
|
||||
static int LoadDataComplete(void* pParam);
|
||||
|
|
@ -131,15 +130,12 @@ private:
|
|||
C4JStorage::EMessageResult result);
|
||||
static int DeleteSaveDialogReturned(void* pParam, int iPad,
|
||||
C4JStorage::EMessageResult result);
|
||||
static int DeleteSaveDataReturned(void* pParam, bool bSuccess);
|
||||
int deleteSaveDataReturned(bool bSuccess);
|
||||
static int MustSignInReturnedPSN(void* pParam, int iPad,
|
||||
C4JStorage::EMessageResult result);
|
||||
|
||||
public:
|
||||
// 4jcraft: made public for the thunk system we have for thumbnail loading,
|
||||
// probably a FIXME for when this gets cleaned up
|
||||
static int LoadSaveDataThumbnailReturned(void* lpParam,
|
||||
std::uint8_t* pbThumbnail,
|
||||
unsigned int thumbnailBytes);
|
||||
int loadSaveDataThumbnailReturned(std::uint8_t* pbThumbnail,
|
||||
unsigned int thumbnailBytes);
|
||||
static int StartGame_SignInReturned(void* pParam, bool, int);
|
||||
};
|
||||
|
|
@ -41,36 +41,23 @@ bool UIScene_LoadOrJoinMenu::m_bSaveTransferRunning = false;
|
|||
#define JOIN_LOAD_ONLINE_TIMER_ID 0
|
||||
#define JOIN_LOAD_ONLINE_TIMER_TIME 100
|
||||
|
||||
namespace {
|
||||
int LoadOrJoinThumbnailReturnedThunk(void* lpParam, std::uint8_t* thumbnailData,
|
||||
unsigned int thumbnailBytes) {
|
||||
return UIScene_LoadOrJoinMenu::LoadSaveDataThumbnailReturned(
|
||||
lpParam, thumbnailData, thumbnailBytes);
|
||||
}
|
||||
} // namespace
|
||||
|
||||
int UIScene_LoadOrJoinMenu::LoadSaveDataThumbnailReturned(
|
||||
void* lpParam, std::uint8_t* pbThumbnail, unsigned int dwThumbnailBytes) {
|
||||
UIScene_LoadOrJoinMenu* pClass = (UIScene_LoadOrJoinMenu*)lpParam;
|
||||
|
||||
int UIScene_LoadOrJoinMenu::loadSaveDataThumbnailReturned(
|
||||
std::uint8_t* pbThumbnail, unsigned int dwThumbnailBytes) {
|
||||
app.DebugPrintf("Received data for save thumbnail\n");
|
||||
|
||||
if (pbThumbnail && dwThumbnailBytes) {
|
||||
pClass->m_saveDetails[pClass->m_iRequestingThumbnailId]
|
||||
.pbThumbnailData = new std::uint8_t[dwThumbnailBytes];
|
||||
memcpy(pClass->m_saveDetails[pClass->m_iRequestingThumbnailId]
|
||||
.pbThumbnailData,
|
||||
m_saveDetails[m_iRequestingThumbnailId].pbThumbnailData =
|
||||
new std::uint8_t[dwThumbnailBytes];
|
||||
memcpy(m_saveDetails[m_iRequestingThumbnailId].pbThumbnailData,
|
||||
pbThumbnail, dwThumbnailBytes);
|
||||
pClass->m_saveDetails[pClass->m_iRequestingThumbnailId]
|
||||
.dwThumbnailSize = dwThumbnailBytes;
|
||||
m_saveDetails[m_iRequestingThumbnailId].dwThumbnailSize =
|
||||
dwThumbnailBytes;
|
||||
} else {
|
||||
pClass->m_saveDetails[pClass->m_iRequestingThumbnailId]
|
||||
.pbThumbnailData = nullptr;
|
||||
pClass->m_saveDetails[pClass->m_iRequestingThumbnailId]
|
||||
.dwThumbnailSize = 0;
|
||||
m_saveDetails[m_iRequestingThumbnailId].pbThumbnailData = nullptr;
|
||||
m_saveDetails[m_iRequestingThumbnailId].dwThumbnailSize = 0;
|
||||
app.DebugPrintf("Save thumbnail data is nullptr, or has size 0\n");
|
||||
}
|
||||
pClass->m_bSaveThumbnailReady = true;
|
||||
m_bSaveThumbnailReady = true;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -145,7 +132,8 @@ UIScene_LoadOrJoinMenu::UIScene_LoadOrJoinMenu(int iPad, void* initData,
|
|||
|
||||
UpdateGamesList();
|
||||
|
||||
g_NetworkManager.SetSessionsUpdatedCallback(&UpdateGamesListCallback, this);
|
||||
g_NetworkManager.SetSessionsUpdatedCallback(
|
||||
[this]() { UpdateGamesList(); });
|
||||
|
||||
m_initData = new JoinMenuInitData();
|
||||
|
||||
|
|
@ -169,7 +157,7 @@ UIScene_LoadOrJoinMenu::UIScene_LoadOrJoinMenu(int iPad, void* initData,
|
|||
}
|
||||
|
||||
UIScene_LoadOrJoinMenu::~UIScene_LoadOrJoinMenu() {
|
||||
g_NetworkManager.SetSessionsUpdatedCallback(nullptr, nullptr);
|
||||
g_NetworkManager.SetSessionsUpdatedCallback(nullptr);
|
||||
app.SetLiveLinkRequired(false);
|
||||
|
||||
if (m_currentSessions) {
|
||||
|
|
@ -436,7 +424,9 @@ void UIScene_LoadOrJoinMenu::tick() {
|
|||
C4JStorage::ESaveGameState eLoadStatus =
|
||||
StorageManager.LoadSaveDataThumbnail(
|
||||
&pSaveDetails->SaveInfoA[(int)m_iRequestingThumbnailId],
|
||||
&LoadOrJoinThumbnailReturnedThunk, this);
|
||||
[this](std::uint8_t* data, unsigned int bytes) {
|
||||
return loadSaveDataThumbnailReturned(data, bytes);
|
||||
});
|
||||
|
||||
if (eLoadStatus != C4JStorage::ESaveGame_GetSaveThumbnail) {
|
||||
// something went wrong
|
||||
|
|
@ -501,7 +491,10 @@ void UIScene_LoadOrJoinMenu::tick() {
|
|||
StorageManager.LoadSaveDataThumbnail(
|
||||
&pSaveDetails
|
||||
->SaveInfoA[(int)m_iRequestingThumbnailId],
|
||||
&LoadOrJoinThumbnailReturnedThunk, this);
|
||||
[this](std::uint8_t* data, unsigned int bytes) {
|
||||
return loadSaveDataThumbnailReturned(data,
|
||||
bytes);
|
||||
});
|
||||
if (eLoadStatus != C4JStorage::ESaveGame_GetSaveThumbnail) {
|
||||
// something went wrong
|
||||
m_bRetrievingSaveThumbnails = false;
|
||||
|
|
@ -608,7 +601,7 @@ void UIScene_LoadOrJoinMenu::GetSaveInfo() {
|
|||
m_pSaveDetails = StorageManager.ReturnSavesInfo();
|
||||
if (m_pSaveDetails == nullptr) {
|
||||
C4JStorage::ESaveGameState eSGIStatus = StorageManager.GetSavesInfo(
|
||||
m_iPad, nullptr, this, (char*)"save");
|
||||
m_iPad, nullptr, (char*)"save");
|
||||
}
|
||||
|
||||
#if TO_BE_IMPLEMENTED
|
||||
|
|
@ -826,22 +819,20 @@ void UIScene_LoadOrJoinMenu::handleInput(int iPad, int key, bool repeat,
|
|||
}
|
||||
}
|
||||
|
||||
int UIScene_LoadOrJoinMenu::KeyboardCompleteWorldNameCallback(void* lpParam,
|
||||
bool bRes) {
|
||||
int UIScene_LoadOrJoinMenu::handleKeyboardCompleteWorldName(bool bRes) {
|
||||
// 4J HEG - No reason to set value if keyboard was cancelled
|
||||
UIScene_LoadOrJoinMenu* pClass = (UIScene_LoadOrJoinMenu*)lpParam;
|
||||
pClass->m_bIgnoreInput = false;
|
||||
m_bIgnoreInput = false;
|
||||
if (bRes) {
|
||||
const char* text = InputManager.GetText();
|
||||
// check the name is valid
|
||||
if (text[0] != '\0') {
|
||||
} else {
|
||||
pClass->m_bIgnoreInput = false;
|
||||
pClass->updateTooltips();
|
||||
m_bIgnoreInput = false;
|
||||
updateTooltips();
|
||||
}
|
||||
} else {
|
||||
pClass->m_bIgnoreInput = false;
|
||||
pClass->updateTooltips();
|
||||
m_bIgnoreInput = false;
|
||||
updateTooltips();
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
@ -1431,11 +1422,23 @@ int UIScene_LoadOrJoinMenu::DeleteSaveDialogReturned(
|
|||
if (app.DebugSettingsOn() && app.GetLoadSavesFromFolderEnabled()) {
|
||||
pClass->m_bIgnoreInput = false;
|
||||
} else {
|
||||
StorageManager.DeleteSaveData(
|
||||
&pClass->m_pSaveDetails->SaveInfoA[pClass->m_iSaveListIndex -
|
||||
pClass->m_iDefaultButtonsC],
|
||||
UIScene_LoadOrJoinMenu::DeleteSaveDataReturned,
|
||||
reinterpret_cast<void*>(pClass->GetCallbackUniqueId()));
|
||||
{
|
||||
size_t cbId = pClass->GetCallbackUniqueId();
|
||||
StorageManager.DeleteSaveData(
|
||||
&pClass->m_pSaveDetails
|
||||
->SaveInfoA[pClass->m_iSaveListIndex -
|
||||
pClass->m_iDefaultButtonsC],
|
||||
[cbId](const bool bRes) {
|
||||
ui.lockCallbackScenes();
|
||||
auto* p = (UIScene_LoadOrJoinMenu*)
|
||||
ui.GetSceneFromCallbackId(cbId);
|
||||
if (p) {
|
||||
p->deleteSaveDataReturned(bRes);
|
||||
}
|
||||
ui.unlockCallbackScenes();
|
||||
return 0;
|
||||
});
|
||||
}
|
||||
pClass->m_controlSavesTimer.setVisible(true);
|
||||
}
|
||||
} else {
|
||||
|
|
@ -1445,33 +1448,24 @@ int UIScene_LoadOrJoinMenu::DeleteSaveDialogReturned(
|
|||
return 0;
|
||||
}
|
||||
|
||||
int UIScene_LoadOrJoinMenu::DeleteSaveDataReturned(void* lpParam, bool bRes) {
|
||||
ui.lockCallbackScenes();
|
||||
UIScene_LoadOrJoinMenu* pClass =
|
||||
(UIScene_LoadOrJoinMenu*)ui.GetSceneFromCallbackId((size_t)lpParam);
|
||||
int UIScene_LoadOrJoinMenu::deleteSaveDataReturned(bool bRes) {
|
||||
if (bRes) {
|
||||
// wipe the list and repopulate it
|
||||
m_iState = e_SavesRepopulateAfterDelete;
|
||||
} else
|
||||
m_bIgnoreInput = false;
|
||||
|
||||
if (pClass) {
|
||||
if (bRes) {
|
||||
// wipe the list and repopulate it
|
||||
pClass->m_iState = e_SavesRepopulateAfterDelete;
|
||||
} else
|
||||
pClass->m_bIgnoreInput = false;
|
||||
|
||||
pClass->updateTooltips();
|
||||
}
|
||||
ui.unlockCallbackScenes();
|
||||
updateTooltips();
|
||||
return 0;
|
||||
}
|
||||
|
||||
int UIScene_LoadOrJoinMenu::RenameSaveDataReturned(void* lpParam, bool bRes) {
|
||||
UIScene_LoadOrJoinMenu* pClass = (UIScene_LoadOrJoinMenu*)lpParam;
|
||||
|
||||
int UIScene_LoadOrJoinMenu::renameSaveDataReturned(bool bRes) {
|
||||
if (bRes) {
|
||||
pClass->m_iState = e_SavesRepopulate;
|
||||
m_iState = e_SavesRepopulate;
|
||||
} else
|
||||
pClass->m_bIgnoreInput = false;
|
||||
m_bIgnoreInput = false;
|
||||
|
||||
pClass->updateTooltips();
|
||||
updateTooltips();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -1500,8 +1494,10 @@ int UIScene_LoadOrJoinMenu::SaveOptionsDialogReturned(
|
|||
wchar_t* ptr = wSaveName;
|
||||
InputManager.RequestKeyboard(
|
||||
app.GetString(IDS_RENAME_WORLD_TITLE), wSaveName, 0, 25,
|
||||
&UIScene_LoadOrJoinMenu::KeyboardCompleteWorldNameCallback,
|
||||
pClass, C_4JInput::EKeyboardMode_Default);
|
||||
[pClass](bool bRes) -> int {
|
||||
return pClass->handleKeyboardCompleteWorldName(bRes);
|
||||
},
|
||||
C_4JInput::EKeyboardMode_Default);
|
||||
} break;
|
||||
|
||||
case C4JStorage::EMessage_ResultThirdOption: // delete -
|
||||
|
|
@ -1578,39 +1574,34 @@ void UIScene_LoadOrJoinMenu::LaunchSaveTransfer() {
|
|||
ui.NavigateToScene(m_iPad, eUIScene_FullscreenProgress, loadingParams);
|
||||
}
|
||||
|
||||
int UIScene_LoadOrJoinMenu::CreateDummySaveDataCallback(void* lpParam,
|
||||
bool bRes) {
|
||||
UIScene_LoadOrJoinMenu* pClass = (UIScene_LoadOrJoinMenu*)lpParam;
|
||||
int UIScene_LoadOrJoinMenu::createDummySaveDataCallback(bool bRes) {
|
||||
if (bRes) {
|
||||
pClass->m_eSaveTransferState = eSaveTransfer_GetSavesInfo;
|
||||
m_eSaveTransferState = eSaveTransfer_GetSavesInfo;
|
||||
} else {
|
||||
pClass->m_eSaveTransferState = eSaveTransfer_Error;
|
||||
app.DebugPrintf("CreateDummySaveDataCallback failed\n");
|
||||
m_eSaveTransferState = eSaveTransfer_Error;
|
||||
app.DebugPrintf("createDummySaveDataCallback failed\n");
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int UIScene_LoadOrJoinMenu::CrossSaveGetSavesInfoCallback(
|
||||
void* lpParam, SAVE_DETAILS* pSaveDetails, bool bRes) {
|
||||
UIScene_LoadOrJoinMenu* pClass = (UIScene_LoadOrJoinMenu*)lpParam;
|
||||
int UIScene_LoadOrJoinMenu::crossSaveGetSavesInfoCallback(
|
||||
SAVE_DETAILS* pSaveDetails, bool bRes) {
|
||||
if (bRes) {
|
||||
pClass->m_eSaveTransferState = eSaveTransfer_GetFileData;
|
||||
m_eSaveTransferState = eSaveTransfer_GetFileData;
|
||||
} else {
|
||||
pClass->m_eSaveTransferState = eSaveTransfer_Error;
|
||||
app.DebugPrintf("CrossSaveGetSavesInfoCallback failed\n");
|
||||
m_eSaveTransferState = eSaveTransfer_Error;
|
||||
app.DebugPrintf("crossSaveGetSavesInfoCallback failed\n");
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int UIScene_LoadOrJoinMenu::LoadCrossSaveDataCallback(void* pParam,
|
||||
bool bIsCorrupt,
|
||||
int UIScene_LoadOrJoinMenu::loadCrossSaveDataCallback(bool bIsCorrupt,
|
||||
bool bIsOwner) {
|
||||
UIScene_LoadOrJoinMenu* pClass = (UIScene_LoadOrJoinMenu*)pParam;
|
||||
if (bIsCorrupt == false && bIsOwner) {
|
||||
pClass->m_eSaveTransferState = eSaveTransfer_CreatingNewSave;
|
||||
m_eSaveTransferState = eSaveTransfer_CreatingNewSave;
|
||||
} else {
|
||||
pClass->m_eSaveTransferState = eSaveTransfer_Error;
|
||||
app.DebugPrintf("LoadCrossSaveDataCallback failed \n");
|
||||
m_eSaveTransferState = eSaveTransfer_Error;
|
||||
app.DebugPrintf("loadCrossSaveDataCallback failed \n");
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -1622,10 +1613,8 @@ int UIScene_LoadOrJoinMenu::CrossSaveFinishedCallback(
|
|||
return 0;
|
||||
}
|
||||
|
||||
int UIScene_LoadOrJoinMenu::CrossSaveDeleteOnErrorReturned(void* lpParam,
|
||||
bool bRes) {
|
||||
UIScene_LoadOrJoinMenu* pClass = (UIScene_LoadOrJoinMenu*)lpParam;
|
||||
pClass->m_eSaveTransferState = eSaveTransfer_ErrorMesssage;
|
||||
int UIScene_LoadOrJoinMenu::crossSaveDeleteOnErrorReturned(bool bRes) {
|
||||
m_eSaveTransferState = eSaveTransfer_ErrorMesssage;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -1750,8 +1739,9 @@ int UIScene_LoadOrJoinMenu::DownloadSonyCrossSaveThreadProc(void* lpParameter) {
|
|||
app.getRemoteStorage()->waitForStorageManagerIdle();
|
||||
C4JStorage::ESaveGameState saveState =
|
||||
StorageManager.SaveSaveData(
|
||||
&UIScene_LoadOrJoinMenu::CreateDummySaveDataCallback,
|
||||
lpParameter);
|
||||
[pClass](const bool bRes) {
|
||||
return pClass->createDummySaveDataCallback(bRes);
|
||||
});
|
||||
if (saveState == C4JStorage::ESaveGame_Save) {
|
||||
pClass->m_eSaveTransferState =
|
||||
eSaveTransfer_CreatingDummyFile;
|
||||
|
|
@ -1782,8 +1772,11 @@ int UIScene_LoadOrJoinMenu::DownloadSonyCrossSaveThreadProc(void* lpParameter) {
|
|||
C4JStorage::ESaveGameState eSGIStatus =
|
||||
StorageManager.GetSavesInfo(
|
||||
pClass->m_iPad,
|
||||
&UIScene_LoadOrJoinMenu::CrossSaveGetSavesInfoCallback,
|
||||
pClass, "save");
|
||||
[pClass](SAVE_DETAILS* pSaveDetails, const bool bRes) {
|
||||
return pClass->crossSaveGetSavesInfoCallback(
|
||||
pSaveDetails, bRes);
|
||||
},
|
||||
"save");
|
||||
pClass->m_eSaveTransferState = eSaveTransfer_GettingSavesInfo;
|
||||
} break;
|
||||
case eSaveTransfer_GettingSavesInfo:
|
||||
|
|
@ -1872,7 +1865,11 @@ int UIScene_LoadOrJoinMenu::DownloadSonyCrossSaveThreadProc(void* lpParameter) {
|
|||
C4JStorage::ESaveGameState eLoadStatus =
|
||||
StorageManager.LoadSaveData(
|
||||
&pSaveDetails->SaveInfoA[saveInfoIndex],
|
||||
&LoadCrossSaveDataCallback, pClass);
|
||||
[pClass](const bool bIsCorrupt,
|
||||
const bool bIsOwner) {
|
||||
return pClass->loadCrossSaveDataCallback(
|
||||
bIsCorrupt, bIsOwner);
|
||||
});
|
||||
if (eLoadStatus == C4JStorage::ESaveGame_Load) {
|
||||
pClass->m_eSaveTransferState =
|
||||
eSaveTransfer_LoadingSaveFromDisc;
|
||||
|
|
@ -2041,9 +2038,10 @@ int UIScene_LoadOrJoinMenu::DownloadSonyCrossSaveThreadProc(void* lpParameter) {
|
|||
C4JStorage::ESaveGameState eDeleteStatus =
|
||||
StorageManager.DeleteSaveData(
|
||||
&pSaveDetails->SaveInfoA[saveInfoIndex],
|
||||
UIScene_LoadOrJoinMenu::
|
||||
CrossSaveDeleteOnErrorReturned,
|
||||
pClass);
|
||||
[pClass](const bool bRes) {
|
||||
return pClass
|
||||
->crossSaveDeleteOnErrorReturned(bRes);
|
||||
});
|
||||
if (eDeleteStatus == C4JStorage::ESaveGame_Delete) {
|
||||
pClass->m_eSaveTransferState =
|
||||
eSaveTransfer_ErrorDeletingSave;
|
||||
|
|
|
|||
|
|
@ -136,9 +136,8 @@ protected:
|
|||
virtual std::wstring getMoviePath();
|
||||
|
||||
public:
|
||||
static int LoadSaveDataThumbnailReturned(void* lpParam,
|
||||
std::uint8_t* pbThumbnail,
|
||||
unsigned int thumbnailBytes);
|
||||
int loadSaveDataThumbnailReturned(std::uint8_t* pbThumbnail,
|
||||
unsigned int thumbnailBytes);
|
||||
static int LoadSaveCallback(void* lpParam, bool bRes);
|
||||
static int DeleteSaveDialogReturned(void* pParam, int iPad,
|
||||
C4JStorage::EMessageResult result);
|
||||
|
|
@ -146,9 +145,9 @@ public:
|
|||
C4JStorage::EMessageResult result);
|
||||
static int TexturePackDialogReturned(void* pParam, int iPad,
|
||||
C4JStorage::EMessageResult result);
|
||||
static int DeleteSaveDataReturned(void* lpParam, bool bRes);
|
||||
static int RenameSaveDataReturned(void* lpParam, bool bRes);
|
||||
static int KeyboardCompleteWorldNameCallback(void* lpParam, bool bRes);
|
||||
int deleteSaveDataReturned(bool bRes);
|
||||
int renameSaveDataReturned(bool bRes);
|
||||
int handleKeyboardCompleteWorldName(bool bRes);
|
||||
|
||||
protected:
|
||||
void handlePress(F64 controlId, F64 childId);
|
||||
|
|
@ -199,15 +198,12 @@ private:
|
|||
m_downloadedUniqueFilename[64]; // SCE_SAVE_DATA_DIRNAME_DATA_MAXSIZE];
|
||||
bool m_saveTransferDownloadCancelled;
|
||||
void LaunchSaveTransfer();
|
||||
static int CreateDummySaveDataCallback(void* lpParam, bool bRes);
|
||||
static int CrossSaveGetSavesInfoCallback(void* lpParam,
|
||||
SAVE_DETAILS* pSaveDetails,
|
||||
bool bRes);
|
||||
static int LoadCrossSaveDataCallback(void* pParam, bool bIsCorrupt,
|
||||
bool bIsOwner);
|
||||
int createDummySaveDataCallback(bool bRes);
|
||||
int crossSaveGetSavesInfoCallback(SAVE_DETAILS* pSaveDetails, bool bRes);
|
||||
int loadCrossSaveDataCallback(bool bIsCorrupt, bool bIsOwner);
|
||||
static int CrossSaveFinishedCallback(void* pParam, int iPad,
|
||||
C4JStorage::EMessageResult result);
|
||||
static int CrossSaveDeleteOnErrorReturned(void* lpParam, bool bRes);
|
||||
int crossSaveDeleteOnErrorReturned(bool bRes);
|
||||
static int RemoteSaveNotFoundCallback(void* pParam, int iPad,
|
||||
C4JStorage::EMessageResult result);
|
||||
static int DownloadSonyCrossSaveThreadProc(void* lpParameter);
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
|
||||
#include <cmath>
|
||||
#include <format>
|
||||
#include <functional>
|
||||
#include <numbers>
|
||||
|
||||
#include "platform/PlatformTypes.h"
|
||||
|
|
@ -229,7 +230,7 @@ void UIScene_MainMenu::handleInput(int iPad, int key, bool repeat, bool pressed,
|
|||
void UIScene_MainMenu::handlePress(F64 controlId, F64 childId) {
|
||||
int primaryPad = ProfileManager.GetPrimaryPad();
|
||||
|
||||
int (*signInReturnedFunc)(void*, const bool, const int iPad) = nullptr;
|
||||
std::function<int(bool, int)> signInReturnedFunc;
|
||||
|
||||
switch ((int)controlId) {
|
||||
case eControl_PlayGame:
|
||||
|
|
@ -237,36 +238,44 @@ void UIScene_MainMenu::handlePress(F64 controlId, F64 childId) {
|
|||
// CD - Added for audio
|
||||
ui.PlayUISFX(eSFX_Press);
|
||||
|
||||
signInReturnedFunc = &UIScene_MainMenu::CreateLoad_SignInReturned;
|
||||
signInReturnedFunc = [this](bool bContinue, int pad) {
|
||||
return CreateLoad_SignInReturned(this, bContinue, pad);
|
||||
};
|
||||
break;
|
||||
case eControl_Leaderboards:
|
||||
// CD - Added for audio
|
||||
ui.PlayUISFX(eSFX_Press);
|
||||
m_eAction = eAction_RunLeaderboards;
|
||||
signInReturnedFunc = &UIScene_MainMenu::Leaderboards_SignInReturned;
|
||||
signInReturnedFunc = [this](bool bContinue, int pad) {
|
||||
return Leaderboards_SignInReturned(this, bContinue, pad);
|
||||
};
|
||||
break;
|
||||
case eControl_Achievements:
|
||||
// CD - Added for audio
|
||||
ui.PlayUISFX(eSFX_Press);
|
||||
|
||||
m_eAction = eAction_RunAchievements;
|
||||
signInReturnedFunc = &UIScene_MainMenu::Achievements_SignInReturned;
|
||||
signInReturnedFunc = [this](bool bContinue, int pad) {
|
||||
return Achievements_SignInReturned(this, bContinue, pad);
|
||||
};
|
||||
break;
|
||||
case eControl_HelpAndOptions:
|
||||
// CD - Added for audio
|
||||
ui.PlayUISFX(eSFX_Press);
|
||||
|
||||
m_eAction = eAction_RunHelpAndOptions;
|
||||
signInReturnedFunc =
|
||||
&UIScene_MainMenu::HelpAndOptions_SignInReturned;
|
||||
signInReturnedFunc = [this](bool bContinue, int pad) {
|
||||
return HelpAndOptions_SignInReturned(this, bContinue, pad);
|
||||
};
|
||||
break;
|
||||
case eControl_UnlockOrDLC:
|
||||
// CD - Added for audio
|
||||
ui.PlayUISFX(eSFX_Press);
|
||||
|
||||
m_eAction = eAction_RunUnlockOrDLC;
|
||||
signInReturnedFunc =
|
||||
&UIScene_MainMenu::UnlockFullGame_SignInReturned;
|
||||
signInReturnedFunc = [this](bool bContinue, int pad) {
|
||||
return UnlockFullGame_SignInReturned(this, bContinue, pad);
|
||||
};
|
||||
break;
|
||||
case eControl_Exit: {
|
||||
unsigned int uiIDA[2];
|
||||
|
|
@ -284,11 +293,11 @@ void UIScene_MainMenu::handlePress(F64 controlId, F64 childId) {
|
|||
bool confirmUser = false;
|
||||
|
||||
// Note: if no sign in returned func, assume this isn't required
|
||||
if (signInReturnedFunc != nullptr) {
|
||||
if (signInReturnedFunc) {
|
||||
if (ProfileManager.IsSignedIn(primaryPad)) {
|
||||
if (confirmUser) {
|
||||
ProfileManager.RequestSignInUI(false, false, true, false, true,
|
||||
signInReturnedFunc, this,
|
||||
signInReturnedFunc,
|
||||
primaryPad);
|
||||
} else {
|
||||
RunAction(primaryPad);
|
||||
|
|
@ -396,30 +405,41 @@ int UIScene_MainMenu::MustSignInReturned(void* pParam, int iPad,
|
|||
case eAction_RunGame:
|
||||
ProfileManager.RequestSignInUI(
|
||||
false, true, false, false, true,
|
||||
&UIScene_MainMenu::CreateLoad_SignInReturned, pClass, iPad);
|
||||
[pClass](bool b, int p) {
|
||||
return CreateLoad_SignInReturned(pClass, b, p);
|
||||
},
|
||||
iPad);
|
||||
break;
|
||||
case eAction_RunHelpAndOptions:
|
||||
ProfileManager.RequestSignInUI(
|
||||
false, false, true, false, true,
|
||||
&UIScene_MainMenu::HelpAndOptions_SignInReturned, pClass,
|
||||
[pClass](bool b, int p) {
|
||||
return HelpAndOptions_SignInReturned(pClass, b, p);
|
||||
},
|
||||
iPad);
|
||||
break;
|
||||
case eAction_RunLeaderboards:
|
||||
ProfileManager.RequestSignInUI(
|
||||
false, false, true, false, true,
|
||||
&UIScene_MainMenu::Leaderboards_SignInReturned, pClass,
|
||||
[pClass](bool b, int p) {
|
||||
return Leaderboards_SignInReturned(pClass, b, p);
|
||||
},
|
||||
iPad);
|
||||
break;
|
||||
case eAction_RunAchievements:
|
||||
ProfileManager.RequestSignInUI(
|
||||
false, false, true, false, true,
|
||||
&UIScene_MainMenu::Achievements_SignInReturned, pClass,
|
||||
[pClass](bool b, int p) {
|
||||
return Achievements_SignInReturned(pClass, b, p);
|
||||
},
|
||||
iPad);
|
||||
break;
|
||||
case eAction_RunUnlockOrDLC:
|
||||
ProfileManager.RequestSignInUI(
|
||||
false, false, true, false, true,
|
||||
&UIScene_MainMenu::UnlockFullGame_SignInReturned, pClass,
|
||||
[pClass](bool b, int p) {
|
||||
return UnlockFullGame_SignInReturned(pClass, b, p);
|
||||
},
|
||||
iPad);
|
||||
break;
|
||||
default:
|
||||
|
|
@ -589,7 +609,10 @@ int UIScene_MainMenu::CreateLoad_SignInReturned(void* pParam, bool bContinue,
|
|||
#if TO_BE_IMPLEMENTED
|
||||
// offline
|
||||
ProfileManager.DisplayOfflineProfile(
|
||||
&CScene_Main::CreateLoad_OfflineProfileReturned, pClass,
|
||||
[pClass](bool b, int p) {
|
||||
return CScene_Main::CreateLoad_OfflineProfileReturned(
|
||||
pClass, b, p);
|
||||
},
|
||||
ProfileManager.GetPrimaryPad());
|
||||
#else
|
||||
app.DebugPrintf(
|
||||
|
|
|
|||
|
|
@ -314,26 +314,22 @@ UIControl* UIScene_AnvilMenu::getSection(ESceneSection eSection) {
|
|||
return control;
|
||||
}
|
||||
|
||||
int UIScene_AnvilMenu::KeyboardCompleteCallback(void* lpParam, bool bRes) {
|
||||
// 4J HEG - No reason to set value if keyboard was cancelled
|
||||
UIScene_AnvilMenu* pClass = (UIScene_AnvilMenu*)lpParam;
|
||||
pClass->setIgnoreInput(false);
|
||||
|
||||
if (bRes) {
|
||||
std::wstring str = convStringToWstring(InputManager.GetText());
|
||||
pClass->setEditNameValue(str);
|
||||
pClass->m_itemName = std::move(str);
|
||||
pClass->updateItemName();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void UIScene_AnvilMenu::handleEditNamePressed() {
|
||||
setIgnoreInput(true);
|
||||
InputManager.RequestKeyboard(app.GetString(IDS_TITLE_RENAME),
|
||||
m_textInputAnvil.getLabel(), m_iPad, 30,
|
||||
&UIScene_AnvilMenu::KeyboardCompleteCallback,
|
||||
this, C_4JInput::EKeyboardMode_Default);
|
||||
InputManager.RequestKeyboard(
|
||||
app.GetString(IDS_TITLE_RENAME), m_textInputAnvil.getLabel(), m_iPad, 30,
|
||||
[this](bool bRes) -> int {
|
||||
// 4J HEG - No reason to set value if keyboard was cancelled
|
||||
setIgnoreInput(false);
|
||||
if (bRes) {
|
||||
std::wstring str = convStringToWstring(InputManager.GetText());
|
||||
setEditNameValue(str);
|
||||
m_itemName = std::move(str);
|
||||
updateItemName();
|
||||
}
|
||||
return 0;
|
||||
},
|
||||
C_4JInput::EKeyboardMode_Default);
|
||||
}
|
||||
|
||||
void UIScene_AnvilMenu::setEditNameValue(const std::wstring& name) {
|
||||
|
|
|
|||
|
|
@ -72,7 +72,6 @@ protected:
|
|||
|
||||
virtual UIControl* getSection(ESceneSection eSection);
|
||||
|
||||
static int KeyboardCompleteCallback(void* lpParam, bool bRes);
|
||||
virtual void handleEditNamePressed();
|
||||
virtual void setEditNameValue(const std::wstring& name);
|
||||
virtual void setEditNameEditable(bool enabled);
|
||||
|
|
|
|||
|
|
@ -53,7 +53,9 @@ UIScene_InGameInfoMenu::UIScene_InGameInfoMenu(int iPad, void* initData,
|
|||
}
|
||||
|
||||
g_NetworkManager.RegisterPlayerChangedCallback(
|
||||
m_iPad, &UIScene_InGameInfoMenu::OnPlayerChanged, this);
|
||||
m_iPad, [this](INetworkPlayer* pPlayer, bool leaving) {
|
||||
OnPlayerChanged(this, pPlayer, leaving);
|
||||
});
|
||||
|
||||
INetworkPlayer* thisPlayer =
|
||||
g_NetworkManager.GetLocalPlayerByUserIndex(m_iPad);
|
||||
|
|
@ -156,8 +158,7 @@ void UIScene_InGameInfoMenu::updateTooltips() {
|
|||
}
|
||||
|
||||
void UIScene_InGameInfoMenu::handleDestroy() {
|
||||
g_NetworkManager.UnRegisterPlayerChangedCallback(
|
||||
m_iPad, &UIScene_InGameInfoMenu::OnPlayerChanged, this);
|
||||
g_NetworkManager.UnRegisterPlayerChangedCallback(m_iPad);
|
||||
|
||||
m_parentLayer->removeComponent(eUIComponent_MenuBackground);
|
||||
}
|
||||
|
|
@ -166,7 +167,9 @@ void UIScene_InGameInfoMenu::handleGainFocus(bool navBack) {
|
|||
UIScene::handleGainFocus(navBack);
|
||||
if (navBack)
|
||||
g_NetworkManager.RegisterPlayerChangedCallback(
|
||||
m_iPad, &UIScene_InGameInfoMenu::OnPlayerChanged, this);
|
||||
m_iPad, [this](INetworkPlayer* pPlayer, bool leaving) {
|
||||
OnPlayerChanged(this, pPlayer, leaving);
|
||||
});
|
||||
}
|
||||
|
||||
void UIScene_InGameInfoMenu::handleReload() {
|
||||
|
|
|
|||
|
|
@ -297,7 +297,9 @@ UIScene_InGamePlayerOptionsMenu::UIScene_InGamePlayerOptionsMenu(
|
|||
addTimer(CHECKBOXES_TIMER_ID, CHECKBOXES_TIMER_TIME);
|
||||
|
||||
g_NetworkManager.RegisterPlayerChangedCallback(
|
||||
m_iPad, &UIScene_InGamePlayerOptionsMenu::OnPlayerChanged, this);
|
||||
m_iPad, [this](INetworkPlayer* pPlayer, bool leaving) {
|
||||
OnPlayerChanged(this, pPlayer, leaving);
|
||||
});
|
||||
}
|
||||
|
||||
std::wstring UIScene_InGamePlayerOptionsMenu::getMoviePath() {
|
||||
|
|
@ -405,8 +407,7 @@ void UIScene_InGamePlayerOptionsMenu::tick() {
|
|||
}
|
||||
|
||||
void UIScene_InGamePlayerOptionsMenu::handleDestroy() {
|
||||
g_NetworkManager.UnRegisterPlayerChangedCallback(
|
||||
m_iPad, &UIScene_InGamePlayerOptionsMenu::OnPlayerChanged, this);
|
||||
g_NetworkManager.UnRegisterPlayerChangedCallback(m_iPad);
|
||||
}
|
||||
|
||||
void UIScene_InGamePlayerOptionsMenu::handleInput(int iPad, int key,
|
||||
|
|
|
|||
|
|
@ -1,38 +1,23 @@
|
|||
|
||||
#include "UIScene_InGameSaveManagementMenu.h"
|
||||
|
||||
namespace {
|
||||
int InGameSaveManagementThumbnailReturnedThunk(void* lpParam,
|
||||
std::uint8_t* thumbnailData,
|
||||
unsigned int thumbnailBytes) {
|
||||
return UIScene_InGameSaveManagementMenu::LoadSaveDataThumbnailReturned(
|
||||
lpParam, thumbnailData, thumbnailBytes);
|
||||
}
|
||||
} // namespace
|
||||
|
||||
int UIScene_InGameSaveManagementMenu::LoadSaveDataThumbnailReturned(
|
||||
void* lpParam, std::uint8_t* pbThumbnail, unsigned int dwThumbnailBytes) {
|
||||
UIScene_InGameSaveManagementMenu* pClass =
|
||||
(UIScene_InGameSaveManagementMenu*)lpParam;
|
||||
|
||||
int UIScene_InGameSaveManagementMenu::loadSaveDataThumbnailReturned(
|
||||
std::uint8_t* pbThumbnail, unsigned int dwThumbnailBytes) {
|
||||
app.DebugPrintf("Received data for save thumbnail\n");
|
||||
|
||||
if (pbThumbnail && dwThumbnailBytes) {
|
||||
pClass->m_saveDetails[pClass->m_iRequestingThumbnailId]
|
||||
.pbThumbnailData = new std::uint8_t[dwThumbnailBytes];
|
||||
memcpy(pClass->m_saveDetails[pClass->m_iRequestingThumbnailId]
|
||||
.pbThumbnailData,
|
||||
m_saveDetails[m_iRequestingThumbnailId].pbThumbnailData =
|
||||
new std::uint8_t[dwThumbnailBytes];
|
||||
memcpy(m_saveDetails[m_iRequestingThumbnailId].pbThumbnailData,
|
||||
pbThumbnail, dwThumbnailBytes);
|
||||
pClass->m_saveDetails[pClass->m_iRequestingThumbnailId]
|
||||
.dwThumbnailSize = dwThumbnailBytes;
|
||||
m_saveDetails[m_iRequestingThumbnailId].dwThumbnailSize =
|
||||
dwThumbnailBytes;
|
||||
} else {
|
||||
pClass->m_saveDetails[pClass->m_iRequestingThumbnailId]
|
||||
.pbThumbnailData = nullptr;
|
||||
pClass->m_saveDetails[pClass->m_iRequestingThumbnailId]
|
||||
.dwThumbnailSize = 0;
|
||||
m_saveDetails[m_iRequestingThumbnailId].pbThumbnailData = nullptr;
|
||||
m_saveDetails[m_iRequestingThumbnailId].dwThumbnailSize = 0;
|
||||
app.DebugPrintf("Save thumbnail data is nullptr, or has size 0\n");
|
||||
}
|
||||
pClass->m_bSaveThumbnailReady = true;
|
||||
m_bSaveThumbnailReady = true;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -213,7 +198,9 @@ void UIScene_InGameSaveManagementMenu::tick() {
|
|||
C4JStorage::ESaveGameState eLoadStatus =
|
||||
StorageManager.LoadSaveDataThumbnail(
|
||||
&pSaveDetails->SaveInfoA[(int)m_iRequestingThumbnailId],
|
||||
&InGameSaveManagementThumbnailReturnedThunk, this);
|
||||
[this](std::uint8_t* data, unsigned int bytes) {
|
||||
return loadSaveDataThumbnailReturned(data, bytes);
|
||||
});
|
||||
|
||||
if (eLoadStatus != C4JStorage::ESaveGame_GetSaveThumbnail) {
|
||||
// something went wrong
|
||||
|
|
@ -277,7 +264,10 @@ void UIScene_InGameSaveManagementMenu::tick() {
|
|||
StorageManager.LoadSaveDataThumbnail(
|
||||
&pSaveDetails
|
||||
->SaveInfoA[(int)m_iRequestingThumbnailId],
|
||||
&InGameSaveManagementThumbnailReturnedThunk, this);
|
||||
[this](std::uint8_t* data, unsigned int bytes) {
|
||||
return loadSaveDataThumbnailReturned(data,
|
||||
bytes);
|
||||
});
|
||||
if (eLoadStatus != C4JStorage::ESaveGame_GetSaveThumbnail) {
|
||||
// something went wrong
|
||||
m_bRetrievingSaveThumbnails = false;
|
||||
|
|
@ -327,7 +317,7 @@ void UIScene_InGameSaveManagementMenu::GetSaveInfo() {
|
|||
m_pSaveDetails = StorageManager.ReturnSavesInfo();
|
||||
if (m_pSaveDetails == nullptr) {
|
||||
C4JStorage::ESaveGameState eSGIStatus =
|
||||
StorageManager.GetSavesInfo(m_iPad, nullptr, this, (char*)"save");
|
||||
StorageManager.GetSavesInfo(m_iPad, nullptr, (char*)"save");
|
||||
}
|
||||
|
||||
return;
|
||||
|
|
@ -415,8 +405,9 @@ int UIScene_InGameSaveManagementMenu::DeleteSaveDialogReturned(
|
|||
} else {
|
||||
StorageManager.DeleteSaveData(
|
||||
&pClass->m_pSaveDetails->SaveInfoA[pClass->m_iSaveListIndex],
|
||||
UIScene_InGameSaveManagementMenu::DeleteSaveDataReturned,
|
||||
pClass);
|
||||
[pClass](const bool bRes) {
|
||||
return pClass->deleteSaveDataReturned(bRes);
|
||||
});
|
||||
pClass->m_controlSavesTimer.setVisible(true);
|
||||
}
|
||||
} else {
|
||||
|
|
@ -426,18 +417,14 @@ int UIScene_InGameSaveManagementMenu::DeleteSaveDialogReturned(
|
|||
return 0;
|
||||
}
|
||||
|
||||
int UIScene_InGameSaveManagementMenu::DeleteSaveDataReturned(void* lpParam,
|
||||
bool bRes) {
|
||||
UIScene_InGameSaveManagementMenu* pClass =
|
||||
(UIScene_InGameSaveManagementMenu*)lpParam;
|
||||
|
||||
int UIScene_InGameSaveManagementMenu::deleteSaveDataReturned(bool bRes) {
|
||||
if (bRes) {
|
||||
// wipe the list and repopulate it
|
||||
pClass->m_iState = e_SavesRepopulateAfterDelete;
|
||||
m_iState = e_SavesRepopulateAfterDelete;
|
||||
} else
|
||||
pClass->m_bIgnoreInput = false;
|
||||
m_bIgnoreInput = false;
|
||||
|
||||
pClass->updateTooltips();
|
||||
updateTooltips();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -90,12 +90,11 @@ protected:
|
|||
virtual std::wstring getMoviePath();
|
||||
|
||||
public:
|
||||
static int LoadSaveDataThumbnailReturned(void* lpParam,
|
||||
std::uint8_t* pbThumbnail,
|
||||
unsigned int thumbnailBytes);
|
||||
int loadSaveDataThumbnailReturned(std::uint8_t* pbThumbnail,
|
||||
unsigned int thumbnailBytes);
|
||||
static int DeleteSaveDialogReturned(void* pParam, int iPad,
|
||||
C4JStorage::EMessageResult result);
|
||||
static int DeleteSaveDataReturned(void* lpParam, bool bRes);
|
||||
int deleteSaveDataReturned(bool bRes);
|
||||
|
||||
protected:
|
||||
void handlePress(F64 controlId, F64 childId);
|
||||
|
|
|
|||
|
|
@ -147,18 +147,6 @@ void UIScene_SignEntryMenu::handleInput(int iPad, int key, bool repeat,
|
|||
}
|
||||
}
|
||||
|
||||
int UIScene_SignEntryMenu::KeyboardCompleteCallback(void* lpParam, bool bRes) {
|
||||
// 4J HEG - No reason to set value if keyboard was cancelled
|
||||
UIScene_SignEntryMenu* pClass = (UIScene_SignEntryMenu*)lpParam;
|
||||
pClass->m_bIgnoreInput = false;
|
||||
if (bRes && pClass->m_iEditingLine >= 0 && pClass->m_iEditingLine < 4) {
|
||||
std::wstring str = convStringToWstring(InputManager.GetText());
|
||||
if (str.size() > 15) str.resize(15);
|
||||
pClass->m_textInputLines[pClass->m_iEditingLine].setLabel(str);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void UIScene_SignEntryMenu::handlePress(F64 controlId, F64 childId) {
|
||||
switch ((int)controlId) {
|
||||
case eControl_Confirm: {
|
||||
|
|
@ -173,7 +161,17 @@ void UIScene_SignEntryMenu::handlePress(F64 controlId, F64 childId) {
|
|||
InputManager.RequestKeyboard(
|
||||
app.GetString(IDS_SIGN_TITLE),
|
||||
m_textInputLines[m_iEditingLine].getLabel(), m_iPad, 15,
|
||||
&UIScene_SignEntryMenu::KeyboardCompleteCallback, this,
|
||||
[this](bool bRes) -> int {
|
||||
// 4J HEG - No reason to set value if keyboard was cancelled
|
||||
m_bIgnoreInput = false;
|
||||
if (bRes && m_iEditingLine >= 0 && m_iEditingLine < 4) {
|
||||
std::wstring str =
|
||||
convStringToWstring(InputManager.GetText());
|
||||
if (str.size() > 15) str.resize(15);
|
||||
m_textInputLines[m_iEditingLine].setLabel(str);
|
||||
}
|
||||
return 0;
|
||||
},
|
||||
C_4JInput::EKeyboardMode_Alphabet);
|
||||
} break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -61,6 +61,5 @@ public:
|
|||
|
||||
protected:
|
||||
void handlePress(F64 controlId, F64 childId);
|
||||
static int KeyboardCompleteCallback(void* lpParam, const bool bRes);
|
||||
virtual void handleDestroy();
|
||||
};
|
||||
|
|
|
|||
|
|
@ -93,7 +93,9 @@ UIScene_TeleportMenu::UIScene_TeleportMenu(int iPad, void* initData,
|
|||
}
|
||||
|
||||
g_NetworkManager.RegisterPlayerChangedCallback(
|
||||
m_iPad, &UIScene_TeleportMenu::OnPlayerChanged, this);
|
||||
m_iPad, [this](INetworkPlayer* pPlayer, bool leaving) {
|
||||
OnPlayerChanged(this, pPlayer, leaving);
|
||||
});
|
||||
|
||||
parentLayer->addComponent(iPad, eUIComponent_MenuBackground);
|
||||
|
||||
|
|
@ -114,8 +116,7 @@ void UIScene_TeleportMenu::updateTooltips() {
|
|||
}
|
||||
|
||||
void UIScene_TeleportMenu::handleDestroy() {
|
||||
g_NetworkManager.UnRegisterPlayerChangedCallback(
|
||||
m_iPad, &UIScene_TeleportMenu::OnPlayerChanged, this);
|
||||
g_NetworkManager.UnRegisterPlayerChangedCallback(m_iPad);
|
||||
|
||||
m_parentLayer->removeComponent(eUIComponent_MenuBackground);
|
||||
}
|
||||
|
|
@ -123,7 +124,9 @@ void UIScene_TeleportMenu::handleDestroy() {
|
|||
void UIScene_TeleportMenu::handleGainFocus(bool navBack) {
|
||||
if (navBack)
|
||||
g_NetworkManager.RegisterPlayerChangedCallback(
|
||||
m_iPad, &UIScene_TeleportMenu::OnPlayerChanged, this);
|
||||
m_iPad, [this](INetworkPlayer* pPlayer, bool leaving) {
|
||||
OnPlayerChanged(this, pPlayer, leaving);
|
||||
});
|
||||
}
|
||||
|
||||
void UIScene_TeleportMenu::handleReload() {
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ void UIScene_QuadrantSignin::handleInput(int iPad, int key, bool repeat,
|
|||
if (pressed) {
|
||||
{
|
||||
m_bIgnoreInput = true;
|
||||
m_signInInfo.Func(m_signInInfo.lpParam, false, iPad);
|
||||
m_signInInfo.Func(false, iPad);
|
||||
ProfileManager.CancelProfileAvatarRequest();
|
||||
|
||||
navigateBack();
|
||||
|
|
@ -95,13 +95,15 @@ void UIScene_QuadrantSignin::handleInput(int iPad, int key, bool repeat,
|
|||
ProfileManager.CancelProfileAvatarRequest();
|
||||
|
||||
navigateBack();
|
||||
m_signInInfo.Func(m_signInInfo.lpParam, true, m_iPad);
|
||||
m_signInInfo.Func(true, m_iPad);
|
||||
} else {
|
||||
{
|
||||
app.DebugPrintf("Non-signed in pad pressed\n");
|
||||
ProfileManager.RequestSignInUI(
|
||||
false, false, false, true, true,
|
||||
&UIScene_QuadrantSignin::SignInReturned, this,
|
||||
[this](bool bContinue, int pad) {
|
||||
return SignInReturned(this, bContinue, pad);
|
||||
},
|
||||
iPad);
|
||||
}
|
||||
}
|
||||
|
|
@ -133,14 +135,6 @@ int UIScene_QuadrantSignin::SignInReturned(void* pParam, bool bContinue,
|
|||
return 0;
|
||||
}
|
||||
|
||||
namespace {
|
||||
int AvatarReturnedThunk(void* lpParam, std::uint8_t* thumbnailData,
|
||||
unsigned int thumbnailBytes) {
|
||||
return UIScene_QuadrantSignin::AvatarReturned(lpParam, thumbnailData,
|
||||
thumbnailBytes);
|
||||
}
|
||||
} // namespace
|
||||
|
||||
void UIScene_QuadrantSignin::updateState() {
|
||||
for (unsigned int i = 0; i < XUSER_MAX_COUNT; ++i) {
|
||||
if (ProfileManager.IsSignedIn(i) && InputManager.IsPadConnected(i)) {
|
||||
|
|
@ -156,8 +150,11 @@ void UIScene_QuadrantSignin::updateState() {
|
|||
|
||||
if (!m_iconRequested[i]) {
|
||||
app.DebugPrintf(app.USER_SR, "Requesting avatar for %d\n", i);
|
||||
if (ProfileManager.GetProfileAvatar(i, &AvatarReturnedThunk,
|
||||
this)) {
|
||||
if (ProfileManager.GetProfileAvatar(
|
||||
i,
|
||||
[this](std::uint8_t* data, unsigned int bytes) {
|
||||
return AvatarReturned(this, data, bytes);
|
||||
})) {
|
||||
m_iconRequested[i] = true;
|
||||
m_lastRequestedAvatar = i;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -454,10 +454,13 @@ int main(int argc, const char* argv[]) {
|
|||
// fuck you
|
||||
ui.init(1920, 1080);
|
||||
// storage manager is needed for the trial key check
|
||||
StorageManager.Init(0, app.GetString(IDS_DEFAULT_SAVENAME),
|
||||
(char*)"savegame.dat", FIFTY_ONE_MB,
|
||||
&CConsoleMinecraftApp::DisplaySavingMessage,
|
||||
(void*)&app, (char*)"");
|
||||
StorageManager.Init(
|
||||
0, app.GetString(IDS_DEFAULT_SAVENAME), (char*)"savegame.dat",
|
||||
FIFTY_ONE_MB,
|
||||
[](const C4JStorage::ESavingMessage eMsg, int iPad) {
|
||||
return app.displaySavingMessage(eMsg, iPad);
|
||||
},
|
||||
(char*)"");
|
||||
|
||||
////////////////
|
||||
// Initialise //
|
||||
|
|
@ -486,7 +489,9 @@ int main(int argc, const char* argv[]) {
|
|||
// set a function to be called when there's a sign in change, so we can exit
|
||||
// a level if the primary player signs out
|
||||
ProfileManager.SetSignInChangeCallback(
|
||||
&CConsoleMinecraftApp::SignInChangeCallback, &app);
|
||||
[](bool bVal, unsigned int uiSignInData) {
|
||||
CConsoleMinecraftApp::SignInChangeCallback(&app, bVal, uiSignInData);
|
||||
});
|
||||
|
||||
// Set a callback for when there is a read error on profile data
|
||||
// StorageManager.SetProfileReadErrorCallback(&CConsoleMinecraftApp::ProfileReadErrorCallback,
|
||||
|
|
|
|||
|
|
@ -735,7 +735,10 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance,
|
|||
// Set a callback for the default player options to be set - when there is
|
||||
// no profile data for the player
|
||||
ProfileManager.SetDefaultOptionsCallback(
|
||||
&CConsoleMinecraftApp::DefaultOptionsCallback, (void*)&app);
|
||||
[](C_4JProfile::PROFILESETTINGS* pSettings, int iPad) {
|
||||
return CConsoleMinecraftApp::DefaultOptionsCallback(&app, pSettings,
|
||||
iPad);
|
||||
});
|
||||
// QNet needs to be setup after profile manager, as we do not want its
|
||||
// Notify listener to handle XN_SYS_SIGNINCHANGED notifications. This does
|
||||
// mean that we need to have a callback in the ProfileManager for
|
||||
|
|
|
|||
|
|
@ -1418,9 +1418,11 @@ void Minecraft::run_middle() {
|
|||
g_NetworkManager
|
||||
.IsLocalGame(),
|
||||
true, false, true,
|
||||
&Minecraft::
|
||||
InGame_SignInReturned,
|
||||
this, i);
|
||||
[this](bool b, int p) {
|
||||
return InGame_SignInReturned(
|
||||
this, b, p);
|
||||
},
|
||||
i);
|
||||
} else {
|
||||
}
|
||||
} else {
|
||||
|
|
@ -1450,9 +1452,11 @@ void Minecraft::run_middle() {
|
|||
i)) {
|
||||
ProfileManager
|
||||
.RequestConvertOfflineToGuestUI(
|
||||
&Minecraft::
|
||||
InGame_SignInReturned,
|
||||
this, i);
|
||||
[this](bool b, int p) {
|
||||
return InGame_SignInReturned(
|
||||
this, b, p);
|
||||
},
|
||||
i);
|
||||
// 4J Stu - Don't allow
|
||||
// converting to guests as we
|
||||
// don't allow any guest sign-in
|
||||
|
|
@ -1490,9 +1494,11 @@ void Minecraft::run_middle() {
|
|||
g_NetworkManager
|
||||
.IsLocalGame(),
|
||||
true, false, true,
|
||||
&Minecraft::
|
||||
InGame_SignInReturned,
|
||||
this, i);
|
||||
[this](bool b, int p) {
|
||||
return InGame_SignInReturned(
|
||||
this, b, p);
|
||||
},
|
||||
i);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
|
@ -1503,8 +1509,11 @@ void Minecraft::run_middle() {
|
|||
false,
|
||||
g_NetworkManager.IsLocalGame(),
|
||||
true, false, true,
|
||||
&Minecraft::InGame_SignInReturned,
|
||||
this, i);
|
||||
[this](bool b, int p) {
|
||||
return InGame_SignInReturned(
|
||||
this, b, p);
|
||||
},
|
||||
i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -236,10 +236,12 @@ void DLCTexturePack::loadData() {
|
|||
int mountIndex = m_dlcInfoPack->GetDLCMountIndex();
|
||||
|
||||
if (mountIndex > -1) {
|
||||
if (StorageManager.MountInstalledDLC(InputManager.GetPrimaryPad(),
|
||||
mountIndex,
|
||||
&DLCTexturePack::packMounted, this,
|
||||
"TPACK") != ERROR_IO_PENDING) {
|
||||
if (StorageManager.MountInstalledDLC(
|
||||
InputManager.GetPrimaryPad(), mountIndex,
|
||||
[this](int pad, std::uint32_t err, std::uint32_t lic) {
|
||||
return onPackMounted(pad, err, lic);
|
||||
},
|
||||
"TPACK") != ERROR_IO_PENDING) {
|
||||
// corrupt DLC
|
||||
m_bHasLoadedData = true;
|
||||
if (app.getLevelGenerationOptions())
|
||||
|
|
@ -266,9 +268,9 @@ std::wstring DLCTexturePack::getFilePath(std::uint32_t packId,
|
|||
return app.getFilePath(packId, filename, bAddDataFolder);
|
||||
}
|
||||
|
||||
int DLCTexturePack::packMounted(void* pParam, int iPad, std::uint32_t dwErr,
|
||||
std::uint32_t dwLicenceMask) {
|
||||
DLCTexturePack* texturePack = static_cast<DLCTexturePack*>(pParam);
|
||||
int DLCTexturePack::onPackMounted(int iPad, std::uint32_t dwErr,
|
||||
std::uint32_t dwLicenceMask) {
|
||||
DLCTexturePack* texturePack = this;
|
||||
texturePack->m_bLoadingData = false;
|
||||
if (dwErr != ERROR_SUCCESS) {
|
||||
// corrupt DLC
|
||||
|
|
|
|||
|
|
@ -76,8 +76,8 @@ private:
|
|||
bool bAddDataFolder = true);
|
||||
|
||||
public:
|
||||
static int packMounted(void* pParam, int iPad, std::uint32_t dwErr,
|
||||
std::uint32_t dwLicenceMask);
|
||||
int onPackMounted(int iPad, std::uint32_t dwErr,
|
||||
std::uint32_t dwLicenceMask);
|
||||
virtual void loadData();
|
||||
virtual void loadUI();
|
||||
virtual void unloadUI();
|
||||
|
|
|
|||
|
|
@ -995,7 +995,9 @@ void ConsoleSaveFileSplit::tick() {
|
|||
#endif
|
||||
|
||||
if (writeRequired) {
|
||||
PlatformStorage.SaveSubfiles(SaveRegionFilesCallback, this);
|
||||
PlatformStorage.SaveSubfiles([this](bool bRes) {
|
||||
return SaveRegionFilesCallback(this, bRes);
|
||||
});
|
||||
}
|
||||
|
||||
ReleaseSaveAccess();
|
||||
|
|
@ -1378,8 +1380,9 @@ void ConsoleSaveFileSplit::Flush(bool autosave, bool updateThumbnail) {
|
|||
PlatformStorage.GetSaveUniqueNumber(&saveOrCheckpointId);
|
||||
|
||||
// save the data
|
||||
PlatformStorage.SaveSaveData(
|
||||
&ConsoleSaveFileSplit::SaveSaveDataCallback, this);
|
||||
PlatformStorage.SaveSaveData([this](bool bRes) {
|
||||
return SaveSaveDataCallback(this, bRes);
|
||||
});
|
||||
#if !defined(_CONTENT_PACKAGE)
|
||||
if (app.DebugSettingsOn()) {
|
||||
if (app.GetWriteSavesToFolderEnabled()) {
|
||||
|
|
@ -1398,7 +1401,9 @@ int ConsoleSaveFileSplit::SaveSaveDataCallback(void* lpParam, bool bRes) {
|
|||
if (!pClass->m_autosave) {
|
||||
// This is called from the PlatformStorage.Tick() which should always be
|
||||
// on the main thread
|
||||
PlatformStorage.SaveSubfiles(SaveRegionFilesCallback, pClass);
|
||||
PlatformStorage.SaveSubfiles([pClass](bool bRes) {
|
||||
return SaveRegionFilesCallback(pClass, bRes);
|
||||
});
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ SignTileEntity::SignTileEntity() : TileEntity() {
|
|||
SignTileEntity::~SignTileEntity() {
|
||||
// TODO ORBIS_STUBBED;
|
||||
// 4J-PB - we don't need to verify strings anymore -
|
||||
// PlatformInput.CancelQueuedVerifyStrings(&SignTileEntity::StringVerifyCallback,(void*)this);
|
||||
// PlatformInput.CancelQueuedVerifyStrings([this](STRING_VERIFY_RESPONSE* r) { return handleStringVerify(r); });
|
||||
}
|
||||
|
||||
void SignTileEntity::save(CompoundTag* tag) {
|
||||
|
|
@ -124,7 +124,7 @@ sizeof(wchar_t)*(MAX_LINE_LENGTH+1)); if(m_wsmessages[i].length()>0)
|
|||
// at this point, we can ask the online string verifier if our sign
|
||||
text is ok #if 0 m_bVerified=true; #else
|
||||
|
||||
if(!PlatformInput.VerifyStrings((wchar_t**)&wcMessages,MAX_SIGN_LINES,&SignTileEntity::StringVerifyCallback,(void*)this))
|
||||
if(!PlatformInput.VerifyStrings((wchar_t**)&wcMessages,MAX_SIGN_LINES,[this](STRING_VERIFY_RESPONSE* r) { return handleStringVerify(r); }))
|
||||
{
|
||||
// Nothing to verify
|
||||
m_bVerified=true;
|
||||
|
|
@ -148,26 +148,23 @@ void SignTileEntity::SetMessage(int iIndex, std::wstring& wsText) {
|
|||
}
|
||||
|
||||
// 4J-PB - added for string verification
|
||||
int SignTileEntity::StringVerifyCallback(void* lpParam,
|
||||
STRING_VERIFY_RESPONSE* pResults) {
|
||||
int SignTileEntity::handleStringVerify(STRING_VERIFY_RESPONSE* pResults) {
|
||||
// results will be in m_pStringVerifyResponse
|
||||
SignTileEntity* pClass = (SignTileEntity*)lpParam;
|
||||
|
||||
pClass->m_bVerified = true;
|
||||
pClass->m_bCensored = false;
|
||||
m_bVerified = true;
|
||||
m_bCensored = false;
|
||||
for (int i = 0; i < pResults->wNumStrings; i++) {
|
||||
if (pResults->pStringResult[i] != ERROR_SUCCESS) {
|
||||
pClass->m_bCensored = true;
|
||||
m_bCensored = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!pClass->level->isClientSide) {
|
||||
ServerLevel* serverLevel = (ServerLevel*)pClass->level;
|
||||
if (!level->isClientSide) {
|
||||
ServerLevel* serverLevel = (ServerLevel*)level;
|
||||
// 4J Stu - This callback gets called on the main thread, but tried to
|
||||
// access things on the server thread. Change to go through the
|
||||
// protected method.
|
||||
// pClass->level->sendTileUpdated(pClass->x, pClass->y, pClass->z);
|
||||
serverLevel->queueSendTileUpdate(pClass->x, pClass->y, pClass->z);
|
||||
// level->sendTileUpdated(x, y, z);
|
||||
serverLevel->queueSendTileUpdate(x, y, z);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -52,8 +52,7 @@ public:
|
|||
void setAllowedPlayerEditor(std::shared_ptr<Player> player);
|
||||
std::shared_ptr<Player> getPlayerWhoMayEdit();
|
||||
virtual void setChanged();
|
||||
static int StringVerifyCallback(void* lpParam,
|
||||
STRING_VERIFY_RESPONSE* pResults);
|
||||
int handleStringVerify(STRING_VERIFY_RESPONSE* pResults);
|
||||
|
||||
// 4J Added
|
||||
virtual std::shared_ptr<TileEntity> clone();
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
#pragma once
|
||||
|
||||
#include <functional>
|
||||
|
||||
#include "PlatformTypes.h"
|
||||
|
||||
// TODO: migrate C-style callbacks (int (*Func)(void*, ...), void* lpParam)
|
||||
// to std::function or std::function_ref (C++26).
|
||||
class IPlatformInput {
|
||||
public:
|
||||
enum EKeyboardMode {
|
||||
|
|
@ -53,8 +53,8 @@ public:
|
|||
unsigned int uiTo) = 0;
|
||||
virtual void SetKeyRepeatRate(float fRepeatDelaySecs,
|
||||
float fRepeatRateSecs) = 0;
|
||||
virtual void SetDebugSequence(const char* chSequenceA, int (*Func)(void*),
|
||||
void* lpParam) = 0;
|
||||
virtual void SetDebugSequence(const char* chSequenceA,
|
||||
std::function<int()> callback) = 0;
|
||||
[[nodiscard]] virtual float GetIdleSeconds(int iPad) = 0;
|
||||
[[nodiscard]] virtual bool IsPadConnected(int iPad) = 0;
|
||||
|
||||
|
|
@ -82,18 +82,16 @@ public:
|
|||
virtual EKeyboardResult RequestKeyboard(const wchar_t* Title,
|
||||
const wchar_t* Text, int iPad,
|
||||
unsigned int uiMaxChars,
|
||||
int (*Func)(void*, const bool),
|
||||
void* lpParam,
|
||||
std::function<int(bool)> callback,
|
||||
EKeyboardMode eMode) = 0;
|
||||
[[nodiscard]] virtual const char* GetText() = 0;
|
||||
|
||||
// String verification (TCR 92)
|
||||
virtual bool VerifyStrings(wchar_t** pwStringA, int iStringC,
|
||||
int (*Func)(void*, STRING_VERIFY_RESPONSE*),
|
||||
void* lpParam) = 0;
|
||||
virtual void CancelQueuedVerifyStrings(int (*Func)(void*,
|
||||
STRING_VERIFY_RESPONSE*),
|
||||
void* lpParam) = 0;
|
||||
virtual bool VerifyStrings(
|
||||
wchar_t** pwStringA, int iStringC,
|
||||
std::function<int(STRING_VERIFY_RESPONSE*)> callback) = 0;
|
||||
virtual void CancelQueuedVerifyStrings(
|
||||
std::function<int(STRING_VERIFY_RESPONSE*)> callback) = 0;
|
||||
virtual void CancelAllVerifyInProgress() = 0;
|
||||
|
||||
// Mouse
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
#include <functional>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
|
|
@ -24,7 +25,6 @@ struct SearchForGamesData {
|
|||
XOVERLAPPED* pOverlapped;
|
||||
};
|
||||
|
||||
// TODO: migrate C-style callbacks to std::function or std::function_ref (C++26).
|
||||
class IPlatformNetwork {
|
||||
public:
|
||||
enum eJoinFailedReason {
|
||||
|
|
@ -90,14 +90,9 @@ public:
|
|||
// Callbacks
|
||||
virtual void RegisterPlayerChangedCallback(
|
||||
int iPad,
|
||||
void (*callback)(void* callbackParam, INetworkPlayer* pPlayer,
|
||||
bool leaving),
|
||||
void* callbackParam) = 0;
|
||||
virtual void UnRegisterPlayerChangedCallback(
|
||||
int iPad,
|
||||
void (*callback)(void* callbackParam, INetworkPlayer* pPlayer,
|
||||
bool leaving),
|
||||
void* callbackParam) = 0;
|
||||
std::function<void(INetworkPlayer* pPlayer, bool leaving)>
|
||||
callback) = 0;
|
||||
virtual void UnRegisterPlayerChangedCallback(int iPad) = 0;
|
||||
|
||||
virtual void HandleSignInChange() = 0;
|
||||
|
||||
|
|
@ -134,12 +129,10 @@ public:
|
|||
[[nodiscard]] virtual bool GetGameSessionInfo(
|
||||
int iPad, SessionID sessionId, FriendSessionInfo* foundSession) = 0;
|
||||
virtual void SetSessionsUpdatedCallback(
|
||||
void (*SessionsUpdatedCallback)(void* pParam),
|
||||
void* pSearchParam) = 0;
|
||||
std::function<void()> callback) = 0;
|
||||
virtual void GetFullFriendSessionInfo(
|
||||
FriendSessionInfo* foundSession,
|
||||
void (*FriendSessionUpdatedFn)(bool success, void* pParam),
|
||||
void* pParam) = 0;
|
||||
std::function<void(bool success)> callback) = 0;
|
||||
virtual void ForceFriendsSessionRefresh() = 0;
|
||||
|
||||
virtual void FakeLocalPlayerJoined() {}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
#include <functional>
|
||||
#include <string>
|
||||
|
||||
#include "PlatformTypes.h"
|
||||
|
|
@ -8,8 +9,6 @@
|
|||
|
||||
class CXuiStringTable;
|
||||
|
||||
// TODO: migrate C-style callbacks (int (*Func)(void*, ...), void* lpParam)
|
||||
// to std::function or std::function_ref (C++26).
|
||||
class IPlatformProfile {
|
||||
public:
|
||||
struct PROFILESETTINGS {
|
||||
|
|
@ -40,13 +39,13 @@ public:
|
|||
virtual unsigned int RequestSignInUI(
|
||||
bool bFromInvite, bool bLocalGame, bool bNoGuestsAllowed,
|
||||
bool bMultiplayerSignIn, bool bAddUser,
|
||||
int (*Func)(void*, const bool, const int iPad), void* lpParam,
|
||||
std::function<int(bool, int)> callback,
|
||||
int iQuadrant = XUSER_INDEX_ANY) = 0;
|
||||
virtual unsigned int DisplayOfflineProfile(
|
||||
int (*Func)(void*, const bool, const int iPad), void* lpParam,
|
||||
std::function<int(bool, int)> callback,
|
||||
int iQuadrant = XUSER_INDEX_ANY) = 0;
|
||||
virtual unsigned int RequestConvertOfflineToGuestUI(
|
||||
int (*Func)(void*, const bool, const int iPad), void* lpParam,
|
||||
std::function<int(bool, int)> callback,
|
||||
int iQuadrant = XUSER_INDEX_ANY) = 0;
|
||||
virtual void SetPrimaryPlayerChanged(bool bVal) = 0;
|
||||
[[nodiscard]] virtual bool QuerySigninStatus() = 0;
|
||||
|
|
@ -64,27 +63,22 @@ public:
|
|||
virtual void SetPrimaryPad(int iPad) = 0;
|
||||
[[nodiscard]] virtual char* GetGamertag(int iPad) = 0;
|
||||
[[nodiscard]] virtual std::wstring GetDisplayName(int iPad) = 0;
|
||||
virtual void SetSignInChangeCallback(void (*Func)(void*, bool,
|
||||
unsigned int),
|
||||
void* lpParam) = 0;
|
||||
virtual void SetNotificationsCallback(void (*Func)(void*, std::uint32_t,
|
||||
unsigned int),
|
||||
void* lpParam) = 0;
|
||||
virtual void SetSignInChangeCallback(
|
||||
std::function<void(bool, unsigned int)> callback) = 0;
|
||||
virtual void SetNotificationsCallback(
|
||||
std::function<void(std::uint32_t, unsigned int)> callback) = 0;
|
||||
[[nodiscard]] virtual bool RegionIsNorthAmerica() = 0;
|
||||
[[nodiscard]] virtual bool LocaleIsUSorCanada() = 0;
|
||||
[[nodiscard]] virtual int GetLiveConnectionStatus() = 0;
|
||||
[[nodiscard]] virtual bool IsSystemUIDisplayed() = 0;
|
||||
virtual void SetProfileReadErrorCallback(void (*Func)(void*),
|
||||
void* lpParam) = 0;
|
||||
virtual void SetProfileReadErrorCallback(
|
||||
std::function<void()> callback) = 0;
|
||||
|
||||
// Profile data
|
||||
virtual int SetDefaultOptionsCallback(int (*Func)(void*, PROFILESETTINGS*,
|
||||
const int iPad),
|
||||
void* lpParam) = 0;
|
||||
virtual int SetOldProfileVersionCallback(int (*Func)(void*, unsigned char*,
|
||||
const unsigned short,
|
||||
const int),
|
||||
void* lpParam) = 0;
|
||||
virtual int SetDefaultOptionsCallback(
|
||||
std::function<int(PROFILESETTINGS*, int)> callback) = 0;
|
||||
virtual int SetOldProfileVersionCallback(
|
||||
std::function<int(unsigned char*, unsigned short, int)> callback) = 0;
|
||||
[[nodiscard]] virtual PROFILESETTINGS* GetDashboardProfileSettings(
|
||||
int iPad) = 0;
|
||||
virtual void WriteToProfile(int iQuadrant,
|
||||
|
|
@ -104,9 +98,7 @@ public:
|
|||
virtual void ShowProfileCard(int iPad, PlayerUID targetUid) = 0;
|
||||
[[nodiscard]] virtual bool GetProfileAvatar(
|
||||
int iPad,
|
||||
int (*Func)(void* lpParam, std::uint8_t* thumbnailData,
|
||||
unsigned int thumbnailBytes),
|
||||
void* lpParam) = 0;
|
||||
std::function<int(std::uint8_t*, unsigned int)> callback) = 0;
|
||||
virtual void CancelProfileAvatarRequest() = 0;
|
||||
|
||||
// Achievements
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
#include <cstdint>
|
||||
#include <ctime>
|
||||
#include <functional>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
|
|
@ -13,8 +14,6 @@ struct SAVE_DETAILS;
|
|||
using PSAVE_DETAILS = SAVE_DETAILS*;
|
||||
class C4JStringTable;
|
||||
|
||||
// TODO: migrate C-style callbacks (int (*Func)(void*, ...), void* lpParam)
|
||||
// to std::function or std::function_ref (C++26).
|
||||
class IPlatformStorage {
|
||||
public:
|
||||
// Enums live here so both the interface consumer and the concrete
|
||||
|
|
@ -120,21 +119,21 @@ public:
|
|||
virtual void Init(unsigned int uiSaveVersion,
|
||||
const wchar_t* pwchDefaultSaveName, char* pszSavePackName,
|
||||
int iMinimumSaveSize,
|
||||
int (*Func)(void*, const ESavingMessage, int),
|
||||
void* lpParam, const char* szGroupID) = 0;
|
||||
std::function<int(const ESavingMessage, int)> callback,
|
||||
const char* szGroupID) = 0;
|
||||
virtual void ResetSaveData() = 0;
|
||||
|
||||
// Messages
|
||||
virtual EMessageResult RequestMessageBox(
|
||||
unsigned int uiTitle, unsigned int uiText, unsigned int* uiOptionA,
|
||||
unsigned int uiOptionC, unsigned int pad = XUSER_INDEX_ANY,
|
||||
int (*Func)(void*, int, const EMessageResult) = nullptr,
|
||||
void* lpParam = nullptr, C4JStringTable* pStringTable = nullptr,
|
||||
std::function<int(int, const EMessageResult)> callback = nullptr,
|
||||
C4JStringTable* pStringTable = nullptr,
|
||||
wchar_t* pwchFormatString = nullptr, unsigned int focusButton = 0) = 0;
|
||||
virtual EMessageResult GetMessageBoxResult() = 0;
|
||||
|
||||
// Save device
|
||||
virtual bool SetSaveDevice(int (*Func)(void*, const bool), void* lpParam,
|
||||
virtual bool SetSaveDevice(std::function<int(const bool)> callback,
|
||||
bool bForceResetOfSaveDevice = false) = 0;
|
||||
virtual void SetSaveDeviceSelected(unsigned int uiPad, bool bSelected) = 0;
|
||||
virtual bool GetSaveDeviceSelected(unsigned int iPad) = 0;
|
||||
|
|
@ -147,7 +146,7 @@ public:
|
|||
virtual bool GetSaveUniqueFilename(char* pszName) = 0;
|
||||
virtual void SetSaveUniqueFilename(char* szFilename) = 0;
|
||||
virtual void SetState(ESaveGameControlState eControlState,
|
||||
int (*Func)(void*, const bool), void* lpParam) = 0;
|
||||
std::function<int(const bool)> callback) = 0;
|
||||
virtual void SetSaveDisabled(bool bDisable) = 0;
|
||||
virtual bool GetSaveDisabled() = 0;
|
||||
virtual unsigned int GetSaveSize() = 0;
|
||||
|
|
@ -158,64 +157,60 @@ public:
|
|||
std::uint8_t* pbImage, unsigned int imageBytes,
|
||||
std::uint8_t* pbTextData,
|
||||
unsigned int textDataBytes) = 0;
|
||||
virtual ESaveGameState SaveSaveData(int (*Func)(void*, const bool),
|
||||
void* lpParam) = 0;
|
||||
virtual void CopySaveDataToNewSave(std::uint8_t* pbThumbnail,
|
||||
unsigned int cbThumbnail,
|
||||
wchar_t* wchNewName,
|
||||
int (*Func)(void* lpParam, bool),
|
||||
void* lpParam) = 0;
|
||||
virtual ESaveGameState SaveSaveData(
|
||||
std::function<int(const bool)> callback) = 0;
|
||||
virtual void CopySaveDataToNewSave(
|
||||
std::uint8_t* pbThumbnail, unsigned int cbThumbnail,
|
||||
wchar_t* wchNewName, std::function<int(bool)> callback) = 0;
|
||||
virtual ESaveGameState DoesSaveExist(bool* pbExists) = 0;
|
||||
virtual bool EnoughSpaceForAMinSaveGame() = 0;
|
||||
virtual void SetSaveMessageVPosition(float fY) = 0;
|
||||
virtual ESaveGameState GetSavesInfo(
|
||||
int iPad,
|
||||
int (*Func)(void* lpParam, SAVE_DETAILS* pSaveDetails, const bool),
|
||||
void* lpParam, char* pszSavePackName) = 0;
|
||||
std::function<int(SAVE_DETAILS* pSaveDetails, const bool)> callback,
|
||||
char* pszSavePackName) = 0;
|
||||
virtual PSAVE_DETAILS ReturnSavesInfo() = 0;
|
||||
virtual void ClearSavesInfo() = 0;
|
||||
virtual ESaveGameState LoadSaveDataThumbnail(
|
||||
PSAVE_INFO pSaveInfo,
|
||||
int (*Func)(void* lpParam, std::uint8_t* thumbnailData,
|
||||
unsigned int thumbnailBytes),
|
||||
void* lpParam) = 0;
|
||||
std::function<int(std::uint8_t* thumbnailData,
|
||||
unsigned int thumbnailBytes)>
|
||||
callback) = 0;
|
||||
virtual void GetSaveCacheFileInfo(unsigned int fileIndex,
|
||||
XCONTENT_DATA& xContentData) = 0;
|
||||
virtual void GetSaveCacheFileInfo(unsigned int fileIndex,
|
||||
std::uint8_t** ppbImageData,
|
||||
unsigned int* pImageBytes) = 0;
|
||||
virtual ESaveGameState LoadSaveData(PSAVE_INFO pSaveInfo,
|
||||
int (*Func)(void* lpParam, const bool,
|
||||
const bool),
|
||||
void* lpParam) = 0;
|
||||
virtual ESaveGameState DeleteSaveData(PSAVE_INFO pSaveInfo,
|
||||
int (*Func)(void* lpParam,
|
||||
const bool),
|
||||
void* lpParam) = 0;
|
||||
virtual ESaveGameState LoadSaveData(
|
||||
PSAVE_INFO pSaveInfo,
|
||||
std::function<int(const bool, const bool)> callback) = 0;
|
||||
virtual ESaveGameState DeleteSaveData(
|
||||
PSAVE_INFO pSaveInfo,
|
||||
std::function<int(const bool)> callback) = 0;
|
||||
|
||||
// DLC
|
||||
virtual void RegisterMarketplaceCountsCallback(
|
||||
int (*Func)(void* lpParam, DLC_TMS_DETAILS*, int), void* lpParam) = 0;
|
||||
std::function<int(DLC_TMS_DETAILS*, int)> callback) = 0;
|
||||
virtual void SetDLCPackageRoot(char* pszDLCRoot) = 0;
|
||||
virtual EDLCStatus GetDLCOffers(int iPad,
|
||||
int (*Func)(void*, int, std::uint32_t, int),
|
||||
void* lpParam,
|
||||
std::uint32_t dwOfferTypesBitmask =
|
||||
XMARKETPLACE_OFFERING_TYPE_CONTENT) = 0;
|
||||
virtual EDLCStatus GetDLCOffers(
|
||||
int iPad,
|
||||
std::function<int(int, std::uint32_t, int)> callback,
|
||||
std::uint32_t dwOfferTypesBitmask =
|
||||
XMARKETPLACE_OFFERING_TYPE_CONTENT) = 0;
|
||||
virtual unsigned int CancelGetDLCOffers() = 0;
|
||||
virtual void ClearDLCOffers() = 0;
|
||||
virtual XMARKETPLACE_CONTENTOFFER_INFO& GetOffer(unsigned int dw) = 0;
|
||||
virtual int GetOfferCount() = 0;
|
||||
virtual unsigned int InstallOffer(int iOfferIDC, std::uint64_t* ullOfferIDA,
|
||||
int (*Func)(void*, int, int),
|
||||
void* lpParam, bool bTrial = false) = 0;
|
||||
std::function<int(int, int)> callback,
|
||||
bool bTrial = false) = 0;
|
||||
virtual unsigned int GetAvailableDLCCount(int iPad) = 0;
|
||||
virtual EDLCStatus GetInstalledDLC(int iPad, int (*Func)(void*, int, int),
|
||||
void* lpParam) = 0;
|
||||
virtual EDLCStatus GetInstalledDLC(
|
||||
int iPad, std::function<int(int, int)> callback) = 0;
|
||||
virtual XCONTENT_DATA& GetDLC(unsigned int dw) = 0;
|
||||
virtual std::uint32_t MountInstalledDLC(
|
||||
int iPad, std::uint32_t dwDLC,
|
||||
int (*Func)(void*, int, std::uint32_t, std::uint32_t), void* lpParam,
|
||||
std::function<int(int, std::uint32_t, std::uint32_t)> callback,
|
||||
const char* szMountDrive = nullptr) = 0;
|
||||
virtual unsigned int UnmountInstalledDLC(
|
||||
const char* szMountDrive = nullptr) = 0;
|
||||
|
|
@ -228,8 +223,8 @@ public:
|
|||
int iQuadrant, eGlobalStorage eStorageFacility, eTMS_FileType eFileType,
|
||||
wchar_t* pwchFilename, std::uint8_t** ppBuffer,
|
||||
unsigned int* pBufferSize,
|
||||
int (*Func)(void*, wchar_t*, int, bool, int) = nullptr,
|
||||
void* lpParam = nullptr, int iAction = 0) = 0;
|
||||
std::function<int(wchar_t*, int, bool, int)> callback = nullptr,
|
||||
int iAction = 0) = 0;
|
||||
virtual bool WriteTMSFile(int iQuadrant, eGlobalStorage eStorageFacility,
|
||||
wchar_t* pwchFilename, std::uint8_t* pBuffer,
|
||||
unsigned int bufferSize) = 0;
|
||||
|
|
@ -239,8 +234,9 @@ public:
|
|||
virtual ETMSStatus TMSPP_ReadFile(
|
||||
int iPad, eGlobalStorage eStorageFacility,
|
||||
eTMS_FILETYPEVAL eFileTypeVal, const char* szFilename,
|
||||
int (*Func)(void*, int, int, PTMSPP_FILEDATA, const char*) = nullptr,
|
||||
void* lpParam = nullptr, int iUserData = 0) = 0;
|
||||
std::function<int(int, int, PTMSPP_FILEDATA, const char*)> callback =
|
||||
nullptr,
|
||||
int iUserData = 0) = 0;
|
||||
|
||||
// Subfile management (save splitting)
|
||||
virtual int AddSubfile(int regionIndex) = 0;
|
||||
|
|
@ -249,7 +245,7 @@ public:
|
|||
void** data, unsigned int* size) = 0;
|
||||
virtual void ResetSubfiles() = 0;
|
||||
virtual void UpdateSubfile(int index, void* data, unsigned int size) = 0;
|
||||
virtual void SaveSubfiles(int (*Func)(void*, const bool), void* param) = 0;
|
||||
virtual void SaveSubfiles(std::function<int(const bool)> callback) = 0;
|
||||
virtual ESaveGameState GetSaveState() = 0;
|
||||
|
||||
// Misc
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@
|
|||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <functional>
|
||||
#include <string>
|
||||
|
||||
#include "../InputActions.h"
|
||||
|
|
@ -51,8 +52,7 @@ static bool s_scrollSnapTaken = false;
|
|||
// Text input state (non-blocking keyboard)
|
||||
static bool s_keyboardActive = false;
|
||||
static std::string s_textInputBuf;
|
||||
static int (*s_keyboardCallback)(void*, const bool) = nullptr;
|
||||
static void* s_keyboardCallbackParam = nullptr;
|
||||
static std::function<int(bool)> s_keyboardCallback;
|
||||
|
||||
// We set all the watched keys
|
||||
// I don't know if I'll need to change this if we add chat support soon.
|
||||
|
|
@ -357,9 +357,8 @@ void C_4JInput::Tick() {
|
|||
s_keysCurrent[SDL_SCANCODE_RETURN] = false;
|
||||
s_keysCurrent[SDL_SCANCODE_KP_ENTER] = false;
|
||||
if (s_keyboardCallback) {
|
||||
s_keyboardCallback(s_keyboardCallbackParam, true);
|
||||
s_keyboardCallback(true);
|
||||
s_keyboardCallback = nullptr;
|
||||
s_keyboardCallbackParam = nullptr;
|
||||
}
|
||||
} else if (KPressed(SDL_SCANCODE_ESCAPE)) {
|
||||
s_keyboardActive = false;
|
||||
|
|
@ -368,9 +367,8 @@ void C_4JInput::Tick() {
|
|||
// Consume the key so it doesn't also trigger ACTION_MENU_CANCEL
|
||||
s_keysCurrent[SDL_SCANCODE_ESCAPE] = false;
|
||||
if (s_keyboardCallback) {
|
||||
s_keyboardCallback(s_keyboardCallbackParam, false);
|
||||
s_keyboardCallback(false);
|
||||
s_keyboardCallback = nullptr;
|
||||
s_keyboardCallbackParam = nullptr;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -642,19 +640,17 @@ void C_4JInput::SetJoypadSensitivity(int, float) {}
|
|||
void C_4JInput::SetJoypadStickAxisMap(int, unsigned int, unsigned int) {}
|
||||
void C_4JInput::SetJoypadStickTriggerMap(int, unsigned int, unsigned int) {}
|
||||
void C_4JInput::SetKeyRepeatRate(float, float) {}
|
||||
void C_4JInput::SetDebugSequence(const char*, int (*)(void*), void*) {}
|
||||
void C_4JInput::SetDebugSequence(const char*, std::function<int()>) {}
|
||||
float C_4JInput::GetIdleSeconds(int) { return 0.f; }
|
||||
bool C_4JInput::IsPadConnected(int iPad) { return iPad == 0; }
|
||||
|
||||
EKeyboardResult C_4JInput::RequestKeyboard(const wchar_t*, const wchar_t*, int,
|
||||
unsigned int,
|
||||
int (*callback)(void*, const bool),
|
||||
void* scene,
|
||||
std::function<int(bool)> callback,
|
||||
C_4JInput::EKeyboardMode) {
|
||||
s_keyboardActive = true;
|
||||
s_textInputBuf.clear();
|
||||
s_keyboardCallback = callback;
|
||||
s_keyboardCallbackParam = scene;
|
||||
s_keyboardCallback = std::move(callback);
|
||||
SDL_StartTextInput();
|
||||
return EKeyboardResult::Pending;
|
||||
}
|
||||
|
|
@ -664,12 +660,11 @@ bool C_4JInput::GetMenuDisplayed(int iPad) {
|
|||
}
|
||||
const char* C_4JInput::GetText() { return s_textInputBuf.c_str(); }
|
||||
bool C_4JInput::VerifyStrings(wchar_t**, int,
|
||||
int (*)(void*, STRING_VERIFY_RESPONSE*), void*) {
|
||||
std::function<int(STRING_VERIFY_RESPONSE*)>) {
|
||||
return true;
|
||||
}
|
||||
void C_4JInput::CancelQueuedVerifyStrings(int (*)(void*,
|
||||
STRING_VERIFY_RESPONSE*),
|
||||
void*) {}
|
||||
void C_4JInput::CancelQueuedVerifyStrings(
|
||||
std::function<int(STRING_VERIFY_RESPONSE*)>) {}
|
||||
void C_4JInput::CancelAllVerifyInProgress() {}
|
||||
|
||||
// Primary pad (moved from Profile)
|
||||
|
|
|
|||
|
|
@ -75,8 +75,8 @@ public:
|
|||
void SetJoypadStickTriggerMap(int iPad, unsigned int uiFrom,
|
||||
unsigned int uiTo);
|
||||
void SetKeyRepeatRate(float fRepeatDelaySecs, float fRepeatRateSecs);
|
||||
void SetDebugSequence(const char* chSequenceA, int (*Func)(void*),
|
||||
void* lpParam);
|
||||
void SetDebugSequence(const char* chSequenceA,
|
||||
std::function<int()> callback);
|
||||
float GetIdleSeconds(int iPad);
|
||||
bool IsPadConnected(int iPad);
|
||||
|
||||
|
|
@ -97,8 +97,7 @@ public:
|
|||
// live here. The remaining public API keeps the direct text/callback form.
|
||||
EKeyboardResult RequestKeyboard(const wchar_t* Title, const wchar_t* Text,
|
||||
int iPad, unsigned int uiMaxChars,
|
||||
int (*Func)(void*, const bool),
|
||||
void* lpParam,
|
||||
std::function<int(bool)> callback,
|
||||
C_4JInput::EKeyboardMode eMode);
|
||||
bool GetMenuDisplayed(int);
|
||||
const char* GetText();
|
||||
|
|
@ -127,10 +126,9 @@ public:
|
|||
//
|
||||
// Intent Protect players from inappropriate language.
|
||||
bool VerifyStrings(wchar_t** pwStringA, int iStringC,
|
||||
int (*Func)(void*, STRING_VERIFY_RESPONSE*),
|
||||
void* lpParam);
|
||||
void CancelQueuedVerifyStrings(int (*Func)(void*, STRING_VERIFY_RESPONSE*),
|
||||
void* lpParam);
|
||||
std::function<int(STRING_VERIFY_RESPONSE*)> callback);
|
||||
void CancelQueuedVerifyStrings(
|
||||
std::function<int(STRING_VERIFY_RESPONSE*)> callback);
|
||||
void CancelAllVerifyInProgress(void);
|
||||
|
||||
int GetMouseX();
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
#include <cstdio>
|
||||
#include <cstring>
|
||||
#include <functional>
|
||||
|
||||
#include "../ProfileConstants.h"
|
||||
#include "../sdl2/Input.h"
|
||||
|
|
@ -49,9 +50,8 @@ C_4JProfile::PROFILESETTINGS s_dashboardSettings[XUSER_MAX_COUNT] = {};
|
|||
char s_gamertags[XUSER_MAX_COUNT][16] = {};
|
||||
std::wstring s_displayNames[XUSER_MAX_COUNT];
|
||||
int s_lockedProfile = 0;
|
||||
int (*s_defaultOptionsCallback)(void*, C_4JProfile::PROFILESETTINGS*,
|
||||
const int iPad) = nullptr;
|
||||
void* s_defaultOptionsCallbackParam = nullptr;
|
||||
std::function<int(C_4JProfile::PROFILESETTINGS*, int)>
|
||||
s_defaultOptionsCallback;
|
||||
|
||||
bool isValidPad(int iPad) { return iPad >= 0 && iPad < XUSER_MAX_COUNT; }
|
||||
|
||||
|
|
@ -160,11 +160,9 @@ std::wstring C_4JProfile::GetDisplayName(int iPad) {
|
|||
return s_displayNames[p];
|
||||
}
|
||||
|
||||
int C_4JProfile::SetDefaultOptionsCallback(int (*Func)(void*, PROFILESETTINGS*,
|
||||
const int iPad),
|
||||
void* lpParam) {
|
||||
s_defaultOptionsCallback = Func;
|
||||
s_defaultOptionsCallbackParam = lpParam;
|
||||
int C_4JProfile::SetDefaultOptionsCallback(
|
||||
std::function<int(PROFILESETTINGS*, int)> callback) {
|
||||
s_defaultOptionsCallback = std::move(callback);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
#include <functional>
|
||||
#include <string>
|
||||
|
||||
#include "../PlatformTypes.h"
|
||||
|
|
@ -58,9 +59,8 @@ public:
|
|||
bool* pbContentRestricted, int* piAge);
|
||||
char* GetGamertag(int iPad);
|
||||
std::wstring GetDisplayName(int iPad);
|
||||
int SetDefaultOptionsCallback(int (*Func)(void*, PROFILESETTINGS*,
|
||||
const int iPad),
|
||||
void* lpParam);
|
||||
int SetDefaultOptionsCallback(
|
||||
std::function<int(PROFILESETTINGS*, int)> callback);
|
||||
PROFILESETTINGS* GetDashboardProfileSettings(int iPad);
|
||||
void* GetGameDefinedProfileData(int iQuadrant);
|
||||
void AllowedPlayerCreatedContent(int iPad, bool thisQuadrantOnly,
|
||||
|
|
@ -72,37 +72,34 @@ public:
|
|||
|
||||
void Tick() {}
|
||||
unsigned int RequestSignInUI(bool, bool, bool, bool, bool,
|
||||
int (*)(void*, const bool, const int), void*,
|
||||
std::function<int(bool, int)>,
|
||||
int = XUSER_INDEX_ANY) {
|
||||
return 0;
|
||||
}
|
||||
unsigned int DisplayOfflineProfile(int (*)(void*, const bool, const int),
|
||||
void*, int = XUSER_INDEX_ANY) {
|
||||
unsigned int DisplayOfflineProfile(std::function<int(bool, int)>,
|
||||
int = XUSER_INDEX_ANY) {
|
||||
return 0;
|
||||
}
|
||||
unsigned int RequestConvertOfflineToGuestUI(int (*)(void*, const bool,
|
||||
const int),
|
||||
void*, int = XUSER_INDEX_ANY) {
|
||||
unsigned int RequestConvertOfflineToGuestUI(std::function<int(bool, int)>,
|
||||
int = XUSER_INDEX_ANY) {
|
||||
return 0;
|
||||
}
|
||||
void SetPrimaryPlayerChanged(bool) {}
|
||||
void ShowProfileCard(int, PlayerUID) {}
|
||||
bool GetProfileAvatar(int, int (*)(void*, std::uint8_t*, unsigned int),
|
||||
void*) {
|
||||
bool GetProfileAvatar(int, std::function<int(std::uint8_t*, unsigned int)>) {
|
||||
return false;
|
||||
}
|
||||
void CancelProfileAvatarRequest() {}
|
||||
void SetSignInChangeCallback(void (*)(void*, bool, unsigned int), void*) {}
|
||||
void SetNotificationsCallback(void (*)(void*, std::uint32_t, unsigned int),
|
||||
void*) {}
|
||||
void SetSignInChangeCallback(std::function<void(bool, unsigned int)>) {}
|
||||
void SetNotificationsCallback(
|
||||
std::function<void(std::uint32_t, unsigned int)>) {}
|
||||
bool RegionIsNorthAmerica() { return false; }
|
||||
bool LocaleIsUSorCanada() { return false; }
|
||||
int GetLiveConnectionStatus() { return 0; }
|
||||
bool IsSystemUIDisplayed() { return false; }
|
||||
void SetProfileReadErrorCallback(void (*)(void*), void*) {}
|
||||
int SetOldProfileVersionCallback(int (*)(void*, unsigned char*,
|
||||
const unsigned short, const int),
|
||||
void*) {
|
||||
void SetProfileReadErrorCallback(std::function<void()>) {}
|
||||
int SetOldProfileVersionCallback(
|
||||
std::function<int(unsigned char*, unsigned short, int)>) {
|
||||
return 0;
|
||||
}
|
||||
void WriteToProfile(int, bool = false, bool = false) {}
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ void C4JStorage::Tick(void) {}
|
|||
C4JStorage::EMessageResult C4JStorage::RequestMessageBox(
|
||||
unsigned int uiTitle, unsigned int uiText, unsigned int* uiOptionA,
|
||||
unsigned int uiOptionC, unsigned int pad,
|
||||
int (*Func)(void*, int, const C4JStorage::EMessageResult), void* lpParam,
|
||||
std::function<int(int, const C4JStorage::EMessageResult)> callback,
|
||||
C4JStringTable* pStringTable, wchar_t* pwchFormatString,
|
||||
unsigned int focusButton) {
|
||||
return EMessage_ResultAccept;
|
||||
|
|
@ -28,7 +28,7 @@ C4JStorage::EMessageResult C4JStorage::GetMessageBoxResult() {
|
|||
return EMessage_Undefined;
|
||||
}
|
||||
|
||||
bool C4JStorage::SetSaveDevice(int (*Func)(void*, const bool), void* lpParam,
|
||||
bool C4JStorage::SetSaveDevice(std::function<int(const bool)> callback,
|
||||
bool bForceResetOfSaveDevice) {
|
||||
return true;
|
||||
}
|
||||
|
|
@ -36,8 +36,8 @@ bool C4JStorage::SetSaveDevice(int (*Func)(void*, const bool), void* lpParam,
|
|||
void C4JStorage::Init(unsigned int uiSaveVersion,
|
||||
const wchar_t* pwchDefaultSaveName, char* pszSavePackName,
|
||||
int iMinimumSaveSize,
|
||||
int (*Func)(void*, const ESavingMessage, int),
|
||||
void* lpParam, const char* szGroupID) {}
|
||||
std::function<int(const ESavingMessage, int)> callback,
|
||||
const char* szGroupID) {}
|
||||
void C4JStorage::ResetSaveData() {}
|
||||
void C4JStorage::SetDefaultSaveNameForKeyboardDisplay(
|
||||
const wchar_t* pwchDefaultSaveName) {}
|
||||
|
|
@ -52,7 +52,7 @@ bool C4JStorage::GetSaveUniqueFilename(char* pszName) {
|
|||
}
|
||||
void C4JStorage::SetSaveUniqueFilename(char* szFilename) {}
|
||||
void C4JStorage::SetState(ESaveGameControlState eControlState,
|
||||
int (*Func)(void*, const bool), void* lpParam) {}
|
||||
std::function<int(const bool)> callback) {}
|
||||
void C4JStorage::SetSaveDisabled(bool bDisable) {}
|
||||
bool C4JStorage::GetSaveDisabled(void) { return false; }
|
||||
unsigned int C4JStorage::GetSaveSize() { return 0; }
|
||||
|
|
@ -67,16 +67,14 @@ void C4JStorage::SetSaveImages(std::uint8_t* pbThumbnail,
|
|||
std::uint8_t* pbImage, unsigned int imageBytes,
|
||||
std::uint8_t* pbTextData,
|
||||
unsigned int textDataBytes) {}
|
||||
C4JStorage::ESaveGameState C4JStorage::SaveSaveData(int (*Func)(void*,
|
||||
const bool),
|
||||
void* lpParam) {
|
||||
C4JStorage::ESaveGameState C4JStorage::SaveSaveData(
|
||||
std::function<int(const bool)> callback) {
|
||||
return ESaveGame_Idle;
|
||||
}
|
||||
void C4JStorage::CopySaveDataToNewSave(std::uint8_t* pbThumbnail,
|
||||
unsigned int cbThumbnail,
|
||||
wchar_t* wchNewName,
|
||||
int (*Func)(void* lpParam, bool),
|
||||
void* lpParam) {}
|
||||
std::function<int(bool)> callback) {}
|
||||
void C4JStorage::SetSaveDeviceSelected(unsigned int uiPad, bool bSelected) {}
|
||||
bool C4JStorage::GetSaveDeviceSelected(unsigned int iPad) { return true; }
|
||||
C4JStorage::ESaveGameState C4JStorage::DoesSaveExist(bool* pbExists) {
|
||||
|
|
@ -87,17 +85,17 @@ bool C4JStorage::EnoughSpaceForAMinSaveGame() { return true; }
|
|||
void C4JStorage::SetSaveMessageVPosition(float fY) {}
|
||||
C4JStorage::ESaveGameState C4JStorage::GetSavesInfo(
|
||||
int iPad,
|
||||
int (*Func)(void* lpParam, SAVE_DETAILS* pSaveDetails, const bool),
|
||||
void* lpParam, char* pszSavePackName) {
|
||||
std::function<int(SAVE_DETAILS* pSaveDetails, const bool)> callback,
|
||||
char* pszSavePackName) {
|
||||
return ESaveGame_Idle;
|
||||
}
|
||||
PSAVE_DETAILS C4JStorage::ReturnSavesInfo() { return nullptr; }
|
||||
void C4JStorage::ClearSavesInfo() {}
|
||||
C4JStorage::ESaveGameState C4JStorage::LoadSaveDataThumbnail(
|
||||
PSAVE_INFO pSaveInfo,
|
||||
int (*Func)(void* lpParam, std::uint8_t* thumbnailData,
|
||||
unsigned int thumbnailBytes),
|
||||
void* lpParam) {
|
||||
std::function<int(std::uint8_t* thumbnailData,
|
||||
unsigned int thumbnailBytes)>
|
||||
callback) {
|
||||
return ESaveGame_Idle;
|
||||
}
|
||||
void C4JStorage::GetSaveCacheFileInfo(unsigned int fileIndex,
|
||||
|
|
@ -111,22 +109,20 @@ void C4JStorage::GetSaveCacheFileInfo(unsigned int fileIndex,
|
|||
if (pImageBytes) *pImageBytes = 0;
|
||||
}
|
||||
C4JStorage::ESaveGameState C4JStorage::LoadSaveData(
|
||||
PSAVE_INFO pSaveInfo, int (*Func)(void* lpParam, const bool, const bool),
|
||||
void* lpParam) {
|
||||
PSAVE_INFO pSaveInfo,
|
||||
std::function<int(const bool, const bool)> callback) {
|
||||
return ESaveGame_Idle;
|
||||
}
|
||||
C4JStorage::ESaveGameState C4JStorage::DeleteSaveData(PSAVE_INFO pSaveInfo,
|
||||
int (*Func)(void* lpParam,
|
||||
const bool),
|
||||
void* lpParam) {
|
||||
C4JStorage::ESaveGameState C4JStorage::DeleteSaveData(
|
||||
PSAVE_INFO pSaveInfo,
|
||||
std::function<int(const bool)> callback) {
|
||||
return ESaveGame_Idle;
|
||||
}
|
||||
void C4JStorage::RegisterMarketplaceCountsCallback(
|
||||
int (*Func)(void* lpParam, C4JStorage::DLC_TMS_DETAILS*, int),
|
||||
void* lpParam) {}
|
||||
std::function<int(C4JStorage::DLC_TMS_DETAILS*, int)> callback) {}
|
||||
void C4JStorage::SetDLCPackageRoot(char* pszDLCRoot) {}
|
||||
C4JStorage::EDLCStatus C4JStorage::GetDLCOffers(
|
||||
int iPad, int (*Func)(void*, int, std::uint32_t, int), void* lpParam,
|
||||
int iPad, std::function<int(int, std::uint32_t, int)> callback,
|
||||
std::uint32_t dwOfferTypesBitmask) {
|
||||
return EDLC_NoOffers;
|
||||
}
|
||||
|
|
@ -137,16 +133,15 @@ XMARKETPLACE_CONTENTOFFER_INFO& C4JStorage::GetOffer(unsigned int dw) {
|
|||
}
|
||||
int C4JStorage::GetOfferCount() { return 0; }
|
||||
unsigned int C4JStorage::InstallOffer(int iOfferIDC, std::uint64_t* ullOfferIDA,
|
||||
int (*Func)(void*, int, int),
|
||||
void* lpParam, bool bTrial) {
|
||||
std::function<int(int, int)> callback,
|
||||
bool bTrial) {
|
||||
return 0;
|
||||
}
|
||||
unsigned int C4JStorage::GetAvailableDLCCount(int iPad) { return 0; }
|
||||
C4JStorage::EDLCStatus C4JStorage::GetInstalledDLC(int iPad,
|
||||
int (*Func)(void*, int, int),
|
||||
void* lpParam) {
|
||||
if (Func) {
|
||||
Func(lpParam, 0, iPad);
|
||||
C4JStorage::EDLCStatus C4JStorage::GetInstalledDLC(
|
||||
int iPad, std::function<int(int, int)> callback) {
|
||||
if (callback) {
|
||||
callback(0, iPad);
|
||||
}
|
||||
return EDLC_NoInstalledDLC;
|
||||
}
|
||||
|
|
@ -155,7 +150,7 @@ XCONTENT_DATA& C4JStorage::GetDLC(unsigned int dw) {
|
|||
}
|
||||
std::uint32_t C4JStorage::MountInstalledDLC(
|
||||
int iPad, std::uint32_t dwDLC,
|
||||
int (*Func)(void*, int, std::uint32_t, std::uint32_t), void* lpParam,
|
||||
std::function<int(int, std::uint32_t, std::uint32_t)> callback,
|
||||
const char* szMountDrive) {
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -171,7 +166,7 @@ C4JStorage::ETMSStatus C4JStorage::ReadTMSFile(
|
|||
int iQuadrant, eGlobalStorage eStorageFacility,
|
||||
C4JStorage::eTMS_FileType eFileType, wchar_t* pwchFilename,
|
||||
std::uint8_t** ppBuffer, unsigned int* pBufferSize,
|
||||
int (*Func)(void*, wchar_t*, int, bool, int), void* lpParam, int iAction) {
|
||||
std::function<int(wchar_t*, int, bool, int)> callback, int iAction) {
|
||||
return ETMSStatus_Fail;
|
||||
}
|
||||
bool C4JStorage::WriteTMSFile(int iQuadrant, eGlobalStorage eStorageFacility,
|
||||
|
|
@ -187,7 +182,7 @@ void C4JStorage::StoreTMSPathName(wchar_t* pwchName) {}
|
|||
C4JStorage::ETMSStatus C4JStorage::TMSPP_ReadFile(
|
||||
int iPad, C4JStorage::eGlobalStorage eStorageFacility,
|
||||
C4JStorage::eTMS_FILETYPEVAL eFileTypeVal, const char* szFilename,
|
||||
int (*Func)(void*, int, int, PTMSPP_FILEDATA, const char*), void* lpParam,
|
||||
std::function<int(int, int, PTMSPP_FILEDATA, const char*)> callback,
|
||||
int iUserData) {
|
||||
return ETMSStatus_Fail;
|
||||
}
|
||||
|
|
@ -220,8 +215,8 @@ void C4JStorage::UpdateSubfile(int index, void* data, unsigned int size) {
|
|||
(void)data;
|
||||
(void)size;
|
||||
}
|
||||
void C4JStorage::SaveSubfiles(int (*Func)(void*, const bool), void* param) {
|
||||
if (Func) Func(param, true);
|
||||
void C4JStorage::SaveSubfiles(std::function<int(const bool)> callback) {
|
||||
if (callback) callback(true);
|
||||
}
|
||||
C4JStorage::ESaveGameState C4JStorage::GetSaveState() { return ESaveGame_Idle; }
|
||||
void C4JStorage::ContinueIncompleteOperation() {}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
#include <cstdint>
|
||||
#include <ctime>
|
||||
#include <functional>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
// #include <xtms.h>
|
||||
|
|
@ -111,20 +112,21 @@ public:
|
|||
C4JStorage::EMessageResult RequestMessageBox(
|
||||
unsigned int uiTitle, unsigned int uiText, unsigned int* uiOptionA,
|
||||
unsigned int uiOptionC, unsigned int pad = XUSER_INDEX_ANY,
|
||||
int (*Func)(void*, int, const C4JStorage::EMessageResult) = nullptr,
|
||||
void* lpParam = nullptr, C4JStringTable* pStringTable = nullptr,
|
||||
std::function<int(int, const C4JStorage::EMessageResult)> callback =
|
||||
nullptr,
|
||||
C4JStringTable* pStringTable = nullptr,
|
||||
wchar_t* pwchFormatString = nullptr, unsigned int focusButton = 0);
|
||||
|
||||
C4JStorage::EMessageResult GetMessageBoxResult();
|
||||
|
||||
// save device
|
||||
bool SetSaveDevice(int (*Func)(void*, const bool), void* lpParam,
|
||||
bool SetSaveDevice(std::function<int(const bool)> callback,
|
||||
bool bForceResetOfSaveDevice = false);
|
||||
|
||||
// savegame
|
||||
void Init(unsigned int uiSaveVersion, const wchar_t* pwchDefaultSaveName,
|
||||
char* pszSavePackName, int iMinimumSaveSize,
|
||||
int (*Func)(void*, const ESavingMessage, int), void* lpParam,
|
||||
std::function<int(const ESavingMessage, int)> callback,
|
||||
const char* szGroupID);
|
||||
void ResetSaveData(); // Call before a new save to clear out stored save
|
||||
// file name
|
||||
|
|
@ -135,7 +137,7 @@ public:
|
|||
bool GetSaveUniqueFilename(char* pszName);
|
||||
void SetSaveUniqueFilename(char* szFilename);
|
||||
void SetState(ESaveGameControlState eControlState,
|
||||
int (*Func)(void*, const bool), void* lpParam);
|
||||
std::function<int(const bool)> callback);
|
||||
void SetSaveDisabled(bool bDisable);
|
||||
bool GetSaveDisabled(void);
|
||||
unsigned int GetSaveSize();
|
||||
|
|
@ -148,11 +150,11 @@ public:
|
|||
unsigned int textDataBytes); // Sets the thumbnail & image for the
|
||||
// save, optionally setting the
|
||||
// metadata in the png
|
||||
C4JStorage::ESaveGameState SaveSaveData(int (*Func)(void*, const bool),
|
||||
void* lpParam);
|
||||
C4JStorage::ESaveGameState SaveSaveData(
|
||||
std::function<int(const bool)> callback);
|
||||
void CopySaveDataToNewSave(std::uint8_t* pbThumbnail,
|
||||
unsigned int cbThumbnail, wchar_t* wchNewName,
|
||||
int (*Func)(void* lpParam, bool), void* lpParam);
|
||||
std::function<int(bool)> callback);
|
||||
void SetSaveDeviceSelected(unsigned int uiPad, bool bSelected);
|
||||
bool GetSaveDeviceSelected(unsigned int iPad);
|
||||
C4JStorage::ESaveGameState DoesSaveExist(bool* pbExists);
|
||||
|
|
@ -164,16 +166,16 @@ public:
|
|||
// Get the info for the saves
|
||||
C4JStorage::ESaveGameState GetSavesInfo(
|
||||
int iPad,
|
||||
int (*Func)(void* lpParam, SAVE_DETAILS* pSaveDetails, const bool),
|
||||
void* lpParam, char* pszSavePackName);
|
||||
std::function<int(SAVE_DETAILS* pSaveDetails, const bool)> callback,
|
||||
char* pszSavePackName);
|
||||
PSAVE_DETAILS ReturnSavesInfo();
|
||||
void ClearSavesInfo(); // Clears results
|
||||
C4JStorage::ESaveGameState LoadSaveDataThumbnail(
|
||||
PSAVE_INFO pSaveInfo,
|
||||
int (*Func)(void* lpParam, std::uint8_t* thumbnailData,
|
||||
unsigned int thumbnailBytes),
|
||||
void* lpParam); // Get the thumbnail for an individual save referenced
|
||||
// by pSaveInfo
|
||||
std::function<int(std::uint8_t* thumbnailData,
|
||||
unsigned int thumbnailBytes)>
|
||||
callback); // Get the thumbnail for an individual save referenced
|
||||
// by pSaveInfo
|
||||
|
||||
void GetSaveCacheFileInfo(unsigned int fileIndex,
|
||||
XCONTENT_DATA& xContentData);
|
||||
|
|
@ -182,41 +184,36 @@ public:
|
|||
unsigned int* pImageBytes);
|
||||
|
||||
// Load the save. Need to call GetSaveData once the callback is called
|
||||
C4JStorage::ESaveGameState LoadSaveData(PSAVE_INFO pSaveInfo,
|
||||
int (*Func)(void* lpParam,
|
||||
const bool, const bool),
|
||||
void* lpParam);
|
||||
C4JStorage::ESaveGameState DeleteSaveData(PSAVE_INFO pSaveInfo,
|
||||
int (*Func)(void* lpParam,
|
||||
const bool),
|
||||
void* lpParam);
|
||||
C4JStorage::ESaveGameState LoadSaveData(
|
||||
PSAVE_INFO pSaveInfo,
|
||||
std::function<int(const bool, const bool)> callback);
|
||||
C4JStorage::ESaveGameState DeleteSaveData(
|
||||
PSAVE_INFO pSaveInfo,
|
||||
std::function<int(const bool)> callback);
|
||||
|
||||
// DLC
|
||||
void RegisterMarketplaceCountsCallback(
|
||||
int (*Func)(void* lpParam, C4JStorage::DLC_TMS_DETAILS*, int),
|
||||
void* lpParam);
|
||||
std::function<int(C4JStorage::DLC_TMS_DETAILS*, int)> callback);
|
||||
void SetDLCPackageRoot(char* pszDLCRoot);
|
||||
C4JStorage::EDLCStatus GetDLCOffers(
|
||||
int iPad, int (*Func)(void*, int, std::uint32_t, int), void* lpParam,
|
||||
int iPad, std::function<int(int, std::uint32_t, int)> callback,
|
||||
std::uint32_t dwOfferTypesBitmask = XMARKETPLACE_OFFERING_TYPE_CONTENT);
|
||||
unsigned int CancelGetDLCOffers();
|
||||
void ClearDLCOffers();
|
||||
XMARKETPLACE_CONTENTOFFER_INFO& GetOffer(unsigned int dw);
|
||||
int GetOfferCount();
|
||||
unsigned int InstallOffer(int iOfferIDC, std::uint64_t* ullOfferIDA,
|
||||
int (*Func)(void*, int, int), void* lpParam,
|
||||
std::function<int(int, int)> callback,
|
||||
bool bTrial = false);
|
||||
unsigned int GetAvailableDLCCount(int iPad);
|
||||
|
||||
C4JStorage::EDLCStatus GetInstalledDLC(int iPad,
|
||||
int (*Func)(void*, int, int),
|
||||
void* lpParam);
|
||||
C4JStorage::EDLCStatus GetInstalledDLC(
|
||||
int iPad, std::function<int(int, int)> callback);
|
||||
XCONTENT_DATA& GetDLC(unsigned int dw);
|
||||
std::uint32_t MountInstalledDLC(int iPad, std::uint32_t dwDLC,
|
||||
int (*Func)(void*, int, std::uint32_t,
|
||||
std::uint32_t),
|
||||
void* lpParam,
|
||||
const char* szMountDrive = nullptr);
|
||||
std::uint32_t MountInstalledDLC(
|
||||
int iPad, std::uint32_t dwDLC,
|
||||
std::function<int(int, std::uint32_t, std::uint32_t)> callback,
|
||||
const char* szMountDrive = nullptr);
|
||||
unsigned int UnmountInstalledDLC(const char* szMountDrive = nullptr);
|
||||
void GetMountedDLCFileList(const char* szMountDrive,
|
||||
std::vector<std::string>& fileList);
|
||||
|
|
@ -227,8 +224,8 @@ public:
|
|||
int iQuadrant, eGlobalStorage eStorageFacility,
|
||||
C4JStorage::eTMS_FileType eFileType, wchar_t* pwchFilename,
|
||||
std::uint8_t** ppBuffer, unsigned int* pBufferSize,
|
||||
int (*Func)(void*, wchar_t*, int, bool, int) = nullptr,
|
||||
void* lpParam = nullptr, int iAction = 0);
|
||||
std::function<int(wchar_t*, int, bool, int)> callback = nullptr,
|
||||
int iAction = 0);
|
||||
bool WriteTMSFile(int iQuadrant, eGlobalStorage eStorageFacility,
|
||||
wchar_t* pwchFilename, std::uint8_t* pBuffer,
|
||||
unsigned int bufferSize);
|
||||
|
|
@ -250,8 +247,9 @@ public:
|
|||
C4JStorage::ETMSStatus TMSPP_ReadFile(
|
||||
int iPad, C4JStorage::eGlobalStorage eStorageFacility,
|
||||
C4JStorage::eTMS_FILETYPEVAL eFileTypeVal, const char* szFilename,
|
||||
int (*Func)(void*, int, int, PTMSPP_FILEDATA, const char*) = nullptr,
|
||||
void* lpParam = nullptr, int iUserData = 0);
|
||||
std::function<int(int, int, PTMSPP_FILEDATA, const char*)> callback =
|
||||
nullptr,
|
||||
int iUserData = 0);
|
||||
// Older TMS++ list/delete helpers stayed platform-specific. The shared
|
||||
// surface keeps the read path plus CRC/subfile helpers below.
|
||||
|
||||
|
|
@ -273,7 +271,7 @@ public:
|
|||
unsigned int* size);
|
||||
void ResetSubfiles();
|
||||
void UpdateSubfile(int index, void* data, unsigned int size);
|
||||
void SaveSubfiles(int (*Func)(void*, const bool), void* param);
|
||||
void SaveSubfiles(std::function<int(const bool)> callback);
|
||||
ESaveGameState GetSaveState();
|
||||
|
||||
void ContinueIncompleteOperation();
|
||||
|
|
|
|||
Loading…
Reference in a new issue