Skip to main content

Builder

Modio.Mods.Builder

TypeDescription
ModBuilderA programmatic interface for Creating a new Mod. This class will handle all the publishing tasks that need to be performed intelligently, minimizing the amount of requests made.
ModfileBuilder

ModBuilder

public class ModBuilder

A programmatic interface for Creating a new Mod. This class will handle all the publishing tasks that need to be performed intelligently, minimizing the amount of requests made.

Remarks

When editing a mod these properties will not be populated: LogoFilePath, GalleryFilePaths, LogoFilePath

Property

List Results

public List<(ChangeFlags, Error)> Results

Produces a list of Tuples with each published change & their corresponding result.

string Name

public string Name

get

string Summary

public string Summary

get

string Description

public string Description

get

string LogoFilePath

public string LogoFilePath

get

string GalleryFilePaths

public string[] GalleryFilePaths

get

string Tags

public string[] Tags

get

string MetadataBlob

public string MetadataBlob

get

Dictionary MetadataKvps

public Dictionary<string, string> MetadataKvps

get

List Dependencies

public List<long> Dependencies

get

bool Visible

public bool Visible

get

ModMaturityOptions MaturityOptions

public ModMaturityOptions MaturityOptions

get

ModCommunityOptions CommunityOptions

public ModCommunityOptions CommunityOptions

get

bool IsMonetized

public bool IsMonetized

get

bool IsLimitedStock

public bool IsLimitedStock

get

int Price

public int Price

get

int Stock

public int Stock

get

bool IsEditMode

public bool IsEditMode

Mod EditTarget

public Mod EditTarget

get

Method

SetName

public ModBuilder SetName(string name)

SetSummary

public ModBuilder SetSummary(string summary)

SetDescription

public ModBuilder SetDescription(string description)

SetTags

public ModBuilder SetTags(ICollection<string> tags)
Remarks

This will overwrite all tags on the mod.

SetTags

public ModBuilder SetTags(string tag)
Remarks

This will overwrite all tags on the mod.

AppendTags

public ModBuilder AppendTags(ICollection<string> tags)

AppendTags

public ModBuilder AppendTags(string tag)

SetMetadataBlob

public ModBuilder SetMetadataBlob(string data)

AppendMetadataBlob

public ModBuilder AppendMetadataBlob(string data)

SetMetadataKvps

public ModBuilder SetMetadataKvps(Dictionary<string, string> kvps)
Remarks

This will overwrite any Key entered with the corresponding value.

public ModBuilder SetLogo(string logoFilePath)
public ModBuilder SetLogo(byte[] imageData, ImageFormat format)

SetGallery

public ModBuilder SetGallery(ICollection<string> galleryImageFilePaths)
Remarks

Will overwrite existing gallery images.

SetGallery

public ModBuilder SetGallery(string galleryImageFilePath)
Remarks

Will overwrite existing gallery images.

AppendGallery

public ModBuilder AppendGallery(ICollection<string> galleryImageFilePaths)

AppendGallery

public ModBuilder AppendGallery(string galleryImageFilePath)

SetDependencies

public ModBuilder SetDependencies(ICollection<long> dependencies)
Remarks

Will overwrite existing dependencies.

SetDependencies

public ModBuilder SetDependencies(long dependency)
Remarks

Will overwrite existing dependencies.

AppendDependencies

public ModBuilder AppendDependencies(ICollection<long> dependencies)

AppendDependencies

public ModBuilder AppendDependencies(long dependency)

EditModfile

public ModfileBuilder EditModfile()

SetVisible

public ModBuilder SetVisible(bool isVisible)

SetMaturityOptions

public ModBuilder SetMaturityOptions(ModMaturityOptions maturityOptions)

OverwriteMaturityOptions

public ModBuilder OverwriteMaturityOptions(ModMaturityOptions maturityOptions)

SetCommunityOptions

public ModBuilder SetCommunityOptions(ModCommunityOptions communityOptions)

OverwriteCommunityOptions

public ModBuilder OverwriteCommunityOptions(ModCommunityOptions communityOptions)

SetMonetized

public ModBuilder SetMonetized(bool isMonetized)

SetPrice

public ModBuilder SetPrice(int price)

SetLimitedStock

public ModBuilder SetLimitedStock(bool isLimitedStock)

SetStockAmount

public ModBuilder SetStockAmount(int stockAmount)

Publish

public async Task<(Error error, Mod mod)> Publish()

Publishes the changes to the mod.io API.

Remarks

Will use ModioAPI.Mods.AddMod or ModioAPI.Mods.EditMod to publish changes, then process the remaining data as separate publish tasks.

Returns

Error.None if the initial request succeeds. Use Results to inspect the results of each publish task.


ModfileBuilder

public class ModfileBuilder
Property

string FilePath

public string FilePath

get

string Version

public string Version

get

string ChangeLog

public string ChangeLog

get

string MetadataBlob

public string MetadataBlob

get

Platform Platforms

public Platform[] Platforms

get

Method

SetSourceDirectoryPath

public ModfileBuilder SetSourceDirectoryPath(string filePath)
Remarks

This should be a directory

SetVersion

public ModfileBuilder SetVersion(string version)

SetChangelog

public ModfileBuilder SetChangelog(string changelog)

SetMetadataBlob

public ModfileBuilder SetMetadataBlob(string metadataBlob)

SetPlatform

public ModfileBuilder SetPlatform(Platform platform)
Remarks

This will overwrite all platforms on this modfile.

SetPlatforms

public ModfileBuilder SetPlatforms(ICollection<Platform> platforms)
Remarks

This will overwrite all platforms on this modfile.

AppendPlatform

public ModfileBuilder AppendPlatform(Platform platform)

AppendPlatforms

public ModfileBuilder AppendPlatforms(ICollection<Platform> platforms)

FinishModfile

public ModBuilder FinishModfile()
Enum
Windows
Mac
Linux
Android
IOS
XboxOne
XboxSeriesX
PlayStation4
PlayStation5
Switch
Oculus

Enums

ChangeFlags
None               = 0
Name               = 1 << 0
Summary            = 1 << 1
Description        = 1 << 2
Logo               = 1 << 3
Gallery            = 1 << 4
Tags               = 1 << 5
MetadataBlob       = 1 << 6
MetadataKvps       = 1 << 7
Visibility         = 1 << 8
MaturityOptions    = 1 << 9
CommunityOptions   = 1 << 10
Modfile            = 1 << 11
MonetizationConfig = 1 << 12
Dependencies       = 1 << 13
AddFlags = Name
| Summary
| Description
| Logo
| Visibility
| MaturityOptions
| CommunityOptions
| MetadataBlob
| Tags
EditFlags = Name
| Summary
| Description
| Logo
| Visibility
| MaturityOptions
| CommunityOptions
| MetadataBlob
| Tags
| MonetizationConfig

ImageFormat
Jpg
Jpeg
Png