Changes
Jump to navigation
Jump to search
← Older edit
Newer edit →
Modding:Modder Guide/APIs/Harmony
(view source)
Revision as of 18:48, 4 November 2021
12 bytes added
,
18:48, 4 November 2021
m
Text replacement - "tt>" to "samp>"
Line 22:
Line 22:
'''Harmony should be a last resort''' (see the previous section).
'''Harmony should be a last resort''' (see the previous section).
<ol>
<ol>
−
<li>Edit your mod's <
tt
>.csproj</
tt
> project file, and add this to the first <
tt
><PropertyGroup></
tt
> section:
+
<li>Edit your mod's <
samp
>.csproj</
samp
> project file, and add this to the first <
samp
><PropertyGroup></
samp
> section:
<syntaxhighlight lang="xml">
<syntaxhighlight lang="xml">
<EnableHarmony>true</EnableHarmony>
<EnableHarmony>true</EnableHarmony>
</syntaxhighlight></li>
</syntaxhighlight></li>
−
<li>In your mod's <
tt
>Entry</
tt
> method, use Harmony's code API to register patches:
+
<li>In your mod's <
samp
>Entry</
samp
> method, use Harmony's code API to register patches:
<syntaxhighlight lang="c#">
<syntaxhighlight lang="c#">
var harmony = new Harmony(this.ModManifest.UniqueID);
var harmony = new Harmony(this.ModManifest.UniqueID);
Margotbean
Interface administrators
, patroller,
Suppressors
,
Administrators
, translators
106,748
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