Changes
Jump to navigation
Jump to search
← 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,404
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