Open main menu
Home
Random
Log in
Settings
About Stardew Valley Wiki
Disclaimers
Stardew Valley Wiki
Search
Changes
← Older edit
Newer edit →
Modding:Modder Guide/Get Started
(view source)
Revision as of 15:29, 30 September 2020
20 bytes added
,
15:29, 30 September 2020
m
→Crossplatform support
:
standardize code
Line 185:
Line 185:
<source lang="c#">
<source lang="c#">
// ✘ Don't do this! It will crash on Linux/Mac.
// ✘ Don't do this! It will crash on Linux/Mac.
−
string path = Helper.DirectoryPath + "\assets\asset.xnb";
+
string path =
this.
Helper.DirectoryPath + "\assets\asset.xnb";
// ✓ This is OK
// ✓ This is OK
−
string path = Path.Combine(Helper.DirectoryPath, "assets", "asset.xnb");
+
string path = Path.Combine(
this.
Helper.DirectoryPath, "assets", "asset.xnb");
</source></li>
</source></li>
−
<li>Use <tt>Helper.DirectoryPath</tt>, don't try to determine the mod path yourself.
+
<li>Use <tt>
this.
Helper.DirectoryPath</tt>, don't try to determine the mod path yourself.
<source lang="c#">
<source lang="c#">
Line 198:
Line 198:
// ✓ This is OK
// ✓ This is OK
−
string modFolder = Helper.DirectoryPath;
+
string modFolder =
this.
Helper.DirectoryPath;
</source></li>
</source></li>
</ol>
</ol>
Pathoschild
translators
8,446
edits