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

This class manages the uGUI of the Steam Workshop browse items menu. It registers to events of SteamWorkshopMain class, e.g. SteamWorkshopMain.OnItemListLoaded. SteamWorkshopUIBrowse also receives UI callbacks from uGUI buttons and other elements. 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 SteamWorkshopMain class from your new implementation. More...

Inherits MonoBehaviour.

Classes

class  SortingConfig
 Defines the available item list sorting modes. Used to generate the sort modes dropdown. See SteamWorkshopMain.Sorting for more details. More...
 

Public Member Functions

void InvokeOnPlayButtonClick (WorkshopItem p_clickedItem)
 Internal method triggering the SteamWorkshopUIBrowse.OnPlayButtonClick event with exception handling. Required to ensure code execution even if your code throws exceptions. More...
 
void InvokeOnVoteUpButtonClick (WorkshopItem p_clickedItem)
 Internal method triggering the SteamWorkshopUIBrowse.OnVoteUpButtonClick event with exception handling. Required to ensure code execution even if your code throws exceptions. More...
 
void InvokeOnVoteDownButtonClick (WorkshopItem p_clickedItem)
 Internal method triggering the SteamWorkshopUIBrowse.OnVoteDownButtonClick event with exception handling. Required to ensure code execution even if your code throws exceptions. More...
 
void InvokeOnSubscribeButtonClick (WorkshopItem p_clickedItem)
 Internal method triggering the SteamWorkshopUIBrowse.OnSubscribeButtonClick event with exception handling. Required to ensure code execution even if your code throws exceptions. More...
 
void InvokeOnUnsubscribeButtonClick (WorkshopItem p_clickedItem)
 Internal method triggering the SteamWorkshopUIBrowse.OnUnsubscribeButtonClick event with exception handling. Required to ensure code execution even if your code throws exceptions. More...
 
void InvokeOnAddFavoriteButtonClick (WorkshopItem p_clickedItem)
 Internal method triggering the SteamWorkshopUIBrowse.OnAddFavoriteButtonClick event with exception handling. Required to ensure code execution even if your code throws exceptions. More...
 
void InvokeOnRemoveFavoriteButtonClick (WorkshopItem p_clickedItem)
 Internal method triggering the SteamWorkshopUIBrowse.OnRemoveFavoriteButtonClick event with exception handling. Required to ensure code execution even if your code throws exceptions. More...
 
void InvokeOnItemDataSet (WorkshopItem p_itemData, SteamWorkshopItemNode p_itemUI)
 Internal method triggering the SteamWorkshopUIBrowse.OnItemDataSet event with exception handling. Required to ensure code execution even if your code throws exceptions. More...
 
void SetItems (WorkshopItemList p_itemList)
 Call SetItems to refresh the item selection UI. Calling this method will remove all currently visible items and replace them with those passed in the p_itemList argument. More...
 
void LoadItems (int p_page)
 The same as SteamWorkshopMain.GetItemList with an additional loading popup. More...
 
void Search (string p_searchText)
 Search items containing p_searchText. Will reload the item list if the search text has changed. More...
 

Protected Member Functions

void SetPage (int p_page)
 
virtual void Start ()
 
virtual void LateUpdate ()
 
virtual void OnDestroy ()
 
virtual void ShowErrorMessage (ErrorEventArgs p_errorArgs)
 
virtual void SetItems (WorkshopItemListEventArgs p_itemListArgs)
 
virtual uMyGUI_TreeBrowser.Node [] ConvertItemsToNodes (WorkshopItem[] p_items)
 This method will convert the gives Steam items to UI nodes, which can be passed to the item browser. More...
 
virtual void InitSorting ()
 
virtual void InitSearch ()
 
virtual void InvokeEventHandlerSafely< T > (System.Action< T > p_handler, T p_data)
 

Protected Attributes

uMyGUI_TreeBrowser ITEM_BROWSER = null
 
uMyGUI_PageBox PAGE_SELCTOR = null
 
SortingConfig SORTING = null
 
InputField SEARCH_INPUT = null
 
Button SEARCH_BUTTON = null
 
bool m_improveNavigationFocus = true
 
Dictionary< uMyGUI_TreeBrowser.Node, WorkshopItemm_uiNodeToSteamItem = new Dictionary<uMyGUI_TreeBrowser.Node, WorkshopItem>()
 

Static Protected Attributes

static SteamWorkshopUIBrowse s_instance
 

Properties

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

Events

System.Action< WorkshopSortModeEventArgsOnSortModeChanged
 Invoked when the sort mode was changed. More...
 
System.Action< string > OnSearchButtonClick
 Invoked when the search button is clicked or the search text is committed. More...
 
System.Action< int > OnPageChanged
 Invoked when the item list page was changed. More...
 
System.Action< WorkshopItemEventArgsOnPlayButtonClick
 Invoked when the play button of the WorkshopItemListEntry prefab (SteamWorkshopItemNode class) is clicked. More...
 
System.Action< WorkshopItemEventArgsOnVoteUpButtonClick
 Invoked when the vote up button of the WorkshopItemListEntry prefab (SteamWorkshopItemNode class) is clicked. More...
 
System.Action< WorkshopItemEventArgsOnVoteDownButtonClick
 Invoked when the vote down button of the WorkshopItemListEntry prefab (SteamWorkshopItemNode class) is clicked. More...
 
System.Action< WorkshopItemEventArgsOnSubscribeButtonClick
 Invoked when the subscribe button of the WorkshopItemListEntry prefab (SteamWorkshopItemNode class) is clicked. More...
 
System.Action< WorkshopItemEventArgsOnUnsubscribeButtonClick
 Invoked when the unsubscribe button of the WorkshopItemListEntry prefab (SteamWorkshopItemNode class) is clicked. More...
 
System.Action< WorkshopItemEventArgsOnAddFavoriteButtonClick
 Invoked when the add to favorites button of the WorkshopItemListEntry prefab (SteamWorkshopItemNode class) is clicked. More...
 
System.Action< WorkshopItemEventArgsOnRemoveFavoriteButtonClick
 Invoked when the remove from favorites button of the WorkshopItemListEntry prefab (SteamWorkshopItemNode class) is clicked. More...
 
System.Action< SteamWorkshopItemNode.ItemDataSetEventArgsOnItemDataSet
 Invoked when the data of the WorkshopItemListEntry prefab (SteamWorkshopItemNode class) is updated. You can use this event to initialize fields of your custom UI. For example, you could add a highscore text to the WorkshopItemListEntry prefab. Then you would search the highscore uGUI text object and set the value when this event is triggered. More...
 

Detailed Description

This class manages the uGUI of the Steam Workshop browse items menu. It registers to events of SteamWorkshopMain class, e.g. SteamWorkshopMain.OnItemListLoaded. SteamWorkshopUIBrowse also receives UI callbacks from uGUI buttons and other elements. 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 SteamWorkshopMain class from your new implementation.

Member Function Documentation

◆ ConvertItemsToNodes()

virtual uMyGUI_TreeBrowser.Node [] LapinerTools.Steam.UI.SteamWorkshopUIBrowse.ConvertItemsToNodes ( WorkshopItem []  p_items)
protectedvirtual

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

◆ InitSearch()

virtual void LapinerTools.Steam.UI.SteamWorkshopUIBrowse.InitSearch ( )
protectedvirtual

◆ InitSorting()

virtual void LapinerTools.Steam.UI.SteamWorkshopUIBrowse.InitSorting ( )
protectedvirtual

◆ InvokeEventHandlerSafely< T >()

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

◆ InvokeOnAddFavoriteButtonClick()

void LapinerTools.Steam.UI.SteamWorkshopUIBrowse.InvokeOnAddFavoriteButtonClick ( WorkshopItem  p_clickedItem)

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

◆ InvokeOnItemDataSet()

void LapinerTools.Steam.UI.SteamWorkshopUIBrowse.InvokeOnItemDataSet ( WorkshopItem  p_itemData,
SteamWorkshopItemNode  p_itemUI 
)

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

◆ InvokeOnPlayButtonClick()

void LapinerTools.Steam.UI.SteamWorkshopUIBrowse.InvokeOnPlayButtonClick ( WorkshopItem  p_clickedItem)

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

◆ InvokeOnRemoveFavoriteButtonClick()

void LapinerTools.Steam.UI.SteamWorkshopUIBrowse.InvokeOnRemoveFavoriteButtonClick ( WorkshopItem  p_clickedItem)

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

◆ InvokeOnSubscribeButtonClick()

void LapinerTools.Steam.UI.SteamWorkshopUIBrowse.InvokeOnSubscribeButtonClick ( WorkshopItem  p_clickedItem)

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

◆ InvokeOnUnsubscribeButtonClick()

void LapinerTools.Steam.UI.SteamWorkshopUIBrowse.InvokeOnUnsubscribeButtonClick ( WorkshopItem  p_clickedItem)

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

◆ InvokeOnVoteDownButtonClick()

void LapinerTools.Steam.UI.SteamWorkshopUIBrowse.InvokeOnVoteDownButtonClick ( WorkshopItem  p_clickedItem)

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

◆ InvokeOnVoteUpButtonClick()

void LapinerTools.Steam.UI.SteamWorkshopUIBrowse.InvokeOnVoteUpButtonClick ( WorkshopItem  p_clickedItem)

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

◆ LateUpdate()

virtual void LapinerTools.Steam.UI.SteamWorkshopUIBrowse.LateUpdate ( )
protectedvirtual

◆ LoadItems()

void LapinerTools.Steam.UI.SteamWorkshopUIBrowse.LoadItems ( int  p_page)

The same as SteamWorkshopMain.GetItemList with an additional loading popup.

Parameters
p_pageitem list page to load, starts with 1.

◆ OnDestroy()

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

◆ Search()

void LapinerTools.Steam.UI.SteamWorkshopUIBrowse.Search ( string  p_searchText)

Search items containing p_searchText. Will reload the item list if the search text has changed.

Parameters
p_searchTexttext to search.

◆ SetItems() [1/2]

void LapinerTools.Steam.UI.SteamWorkshopUIBrowse.SetItems ( WorkshopItemList  p_itemList)

Call SetItems to refresh the item selection UI. Calling this method will remove all currently visible items and replace them with those passed in the p_itemList argument.

Parameters
p_itemListlist of items to be visualized.

◆ SetItems() [2/2]

virtual void LapinerTools.Steam.UI.SteamWorkshopUIBrowse.SetItems ( WorkshopItemListEventArgs  p_itemListArgs)
protectedvirtual

◆ SetPage()

void LapinerTools.Steam.UI.SteamWorkshopUIBrowse.SetPage ( int  p_page)
protected

◆ ShowErrorMessage()

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

◆ Start()

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

Member Data Documentation

◆ ITEM_BROWSER

uMyGUI_TreeBrowser LapinerTools.Steam.UI.SteamWorkshopUIBrowse.ITEM_BROWSER = null
protected

◆ m_improveNavigationFocus

bool LapinerTools.Steam.UI.SteamWorkshopUIBrowse.m_improveNavigationFocus = true
protected

◆ m_uiNodeToSteamItem

Dictionary<uMyGUI_TreeBrowser.Node, WorkshopItem> LapinerTools.Steam.UI.SteamWorkshopUIBrowse.m_uiNodeToSteamItem = new Dictionary<uMyGUI_TreeBrowser.Node, WorkshopItem>()
protected

◆ PAGE_SELCTOR

uMyGUI_PageBox LapinerTools.Steam.UI.SteamWorkshopUIBrowse.PAGE_SELCTOR = null
protected

◆ s_instance

SteamWorkshopUIBrowse LapinerTools.Steam.UI.SteamWorkshopUIBrowse.s_instance
staticprotected

◆ SEARCH_BUTTON

Button LapinerTools.Steam.UI.SteamWorkshopUIBrowse.SEARCH_BUTTON = null
protected

◆ SEARCH_INPUT

InputField LapinerTools.Steam.UI.SteamWorkshopUIBrowse.SEARCH_INPUT = null
protected

◆ SORTING

SortingConfig LapinerTools.Steam.UI.SteamWorkshopUIBrowse.SORTING = null
protected

Property Documentation

◆ Instance

SteamWorkshopUIBrowse LapinerTools.Steam.UI.SteamWorkshopUIBrowse.Instance
staticget

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

Event Documentation

◆ OnAddFavoriteButtonClick

System.Action<WorkshopItemEventArgs> LapinerTools.Steam.UI.SteamWorkshopUIBrowse.OnAddFavoriteButtonClick

Invoked when the add to favorites button of the WorkshopItemListEntry prefab (SteamWorkshopItemNode class) is clicked.

◆ OnItemDataSet

System.Action<SteamWorkshopItemNode.ItemDataSetEventArgs> LapinerTools.Steam.UI.SteamWorkshopUIBrowse.OnItemDataSet

Invoked when the data of the WorkshopItemListEntry prefab (SteamWorkshopItemNode class) is updated. You can use this event to initialize fields of your custom UI. For example, you could add a highscore text to the WorkshopItemListEntry prefab. Then you would search the highscore uGUI text object and set the value when this event is triggered.

◆ OnPageChanged

System.Action<int> LapinerTools.Steam.UI.SteamWorkshopUIBrowse.OnPageChanged

Invoked when the item list page was changed.

◆ OnPlayButtonClick

System.Action<WorkshopItemEventArgs> LapinerTools.Steam.UI.SteamWorkshopUIBrowse.OnPlayButtonClick

Invoked when the play button of the WorkshopItemListEntry prefab (SteamWorkshopItemNode class) is clicked.

◆ OnRemoveFavoriteButtonClick

System.Action<WorkshopItemEventArgs> LapinerTools.Steam.UI.SteamWorkshopUIBrowse.OnRemoveFavoriteButtonClick

Invoked when the remove from favorites button of the WorkshopItemListEntry prefab (SteamWorkshopItemNode class) is clicked.

◆ OnSearchButtonClick

System.Action<string> LapinerTools.Steam.UI.SteamWorkshopUIBrowse.OnSearchButtonClick

Invoked when the search button is clicked or the search text is committed.

◆ OnSortModeChanged

System.Action<WorkshopSortModeEventArgs> LapinerTools.Steam.UI.SteamWorkshopUIBrowse.OnSortModeChanged

Invoked when the sort mode was changed.

◆ OnSubscribeButtonClick

System.Action<WorkshopItemEventArgs> LapinerTools.Steam.UI.SteamWorkshopUIBrowse.OnSubscribeButtonClick

Invoked when the subscribe button of the WorkshopItemListEntry prefab (SteamWorkshopItemNode class) is clicked.

◆ OnUnsubscribeButtonClick

System.Action<WorkshopItemEventArgs> LapinerTools.Steam.UI.SteamWorkshopUIBrowse.OnUnsubscribeButtonClick

Invoked when the unsubscribe button of the WorkshopItemListEntry prefab (SteamWorkshopItemNode class) is clicked.

◆ OnVoteDownButtonClick

System.Action<WorkshopItemEventArgs> LapinerTools.Steam.UI.SteamWorkshopUIBrowse.OnVoteDownButtonClick

Invoked when the vote down button of the WorkshopItemListEntry prefab (SteamWorkshopItemNode class) is clicked.

◆ OnVoteUpButtonClick

System.Action<WorkshopItemEventArgs> LapinerTools.Steam.UI.SteamWorkshopUIBrowse.OnVoteUpButtonClick

Invoked when the vote up button of the WorkshopItemListEntry prefab (SteamWorkshopItemNode class) is clicked.


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