Workshop Item Data Create Status
Support us as a GitHub Sponsor and get instant access to all our assets, exclusive tools and assets, escalated support and issue tracking and our gratitude.
These articles are made possible by our GitHub Sponsors ... become a sponsor today!
Used with the User Generated Content interface for 1 line creation of workshop items as the paramiter in the callback e.g.
public static bool CreateItem(
WorkshopItemData item,
Action<WorkshopItemDataCreateStatus> callback = null)
The first paramiter, this defines the data of the item you want to create.
The second paramiter, this is a deligate to a method that will be called when the process is complete. That deligate expects a method that takes 1 paramiter of type WorkshopItemDataCreateStats (this object)
var itemData = new WorkshopItemData
{
// Set the paramiters of this object
};
API.UserGeneratedContent.Client.CreateItem(itemData, (status) =>
{
if(status.hasError)
{
//Something went wrong
Debug.LogError(status.errorMessage);
}
});
public struct WorkshopItemDataCreateStatus
Indicates rather or not this process ended in error. This will be true if either the create or update steps had a fault.
public bool hasError;
If any this will contain the error message related to the fault.
public string errorMessage;
This is the ID of the UGC file that was created as is used by the User Generated Content API. This is a nullable value.
public PublishedFileId_t? ugcFileId;
This is the result status returned by Valve when the create step completes, If this is not a successful result then there will not be a submit item update result. This is a nullable value.
public CreateItemResult_t? createItemResult;
This is the result of the update item status returned by Valve when the update step completes. This is a nullable value.
public SubmitItemUpdateResult_t? submitItemUpdateResult;
Last modified 1mo ago