Changes
Jump to navigation
Jump to search
← Older edit
Newer edit →
Modding:Modder Guide/APIs/Integrations
(view source)
Revision as of 16:38, 11 November 2018
528 bytes added
,
16:38, 11 November 2018
→Mod registry
:
+ SMAPI 2.8 changes
Line 19:
Line 19:
foreach(IManifest manifest in this.Helper.ModRegistry.GetAll()) { … }
foreach(IManifest manifest in this.Helper.ModRegistry.GetAll()) { … }
</source>
</source>
+
+
{{SMAPI upcoming|2.8|content=In SMAPI 2.8, the methods return <tt>IModInfo</tt> instead of <tt>IManifest</tt>:
+
<source lang="c#">
+
// check if a mod is loaded
+
bool isLoaded = this.Helper.ModRegistry.IsLoaded("UniqueModID");
+
+
// get info for a mod
+
IModInfo mod = this.Helper.ModRegistry.Get("UniqueModID");
+
bool isContentPack = mod.IsContentPack;
+
IManifest manifest = mod.Manifest; // name, description, version, etc
+
+
// get info for all loaded mods
+
foreach(IModInfo mod in this.Helper.ModRegistry.GetAll()) { … }
+
</source>
+
}}
==Mod-provided APIs==
==Mod-provided APIs==
Pathoschild
translators
8,403
edits
Navigation menu
Personal tools
Create account
Log in
Namespaces
Modding
Discussion
Variants
Views
Read
View source
View history
More
Search
Navigation
Main page
Recent changes
Admin noticeboard
Help Editing
Random page
Official Links
Official Site
Official Forums
Official Merchandise
Discord
Reddit
Tools
Upload file
Special pages
Printable version