Changes

Jump to navigation Jump to search
no edit summary
Line 375: Line 375:     
<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 <source lang="c#">static</source> 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.
    
You can set defaults directly:
 
You can set defaults directly:
Line 412: Line 412:  
<source lang="c#">
 
<source lang="c#">
 
public override void Entry(IModHelper helper)
 
public override void Entry(IModHelper helper)
{
+
  {
ModConfig config = helper.ReadConfig<ModConfig>();
+
      ModConfig config = helper.ReadConfig<ModConfig>();
}
+
  }
 
</source>
 
</source>
 
</li>
 
</li>
6

edits

Navigation menu