ProjectPublisherclass

object→ProjectPublisher
Namespace
Editor
Assembly
Sandbox.Tools
Declaration
public class Editor.ProjectPublisher

Methods19

Showing 19 methods

public System.Threading.Tasks.Task AddCodePackageReference(string package)PUBLIC

If the code is referencing a package - we can add it to the manifest using this.

ParameterTypeDescription
packagestring—
Returns:Task—

public static bool CanPublishFile(Editor.Asset a)PUBLICSTATIC

Return true if we're not opposed to publishing this asset

ParameterTypeDescription
aAsset—
Returns:bool—

public static Sandbox.Bitmap CropToSquare(Sandbox.Bitmap image)PUBLICSTATIC

The middle of this image, cut square - Steam shows workshop items' main thumbnails square. A new bitmap.

ParameterTypeDescription
imageBitmap—
Returns:Bitmap—

public System.Collections.Generic.List`1<Sandbox.DataModel.GameSetting> GetGameSettings(Sandbox.CompilerOutput[] assemblies)PUBLIC

Fetch a list of game settings to be added to the project's metadata

ParameterTypeDescription
assembliesCompilerOutput[]—
Returns:List<GameSetting>—

public static System.Threading.Tasks.Task`1<Editor.ProjectPublisher.PublishedWorkshopItem[]> GetPublishedWorkshopItemsAsync(string type)PUBLICSTATIC

The workshop items we've published of this type (e.g. "map"), newest first. Empty if Steam couldn't be asked.

ParameterTypeDescription
typestring—
Returns:Task<PublishedWorkshopItem[]>—

public static System.Threading.Tasks.Task`1<ulong> GetWorkshopItemIdAsync(Sandbox.Project project)PUBLICSTATIC

The workshop item a publish of this project goes to unless it's told otherwise - 0 if it isn't a map, or it'll make a new item

ParameterTypeDescription
projectProject—
Returns:Task<ulong>—

public static System.Threading.Tasks.Task`1<Editor.ProjectPublisher.WorkshopItemInfo> GetWorkshopItemInfoAsync(ulong id)PUBLICSTATIC

Ask Steam about a workshop item - not from its cache, it might have just been published

ParameterTypeDescription
idulong—
Returns:Task<WorkshopItemInfo>—

public System.Threading.Tasks.Task PrePublish(System.Threading.CancellationToken cancellationToken = null)PUBLIC

Check the intended manifest, ask the backend which files need to be uploaded.

ParameterTypeDescription
cancellationToken = nullCancellationToken—
Returns:Task—

public System.Threading.Tasks.Task Publish(Editor.IProgress progress = null, System.Threading.CancellationToken cancel = null)PUBLIC

Publish a new revision

ParameterTypeDescription
progress = nullIProgress—
cancel = nullCancellationToken—
Returns:Task—

public static bool PublishesToWorkshop(Sandbox.Project project)PUBLICSTATIC

Would publishing this project put its files in a Steam Workshop item?

ParameterTypeDescription
projectProject—
Returns:bool—

public void SetChangeDetails(string change, string detail)PUBLIC

Allows to set information on the revision - for future reference

ParameterTypeDescription
changestring—
detailstring—
Returns:void—

public void SetMeta(string key, object obj)PUBLIC

ParameterTypeDescription
keystring—
objobject—
Returns:void—

public System.Threading.Tasks.Task SetThumbnail(byte[] image)PUBLIC

Use this image as the package's thumb instead of the one rendered from its asset - the middle of it, cut square (`Editor.ProjectPublisher.CropToSquare(Sandbox.Bitmap)`). Any image a `Sandbox.Bitmap` can read - it goes up as a png. Before `Editor.ProjectPublisher.PrePublish(System.Threading.CancellationToken)`, so it's uploaded.

ParameterTypeDescription
imagebyte[]—
Returns:Task—

public void SetWorkshopItem(ulong id)PUBLIC

Put the files in this workshop item, or a new one with 0, rather than the one the package says. Before `Editor.ProjectPublisher.PrePublish(System.Threading.CancellationToken)`.

ParameterTypeDescription
idulong—
Returns:void—

public System.Threading.Tasks.Task UploadFiles()PUBLIC

Returns:Task—

Properties17

Showing 17 properties

public bool Editor.ProjectPublisher.HasWorkshopUpload { get; set; }PUBLICGETSET

Does this publish put its files in a Steam Workshop item?

Returns:bool—

public bool Editor.ProjectPublisher.IsWorkshopUploaded { get; set; }PUBLICGETSET

Have the files gone up to the workshop? A retried publish doesn't upload them again.

Returns:bool—

public int Editor.ProjectPublisher.MissingFileCount { get; set; }PUBLICGETSET

Returns:int—

public long Editor.ProjectPublisher.MissingFileSize { get; set; }PUBLICGETSET

Returns:long—

public System.Action Editor.ProjectPublisher.OnProgressChanged { get; set; }PUBLICGETSET

Returns:Action—

public string Editor.ProjectPublisher.TargetPackageIdent { get; set; }PUBLICGETSET

Returns:string—

public int Editor.ProjectPublisher.TotalFileCount { get; set; }PUBLICGETSET

Returns:int—

public long Editor.ProjectPublisher.WorkshopBytesDone { get; set; }PUBLICGETSET

How far through the current stage of the workshop upload we are, in bytes

Returns:long—

public long Editor.ProjectPublisher.WorkshopBytesTotal { get; set; }PUBLICGETSET

The size of the current stage of the workshop upload, in bytes. Steam doesn't know until it's started.

Returns:long—

public int Editor.ProjectPublisher.WorkshopFileCount { get; set; }PUBLICGETSET

How many files go in the workshop item

Returns:int—

public ulong Editor.ProjectPublisher.WorkshopTargetItemId { get; set; }PUBLICGETSET

The workshop item this publishes to, or 0 if it'll create a new one

Returns:ulong—

public long Editor.ProjectPublisher.WorkshopUploadSize { get; set; }PUBLICGETSET

The size of the files that go in the workshop item, in bytes

Returns:long—

public string Editor.ProjectPublisher.WorkshopUploadStatus { get; set; }PUBLICGETSET

What the workshop upload is doing right now, or null if it hasn't started

Returns:string—

public string Editor.ProjectPublisher.WorkshopUrl { get; set; }PUBLICGETSET

The workshop item's page on Steam, once there is one

Returns:string—

public string Editor.ProjectPublisher.WorkshopWarning { get; set; }PUBLICGETSET

Something whoever's publishing should know about the workshop item first, like that it isn't theirs. Null if there's nothing to say.

Returns:string—

On this page

Methodspublic System.Threading.Tasks.Task AddCodePackageReference(System.String package)public System.Threading.Tasks.Task AddFile(System.Byte[] contents, System.String relativePath)public System.Threading.Tasks.Task AddFile(System.String contents, System.String relativePath)public static System.Boolean CanPublishFile(Editor.Asset a)public static Sandbox.Bitmap CropToSquare(Sandbox.Bitmap image)public static System.Threading.Tasks.Task`1<Editor.ProjectPublisher> FromAsset(Editor.Asset asset)public static System.Threading.Tasks.Task`1<Editor.ProjectPublisher> FromProject(Sandbox.Project project)public System.Collections.Generic.List`1<Sandbox.DataModel.GameSetting> GetGameSettings(Sandbox.CompilerOutput[] assemblies)public static System.Threading.Tasks.Task`1<Editor.ProjectPublisher.PublishedWorkshopItem[]> GetPublishedWorkshopItemsAsync(System.String type)public static System.Threading.Tasks.Task`1<System.UInt64> GetWorkshopItemIdAsync(Sandbox.Project project)public static System.Threading.Tasks.Task`1<Editor.ProjectPublisher.WorkshopItemInfo> GetWorkshopItemInfoAsync(System.UInt64 id)public System.Threading.Tasks.Task PrePublish(System.Threading.CancellationToken cancellationToken = null)public System.Threading.Tasks.Task Publish(Editor.IProgress progress = null, System.Threading.CancellationToken cancel = null)public static System.Boolean PublishesToWorkshop(Sandbox.Project project)public System.Void SetChangeDetails(System.String change, System.String detail)public System.Void SetMeta(System.String key, System.Object obj)public System.Threading.Tasks.Task SetThumbnail(System.Byte[] image)public System.Void SetWorkshopItem(System.UInt64 id)public System.Threading.Tasks.Task UploadFiles()Propertiespublic System.Collections.Generic.IEnumerable`1<Editor.ProjectPublisher.ProjectFile> Editor.ProjectPublisher.Files { get; set; }public System.Boolean Editor.ProjectPublisher.HasWorkshopUpload { get; set; }public System.Boolean Editor.ProjectPublisher.IsWorkshopUploaded { get; set; }public Editor.ProjectPublisher.PackageManifest Editor.ProjectPublisher.Manifest { get; set; }public System.Int32 Editor.ProjectPublisher.MissingFileCount { get; set; }public System.Int64 Editor.ProjectPublisher.MissingFileSize { get; set; }public System.Action Editor.ProjectPublisher.OnProgressChanged { get; set; }public System.String Editor.ProjectPublisher.TargetPackageIdent { get; set; }public System.Int32 Editor.ProjectPublisher.TotalFileCount { get; set; }public System.Int64 Editor.ProjectPublisher.WorkshopBytesDone { get; set; }public System.Int64 Editor.ProjectPublisher.WorkshopBytesTotal { get; set; }public System.Int32 Editor.ProjectPublisher.WorkshopFileCount { get; set; }public System.UInt64 Editor.ProjectPublisher.WorkshopTargetItemId { get; set; }public System.Int64 Editor.ProjectPublisher.WorkshopUploadSize { get; set; }public System.String Editor.ProjectPublisher.WorkshopUploadStatus { get; set; }public System.String Editor.ProjectPublisher.WorkshopUrl { get; set; }public System.String Editor.ProjectPublisher.WorkshopWarning { get; set; }Metadata