Changes

Jump to navigation Jump to search
update for SMAPI 2.8 release
Line 9: Line 9:  
Your mod can get information about loaded mods, or check if a particular mod is loaded. (All mods are loaded by the time your mod's <tt>Entry(…)</tt> method is called.)
 
Your mod can get information about loaded mods, or check if a particular mod is loaded. (All mods are loaded by the time your mod's <tt>Entry(…)</tt> method is called.)
   −
<source lang="c#">
  −
// check if a mod is loaded
  −
bool isLoaded = this.Helper.ModRegistry.IsLoaded("UniqueModID");
  −
  −
// get manifest info for a mod (name, description, version, etc.)
  −
IManifest manifest = this.Helper.ModRegistry.Get("UniqueModID");
  −
  −
// get manifest info for all loaded mods
  −
foreach(IManifest manifest in this.Helper.ModRegistry.GetAll()) { … }
  −
</source>
  −
  −
{{SMAPI upcoming|2.8|content=In SMAPI 2.8, the methods return <tt>IModInfo</tt> instead of <tt>IManifest</tt>:
   
<source lang="c#">
 
<source lang="c#">
 
// check if a mod is loaded
 
// check if a mod is loaded
Line 33: Line 21:  
foreach(IModInfo mod in this.Helper.ModRegistry.GetAll()) { … }
 
foreach(IModInfo mod in this.Helper.ModRegistry.GetAll()) { … }
 
</source>
 
</source>
}}
      
==Mod-provided APIs==
 
==Mod-provided APIs==
translators
8,403

edits

Navigation menu