Steam
|
SteamWorkshopMain is the easy to use lightweight Steam Workshop API of the Easy Steamworks Integration Unity plugin. Use this class to list, search, sort, download, subscribe, vote, favorite, upload and update Steam workshop items. More...
Inherits LapinerTools.Steam.SteamMainBase< SteamWorkshopMain >.
Public Member Functions | |
bool | GetItemList (uint p_page, System.Action< WorkshopItemListEventArgs > p_onItemListLoaded) |
Loads the item list for the given page. The p_onItemListLoaded callback is invoked when done. First all favorite items of the user are fetched, then all user votes are loaded. Once this is done the given page is loaded and the prior loaded user favorites and vote states are applied. See also SteamWorkshopMain.OnItemListLoaded, SteamWorkshopMain.Sorting and SteamWorkshopMain.SearchText. More... | |
bool | Subscribe (WorkshopItem p_item, System.Action< WorkshopItemEventArgs > p_onSubscribed) |
Subscribe an item. If the subscription is succesfull, then the download is started. See also SteamWorkshopMain.OnSubscribed and SteamWorkshopMain.GetDownloadProgress. More... | |
bool | Subscribe (PublishedFileId_t p_fileId, System.Action< WorkshopItemEventArgs > p_onSubscribed) |
Subscribe an item. If the subscription is succesfull, then the download is started. See also SteamWorkshopMain.OnSubscribed and SteamWorkshopMain.GetDownloadProgress. More... | |
bool | Unsubscribe (WorkshopItem p_item, System.Action< WorkshopItemEventArgs > p_onUnsubscribed) |
Unsubscribe an item. Will not remove the item from disk. If the item is not used for a certain time, then the Steam client will remove it. See also SteamWorkshopMain.OnUnsubscribed. More... | |
bool | Unsubscribe (PublishedFileId_t p_fileId, System.Action< WorkshopItemEventArgs > p_onUnsubscribed) |
Unsubscribe an item. Will not remove the item from disk. If the item is not used for a certain time, then the Steam client will remove it. See also SteamWorkshopMain.OnUnsubscribed. More... | |
bool | AddFavorite (WorkshopItem p_item, System.Action< WorkshopItemEventArgs > p_onAddedFavorite) |
Add an item to user's favorites list. See also SteamWorkshopMain.OnAddedFavorite. More... | |
bool | AddFavorite (PublishedFileId_t p_fileId, System.Action< WorkshopItemEventArgs > p_onAddedFavorite) |
Add an item to user's favorites list. See also SteamWorkshopMain.OnAddedFavorite. More... | |
bool | RemoveFavorite (WorkshopItem p_item, System.Action< WorkshopItemEventArgs > p_onRemovedFavorite) |
Remove an item from user's favorites list. See also SteamWorkshopMain.OnRemovedFavorite. More... | |
bool | RemoveFavorite (PublishedFileId_t p_fileId, System.Action< WorkshopItemEventArgs > p_onRemovedFavorite) |
Remove an item from user's favorites list. See also SteamWorkshopMain.OnRemovedFavorite. More... | |
bool | Vote (WorkshopItem p_item, bool p_isUpVote, System.Action< WorkshopItemEventArgs > p_onVoted) |
Vote an item up or down. See also SteamWorkshopMain.OnVoted. More... | |
bool | Vote (PublishedFileId_t p_fileId, bool p_isUpVote, System.Action< WorkshopItemEventArgs > p_onVoted) |
Vote an item up or down. See also SteamWorkshopMain.OnVoted. More... | |
float | GetDownloadProgress (WorkshopItem p_item) |
Gets the download progress of an item. Use SteamWorkshopMain.Subscribe to start download. See also SteamWorkshopMain.OnInstalled. More... | |
float | GetDownloadProgress (PublishedFileId_t p_fileId) |
Gets the download progress of an item. Use SteamWorkshopMain.Subscribe to start download. See also SteamWorkshopMain.OnInstalled. More... | |
float | GetUploadProgress (WorkshopItemUpdate p_itemUpdate) |
Gets the upload progress of an item. Use SteamWorkshopMain.Upload to start upload. See also SteamWorkshopMain.OnUploaded. More... | |
bool | Upload (WorkshopItemUpdate p_itemData, System.Action< WorkshopItemUpdateEventArgs > p_onUploaded) |
Upload or update the given item. A new item is created if p_itemData's WorkshopItemUpdate.SteamNative.m_nPublishedFileId is not set, otherwise the existing item is updated (new Steam PublishedFileId is stored in p_itemData). If p_itemData's WorkshopItemUpdate.ContentPath is given, then all contents at this path are uploaded or updated. Creates a WorkshopItemInfo.xml file to allow later item updates, see SteamWorkshopMain.GetItemUpdateFromFolder. See also SteamWorkshopMain.GetUploadProgress. More... | |
void | RenderIcon (Camera p_camera, int p_width, int p_height, string p_saveToFilePath, System.Action< Texture2D > p_onRenderIconCompleted) |
Will make a screenshot with the given resolution without rendering the uGUI overlay. More... | |
void | RenderIcon (Camera p_camera, int p_width, int p_height, string p_saveToFilePath, bool p_keepTextureReference, System.Action< Texture2D > p_onRenderIconCompleted) |
Will make a screenshot with the given resolution without rendering the uGUI overlay. More... | |
WorkshopItemUpdate | GetItemUpdateFromFolder (string p_itemContentFolderPath) |
Tries to load the Data.WorkshopItemUpdate data from an item folder. This data can be used in SteamWorkshopMain.Upload to update existing items. The item update data is stored in the WorkshopItemInfo.xml file. More... | |
Public Member Functions inherited from LapinerTools.Steam.SteamMainBase< SteamWorkshopMain > | |
void | Execute< T > (SteamAPICall_t p_steamCall, CallResult< T >.APIDispatchDelegate p_onCompleted) |
The Execute method will handle Steam CallResult creation and storage. Simply pass the configured SteamAPICall and the callback that you want to be invoked when the work is done. Pending results can be viewed in the console with SteamMainBase.IsDebugLogEnabled set to true . More... | |
Protected Member Functions | |
override void | LateUpdate () |
Protected Member Functions inherited from LapinerTools.Steam.SteamMainBase< SteamWorkshopMain > | |
virtual void | OnDisable () |
virtual bool | CheckAndLogResultNoEvent< Trequest > (string p_logText, EResult p_result, bool p_bIOFailure) |
virtual bool | CheckAndLogResult< Trequest, Tevent > (string p_logText, EResult p_result, bool p_bIOFailure, string p_eventName, ref System.Action< Tevent > p_event) |
virtual void | HandleError (string p_logPrefix, ErrorEventArgs p_error) |
virtual void | InvokeEventHandlerSafely< T > (System.Action< T > p_handler, T p_data) |
virtual void | SetSingleShotEventHandler< T > (string p_eventName, ref System.Action< T > p_event, System.Action< T > p_handler) |
virtual void | CallSingleShotEventHandlers< T > (string p_eventName, T p_args, ref System.Action< T > p_event) |
virtual void | ClearSingleShotEventHandlers< T > (string p_eventName, ref System.Action< T > p_event) |
Properties | |
WorkshopSortMode | Sorting [get, set] |
Controls the item list sorting. See also SteamWorkshopMain.OnItemListLoaded and SteamWorkshopMain.GetItemList. More... | |
string | SearchText [get, set] |
This search filter is applied to the item list. See also SteamWorkshopMain.OnItemListLoaded and SteamWorkshopMain.GetItemList. More... | |
bool | IsSteamCacheEnabled [get, set] |
Set this property to true if you want your UI to respond faster, but sacrifice up-to-dateness. Disabled by default. More... | |
Properties inherited from LapinerTools.Steam.SteamMainBase< SteamWorkshopMain > | |
static SteamMainT | Instance [get] |
You can use the static Instance property to access the Steam API from wherever you need it in your code. See also SteamMainBase.IsInstanceSet. More... | |
static bool | IsInstanceSet [get] |
The static IsInstanceSet property can be used before accessing the Instance property to prevent a new instance from being created in the teardown phase. For example, if you want to unregister from an event, then first check that IsInstanceSet is true. If it is false, then your event registration is not valid anymore. More... | |
bool | IsDebugLogEnabled [get, set] |
Set this property to true if you want to see a detailed log in the console. Disabled by default. More... | |
Events | |
System.Action< WorkshopItemListEventArgs > | OnItemListLoaded |
Invoked when the item list is fully loaded. See also SteamWorkshopMain.GetItemList. More... | |
System.Action< WorkshopItemEventArgs > | OnSubscribed |
Invoked when an item was successfully subscribed. See also SteamWorkshopMain.Subscribe. More... | |
System.Action< WorkshopItemEventArgs > | OnUnsubscribed |
Invoked when an item was successfully unsubscribed. See also SteamWorkshopMain.Unsubscribe. More... | |
System.Action< WorkshopItemEventArgs > | OnAddedFavorite |
Invoked when an item was successfully added to the user's favorites list. See also SteamWorkshopMain.AddFavorite. More... | |
System.Action< WorkshopItemEventArgs > | OnRemovedFavorite |
Invoked when an item was successfully removed from the user's favorites list. See also SteamWorkshopMain.RemoveFavorite. More... | |
System.Action< WorkshopItemEventArgs > | OnVoted |
Invoked when an item was successfully voted up or down. See also SteamWorkshopMain.Vote. More... | |
System.Action< WorkshopItemEventArgs > | OnInstalled |
Invoked when an item was successfully downloaded and installed. See also SteamWorkshopMain.Subscribe and SteamWorkshopMain.GetDownloadProgress. More... | |
System.Action< WorkshopItemUpdateEventArgs > | OnUploaded |
Invoked when an item was successfully uploaded or updated. See also SteamWorkshopMain.Upload and SteamWorkshopMain.GetUploadProgress. More... | |
Events inherited from LapinerTools.Steam.SteamMainBase< SteamWorkshopMain > | |
System.Action< ErrorEventArgs > | OnError |
Invoked when a Steam error has occured. More... | |
Additional Inherited Members | |
Protected Attributes inherited from LapinerTools.Steam.SteamMainBase< SteamWorkshopMain > | |
SteamRequestList | m_pendingRequests |
object | m_lock |
bool | m_isDebugLogEnabled |
Static Protected Attributes inherited from LapinerTools.Steam.SteamMainBase< SteamWorkshopMain > | |
static SteamMainT | s_instance |
SteamWorkshopMain is the easy to use lightweight Steam Workshop API of the Easy Steamworks Integration Unity plugin. Use this class to list, search, sort, download, subscribe, vote, favorite, upload and update Steam workshop items.
bool LapinerTools.Steam.SteamWorkshopMain.AddFavorite | ( | WorkshopItem | p_item, |
System.Action< WorkshopItemEventArgs > | p_onAddedFavorite | ||
) |
Add an item to user's favorites list. See also SteamWorkshopMain.OnAddedFavorite.
true
, if a request was started, false
when the request could not have been started due to an error.p_item | item added to favorites. |
p_onAddedFavorite | invoked when the item is added to favorites successfully or an error has occured. |
bool LapinerTools.Steam.SteamWorkshopMain.AddFavorite | ( | PublishedFileId_t | p_fileId, |
System.Action< WorkshopItemEventArgs > | p_onAddedFavorite | ||
) |
Add an item to user's favorites list. See also SteamWorkshopMain.OnAddedFavorite.
true
, if a request was started, false
when the request could not have been started due to an error.p_fileId | Steam PublishedFileId of the item added to favorites. |
p_onAddedFavorite | invoked when the item is added to favorites successfully or an error has occured. |
float LapinerTools.Steam.SteamWorkshopMain.GetDownloadProgress | ( | WorkshopItem | p_item | ) |
Gets the download progress of an item. Use SteamWorkshopMain.Subscribe to start download. See also SteamWorkshopMain.OnInstalled.
p_item | item being downloaded. |
float LapinerTools.Steam.SteamWorkshopMain.GetDownloadProgress | ( | PublishedFileId_t | p_fileId | ) |
Gets the download progress of an item. Use SteamWorkshopMain.Subscribe to start download. See also SteamWorkshopMain.OnInstalled.
p_fileId | Steam PublishedFileId of the item being downloaded. |
bool LapinerTools.Steam.SteamWorkshopMain.GetItemList | ( | uint | p_page, |
System.Action< WorkshopItemListEventArgs > | p_onItemListLoaded | ||
) |
Loads the item list for the given page. The p_onItemListLoaded callback is invoked when done. First all favorite items of the user are fetched, then all user votes are loaded. Once this is done the given page is loaded and the prior loaded user favorites and vote states are applied. See also SteamWorkshopMain.OnItemListLoaded, SteamWorkshopMain.Sorting and SteamWorkshopMain.SearchText.
true
, if a request was started, false
when the request could not have been started due to an error.p_page | item list page to load, starts with 1. |
p_onItemListLoaded | invoked when the item list is either fully loaded or an error has occured. |
WorkshopItemUpdate LapinerTools.Steam.SteamWorkshopMain.GetItemUpdateFromFolder | ( | string | p_itemContentFolderPath | ) |
Tries to load the Data.WorkshopItemUpdate data from an item folder. This data can be used in SteamWorkshopMain.Upload to update existing items. The item update data is stored in the WorkshopItemInfo.xml file.
p_itemContentFolderPath | Path of the item folder containing a WorkshopItemInfo.xml file. |
float LapinerTools.Steam.SteamWorkshopMain.GetUploadProgress | ( | WorkshopItemUpdate | p_itemUpdate | ) |
Gets the upload progress of an item. Use SteamWorkshopMain.Upload to start upload. See also SteamWorkshopMain.OnUploaded.
p_itemUpdate | update data of the item being uploaded. |
|
protectedvirtual |
Reimplemented from LapinerTools.Steam.SteamMainBase< SteamWorkshopMain >.
bool LapinerTools.Steam.SteamWorkshopMain.RemoveFavorite | ( | WorkshopItem | p_item, |
System.Action< WorkshopItemEventArgs > | p_onRemovedFavorite | ||
) |
Remove an item from user's favorites list. See also SteamWorkshopMain.OnRemovedFavorite.
true
, if a request was started, false
when the request could not have been started due to an error.p_item | item removed from favorites. |
p_onRemovedFavorite | invoked when the item is removed from favorites successfully or an error has occured. |
bool LapinerTools.Steam.SteamWorkshopMain.RemoveFavorite | ( | PublishedFileId_t | p_fileId, |
System.Action< WorkshopItemEventArgs > | p_onRemovedFavorite | ||
) |
Remove an item from user's favorites list. See also SteamWorkshopMain.OnRemovedFavorite.
true
, if a request was started, false
when the request could not have been started due to an error.p_fileId | Steam PublishedFileId of the item removed from favorites. |
p_onRemovedFavorite | invoked when the item is removed from favorites successfully or an error has occured. |
void LapinerTools.Steam.SteamWorkshopMain.RenderIcon | ( | Camera | p_camera, |
int | p_width, | ||
int | p_height, | ||
string | p_saveToFilePath, | ||
System.Action< Texture2D > | p_onRenderIconCompleted | ||
) |
Will make a screenshot with the given resolution without rendering the uGUI overlay.
p_camera | camera to render. |
p_width | screenshot width, must be less or equal screen width. |
p_height | screenshot height, must be less or equal screen height. |
p_saveToFilePath | screenshot is saved as a PNG file at this path. Can be null or empty. |
p_onRenderIconCompleted | invoked when the screenshot is rendered. A Texture2D instance containing the screenshot is passed as argument. |
void LapinerTools.Steam.SteamWorkshopMain.RenderIcon | ( | Camera | p_camera, |
int | p_width, | ||
int | p_height, | ||
string | p_saveToFilePath, | ||
bool | p_keepTextureReference, | ||
System.Action< Texture2D > | p_onRenderIconCompleted | ||
) |
Will make a screenshot with the given resolution without rendering the uGUI overlay.
p_camera | camera to render. |
p_width | screenshot width, must be less or equal screen width. |
p_height | screenshot height, must be less or equal screen height. |
p_saveToFilePath | screenshot is saved as a PNG file at this path. Can be null or empty. |
p_keepTextureReference | if set to true then the Texture2D will destroyed with the SteamWorkshopMain instance or when the next screenshot is taken, otherwise you must destroy the Texture2D in your code. |
p_onRenderIconCompleted | invoked when the screenshot is rendered. A Texture2D instance containing the screenshot is passed as argument. |
bool LapinerTools.Steam.SteamWorkshopMain.Subscribe | ( | WorkshopItem | p_item, |
System.Action< WorkshopItemEventArgs > | p_onSubscribed | ||
) |
Subscribe an item. If the subscription is succesfull, then the download is started. See also SteamWorkshopMain.OnSubscribed and SteamWorkshopMain.GetDownloadProgress.
true
, if a request was started, false
when the request could not have been started due to an error.p_item | item to subscribe. |
p_onSubscribed | invoked when the item is subscribed successfully or an error has occured. |
bool LapinerTools.Steam.SteamWorkshopMain.Subscribe | ( | PublishedFileId_t | p_fileId, |
System.Action< WorkshopItemEventArgs > | p_onSubscribed | ||
) |
Subscribe an item. If the subscription is succesfull, then the download is started. See also SteamWorkshopMain.OnSubscribed and SteamWorkshopMain.GetDownloadProgress.
true
, if a request was started, false
when the request could not have been started due to an error.p_fileId | Steam PublishedFileId of the item to subscribe. |
p_onSubscribed | invoked when the item is subscribed successfully or an error has occured. |
bool LapinerTools.Steam.SteamWorkshopMain.Unsubscribe | ( | WorkshopItem | p_item, |
System.Action< WorkshopItemEventArgs > | p_onUnsubscribed | ||
) |
Unsubscribe an item. Will not remove the item from disk. If the item is not used for a certain time, then the Steam client will remove it. See also SteamWorkshopMain.OnUnsubscribed.
true
, if a request was started, false
when the request could not have been started due to an error.p_item | item to unsubscribe. |
p_onUnsubscribed | invoked when the item is unsubscribed successfully or an error has occured. |
bool LapinerTools.Steam.SteamWorkshopMain.Unsubscribe | ( | PublishedFileId_t | p_fileId, |
System.Action< WorkshopItemEventArgs > | p_onUnsubscribed | ||
) |
Unsubscribe an item. Will not remove the item from disk. If the item is not used for a certain time, then the Steam client will remove it. See also SteamWorkshopMain.OnUnsubscribed.
true
, if a request was started, false
when the request could not have been started due to an error.p_fileId | Steam PublishedFileId of the item to unsubscribe. |
p_onUnsubscribed | invoked when the item is unsubscribed successfully or an error has occured. |
bool LapinerTools.Steam.SteamWorkshopMain.Upload | ( | WorkshopItemUpdate | p_itemData, |
System.Action< WorkshopItemUpdateEventArgs > | p_onUploaded | ||
) |
Upload or update the given item. A new item is created if p_itemData's WorkshopItemUpdate.SteamNative.m_nPublishedFileId is not set, otherwise the existing item is updated (new Steam PublishedFileId is stored in p_itemData). If p_itemData's WorkshopItemUpdate.ContentPath is given, then all contents at this path are uploaded or updated. Creates a WorkshopItemInfo.xml file to allow later item updates, see SteamWorkshopMain.GetItemUpdateFromFolder. See also SteamWorkshopMain.GetUploadProgress.
true
, if a request was started, false
when the request could not have been started due to an error.p_itemData | update data of the item to upload. |
p_onUploaded | invoked when the item upload is successfull or an error has occured. |
bool LapinerTools.Steam.SteamWorkshopMain.Vote | ( | WorkshopItem | p_item, |
bool | p_isUpVote, | ||
System.Action< WorkshopItemEventArgs > | p_onVoted | ||
) |
Vote an item up or down. See also SteamWorkshopMain.OnVoted.
true
, if a request was started, false
when the request could not have been started due to an error.p_item | voted item. |
p_isUpVote | if set to true then the item will be voted up, otherwise the item is voted down. |
p_onVoted | invoked when the item vote is successfull or an error has occured. |
bool LapinerTools.Steam.SteamWorkshopMain.Vote | ( | PublishedFileId_t | p_fileId, |
bool | p_isUpVote, | ||
System.Action< WorkshopItemEventArgs > | p_onVoted | ||
) |
Vote an item up or down. See also SteamWorkshopMain.OnVoted.
true
, if a request was started, false
when the request could not have been started due to an error.p_fileId | Steam PublishedFileId of the voted item. |
p_isUpVote | if set to true then the item will be voted up, otherwise the item is voted down. |
p_onVoted | invoked when the item vote is successfull or an error has occured. |
|
getset |
Set this property to true
if you want your UI to respond faster, but sacrifice up-to-dateness. Disabled by default.
|
getset |
This search filter is applied to the item list. See also SteamWorkshopMain.OnItemListLoaded and SteamWorkshopMain.GetItemList.
|
getset |
Controls the item list sorting. See also SteamWorkshopMain.OnItemListLoaded and SteamWorkshopMain.GetItemList.
System.Action<WorkshopItemEventArgs> LapinerTools.Steam.SteamWorkshopMain.OnAddedFavorite |
Invoked when an item was successfully added to the user's favorites list. See also SteamWorkshopMain.AddFavorite.
System.Action<WorkshopItemEventArgs> LapinerTools.Steam.SteamWorkshopMain.OnInstalled |
Invoked when an item was successfully downloaded and installed. See also SteamWorkshopMain.Subscribe and SteamWorkshopMain.GetDownloadProgress.
System.Action<WorkshopItemListEventArgs> LapinerTools.Steam.SteamWorkshopMain.OnItemListLoaded |
Invoked when the item list is fully loaded. See also SteamWorkshopMain.GetItemList.
System.Action<WorkshopItemEventArgs> LapinerTools.Steam.SteamWorkshopMain.OnRemovedFavorite |
Invoked when an item was successfully removed from the user's favorites list. See also SteamWorkshopMain.RemoveFavorite.
System.Action<WorkshopItemEventArgs> LapinerTools.Steam.SteamWorkshopMain.OnSubscribed |
Invoked when an item was successfully subscribed. See also SteamWorkshopMain.Subscribe.
System.Action<WorkshopItemEventArgs> LapinerTools.Steam.SteamWorkshopMain.OnUnsubscribed |
Invoked when an item was successfully unsubscribed. See also SteamWorkshopMain.Unsubscribe.
System.Action<WorkshopItemUpdateEventArgs> LapinerTools.Steam.SteamWorkshopMain.OnUploaded |
Invoked when an item was successfully uploaded or updated. See also SteamWorkshopMain.Upload and SteamWorkshopMain.GetUploadProgress.
System.Action<WorkshopItemEventArgs> LapinerTools.Steam.SteamWorkshopMain.OnVoted |
Invoked when an item was successfully voted up or down. See also SteamWorkshopMain.Vote.