Class Mod
Supports all classes in the .NET Framework class hierarchy and provides low-level services to derived classes. This is the ultimate base class of all classes in the .NET Framework; it is the root of the type hierarchy.To browse the .NET Framework source code for this type, see the Reference Source.
Inherited Members
Namespace: Modding
Assembly: Assembly-CSharp.mm.dll
Syntax
[PublicAPI]
public abstract class Mod : Loggable, IMod, ILogger
Constructors
Mod(string)
Constructs the mod, assigns the instance and sets the name.
Declaration
protected Mod(string name = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name |
Fields
Name
The Mods Name
Declaration
public readonly string Name
Field Value
| Type | Description |
|---|---|
| string |
Methods
GetMenuButtonText()
If this mod defines a menu via the IMenuMod or ICustomMenuMod interfaces, override this method to change the text of the button to jump to this mod's menu.
Declaration
public virtual string GetMenuButtonText()
Returns
| Type | Description |
|---|---|
| string |
GetName()
Get's the Mod's Name
Declaration
public string GetName()
Returns
| Type | Description |
|---|---|
| string |
GetPreloadNames()
Returns the objects to preload in order for the mod to work.
Declaration
public virtual List<(string, string)> GetPreloadNames()
Returns
| Type | Description |
|---|---|
| List<(string, string)> | A List of tuples containing scene name, object name |
GetVersion()
Returns version of Mod
Declaration
public virtual string GetVersion()
Returns
| Type | Description |
|---|---|
| string | Mod Version |
Initialize()
Called after preloading of all mods.
Declaration
public virtual void Initialize()
Initialize(Dictionary<string, Dictionary<string, GameObject>>)
Called after preloading of all mods.
Declaration
public virtual void Initialize(Dictionary<string, Dictionary<string, GameObject>> preloadedObjects)
Parameters
| Type | Name | Description |
|---|---|---|
| Dictionary<string, Dictionary<string, GameObject>> | preloadedObjects | The preloaded objects relevant to this Mod |
LoadPriority()
Controls when this mod should load compared to other mods. Defaults to ordered by name.
Declaration
public virtual int LoadPriority()
Returns
| Type | Description |
|---|---|
| int |
PreloadSceneHooks()
A list of requested scenes to be preloaded and actions to execute on loading of those scenes
Declaration
public virtual (string, Func<IEnumerator>)[] PreloadSceneHooks()
Returns
| Type | Description |
|---|---|
| (string, Func<IEnumerator>)[] | List of tuples containg scene names and the respective actions. |
SaveGlobalSettings()
Save global settings to saves folder.
Declaration
protected void SaveGlobalSettings()