userachievementmanager - TogetherGames/Public-Corona-Lua GitHub Wiki
together.UserAchievementManager
The UserAchievementManager is used for fetching and finding achievements that exist for the current user.
table UserAchievements
Stores all the UserAchievements contained in the Manager.
Adds a UserAchievement to the internally managed list without persistence.
Note
This method is deprecated
Returns void
UserAchievementManager:Add( userAchievement )
TogetherUserAchievement userAchievement
Instance of a UserAchievement to add internally
--------------------------------------------------------------------------------Finds the UserAchievement with the specified UserAchievementID if it exists, otherwise returns nil.
Returns TogetherUserAchievement
UserAchievementManager:FindByUserAchievementID( userAchievementID )
number userAchievementID
The ID of the UserAchievement to find
--------------------------------------------------------------------------------Finds the UserAchievement with the specified AchievementID if it exists, otherwise returns nil.
Returns TogetherUserAchievement
UserAchievementManager:FindByAchievementID( achievementID )
number achievementID
The ID of the Achievement to find
--------------------------------------------------------------------------------Gets the number of UserAchievements currently managed internally.
Returns number
UserAchievementManager:GetCount( )
Gets the UserAchievement at the specified index if it exists, otherwise returns nil.
Returns TogetherUserAchievement
UserAchievementManager:Get( index )
number index
The index of the UserAchievement to find
--------------------------------------------------------------------------------Returns the index of the specified UserAchievement if it exists, otherwise returns nil.
Returns number
UserAchievementManager:IndexOf( userAchievement )
TogetherUserAchievement userAchievement
Instance of the UserAchievement to find the index of
--------------------------------------------------------------------------------Returns the index of the UserAchievement with the specified UserAchievementID if it exists, otherwise returns -1.
Returns number
UserAchievementManager:IndexOfByUserAchievementID( userAchievementID )
number userAchievementID
The ID of the UserAchievement to find the index of
--------------------------------------------------------------------------------Removes a UserAchievement from the internally managed list. This does not delete the user achievement from the session's account persistently.
Note
This method is deprecated
Returns void
UserAchievementManager:Remove( index )
number index
The index of the UserAchievement to be removed.
--------------------------------------------------------------------------------Awards a UserAchievement. Upon success, this will automatically update the internal list.
Returns void
UserAchievementManager:Award( achievementID, actionName, roomID, userAchievementProperties, notificationMessage, callbackFunc )
number achievementID
The ID of the Achievement to award.
[string](#) actionNameThe Action of the Achievements to award.
[number](#) roomIDThe ID of the Room the UserAchievement is being awarded in.
[PropertyCollection](./propertycollection) userAchievementPropertiesThe properties to assign to the UserAchievement. Pass in nil to assign no properties.
[string](#) notificationMessageThe notification message to send to the User. Pass in "" if no notification should be sent.
[function](#) callbackFuncThe function to call upon completion.
--------------------------------------------------------------------------------Deletes a UserAchievement. Upon success, this will automatically update the internal list.
Returns void
UserAchievementManager:Delete( userAchievementID, callbackFunc )
number userAchievementID
The ID of the UserAchievement to delete.
[function](#) callbackFuncThe function to call upon completion.
--------------------------------------------------------------------------------Gets all UserAchievements assigned to the User. Upon success, this will automatically update the internal list.
Returns void
UserAchievementManager:GetAll( callbackFunc )
function callbackFunc
The function to call upon completion.
--------------------------------------------------------------------------------Purchases a UserAchievement. Upon success, this will automatically update the internal list.
Note
This method is deprecated
Returns void
UserAchievementManager:Purchase( achievementID, roomID, userAchievementProperties, useGameUserProfileProperties, callbackFunc )
number achievementID
The ID of the Achievement to purchase.
[number](#) roomIDThe ID of the Room the UserAchievement is being purchased in.
[PropertyCollection](./propertycollection) userAchievementPropertiesThe properties to assign to the UserAchievement. Pass in nil to assign no properties.
[boolean](#) useGameUserProfilePropertiesThis has not effect, pass false.
[function](#) callbackFuncThe function to call upon completion.
--------------------------------------------------------------------------------Sells a UserAchievement. Upon success, this will automatically update the internal list.
Note
This method is deprecated
Returns void
UserAchievementManager:Sell( userAchievementID, callbackFunc )
number userAchievementID
The ID of the Achievement to sell.
[function](#) callbackFuncThe function to call upon completion.
--------------------------------------------------------------------------------