

Utility tool for plugin developers to use Workshop information in their own plugins. This plugin also caches the in-game icon for workshop items using ImageLibrary so you can use the real icon for items in various situations, like custom item stores and any other CUI-dependent type of plugins.
API
DownloadGameIcon
void DownloadGameIcon ( ulong workshopId, Action<byte[]> onIconReceived );
Requests and returns the byte[] data of a workshop in-game item icon (png, with transparency).
StoreGameIcon
void StoreGameIcon ( ulong workshopId, bool redownload = false, Action<ulong> onIconStore = null );
Downloads and stores the workshop in-game item icon (png, with transparency) in ImageLibrary in the following name format: workshop_<workshopId>
Usage:
new CuiRawImageComponent { Png = (string) ImageLibrary?.Call ( "GetImage", $"workshop_{workshopId}" ) };
GetGameIcon
string GetGameIcon ( ulong workshopId );
Returns the ImageLibrary ID.
Usage:
new CuiRawImageComponent { Png = returnedId };
GetInfo
void GetInfo ( ulong workshopId, Action<Newtonsoft.Json.Linq.JObject> onInfoReceived );
Gets the workshop information as seen on Steam for you to use & access. Ideally used to cache information whenever needed.
{ "creatorId": "", "size": 0, "title": "", "previewUrl": "", "description": "", "views": 0, "favorites": 0, "tags": [ { "tag": "" } ] }
Usage:
WorkshopAPI?.Call ( "GetWorkshopInfo", 2494493821ul, new Action<Newtonsoft.Json.Linq.JObject> ( info => { Puts ( $"{info [ "title" ]}" ); } ) );
IsGameIconStored
bool IsGameIconStored ( ulong workshopId );
Lets you know if the in-game workshop icon is already stored or not.
Config
For limitation reasons, ScaleMultiplier (defaults to 1f) is used to downscale the icon because the original size sometimes exceeds the maximum server FileStorage size limit. You could try using the original HD size (ScaleMultiplier: 1), but if the image remains blank, it's because the size of the icon is too large.
EnableLogs (defaults to true) will log whenever an in-game workshop icon has been (re)stored in ImageLibrary.
{ "ScaleMultiplier": 1.0, "EnableLogs": true }
How it Works
Mainly used to get workshop page information and the in-game icon in any CUI plugin you're willing to write.
Total number of downloads.
Total customers served.
Total number of files sold.
Total payments processed.
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.