[UI] Added modify profile UI
- Changed default icons size from 75x75 to 64x64 to match console icons size - Added png_utils - Removed all dialogs from xam_ui.cc into separate entities under xam/ui - Added option to return INT32 and WSTRING type settings to host - Added multiple enums related to user settings - Added code to handle changing user pfp - Fixed bug with system app being added to GPD played list - Changed logic in: XamUserGetUserFlagsFromXUID - Implemented: XamUserIsOnlineEnabled - Implemented: XamUserGetMembershipTier - Implemented: XamUserGetMembershipTierFromXUID - Implemented: XamUserGetUserTenure - Partially Implemented: XamUserGetSubscriptionType
This commit is contained in:
committed by
Radosław Gliński
parent
270e88a7a7
commit
e601b5ab87
@@ -93,7 +93,32 @@ void UserProfile::LoadProfileIcon(XTileType tile_type) {
|
||||
&written_bytes);
|
||||
file->Destroy();
|
||||
|
||||
profile_images_.insert({tile_type, data});
|
||||
profile_images_.insert_or_assign(tile_type, data);
|
||||
}
|
||||
|
||||
void UserProfile::WriteProfileIcon(XTileType tile_type,
|
||||
std::span<const uint8_t> icon_data) {
|
||||
const std::string path =
|
||||
fmt::format("User_{:016X}:\\{}", xuid_, kTileFileNames.at(tile_type));
|
||||
|
||||
vfs::File* file = nullptr;
|
||||
vfs::FileAction action;
|
||||
|
||||
const X_STATUS result = kernel_state()->file_system()->OpenFile(
|
||||
nullptr, path, vfs::FileDisposition::kOverwriteIf,
|
||||
vfs::FileAccess::kGenericAll, false, true, &file, &action);
|
||||
|
||||
if (result != X_STATUS_SUCCESS) {
|
||||
return;
|
||||
}
|
||||
|
||||
size_t written_bytes = 0;
|
||||
|
||||
file->WriteSync({icon_data.data(), icon_data.size()}, 0, &written_bytes);
|
||||
file->Destroy();
|
||||
|
||||
profile_images_.insert_or_assign(
|
||||
tile_type, std::vector<uint8_t>(icon_data.begin(), icon_data.end()));
|
||||
}
|
||||
|
||||
std::vector<uint8_t> UserProfile::LoadGpd(const uint32_t title_id) {
|
||||
|
||||
Reference in New Issue
Block a user