Editing User:Dninemfive
Jump to navigation
Jump to search
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 6: | Line 6: | ||
== Introduction to reading Def classes == | == Introduction to reading Def classes == | ||
− | This article is intended for XML modders who don't want to work with C# (even though it's [[Plague Gun (1.1)|much less imposing than you think]]) but want to know what exactly they can write in their defs. | + | This article is intended for XML modders who don't want to work with C# (even though it's [[Modding Tutorials/Plague Gun (1.1)|much less imposing than you think]]) but want to know what exactly they can write in their defs. |
=== Definitions === | === Definitions === | ||
− | '''Fields''' are variables in C# class defintions defined at the top of classes (when decompiled). For example, <source lang="csharp"> | + | '''Fields'''' are variables in C# class defintions defined at the top of classes (when decompiled). For example, <source lang="csharp"> |
public class ExampleDef : Def { | public class ExampleDef : Def { | ||
public bool exampleBool = true; | public bool exampleBool = true; | ||
Line 44: | Line 44: | ||
=== ModLister.RoyaltyInstalled === | === ModLister.RoyaltyInstalled === | ||
In C#, the canonical check for whether Royalty is installed is <code>ModLister.RoyaltyInstalled</code>. Notably, this check whether the Steam user ''owns'' Royalty, rather than whether it's enabled in the load order. | In C#, the canonical check for whether Royalty is installed is <code>ModLister.RoyaltyInstalled</code>. Notably, this check whether the Steam user ''owns'' Royalty, rather than whether it's enabled in the load order. | ||
− | === | + | === IfModLoaded === |
− | You can use the <code> | + | You can use the <code>IfModLoaded</code> and <code>IfModNotLoaded</code> attributes in <code>LoadFolders.xml</code> to conditionally load defs, treating Royalty as a mod. |
<source lang="xml"> | <source lang="xml"> | ||
<loadFolders> | <loadFolders> | ||
<default> | <default> | ||
<li>/</li> | <li>/</li> | ||
− | <li | + | <li IfModLoaded="Royalty">RoyaltyDefs</li> |
</default> | </default> | ||
</loadFolders> | </loadFolders> |