Mod Loader/Reference/API index
Find public methods, overloads, events, and related types available in Mod Loader 0.7.8. All types below are in the DressmakerMods namespace. Use the links beside each section for examples and API behaviour.
Start with plugin lifecycle for registration and cleanup. Call Unity-facing APIs on the main thread. Check ModLoaderApi.Supports for optional integrations. A capability version describes its API contract; set your BepInEx dependency to a loader version that contains the members you use.
What can I hook into?
| When you need to react to... | Use | How |
|---|---|---|
| Content registration finishes | ModLifecycleApi.WhenContentReady
|
Runs immediately if registration already finished. |
| A save or scene changes | ModLifecycleApi.Subscribe
|
Choose a ModLifecycleEvent and optional priority. |
| A sidebar inventory refreshes | ModInventoryApi.Subscribe
|
Receives Fabrics or Accessories after the refresh. |
| A garment is selected or a panel changes | GarmentEventsApi.Subscribe
|
Choose Selected, PanelCreated, or FabricChanged. |
| An accessory prefab loads or fails | AccessoryPrefabApi.PrefabReady / PrefabFailed
|
Subscribe with += and remove the handler with -= when finished. |
| An accessory or trim point is placed | AccessoryPlacementApi.Register
|
Return a placement suggestion from your rule. |
| A fabric is rendered | FabricRenderApi.Register
|
Apply changes to the material for that view. |
| A tool needs gameplay input | ModInputApi.Register
|
Supply a predicate for when the claim is active. |
| A shop needs layout information | ModShopApi.RegisterLayout
|
Supply layout and optional visibility callbacks. |
| A mod setting changes | ModSettingsApi.Register
|
Bind controls to config entries or an action callback. |
Choose an API
- Plugin registration and lifetime
- Game events and inventory
- Input and shortcuts
- Mod Settings
- Save data and portable content
- Fabrics and shaders
- Fabric rendering
- Textures and previews
- Accessories and prefab loading
- Placement and trim editing
- Garments, panels, and tags
- Friendship rewards
- Art and mannequin colours
- Pencil palettes
- Music and purchase sounds
- Shop layout providers
- Console commands and diagnostics
Signatures include optional parameter defaults and generic constraints. Methods are listed on the type that declares them. Follow a base-type link for inherited members. Create data definitions with object initializers, then pass them to the matching registration method.
Plugin registration and lifetime
ModLoaderApi
| Method or constructor | Use |
|---|---|
static bool Supports(string capability, int minimumVersion = 1)
|
Check a capability version and its current availability. |
static ModContext[] GetMods()
|
Get registered plugin contexts sorted by name. |
static ModContext Find(string id)
|
Find a registered plugin context by plugin ID. |
static ModContext Register(BaseUnityPlugin plugin, ModInfo information = null)
|
Register your initialized BepInEx plugin and obtain its owned context. |
Properties, fields, and events:
static bool IsReady { get; }
IsReady: True when startup has finished, including startup with skipped features. Check Supports before using optional APIs.
ModContext
A plugin's registrations and resources. Dispose on unload.
| Method or constructor | Use |
|---|---|
T Track<T>(T resource) where T : IDisposable
|
Hands cleanup of a registration or resource to this context. |
void Dispose()
|
Release the context and its tracked registrations and resources. |
Properties, fields, and events:
string Id { get; }
string Name { get; }
string Author { get; }
string Description { get; }
string Credits { get; }
Version Version { get; }
string Directory { get; }
bool IsDisposed { get; }
ModDiagnosticReporter Diagnostics { get; }
ModTextureLoader Textures { get; }
ModSaveData SaveData { get; }
ModInfo
Properties, fields, and events:
string Name { get; set; }
string Author { get; set; }
string Description { get; set; }
string Credits { get; set; }
Game events and inventory
GarmentEventsApi
| Method or constructor | Use |
|---|---|
static IDisposable Subscribe(ModContext owner, GarmentEvent value, Action<GarmentEventContext> callback)
|
Subscribes on the Unity thread. Dispose to unsubscribe. |
ModInventoryApi
Observes completed inventory refreshes without replacing native or virtualized rows.
| Method or constructor | Use |
|---|---|
static IDisposable Subscribe(ModContext owner, Action<ModInventoryKind> callback, int priority = 0)
|
Higher priorities run first; ties sort by plugin ID, then registration order. |
static bool Refresh(ModInventoryKind kind)
|
Refresh an available sidebar. Call outside refresh notification callbacks. |
ModLifecycleApi
| Method or constructor | Use |
|---|---|
static IDisposable Subscribe(ModContext owner, ModLifecycleEvent value, Action<ModLifecycleContext> callback)
|
Subscribe to a lifecycle event. The overload with priority controls callback ordering. |
static IDisposable Subscribe(ModContext owner, ModLifecycleEvent value, Action<ModLifecycleContext> callback, int priority)
|
Subscribe to a lifecycle event. The overload with priority controls callback ordering. |
static IDisposable WhenContentReady(ModContext owner, Action callback)
|
Runs after startup registration, or immediately if finished. |
Properties, fields, and events:
static bool IsContentReady { get; }
GarmentEvent
Values:
Selected PanelCreated FabricChanged
GarmentEventContext
Properties, fields, and events:
GarmentEvent Event { get; }
GarmentComponent Garment { get; }
int Variant { get; }
PatternPanel Panel { get; }
Fabric PreviousFabric { get; }
Fabric Fabric { get; }
ModInventoryKind
Values:
Fabrics Accessories
ModLifecycleContext
Properties, fields, and events:
ModLifecycleEvent Event { get; }
int SaveSlot { get; }
string SceneName { get; }
ModLifecycleEvent
Values:
ContentReady SaveLoading SaveLoaded BeforeSave AfterSave SceneLoaded ReturnedToTitle SaveDeleted
Input and shortcuts
ModInputApi
Shares gameplay input between plugins. Unity UI input is unchanged.
| Method or constructor | Use |
|---|---|
static IDisposable Register(ModContext owner, string localId, ModInputChannel channels, Func<bool> active, int priority = 0)
|
Evaluated before native input reads, even before the plugin's Update. |
static string GetOwner(ModInputChannel channel)
|
Get the active owner of one input channel, or null when it is unclaimed. |
static bool HasControl(ModContext owner, ModInputChannel channel)
|
Check whether your plugin can use one input channel. |
static Vector2 ReadMouseWheel(ModContext owner)
|
Read the wheel while your plugin has control and gameplay input is available. |
ModKeybindApi
Remappable mod actions in Mod Settings > Keybinds.
| Method or constructor | Use |
|---|---|
static IDisposable Register(string modId, string localId, string displayName, KeyCode primary, KeyCode alternate = KeyCode.None)
|
Registers a mod action. Dispose on unload. |
static bool IsHeld(string id)
|
Check whether a registered action is held. |
static bool WasPressed(string id)
|
Check whether a registered action was pressed this frame. |
static bool WasReleased(string id)
|
Check whether a registered action was released this frame. |
Properties, fields, and events:
static bool InputSuppressed { get; }
ModInputChannel
Combine these flags with |.
Values:
MouseWheel = 1 PrimaryPointer = 2 SecondaryPointer = 4 Camera = 8 Keyboard = 16
Mod Settings
ModSettingsApi
| Method or constructor | Use |
|---|---|
static ModSettingsTab Register(ModContext owner, string id, string title, ModSettingsCategory category, params ModSetting[] settings)
|
Register a settings tab or an owned section in a built-in category. |
static ModSettingsTab Register(string id, string title, params ModSetting[] settings)
|
Register a settings tab or an owned section in a built-in category. |
static ModSettingsTab RegisterInAccessories(string id, string title, params ModSetting[] settings)
|
Adds an Accessories section. Dispose on unload. |
static ModSettingsTab RegisterInGameplay(string id, string title, params ModSetting[] settings)
|
Adds a Gameplay section. Dispose on unload. |
static ModSettingsTab RegisterInAppearance(string id, string title, params ModSetting[] settings)
|
Adds an Appearance section. Dispose on unload. |
static ModSettingsTab RegisterInRecovery(string id, string title, params ModSetting[] settings)
|
Adds a Recovery section. Dispose on unload. |
static ModSettingsTab RegisterInKeybinds(string id, string title, params ModSetting[] settings)
|
Adds a Keybinds section. Dispose on unload. |
static ModSettingsTab RegisterInGraphics(string id, string title, params ModSetting[] settings)
|
Adds a Graphics section. Dispose on unload. |
ModSettingsTab
| Method or constructor | Use |
|---|---|
void Dispose()
|
Remove the registered settings tab or section. |
Properties, fields, and events:
string Id { get; }
string Title { get; }
ReadOnlyCollection<ModSetting> Settings { get; }
AccessibilitySettings
Properties, fields, and events:
static ConfigEntry<bool> StillSewingGuides { get; }
static ConfigEntry<bool> SoftSewingGuideColors { get; }
static ConfigEntry<bool> StillCuttingArrow { get; }
static ConfigEntry<bool> StillPatternWarnings { get; }
static ConfigEntry<float> Brightness { get; }
static ConfigEntry<float> Saturation { get; }
static ConfigEntry<float> SewingView { get; }
Brightness: Deprecated. Unused. Brightness is no longer adjustable here.
Saturation: Deprecated. Unused. Saturation is no longer adjustable here.
ModActionSetting
Inherits from ModSetting.
| Method or constructor | Use |
|---|---|
ModActionSetting(string title, string description, Func<string> action)
|
Create a settings button whose callback returns a status message. |
Properties, fields, and events:
Func<string> Action { get; }
ModSetting
Properties, fields, and events:
string Title { get; }
string Description { get; }
ModSettingsCategory
Values:
Gameplay Accessories Appearance Recovery Keybinds Graphics
ModSliderSetting
Inherits from ModSetting.
| Method or constructor | Use |
|---|---|
ModSliderSetting(string title, string description, ConfigEntry<float> entry, float minimum, float maximum, bool wholeNumbers = false, string suffix = "")
|
Create a slider backed by a float config entry, with limits and display options. |
Properties, fields, and events:
ConfigEntry<float> Entry { get; }
float Minimum { get; }
float Maximum { get; }
bool WholeNumbers { get; }
string Suffix { get; }
ModToggleSetting
Inherits from ModSetting.
| Method or constructor | Use |
|---|---|
ModToggleSetting(string title, string description, ConfigEntry<bool> entry)
|
Create a toggle backed by a boolean config entry. |
Properties, fields, and events:
ConfigEntry<bool> Entry { get; }
Save data and portable content
ModContentApi
Recovery and export metadata for plugin content.
| Method or constructor | Use |
|---|---|
static ModContentInfo Describe(ScriptableEnum value)
|
Read the recorded content owner, ID, GUID, kind, and plugin requirement. |
static void RegisterFallback(ModContext owner, ScriptableEnum value, ScriptableEnum nativeFallback)
|
Records a native substitute; the saved custom ID is unchanged. |
static IDisposable RegisterAlias(ModContext owner, string oldLocalId, ScriptableEnum value)
|
Maps a previous local ID to a renamed item. |
static void SetExportDefinition(ModContext owner, Fabric value, FabricDefinition definition)
|
Supply a file-based definition to include this item in exported dresses. |
static void SetExportDefinition(ModContext owner, AccessoryDefinition value, ModAccessoryDefinition definition)
|
Supply a file-based definition to include this item in exported dresses. |
static void SetExportDefinition(ModContext owner, GarmentComponent value, ModGarmentDefinition definition)
|
Supply a file-based definition to include this item in exported dresses. |
static void SetExportAttributions(ModContext owner, ScriptableEnum value, IEnumerable<ModAttribution> attributions)
|
Set the credits included with an exported item. |
ModSaveDataApi
| Method or constructor | Use |
|---|---|
static void CopySlotData(int sourceSlot, int destinationSlot)
|
Copies stored sidecar data after a caller copies the base game slot. Both slots must be closed. |
ModSaveData
Versioned plugin data saved beside the current game save. Write changes are committed after the game saves successfully.
| Method or constructor | Use |
|---|---|
T Read<T>(string key, int schemaVersion = 1, Func<JToken, int, JToken> migrate = null)
|
Read a per-save value, optionally migrating it to the requested schema version. |
void Write<T>(string key, T value, int schemaVersion = 1)
|
Update an in-memory per-save value for the next game save. |
void Delete(string key)
|
Remove an in-memory per-save entry for the next game save. |
ModAttribution
Properties, fields, and events:
string Name { get; set; }
string Author { get; set; }
string License { get; set; }
string Url { get; set; }
string Notes { get; set; }
ModContentInfo
Properties, fields, and events:
string ModId { get; }
string Name { get; }
string Guid { get; }
string Kind { get; }
bool RequiresPlugin { get; }
Fabrics and shaders
FabricModApi
Registers fabrics from C#, validated like mod.json.
| Method or constructor | Use |
|---|---|
static void WhenReady(Action callback)
|
Runs after manifest fabrics load, or immediately if ready. |
static Fabric FindFabric(string id)
|
Find a base-game or modded fabric by ID. |
static Fabric[] GetFabrics()
|
Get base-game and modded fabrics. |
static FabricType FindType(string id)
|
Finds a native or registered fabric type by full ID. |
static ItemTag FindTag(string id)
|
Finds a native or registered item tag by full ID. |
static FabricType RegisterType(string modId, string localId, string displayName)
|
Registers a fabric type under a namespaced ID. |
static ItemTag RegisterTag(string modId, string localId, string displayName)
|
Registers an item tag for fabrics, accessories and garments. |
static Fabric Register(string modId, FabricDefinition definition, string assetDirectory)
|
Registers a fabric under a stable ID. |
static Fabric RegisterFromBase(string baseFabricId, string modId, string localId, string displayName, string assetDirectory, Action<FabricDefinition> configure = null)
|
Registers a fabric, copying omitted fields from a base fabric. |
static FabricShaderBundle LoadShaderBundle(string bundlePath, string shaderAssetName)
|
Loads a shader from an AssetBundle. Keep the handle for the plugin's lifetime. |
Properties, fields, and events:
static bool IsReady { get; }
ModShaderApi
| Method or constructor | Use |
|---|---|
static ModShaderRegistration Register(ModContext owner, ModShaderDefinition definition)
|
Register a shader provider and its material or view configuration callbacks. |
static ModShaderRegistration[] GetShaders()
|
Get registered shader choices. |
static ModShaderRegistration Find(string id)
|
Find a shader registration by full ID. |
FabricShaderBundle
| Method or constructor | Use |
|---|---|
void Dispose()
|
Unload the shader bundle handle when its users have finished. |
Properties, fields, and events:
Shader Shader { get; }
ModShaderRegistration
| Method or constructor | Use |
|---|---|
void Dispose()
|
Remove the shader choice from the registry. |
Properties, fields, and events:
string Id { get; }
string Name { get; }
Shader Shader { get; }
bool ShowInFabricCreator { get; }
string MainTextureProperty { get; }
FabricDefinition
Properties, fields, and events:
string Id { get; set; }
string Name { get; set; }
string BaseFabric { get; set; }
string FabricType { get; set; }
List<string> Colors { get; set; }
string Texture { get; set; }
FabricMaterialDefinition Material { get; set; }
int? Cost { get; set; }
int? UnlockLevel { get; set; }
List<FabricTagDefinition> TagWeights { get; set; }
string Notes { get; set; }
Shader RuntimeShader { get; set; }
Texture2D RuntimeTexture { get; set; }
Action<Material> ConfigureMaterial { get; set; }
FabricMaterialDefinition
Properties, fields, and events:
string Shader { get; set; }
string Color { get; set; }
float[] MainTextureScale { get; set; }
float[] MainTextureOffset { get; set; }
int? RenderQueue { get; set; }
List<string> Keywords { get; set; }
Dictionary<string, float> Floats { get; set; }
Dictionary<string, int> Ints { get; set; }
Dictionary<string, string> Colors { get; set; }
Dictionary<string, float[]> Vectors { get; set; }
Dictionary<string, string> Textures { get; set; }
Dictionary<string, float[]> TextureScales { get; set; }
Dictionary<string, float[]> TextureOffsets { get; set; }
FabricTagDefinition
Properties, fields, and events:
string Tag { get; set; }
float Weight { get; set; }
ModFabricTag
Properties, fields, and events:
string Id { get; set; }
string Name { get; set; }
ModFabricType
Properties, fields, and events:
string Id { get; set; }
string Name { get; set; }
ModShaderDefinition
Properties, fields, and events:
string Id { get; set; }
string Name { get; set; }
Shader Shader { get; set; }
bool ShowInFabricCreator { get; set; }
string MainTextureProperty { get; set; }
Action<Material> ConfigureMaterial { get; set; }
Action<FabricRenderContext> ConfigureView { get; set; }
Fabric rendering
FabricRenderApi
Session-only material overrides applied after native properties.
| Method or constructor | Use |
|---|---|
static FabricRenderRegistration Register(Fabric fabric, FabricRenderSurface surfaces, Action<FabricRenderContext> configure, int priority = 0)
|
Overrides one fabric. Higher priority runs later; ties keep registration order. |
static FabricRenderRegistration Register(ModContext owner, string id, Fabric fabric, FabricRenderSurface surfaces, Action<FabricRenderContext> configure, int priority = 0)
|
Owns the override lifetime. Higher priorities apply later; ties sort by plugin and rule ID. |
FabricRenderContext
A game- or loader-owned material for the current view. Apply rendering changes to this material.
| Method or constructor | Use |
|---|---|
bool HasOriginalProperty(string name)
|
Check whether the original material has this shader property. |
Texture GetOriginalTexture(string name)
|
Read an original material texture. |
Color GetOriginalColor(string name)
|
Read an original material colour. |
float GetOriginalFloat(string name)
|
Read an original material float. |
Vector4 GetOriginalVector(string name)
|
Read an original material vector. |
Vector2 GetOriginalTextureScale(string name)
|
Read the original texture scale. |
Vector2 GetOriginalTextureOffset(string name)
|
Read the original texture offset. |
void UseShader(Shader shader)
|
Swaps the shader, keeping properties. It must support the view's features. |
Properties, fields, and events:
Fabric Fabric { get; }
FabricRenderSurface Surface { get; }
Material Material { get; }
Shader OriginalShader { get; }
FabricRenderRegistration
| Method or constructor | Use |
|---|---|
void Refresh()
|
Reapplies callbacks after a setting changes. |
void Dispose()
|
Removes this callback and recomposes the rest. |
FabricRenderSurface
Combine these flags with |.
Values:
Shop = 1 Preview = 2 CuttingTable = 4 Garment = 8 Hover = 16 Animation = 32 Unlock = 64 All = Shop | Preview | CuttingTable | Garment | Hover | Animation | Unlock
Textures and previews
ModTextureApi
Residency of loader-managed images. Main thread only.
| Method or constructor | Use |
|---|---|
static bool IsManaged(Texture texture)
|
True if the loader manages this pack image's resolution. |
static IDisposable Pin(Texture texture)
|
Load a managed image at full resolution and prevent eviction until disposed. |
static IDisposable RegisterMaterial(Material material, Func<bool> isInUse = null)
|
Track a material while it is in use. Use Pin for immediate full resolution. |
static IDisposable RegisterRenderer(Renderer renderer, Func<bool> isInUse = null)
|
Tracks current materials while visible. Supply a predicate for custom or instanced drawing. |
static void NotifyChanged(Component component)
|
Requests a fresh material check after a renderer or UI graphic changes. Main thread only. |
Properties, fields, and events:
static long ResidentBytes { get; }
static long BudgetBytes { get; }
ResidentBytes: Estimated GPU bytes for managed images. CPU copies and temporary loads are extra.
BudgetBytes: Soft GPU budget. Visible or pinned images may exceed it.
ModTextureHandle
Owns a texture loaded through ModTextureLoader. Keep the handle alive while materials use its texture.
| Method or constructor | Use |
|---|---|
IDisposable Pin()
|
Load the original image and keep it resident until the pin is disposed. |
void Dispose()
|
Release your texture handle. |
Properties, fields, and events:
Texture2D Texture { get; }
ModTextureLoader
| Method or constructor | Use |
|---|---|
ModTextureHandle Load(string relativePath, ModTextureOptions options = null)
|
Load an image relative to the plugin directory with the chosen texture options. |
ModTextureOptions
Properties, fields, and events:
TextureColorSpace ColorSpace { get; set; }
bool Stream { get; set; }
bool Mipmaps { get; set; }
TextureWrapMode WrapU { get; set; }
TextureWrapMode WrapV { get; set; }
FilterMode Filter { get; set; }
TextureColorSpace
Values:
SRgb Linear
Accessories and prefab loading
AccessoryModApi
| Method or constructor | Use |
|---|---|
static void WhenReady(Action callback)
|
Run after accessory registration, or immediately if it has finished. |
static AccessoryDefinition Find(string id)
|
Find an accessory by its registered ID. |
static AccessoryDefinition Register(ModContext owner, ModAccessoryDefinition definition)
|
Register an accessory from a pack-style definition owned by your plugin. |
static AccessoryFactoryRegistration RegisterFactory(ModContext owner, ModAccessoryDefinition definition, Func<AccessoryItem> factory)
|
Builds the prefab on first use. Return an inactive clone; the loader owns it. |
AccessoryPrefabApi
Accessory prefab access. Main thread only; loads synchronously.
| Method or constructor | Use |
|---|---|
static void WhenCatalogReady(Action callback)
|
Runs after pack registration, or immediately if finished. |
static AccessoryItem GetPrefab(AccessoryDefinition accessory)
|
Shared prefab, built on first use. Clone its mesh before editing geometry. Throws on failure. |
static UnityEngine.Sprite GetIcon(AccessoryDefinition accessory)
|
Returns the shared accessory icon, loading it immediately if needed. Main thread only. |
static AccessoryPrefabState GetState(AccessoryDefinition accessory)
|
Read the prefab loading state. |
static Exception GetError(AccessoryDefinition accessory)
|
Read the error recorded for a failed prefab. |
static void Request(AccessoryDefinition accessory, Action<AccessoryItem> ready, Action<Exception> failed)
|
Load the prefab synchronously, then call the ready or failed callback. |
Properties, fields, and events:
static bool IsCatalogReady { get; }
static event Action<AccessoryDefinition, AccessoryItem> PrefabReady
static event Action<AccessoryDefinition, Exception> PrefabFailed
PrefabReady: Raised once when a deferred prefab is built. Shared; clone before editing.
PrefabFailed: Raised once if a deferred factory fails.
AccessoryFactoryRegistration
| Method or constructor | Use |
|---|---|
void Dispose()
|
Stops deferred creation; restores the base prefab. |
Properties, fields, and events:
AccessoryDefinition Accessory { get; }
AccessoryPrefabState
Values:
Pending Loading Ready Failed
ModAccessoryDefinition
Properties, fields, and events:
string Id { get; set; }
string Name { get; set; }
string BaseAccessory { get; set; }
bool ReuseAsset { get; set; }
float? BeadSpacing { get; set; }
string Model { get; set; }
string Texture { get; set; }
FabricMaterialDefinition Material { get; set; }
string Icon { get; set; }
string AccessoryType { get; set; }
int? Cost { get; set; }
int? UnlockLevel { get; set; }
List<FabricTagDefinition> TagWeights { get; set; }
string Notes { get; set; }
Placement and trim editing
AdvancedTrimHooks exposes trim-editor callbacks and undo registration. Assign callback properties while your editor owns them, and release those assignments when it unloads.
AccessoryPlacementApi
Registers accessory placement rules, optionally with trim points.
| Method or constructor | Use |
|---|---|
static IDisposable Register(string id, Func<AccessoryPlacementContext, AccessoryPlacementSuggestion> callback)
|
Registers a placement rule. First rule to suggest wins the frame. |
static IDisposable Register(string id, Func<AccessoryPlacementContext, AccessoryPlacementSuggestion> callback, bool includeTrims)
|
Opts in to trim points; history holds neighbouring points. |
static IDisposable Register(ModContext owner, string id, Func<AccessoryPlacementContext, AccessoryPlacementSuggestion> callback, bool includeTrims = false, int priority = 0)
|
Higher priorities run first; owned rules with equal priority sort by plugin and rule ID. |
static bool TryResolveTrimPoint(AccessoryPlacementController controller, AccessoryItemPath path, int insertionIndex, ref Vector3 point, ref Vector3 normal)
|
Apply placement rules to a world point; return whether a surface was found. |
AdvancedTrimHooks
| Method or constructor | Use |
|---|---|
static void DiscardNativeEdit(AccessoryItemPath path)
|
Ask the registered edit handler to discard the native trim edit. |
static void RecordAddedPoints(AccessoryItemPath path, IEnumerable<AccessoryPin> pins)
|
Pass added trim points to the registered history handler. |
static void RecordUndo(Func<bool?> undo)
|
Add a trim edit to placement history. Overloads accept redo and discarded-history callbacks. |
static void RecordUndo(Func<bool?> undo, Func<bool?> redo)
|
Add a trim edit to placement history. Overloads accept redo and discarded-history callbacks. |
static void RecordUndo(Func<bool?> undo, Func<bool?> redo, Action discard)
|
Add a trim edit to placement history. Overloads accept redo and discarded-history callbacks. |
Properties, fields, and events:
static Func<bool> IsEditing { get; set; }
static Func<int> PauseSuppressionFrame { get; set; }
static bool Editing { get; }
static int SuppressPauseThroughFrame { get; }
static Action<AccessoryItemPath> DiscardNativeEditAction { get; set; }
static Action<AccessoryItemPath, IEnumerable<AccessoryPin>> RecordAddedPointsAction { get; set; }
AccessoryGuideAxis
Values:
None Vertical Horizontal
AccessoryPlacementContext
Mannequin-local metres. X is sideways, Y is up the garment.
Properties, fields, and events:
Vector2 Position { get; }
Vector2 LastPosition { get; }
Vector2 PreviousPosition { get; }
bool HasLast { get; }
bool HasPrevious { get; }
AccessoryDefinition Definition { get; }
bool IsTrimPoint { get; }
AccessoryPlacementSuggestion
A rule's preview and placement request.
Properties, fields, and events:
bool Snap { get; set; }
Vector2 Target { get; set; }
bool ShowMeasurement { get; set; }
bool DetailedMeasurement { get; set; }
AccessoryGuideAxis GuideAxis { get; set; }
string ModeLabel { get; set; }
float GridSpacing { get; set; }
GridSpacing: Grid spacing in metres. Zero hides the grid.
Garments, panels, and tags
GarmentModApi
Garment registration and asset helpers.
| Method or constructor | Use |
|---|---|
static void WhenReady(Action callback)
|
Runs after garment packs load, or immediately if ready. |
static void RegisterPieceType(string id, GarmentComponent.Type value, string displayName)
|
Register in Awake, before packs load. Your plugin supplies gameplay support. |
static void SetPieceType(GarmentComponent component, string pieceType)
|
Assigns a registered category, keeping base class and fitting data. |
static void LoadAssets(GarmentComponent component)
|
Load a pack garment's meshes and sketches before reading or editing its variations. Main thread only. |
static GarmentComponent FindComponent(string id)
|
Find a garment and load its deferred assets before returning it. |
static GarmentComponent[] GetComponents()
|
Get garment components and load their deferred assets. |
static ItemTag FindTag(string id)
|
Find a base-game or modded garment tag by ID. |
static ItemTag[] GetTags()
|
Get the native and registered garment tags. |
static ItemTag RegisterTag(string modId, string localId, string displayName)
|
Creates a namespaced tag that saves resolve next launch. |
static GarmentComponent RegisterComponent(string modId, ModGarmentDefinition definition, string assetDirectory)
|
Registers a garment from a mod.json-style definition. |
static GarmentComponent RegisterFromBase(string baseComponentId, string modId, string localId, string displayName, Action<GarmentComponent> configure)
|
Copies a base garment, applies edits and registers it. |
static void SetAutoUnlock(GarmentComponent component, bool enabled)
|
Set automatic availability while preserving earned unlocks. |
static Sprite LoadIcon(string assetDirectory, string file)
|
Load a garment icon from the asset directory. |
static void ConfigureCompatibility(GarmentComponent component, GarmentCompatibilityOptions options)
|
Changes native combination rules; exclusions re-resolve as garments register. |
static GarmentMeshDiagnostic[] InspectPanelMesh(Mesh mesh)
|
Inspect mesh UVs, tangents, and scale and return diagnostics. |
static Mesh TransformPanelMesh(Mesh mesh, GarmentMeshTransform transform)
|
Returns a transformed copy. Caller owns it. |
static Texture2D LoadSketch(string assetDirectory, string file)
|
Load a garment sketch image from the asset directory. |
static string[] GetPanelZoneNames()
|
Zone names accepted by garment JSON and ParsePanelZones. |
static Mannequin.Zones ParsePanelZones(params string[] names)
|
Combines named zones. Numeric, empty, unknown and None are rejected. |
static PatternPanelDefinition CreatePanel(Mesh mesh, string name, Mannequin.Zones zones, Vector3? grainDirection = null, bool isBiasCut = false)
|
Create an independent panel using a mesh owned by your plugin. |
static Mesh LoadPanelMesh(string assetDirectory, string file)
|
Load a panel mesh from the asset directory. |
Properties, fields, and events:
static bool IsReady { get; }
ModGarmentPanel
| Method or constructor | Use |
|---|---|
bool ShouldSerializeBasePanel()
|
Tell the JSON serializer whether to include BasePanel. |
Properties, fields, and events:
string NormalMap { get; set; }
string AmbientOcclusionMap { get; set; }
bool? FlipNormalGreen { get; set; }
GarmentMeshTransform Transform { get; set; }
int BasePanel { get; set; }
List<string> Zones { get; set; }
string Model { get; set; }
string Name { get; set; }
float[] GrainDirection { get; set; }
bool? IsBiasCut { get; set; }
GarmentCompatibilityOptions
Properties, fields, and events:
bool? UsesSleeves { get; set; }
string CollarType { get; set; }
string WaistType { get; set; }
bool? DetachedSleeves { get; set; }
string[] ExcludedComponents { get; set; }
GarmentMeshDiagnostic
Properties, fields, and events:
string Code { get; }
string Message { get; }
GarmentMeshTransform
Properties, fields, and events:
float[] Scale { get; set; }
float[] Rotation { get; set; }
float[] Offset { get; set; }
GarmentTagWeight
Properties, fields, and events:
string Tag { get; set; }
float Weight { get; set; }
ModGarmentDefinition
Properties, fields, and events:
GarmentCompatibilityOptions Compatibility { get; set; }
bool? FlipNormalGreen { get; set; }
string NormalMap { get; set; }
string AmbientOcclusionMap { get; set; }
bool UnlockByDefault { get; set; }
string Id { get; set; }
string Name { get; set; }
string PieceType { get; set; }
string BaseComponent { get; set; }
string Icon { get; set; }
string Sketch { get; set; }
List<GarmentTagWeight> TagWeights { get; set; }
bool ReplaceTags { get; set; }
List<ModGarmentVariant> Variants { get; set; }
string Notes { get; set; }
ModGarmentTag
Properties, fields, and events:
string Id { get; set; }
string Name { get; set; }
ModGarmentVariant
Properties, fields, and events:
bool? FlipNormalGreen { get; set; }
string NormalMap { get; set; }
string AmbientOcclusionMap { get; set; }
int BaseVariant { get; set; }
string Sketch { get; set; }
List<ModGarmentPanel> Panels { get; set; }
Friendship rewards
FriendshipRewardApi
Adds garment rewards to friendship levels. Main thread only.
| Method or constructor | Use |
|---|---|
static CharacterDefinition FindClient(string id)
|
Find a base-game or modded client by ID or name. |
static IDisposable WhenReady(ModContext owner, Action callback)
|
Waits for clients and garments. Late subscribers run immediately. |
static IDisposable Register(ModContext owner, string localId, CharacterDefinition client, ModFriendshipReward reward)
|
Register garment rewards for a client friendship level. |
ModFriendshipReward
Properties, fields, and events:
int Level { get; set; }
List<string> Garments { get; set; }
Art and mannequin colours
ArtModApi
| Method or constructor | Use |
|---|---|
static ArtRegistration Register(string id, ArtReplacementDefinition replacement, string assetDirectory)
|
Loads a PNG/JPEG from assetDirectory. The handle owns the image. |
static ArtRegistration RegisterTexture(string id, ArtReplacementDefinition replacement, Texture2D image)
|
Registers a caller-owned image. Keep it alive past handle disposal. |
static ArtRegistration RegisterColor(string id, ArtReplacementDefinition replacement)
|
Overrides a renderer's shader colour, leaving the shared material alone. |
static string ExportAtlases(string outputDirectory)
|
Export sprite sheets and their catalog into a new subfolder. |
static ArtTarget[] GetTargets()
|
Describes portrait slots, sprites, UI images and texture slots. |
MannequinColorApi
| Method or constructor | Use |
|---|---|
static IDisposable Register(string id, MannequinColorDefinition definition)
|
Overrides shader colours for a mannequin colour preset. Dispose to restore. |
ArtRegistration
| Method or constructor | Use |
|---|---|
void Refresh()
|
Rescans scenes and reapplies art rules. |
void Dispose()
|
Restores targets, then releases owned assets. |
ArtReplacementDefinition
One art selector and its replacement file.
Properties, fields, and events:
bool Enabled { get; set; }
string Id { get; set; }
string Kind { get; set; }
string AssetName { get; set; }
string Scene { get; set; }
string ObjectPath { get; set; }
int MaterialIndex { get; set; }
string TextureProperty { get; set; }
string ColorProperty { get; set; }
string Image { get; set; }
float[] Color { get; set; }
string Portrait { get; set; }
int PortraitIndex { get; set; }
string ButtonState { get; set; }
int Priority { get; set; }
ArtTarget
Properties, fields, and events:
float[] Color { get; }
string Kind { get; }
string AssetName { get; }
string Scene { get; }
string ObjectPath { get; }
int MaterialIndex { get; }
string TextureProperty { get; }
string Portrait { get; }
int PortraitIndex { get; }
string ButtonState { get; }
int Width { get; }
int Height { get; }
MannequinColorDefinition
Properties, fields, and events:
string Id { get; set; }
bool Enabled { get; set; }
string DisplayColor { get; set; }
Dictionary<string, float[]> Colors { get; set; }
Pencil palettes
PencilColorModApi
Changes the sketchbook pencil palette and drawing color.
| Method or constructor | Use |
|---|---|
static IDisposable WhenReady(Action callback)
|
Runs once the palette exists. Dispose to cancel. |
static IDisposable AddColor(string id, Color color)
|
Appends a swatch. Prefix IDs with your mod ID. |
static IDisposable SetPalette(string id, params Color[] colors)
|
Replaces the base palette. Latest replacement wins; added swatches stay. |
static IDisposable AddCategory(string id, string name, params Color[] colors)
|
Adds a named palette beside Default. |
static PencilColorCategory[] GetCategories()
|
Lists category IDs and names, including Default. Requires IsReady. |
static string GetSelectedCategory()
|
Read the selected pencil palette category ID. |
static void SetCategory(string id)
|
Select the visible palette category while preserving the current drawing colour. |
static Color[] GetColors()
|
Copy of the effective palette. Requires IsReady. |
static Color[] GetOriginalColors()
|
Copy of the unmodified palette. Requires IsReady. |
static bool TryGetSelectedColor(out Color color)
|
False before the sketchbook exists. |
static void SetSelectedColor(Color color)
|
Set the drawing colour for the pencil and fill tools. |
Properties, fields, and events:
static bool IsReady { get; }
PencilColorCategory
Properties, fields, and events:
string Id { get; }
string Name { get; }
Music and purchase sounds
For shop audio, see the purchase sound guide.
PurchaseSoundModApi
Edits purchase sound banks for fabric and accessories.
| Method or constructor | Use |
|---|---|
static IDisposable WhenReady(Action callback)
|
Runs when the sound controller is ready. Dispose to cancel. |
static AudioClip[] GetOriginalClips(PurchaseSound sound)
|
Original clips for this outcome (copy). |
static AudioClip[] GetClips(PurchaseSound sound)
|
Effective clips for this outcome (copy). |
static IDisposable AddClip(PurchaseSound sound, string id, AudioClip clip)
|
Adds a clip to a purchase bank. Dispose on unload. |
static bool RemoveClip(PurchaseSound sound, string id)
|
Removes a clip added here. False if the ID is unknown. |
static IDisposable SuppressClip(PurchaseSound sound, AudioClip clip)
|
Hides a clip until the handle is disposed. |
Properties, fields, and events:
static bool IsReady { get; }
SoundtrackModApi
Edits the music playlist used by MusicController.PlayNext.
| Method or constructor | Use |
|---|---|
static IDisposable WhenReady(Action callback)
|
Runs when the music controller is ready, or immediately if it exists. |
static IDisposable RegisterTrack(string id, AudioClip clip)
|
Adds a clip to the playlist. Dispose on unload. |
static bool RemoveTrack(string id)
|
Removes a track added here. False if the ID is unknown. |
static IDisposable SuppressTrack(AudioClip clip)
|
Hides a game track until the handle is disposed. |
static AudioClip[] GetOriginalTracks()
|
Original playlist tracks (copy). Empty until IsReady. |
static AudioClip[] GetTracks()
|
Current playlist (copy). Empty until IsReady. |
Properties, fields, and events:
static bool IsReady { get; }
IsReady: True once the game has a music controller.
PurchaseSound
Values:
Success NotEnoughGold
Shop layout providers
ModShopApi
| Method or constructor | Use |
|---|---|
static IDisposable RegisterLayout(ModContext owner, string id, Func<Shop, ModShopLayout> layout, Func<Shop, ShopBolt, bool?> visibility = null, int priority = 0)
|
Higher priorities win; ties use plugin ID and local ID. Dispose to remove the provider. |
static ModShopLayout GetLayout(Shop shop)
|
Queries the active layout. Call on Unity's main thread, outside layout callbacks. |
static bool IsFabricPreviewVisible(Shop shop, ShopBolt bolt)
|
Queries viewport visibility, including the active provider's optional override. |
static int GetAccessoryHolderCapacity(AccessoryShopHolder holder)
|
Returns the current physical slot count, including changes made by other mods. |
ModShopLayout
A column-major fabric layout. Return a layout for shops your provider handles, or null to let another provider handle the request.
| Method or constructor | Use |
|---|---|
ModShopLayout(int fabricRows)
|
Describe a column-major fabric layout with 1 to 32 rows. |
Properties, fields, and events:
int FabricRows { get; }
Console commands and diagnostics
DebugConsoleApi
In-game Ctrl+` console commands and output. Main thread only.
| Method or constructor | Use |
|---|---|
static IDisposable Register(string name, string description, Func<string, string> handler)
|
Registers a command. Dispose on unload. |
static string Run(string commandLine)
|
Runs a command line; output goes to the console. |
static void Write(string message)
|
Adds text to the bounded output history. |
Properties, fields, and events:
static bool IsOpen { get; }
ModDiagnosticReporter
| Method or constructor | Use |
|---|---|
void Warning(string code, string message)
|
Report a recoverable problem with your plugin ID. |
void Error(string code, string message)
|
Report an error with your plugin ID. |
void Report(ModProblem problem)
|
Report a structured problem to Loading problems and the log. |
ModProblem
Properties, fields, and events:
string Code { get; set; }
string Message { get; set; }
string ItemId { get; set; }
string File { get; set; }
string Details { get; set; }
ModProblemSeverity Severity { get; set; }
ModProblemSeverity
Values:
Warning Error