Workshop Item Data Create Status

Introduction

Used with the User Generated Content interface for 1 line creation of workshop items as the paramiter in the callback e.g.
1
public static bool CreateItem(
2
WorkshopItemData item,
3
Action<WorkshopItemDataCreateStatus> callback = null)
Copied!
This method is part of the User Generated Content API, you provide it with two paramiters.

WorkshopItemData

The first paramiter, this defines the data of the item you want to create.

Action<WorkshopItemDataCreateStatus>

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)

Example Call

1
var itemData = new WorkshopItemData
2
{
3
// Set the paramiters of this object
4
};
5
6
API.UserGeneratedContent.Client.CreateItem(itemData, (status) =>
7
{
8
if(status.hasError)
9
{
10
//Something went wrong
11
Debug.LogError(status.errorMessage);
12
}
13
});
Copied!

Definition

1
public struct WorkshopItemDataCreateStatus
Copied!

Fields and Attributes

hasError

Indicates rather or not this process ended in error. This will be true if either the create or update steps had a fault.
1
public bool hasError;
Copied!

errorMessage

If any this will contain the error message related to the fault.
1
public string errorMessage;
Copied!

ugcFileId

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.
1
public PublishedFileId_t? ugcFileId;
Copied!

createItemResult

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.
1
public CreateItemResult_t? createItemResult;
Copied!

submitItemUpdateResult

This is the result of the update item status returned by Valve when the update step completes. This is a nullable value.
1
public SubmitItemUpdateResult_t? submitItemUpdateResult;
Copied!