[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:
Gliniak
2025-05-10 12:52:05 +02:00
committed by Radosław Gliński
parent 270e88a7a7
commit e601b5ab87
30 changed files with 2904 additions and 1404 deletions

View File

@@ -46,6 +46,14 @@ struct X_USER_PROFILE_SETTING {
};
static_assert_size(X_USER_PROFILE_SETTING, 40);
enum class X_USER_PROFILE_GAMERCARD_ZONE_OPTIONS {
GAMERCARD_ZONE_NONE,
GAMERCARD_ZONE_RR,
GAMERCARD_ZONE_PRO,
GAMERCARD_ZONE_FAMILY,
GAMERCARD_ZONE_UNDERGROUND
};
enum class XTileType {
kAchievement,
kGameIcon,
@@ -75,6 +83,9 @@ static const std::map<XTileType, std::string> kTileFileNames = {
{XTileType::kAvatarGamerTileSmall, "avtr_32.png"},
};
static constexpr std::pair<uint16_t, uint16_t> kProfileIconSize = {64, 64};
static constexpr std::pair<uint16_t, uint16_t> kProfileIconSizeSmall = {32, 32};
class UserProfile {
public:
UserProfile(uint64_t xuid, X_XAMACCOUNTINFO* account_info);
@@ -88,6 +99,7 @@ class UserProfile {
uint32_t GetSubscriptionTier() const {
return account_info_.GetSubscriptionTier();
}
bool IsLiveEnabled() const { return account_info_.IsLiveEnabled(); }
std::span<const uint8_t> GetProfileIcon(XTileType icon_type) {
// Overwrite same types?
@@ -132,6 +144,8 @@ class UserProfile {
void LoadProfileGpds();
void LoadProfileIcon(XTileType tile_type);
void WriteProfileIcon(XTileType tile_type,
std::span<const uint8_t> icon_data);
std::vector<uint8_t> LoadGpd(const uint32_t title_id);
bool WriteGpd(const uint32_t title_id);
};