Emergency push.

This commit is contained in:
J-D-K
2025-01-31 19:45:44 -05:00
parent e894b39c63
commit 88e66992ed
47 changed files with 1669 additions and 300 deletions

View File

@@ -4,7 +4,7 @@
#include "data/data.hpp"
#include "logger.hpp"
#include "sdl.hpp"
#include "stringUtil.hpp"
#include "stringutil.hpp"
#include <algorithm>
#include <cstring>
@@ -102,9 +102,15 @@ data::User::User(AccountUid accountID, FsSaveDataType saveType) : m_accountID(ac
accountProfileClose(&profile);
}
data::User::User(AccountUid accountID, std::string_view pathSafeNickname, std::string_view iconPath, FsSaveDataType saveType)
data::User::User(AccountUid accountID,
std::string_view nickname,
std::string_view pathSafeNickname,
std::string_view iconPath,
FsSaveDataType saveType)
: m_accountID(accountID), m_saveType(saveType), m_icon(sdl::TextureManager::createLoadTexture(pathSafeNickname, iconPath.data()))
{
// We're just gonna use this for both.
std::memcpy(m_nickname, nickname.data(), nickname.length());
std::memcpy(m_pathSafeNickname, pathSafeNickname.data(), pathSafeNickname.length());
}
@@ -115,6 +121,11 @@ void data::User::addData(const FsSaveDataInfo &saveInfo, const PdmPlayStatistics
m_userData.push_back(std::make_pair(applicationID, std::make_pair(saveInfo, playStats)));
}
void data::User::eraseData(int index)
{
m_userData.erase(m_userData.begin() + index);
}
void data::User::sortData(void)
{
std::sort(m_userData.begin(), m_userData.end(), sortUserData);