[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
@@ -461,8 +461,21 @@ dword_result_t XamUserContentRestrictionCheckAccess_entry(
|
||||
}
|
||||
DECLARE_XAM_EXPORT1(XamUserContentRestrictionCheckAccess, kUserProfiles, kStub);
|
||||
|
||||
dword_result_t XamUserIsOnlineEnabled_entry(dword_t user_index) { return 1; }
|
||||
DECLARE_XAM_EXPORT1(XamUserIsOnlineEnabled, kUserProfiles, kStub);
|
||||
dword_result_t XamUserIsOnlineEnabled_entry(dword_t user_index) {
|
||||
if (user_index >= XUserMaxUserCount) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!kernel_state()->xam_state()->IsUserSignedIn(user_index)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return kernel_state()
|
||||
->xam_state()
|
||||
->GetUserProfile(user_index)
|
||||
->IsLiveEnabled();
|
||||
}
|
||||
DECLARE_XAM_EXPORT1(XamUserIsOnlineEnabled, kUserProfiles, kImplemented);
|
||||
|
||||
dword_result_t XamUserGetMembershipTier_entry(dword_t user_index) {
|
||||
if (user_index >= XUserMaxUserCount) {
|
||||
@@ -473,9 +486,23 @@ dword_result_t XamUserGetMembershipTier_entry(dword_t user_index) {
|
||||
return X_ERROR_NO_SUCH_USER;
|
||||
}
|
||||
|
||||
return X_XAMACCOUNTINFO::AccountSubscriptionTier::kSubscriptionTierGold;
|
||||
return kernel_state()
|
||||
->xam_state()
|
||||
->GetUserProfile(user_index)
|
||||
->GetSubscriptionTier();
|
||||
}
|
||||
DECLARE_XAM_EXPORT1(XamUserGetMembershipTier, kUserProfiles, kStub);
|
||||
DECLARE_XAM_EXPORT1(XamUserGetMembershipTier, kUserProfiles, kImplemented);
|
||||
|
||||
dword_result_t XamUserGetMembershipTierFromXUID_entry(qword_t xuid) {
|
||||
const auto profile = kernel_state()->xam_state()->GetUserProfile(xuid);
|
||||
if (!profile) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return profile->GetSubscriptionTier();
|
||||
}
|
||||
DECLARE_XAM_EXPORT1(XamUserGetMembershipTierFromXUID, kUserProfiles,
|
||||
kImplemented);
|
||||
|
||||
dword_result_t XamUserAreUsersFriends_entry(dword_t user_index, dword_t unk1,
|
||||
dword_t unk2, lpdword_t out_value,
|
||||
@@ -868,15 +895,25 @@ dword_result_t XamUserIsUnsafeProgrammingAllowed_entry(dword_t user_index,
|
||||
DECLARE_XAM_EXPORT1(XamUserIsUnsafeProgrammingAllowed, kUserProfiles, kStub);
|
||||
|
||||
dword_result_t XamUserGetSubscriptionType_entry(dword_t user_index,
|
||||
dword_t unk2, dword_t unk3) {
|
||||
lpdword_t subscription_ptr,
|
||||
lpdword_t r5,
|
||||
dword_t overlapped_ptr) {
|
||||
if (user_index >= XUserMaxUserCount) {
|
||||
return X_ERROR_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
if (!unk2 || !unk3) {
|
||||
if (!subscription_ptr || !r5) {
|
||||
return X_E_INVALIDARG;
|
||||
}
|
||||
|
||||
auto user = kernel_state()->xam_state()->GetUserProfile(user_index);
|
||||
if (!user) {
|
||||
return X_ERROR_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
*subscription_ptr = user->GetSubscriptionTier();
|
||||
*r5 = 0x0;
|
||||
|
||||
return X_ERROR_SUCCESS;
|
||||
}
|
||||
DECLARE_XAM_EXPORT1(XamUserGetSubscriptionType, kUserProfiles, kStub);
|
||||
@@ -894,12 +931,11 @@ dword_result_t XamUserGetUserFlags_entry(dword_t user_index) {
|
||||
DECLARE_XAM_EXPORT1(XamUserGetUserFlags, kUserProfiles, kImplemented);
|
||||
|
||||
dword_result_t XamUserGetUserFlagsFromXUID_entry(qword_t xuid) {
|
||||
if (!kernel_state()->xam_state()->IsUserSignedIn(xuid)) {
|
||||
const auto& user_profile = kernel_state()->xam_state()->GetUserProfile(xuid);
|
||||
if (!user_profile) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
const auto& user_profile = kernel_state()->xam_state()->GetUserProfile(xuid);
|
||||
|
||||
return user_profile->GetCachedFlags();
|
||||
}
|
||||
DECLARE_XAM_EXPORT1(XamUserGetUserFlagsFromXUID, kUserProfiles, kImplemented);
|
||||
@@ -961,6 +997,45 @@ dword_result_t XamUserCreateStatsEnumerator_entry(
|
||||
}
|
||||
DECLARE_XAM_EXPORT1(XamUserCreateStatsEnumerator, kUserProfiles, kSketchy);
|
||||
|
||||
dword_result_t XamUserGetUserTenure_entry(dword_t user_index,
|
||||
lpdword_t tenure_level_ptr,
|
||||
lpdword_t milestone_ptr,
|
||||
lpqword_t milestone_date_ptr,
|
||||
dword_t overlap_ptr) {
|
||||
if (!kernel_state()->xam_state()->IsUserSignedIn(user_index)) {
|
||||
return X_E_INVALIDARG;
|
||||
}
|
||||
|
||||
const auto& user_profile =
|
||||
kernel_state()->xam_state()->GetUserProfile(user_index);
|
||||
|
||||
if (const auto setting =
|
||||
kernel_state()->xam_state()->user_tracker()->GetSetting(
|
||||
user_profile, kDashboardID,
|
||||
static_cast<uint32_t>(UserSettingId::XPROFILE_TENURE_LEVEL))) {
|
||||
*tenure_level_ptr = std::get<int32_t>(setting->get_host_data());
|
||||
}
|
||||
|
||||
if (const auto setting =
|
||||
kernel_state()->xam_state()->user_tracker()->GetSetting(
|
||||
user_profile, kDashboardID,
|
||||
static_cast<uint32_t>(
|
||||
UserSettingId::XPROFILE_TENURE_MILESTONE))) {
|
||||
*milestone_ptr = std::get<int32_t>(setting->get_host_data());
|
||||
}
|
||||
|
||||
if (const auto setting =
|
||||
kernel_state()->xam_state()->user_tracker()->GetSetting(
|
||||
user_profile, kDashboardID,
|
||||
static_cast<uint32_t>(
|
||||
UserSettingId::XPROFILE_TENURE_NEXT_MILESTONE_DATE))) {
|
||||
*milestone_date_ptr = std::get<int64_t>(setting->get_host_data());
|
||||
}
|
||||
|
||||
return X_ERROR_SUCCESS;
|
||||
}
|
||||
DECLARE_XAM_EXPORT1(XamUserGetUserTenure, kUserProfiles, kImplemented);
|
||||
|
||||
} // namespace xam
|
||||
} // namespace kernel
|
||||
} // namespace xe
|
||||
|
||||
Reference in New Issue
Block a user