Changes

Jump to navigation Jump to search
no edit summary
Line 376: Line 376:  
<ol>
 
<ol>
 
<li>Create your model. This is just a C# class with properties for the config options you want, and it can contain almost anything from a few boolean fields to a complex object graph (You should try to keep it simple for your users, though). Be sure to declare the values as static to access them outside of the class.
 
<li>Create your model. This is just a C# class with properties for the config options you want, and it can contain almost anything from a few boolean fields to a complex object graph (You should try to keep it simple for your users, though). Be sure to declare the values as static to access them outside of the class.
 
+
<br />You can set defaults directly:
 
  −
You can set defaults directly:
      
<source lang="c#">
 
<source lang="c#">
Line 412: Line 410:  
Example:
 
Example:
 
<source lang="c#">
 
<source lang="c#">
  public class ModEntry : Mod
+
public class ModEntry : Mod
 +
{
 +
  public override void Entry(IModHelper helper)
 
   {
 
   {
     public override void Entry(IModHelper helper)
+
     ModConfig config = helper.ReadConfig<ModConfig>();
    {
+
  }
      ModConfig config = helper.ReadConfig<ModConfig>();
  −
    }
   
}
 
}
 
</source>
 
</source>
6

edits

Navigation menu