Garry's Mod Wiki

WorkshopFileBase

This is used internally - although you're able to use it you probably shouldn't.

This object is created by WorkshopFileBase which is used internally to fetch data of the specific namespace or to publish saves and dupes.

This also exists on the Server but most functions may throw an error. It's meant to be used clientside.

You need to set the HTML field to a DHTML panel that is set up correctly like here, or else you might get errors.

Methods

WorkshopFileBase:Fetch( string type, number offset, number perpage, table extratags, string searchText, number filter = nil, string sort = nil )
Fetches all subscriptions for the set namespace and type If you want to use the type local you need to implement the :FetchLocal(offset, perpage) function!
WorkshopFileBase:FetchSubscribed( number offset, number perpage, table tags, string searchText, boolean isUGC = nil, number filter = nil, string sort = nil )
Fetches all subscriptions for the set namespace and passes the result to WorkshopFileBase:FillFileInfo.
WorkshopFileBase:FillFileInfo( table results, boolean isUGC )
Updates the set HTML panel with the newly fetched results
WorkshopFileBase:Publish( string filename, string image )
Creates a UGCPublishWindow to publish the dupe or save
WorkshopFileBase:RetrieveUserName( string steamid, function callback )
Retrieves the username for the given SteamID.