Changes

no edit summary
Line 375: Line 375:     
<ol>
 
<ol>
<li>Create your model. This is just a 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.)
+
<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.
    
You can set defaults directly:
 
You can set defaults directly:
Line 407: Line 407:  
<source lang="c#">
 
<source lang="c#">
 
ModConfig config = helper.ReadConfig<ModConfig>();
 
ModConfig config = helper.ReadConfig<ModConfig>();
 +
</source>
 +
 +
Example:
 +
<source lang="c#">
 +
public override void Entry(IModHelper helper)
 +
{
 +
ModConfig config = helper.ReadConfig<ModConfig>();
 +
}
 
</source>
 
</source>
 
</li>
 
</li>
6

edits