Alterações

Saltar para a navegação Saltar para a pesquisa
Linha 180: Linha 180:     
<ol>
 
<ol>
<li>Use the [https://github.com/Pathoschild/Stardew.ModBuildConfig#readme crossplatform build config] package to automatically set up your project references. This makes crossplatform compatibility easier and lets your code compile on any platform. (If you followed the above guide, you already have this.)</li>
+
<li>Use o pacote [https://github.com/Pathoschild/Stardew.ModBuildConfig#readme configuração de compilação multiplataforma] para ajustar as referencias do seu projeto automaticamente. Isso facilita a compatibilidade entre plataformas, além de deixar seu código compilar em qualquer plataforma. (Se você tiver seguido o guia acima, já tem isso.)</li>
   −
<li>Use <samp>Path.Combine</samp> to build file paths, don't hardcode path separators since they won't work on all platforms.
+
<li>Use <samp>Path.Combine</samp> para criar caminhos de arquivo, não codifique os separadores de caminho, pois poderão não funcionar em todas as plataformas.</li>
    
<syntaxhighlight lang="c#">
 
<syntaxhighlight lang="c#">
// ✘ Don't do this! It will crash on Linux/Mac.
+
// ✘ Não faça isso! Do contrario irá crashar (travar) no Linux/Mac.
 
string path = Helper.DirectoryPath + "\assets\asset.xnb";
 
string path = Helper.DirectoryPath + "\assets\asset.xnb";
   −
// ✓ This is OK
+
// ✓ Isso é OK
 
string path = Path.Combine(Helper.DirectoryPath, "assets", "asset.xnb");
 
string path = Path.Combine(Helper.DirectoryPath, "assets", "asset.xnb");
 
</syntaxhighlight></li>
 
</syntaxhighlight></li>
   −
<li>Use <samp>Helper.DirectoryPath</samp>, don't try to determine the mod path yourself.
+
<li>Use o <samp>Helper.DirectoryPath</samp>, Não tente determinar o caminho do mod sozinho.
    
<syntaxhighlight lang="c#">
 
<syntaxhighlight lang="c#">
// ✘ Don't do this! It will crash if SMAPI rewrites the assembly (''e.g.,'' to update or crossplatform it).
+
// ✘ Não faça isso! Ele vai crashar (travar) se o SMAPI reescrever o assembly. (''exp.'' para atualiza-lo ou torna-lo multiplataforma).
 
string modFolder = Assembly.GetCallingAssembly().Location;
 
string modFolder = Assembly.GetCallingAssembly().Location;
   −
// ✓ This is OK
+
// ✓ Isso é OK
 
string modFolder = Helper.DirectoryPath;
 
string modFolder = Helper.DirectoryPath;
 
</syntaxhighlight></li>
 
</syntaxhighlight></li>
37

edições

Menu de navegação