mirror of
https://github.com/4jcraft/4jcraft.git
synced 2026-08-20 08:17:16 +00:00
DWORD→uint32_t, BYTE→uint8_t, HRESULT→int32_t, HANDLE→void*, UINT→uint32_t, INT→int32_t, WORD→uint16_t, LONG→int32_t, SHORT→int16_t, LONGLONG→int64_t, ULONG_PTR→uintptr_t, PBYTE→uint8_t*, LPWSTR/PWSTR→wchar_t*, FLOAT→float, CHAR→char, boolean→bool, CONST→const, TRUE→true, FALSE→false across 176 files (excluding vendor libs and Linux stubs).
129 lines
5.4 KiB
C++
129 lines
5.4 KiB
C++
#pragma once
|
|
|
|
enum eAwardType
|
|
{
|
|
eAwardType_Achievement = 0,
|
|
eAwardType_GamerPic,
|
|
eAwardType_Theme,
|
|
eAwardType_AvatarItem,
|
|
};
|
|
|
|
enum eUpsellType
|
|
{
|
|
eUpsellType_Custom = 0, // This is the default, and means that the upsell dialog was initiated in the app code
|
|
eUpsellType_Achievement,
|
|
eUpsellType_GamerPic,
|
|
eUpsellType_Theme,
|
|
eUpsellType_AvatarItem,
|
|
};
|
|
|
|
enum eUpsellResponse
|
|
{
|
|
eUpsellResponse_Declined,
|
|
eUpsellResponse_Accepted_NoPurchase,
|
|
eUpsellResponse_Accepted_Purchase,
|
|
};
|
|
|
|
|
|
|
|
class C_4JProfile
|
|
{
|
|
public:
|
|
struct PROFILESETTINGS
|
|
{
|
|
int iYAxisInversion;
|
|
int iControllerSensitivity;
|
|
int iVibration;
|
|
bool bSwapSticks;
|
|
};
|
|
|
|
|
|
// 4 players have game defined data, puiGameDefinedDataChangedBitmask needs to be checked by the game side to see if there's an update needed - it'll have the bits set for players to be updated
|
|
void Initialise( uint32_t dwTitleID,
|
|
uint32_t dwOfferID,
|
|
unsigned short usProfileVersion,
|
|
uint32_t uiProfileValuesC,
|
|
uint32_t uiProfileSettingsC,
|
|
uint32_t *pdwProfileSettingsA,
|
|
int iGameDefinedDataSizeX4,
|
|
unsigned int *puiGameDefinedDataChangedBitmask);
|
|
void SetTrialTextStringTable(CXuiStringTable *pStringTable,int iAccept,int iReject);
|
|
void SetTrialAwardText(eAwardType AwardType,int iTitle,int iText); // achievement popup in the trial game
|
|
int GetLockedProfile();
|
|
void SetLockedProfile(int iProf);
|
|
bool IsSignedIn(int iQuadrant);
|
|
bool IsSignedInLive(int iProf);
|
|
bool IsGuest(int iQuadrant);
|
|
uint32_t RequestSignInUI(bool bFromInvite,bool bLocalGame,bool bNoGuestsAllowed,bool bMultiplayerSignIn,bool bAddUser, int( *Func)(void*,const bool, const int iPad),void* lpParam,int iQuadrant=XUSER_INDEX_ANY);
|
|
uint32_t DisplayOfflineProfile(int( *Func)(void*,const bool, const int iPad),void* lpParam,int iQuadrant=XUSER_INDEX_ANY);
|
|
uint32_t RequestConvertOfflineToGuestUI(int( *Func)(void*,const bool, const int iPad),void* lpParam,int iQuadrant=XUSER_INDEX_ANY);
|
|
void SetPrimaryPlayerChanged(bool bVal);
|
|
bool QuerySigninStatus(void);
|
|
void GetXUID(int iPad, PlayerUID *pXuid,bool bOnlineXuid);
|
|
bool AreXUIDSEqual(PlayerUID xuid1,PlayerUID xuid2);
|
|
bool XUIDIsGuest(PlayerUID xuid);
|
|
bool AllowedToPlayMultiplayer(int iProf);
|
|
bool GetChatAndContentRestrictions(int iPad,bool *pbChatRestricted,bool *pbContentRestricted,int *piAge);
|
|
void StartTrialGame(); // disables saves and leaderboard, and change state to readyforgame from pregame
|
|
void AllowedPlayerCreatedContent(int iPad, bool thisQuadrantOnly, bool *allAllowed, bool *friendsAllowed);
|
|
bool CanViewPlayerCreatedContent(int iPad, bool thisQuadrantOnly, PPlayerUID pXuids, uint32_t dwXuidCount );
|
|
void ShowProfileCard(int iPad, PlayerUID targetUid);
|
|
bool GetProfileAvatar(int iPad,int( *Func)(void* lpParam,uint8_t* pbThumbnail,uint32_t dwThumbnailBytes), void* lpParam);
|
|
void CancelProfileAvatarRequest();
|
|
|
|
|
|
// SYS
|
|
int GetPrimaryPad();
|
|
void SetPrimaryPad(int iPad);
|
|
char* GetGamertag(int iPad);
|
|
std::wstring GetDisplayName(int iPad);
|
|
bool IsFullVersion();
|
|
void SetSignInChangeCallback(void ( *Func)(void*, bool, unsigned int),void* lpParam);
|
|
void SetNotificationsCallback(void ( *Func)(void*, uint32_t, unsigned int),void* lpParam);
|
|
bool RegionIsNorthAmerica(void);
|
|
bool LocaleIsUSorCanada(void);
|
|
int32_t GetLiveConnectionStatus();
|
|
bool IsSystemUIDisplayed();
|
|
void SetProfileReadErrorCallback(void ( *Func)(void*), void* lpParam);
|
|
|
|
|
|
// PROFILE DATA
|
|
int SetDefaultOptionsCallback(int( *Func)(void*,PROFILESETTINGS *, const int iPad),void* lpParam);
|
|
int SetOldProfileVersionCallback(int( *Func)(void*,unsigned char *, const unsigned short,const int),void* lpParam);
|
|
PROFILESETTINGS * GetDashboardProfileSettings(int iPad);
|
|
void WriteToProfile(int iQuadrant, bool bGameDefinedDataChanged=false, bool bOverride5MinuteLimitOnProfileWrites=false);
|
|
void ForceQueuedProfileWrites(int iPad=XUSER_INDEX_ANY);
|
|
void *GetGameDefinedProfileData(int iQuadrant);
|
|
void ResetProfileProcessState(); // after a sign out from the primary player, call this
|
|
void Tick( void );
|
|
|
|
// ACHIEVEMENTS & AWARDS
|
|
|
|
void RegisterAward(int iAwardNumber,int iGamerconfigID, eAwardType eType, bool bLeaderboardAffected=false,
|
|
CXuiStringTable*pStringTable=nullptr, int iTitleStr=-1, int iTextStr=-1, int iAcceptStr=-1, char *pszThemeName=nullptr, unsigned int uiThemeSize=0L);
|
|
int GetAwardId(int iAwardNumber);
|
|
eAwardType GetAwardType(int iAwardNumber);
|
|
bool CanBeAwarded(int iQuadrant, int iAwardNumber);
|
|
void Award(int iQuadrant, int iAwardNumber, bool bForce=false);
|
|
bool IsAwardsFlagSet(int iQuadrant, int iAward);
|
|
|
|
// RICH PRESENCE
|
|
|
|
void RichPresenceInit(int iPresenceCount, int iContextCount);
|
|
void RegisterRichPresenceContext(int iGameConfigContextID);
|
|
void SetRichPresenceContextValue(int iPad,int iContextID, int iVal);
|
|
void SetCurrentGameActivity(int iPad,int iNewPresence, bool bSetOthersToIdle=false);
|
|
|
|
// PURCHASE
|
|
void DisplayFullVersionPurchase(bool bRequired, int iQuadrant, int iUpsellParam = -1);
|
|
void SetUpsellCallback(void ( *Func)(void* lpParam, eUpsellType type, eUpsellResponse response, int iUserData),void* lpParam);
|
|
|
|
// Debug
|
|
void SetDebugFullOverride(bool bVal); // To override the license version (trail/full). Only in debug/release, not ContentPackage
|
|
|
|
};
|
|
|
|
// Singleton
|
|
extern C_4JProfile ProfileManager;
|
|
|