Steam
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | Properties | Events | List of all members
LapinerTools.Steam.UI.SteamLeaderboardsUI Class Reference

This class manages the uGUI of the Steam leaderboards UI. It registers to events of SteamLeaderboardsMain class, e.g. SteamLeaderboardsMain.OnDownloadedScores. You can replace this class with your own UI e.g. NGUI. In this case you need to take care of registering to events and calling methods of the SteamLeaderboardsMain class from your new implementation. More...

Inherits MonoBehaviour.

Public Member Functions

void InvokeOnEntryDataSet (LeaderboardsScoreEntry p_entryData, SteamLeaderboardsScoreEntryNode p_entryUI)
 Internal method triggering the SteamLeaderboardsUI.OnEntryDataSet event with exception handling. Required to ensure code execution even if your code throws exceptions. More...
 
void SetScores (List< LeaderboardsScoreEntry > p_scores)
 Call SetScores to refresh the leaderboard UI. Calling this method will remove all currently visible score entries and replace them with those passed in the p_scores argument. More...
 
void SetLeaderboardName (string p_leaderboardName)
 Call SetLeaderboardName to update the text of the uGUI Text object linked in the LEADERBOARD_NAME_TEXT inspector property. More...
 
void DownloadScores (string p_leaderboardName)
 The same as SteamLeaderboardsMain.DownloadScores with an additional loading popup. More...
 
void DownloadScoresAroundUser (string p_leaderboardName, int p_range)
 The same as SteamLeaderboardsMain.DownloadScoresAroundUser with an additional loading popup. More...
 

Static Public Member Functions

static void UploadScore (string p_leaderboardName, int p_score)
 The same as SteamLeaderboardsMain.UploadScore with an additional loading popup and a new record popup. More...
 
static void UploadScore (string p_leaderboardName, int p_score, System.Action< LeaderboardsUploadedScoreEventArgs > p_onUploadedScoreSuccessfully)
 The same as SteamLeaderboardsMain.UploadScore with an additional loading popup and new record popup. More...
 

Protected Member Functions

virtual void Start ()
 
virtual void Update ()
 
virtual void OnDestroy ()
 
virtual void ShowErrorMessage (ErrorEventArgs p_errorArgs)
 
virtual void SetScores (LeaderboardsDownloadedScoresEventArgs p_leaderboardArgs)
 
virtual uMyGUI_TreeBrowser.Node [] ConvertScoresToNodes (List< LeaderboardsScoreEntry > p_scores)
 This method will convert the gives Steam score entries to UI nodes, which can be passed to the item browser. More...
 
virtual void UpdateScrollbarVisibility ()
 
virtual void InvokeEventHandlerSafely< T > (System.Action< T > p_handler, T p_data)
 

Protected Attributes

Text LEADERBOARD_NAME_TEXT = null
 
Text LEADERBOARD_EMPTY_MESSAGE = null
 
uMyGUI_TreeBrowser SCORES_BROWSER = null
 

Static Protected Attributes

static SteamLeaderboardsUI s_instance
 

Properties

static SteamLeaderboardsUI Instance [get]
 You can use the static Instance property to access the SteamLeaderboardsUI class from wherever you need it in your code. Use this property only if you know that you have a static SteamLeaderboardsUI uGUI in your scene. If you use the SteamLeaderboardsPopup, then there is no guarantee that the SteamLeaderboardsUI was already created. More...
 

Events

System.Action< SteamLeaderboardsScoreEntryNode.EntryDataSetEventArgsOnEntryDataSet
 Invoked when the data of the LeaderboardListEntry prefab (SteamLeaderboardsScoreEntryNode class) is updated. You can use this event to initialize fields of your custom UI. For example, you could add a replay button to the LeaderboardListEntry prefab. Then you would search the replay uGUI button object and set the button callback when this event is triggered. More...
 

Detailed Description

This class manages the uGUI of the Steam leaderboards UI. It registers to events of SteamLeaderboardsMain class, e.g. SteamLeaderboardsMain.OnDownloadedScores. You can replace this class with your own UI e.g. NGUI. In this case you need to take care of registering to events and calling methods of the SteamLeaderboardsMain class from your new implementation.

Member Function Documentation

◆ ConvertScoresToNodes()

virtual uMyGUI_TreeBrowser.Node [] LapinerTools.Steam.UI.SteamLeaderboardsUI.ConvertScoresToNodes ( List< LeaderboardsScoreEntry p_scores)
protectedvirtual

This method will convert the gives Steam score entries to UI nodes, which can be passed to the item browser.

◆ DownloadScores()

void LapinerTools.Steam.UI.SteamLeaderboardsUI.DownloadScores ( string  p_leaderboardName)

The same as SteamLeaderboardsMain.DownloadScores with an additional loading popup.

Parameters
p_leaderboardNameleaderboard name.

◆ DownloadScoresAroundUser()

void LapinerTools.Steam.UI.SteamLeaderboardsUI.DownloadScoresAroundUser ( string  p_leaderboardName,
int  p_range 
)

The same as SteamLeaderboardsMain.DownloadScoresAroundUser with an additional loading popup.

Parameters
p_leaderboardNameleaderboard name.
p_rangerange around user's score.

◆ InvokeEventHandlerSafely< T >()

virtual void LapinerTools.Steam.UI.SteamLeaderboardsUI.InvokeEventHandlerSafely< T > ( System.Action< T >  p_handler,
p_data 
)
protectedvirtual

◆ InvokeOnEntryDataSet()

void LapinerTools.Steam.UI.SteamLeaderboardsUI.InvokeOnEntryDataSet ( LeaderboardsScoreEntry  p_entryData,
SteamLeaderboardsScoreEntryNode  p_entryUI 
)

Internal method triggering the SteamLeaderboardsUI.OnEntryDataSet event with exception handling. Required to ensure code execution even if your code throws exceptions.

◆ OnDestroy()

virtual void LapinerTools.Steam.UI.SteamLeaderboardsUI.OnDestroy ( )
protectedvirtual

◆ SetLeaderboardName()

void LapinerTools.Steam.UI.SteamLeaderboardsUI.SetLeaderboardName ( string  p_leaderboardName)

Call SetLeaderboardName to update the text of the uGUI Text object linked in the LEADERBOARD_NAME_TEXT inspector property.

◆ SetScores() [1/2]

void LapinerTools.Steam.UI.SteamLeaderboardsUI.SetScores ( List< LeaderboardsScoreEntry p_scores)

Call SetScores to refresh the leaderboard UI. Calling this method will remove all currently visible score entries and replace them with those passed in the p_scores argument.

Parameters
p_scoreslist of items to be visualized.

◆ SetScores() [2/2]

virtual void LapinerTools.Steam.UI.SteamLeaderboardsUI.SetScores ( LeaderboardsDownloadedScoresEventArgs  p_leaderboardArgs)
protectedvirtual

◆ ShowErrorMessage()

virtual void LapinerTools.Steam.UI.SteamLeaderboardsUI.ShowErrorMessage ( ErrorEventArgs  p_errorArgs)
protectedvirtual

◆ Start()

virtual void LapinerTools.Steam.UI.SteamLeaderboardsUI.Start ( )
protectedvirtual

◆ Update()

virtual void LapinerTools.Steam.UI.SteamLeaderboardsUI.Update ( )
protectedvirtual

◆ UpdateScrollbarVisibility()

virtual void LapinerTools.Steam.UI.SteamLeaderboardsUI.UpdateScrollbarVisibility ( )
protectedvirtual

◆ UploadScore() [1/2]

static void LapinerTools.Steam.UI.SteamLeaderboardsUI.UploadScore ( string  p_leaderboardName,
int  p_score 
)
static

The same as SteamLeaderboardsMain.UploadScore with an additional loading popup and a new record popup.

Parameters
p_leaderboardNameleaderboard name.
p_scoreplayer score.

◆ UploadScore() [2/2]

static void LapinerTools.Steam.UI.SteamLeaderboardsUI.UploadScore ( string  p_leaderboardName,
int  p_score,
System.Action< LeaderboardsUploadedScoreEventArgs p_onUploadedScoreSuccessfully 
)
static

The same as SteamLeaderboardsMain.UploadScore with an additional loading popup and new record popup.

Parameters
p_leaderboardNameleaderboard name.
p_scoreplayer score.
p_onUploadedScoreSuccessfullyaction to call when the score is uploaded successfully.

Member Data Documentation

◆ LEADERBOARD_EMPTY_MESSAGE

Text LapinerTools.Steam.UI.SteamLeaderboardsUI.LEADERBOARD_EMPTY_MESSAGE = null
protected

◆ LEADERBOARD_NAME_TEXT

Text LapinerTools.Steam.UI.SteamLeaderboardsUI.LEADERBOARD_NAME_TEXT = null
protected

◆ s_instance

SteamLeaderboardsUI LapinerTools.Steam.UI.SteamLeaderboardsUI.s_instance
staticprotected

◆ SCORES_BROWSER

uMyGUI_TreeBrowser LapinerTools.Steam.UI.SteamLeaderboardsUI.SCORES_BROWSER = null
protected

Property Documentation

◆ Instance

SteamLeaderboardsUI LapinerTools.Steam.UI.SteamLeaderboardsUI.Instance
staticget

You can use the static Instance property to access the SteamLeaderboardsUI class from wherever you need it in your code. Use this property only if you know that you have a static SteamLeaderboardsUI uGUI in your scene. If you use the SteamLeaderboardsPopup, then there is no guarantee that the SteamLeaderboardsUI was already created.

Event Documentation

◆ OnEntryDataSet

System.Action<SteamLeaderboardsScoreEntryNode.EntryDataSetEventArgs> LapinerTools.Steam.UI.SteamLeaderboardsUI.OnEntryDataSet

Invoked when the data of the LeaderboardListEntry prefab (SteamLeaderboardsScoreEntryNode class) is updated. You can use this event to initialize fields of your custom UI. For example, you could add a replay button to the LeaderboardListEntry prefab. Then you would search the replay uGUI button object and set the button callback when this event is triggered.


The documentation for this class was generated from the following file: