Alterações

m
Substituição de texto - "tt>" por "samp>"
Linha 58: Linha 58:  
# Crie uma classe vazia em um projeto com o C#.
 
# Crie uma classe vazia em um projeto com o C#.
 
# Instancie o .NET Framework 4.5, 4.5.1, ou 4.5.2 para melhor compatibilidade.
 
# Instancie o .NET Framework 4.5, 4.5.1, ou 4.5.2 para melhor compatibilidade.
# Referencie o [https://github.com/Pathoschild/Stardew.ModBuildConfig <tt>Pathoschild.Stardew.ModBuildConfig</tt> NuGet package] para adicionar automaticamente as referências corretas, dependendo da plataforma em que o mod está sendo compilado.
+
# Referencie o [https://github.com/Pathoschild/Stardew.ModBuildConfig <samp>Pathoschild.Stardew.ModBuildConfig</samp> NuGet package] para adicionar automaticamente as referências corretas, dependendo da plataforma em que o mod está sendo compilado.
# Crie uma classe com o nome <tt>ModEntry</tt> com uma subclasse chamada <tt>StardewModdingAPI.Mod</tt>.
+
# Crie uma classe com o nome <samp>ModEntry</samp> com uma subclasse chamada <samp>StardewModdingAPI.Mod</samp>.
# Reescreva o método <tt>Entry</tt>, e escreva seu código usando [[#Mod APIs|SMAPI events and APIs]].
+
# Reescreva o método <samp>Entry</samp>, e escreva seu código usando [[#Mod APIs|SMAPI events and APIs]].
# Crie um [[#Aidicione seu manifesto|<tt>manifest.json</tt>]] que descreva o seu mod para o SMAPI.
+
# Crie um [[#Aidicione seu manifesto|<samp>manifest.json</samp>]] que descreva o seu mod para o SMAPI.
 
# Crie [[#Lance seu mod|um arquivo zip contendo os arquivos do seu mod]] para o lançamento.
 
# Crie [[#Lance seu mod|um arquivo zip contendo os arquivos do seu mod]] para o lançamento.
 
}}
 
}}
Linha 71: Linha 71:  
# Create a solution with a .NET Framework class library project (see [[Modding:IDE reference#create-project|how to create a project]]). '''Certifique-se de escolher.NET Framework, not .NET Core ou .NET Standard.'''
 
# Create a solution with a .NET Framework class library project (see [[Modding:IDE reference#create-project|how to create a project]]). '''Certifique-se de escolher.NET Framework, not .NET Core ou .NET Standard.'''
 
# Change the target framework to .NET Framework 4.5, 4.5.1, or 4.5.2 for best compatibility (see [[Modding:IDE reference#set-target-framework|how to change target framework]]).
 
# Change the target framework to .NET Framework 4.5, 4.5.1, or 4.5.2 for best compatibility (see [[Modding:IDE reference#set-target-framework|how to change target framework]]).
# Reference the [https://www.nuget.org/packages/Pathoschild.Stardew.ModBuildConfig <tt>Pathoschild.Stardew.ModBuildConfig</tt> NuGet package] (see [[Modding:IDE reference#add-nuget|how to add the package]]).
+
# Reference the [https://www.nuget.org/packages/Pathoschild.Stardew.ModBuildConfig <samp>Pathoschild.Stardew.ModBuildConfig</samp> NuGet package] (see [[Modding:IDE reference#add-nuget|how to add the package]]).
 
# Restart Visual Studio/MonoDevelop after installing the package.
 
# Restart Visual Studio/MonoDevelop after installing the package.
   Linha 78: Linha 78:     
<ol>
 
<ol>
<li>Exclua o arquivo <tt>Class1.cs</tt> ou <tt>MyClass.cs</tt> (Veja [[Modding:IDE reference#delete-file|como excluir um arquivo]]).</li>
+
<li>Exclua o arquivo <samp>Class1.cs</samp> ou <samp>MyClass.cs</samp> (Veja [[Modding:IDE reference#delete-file|como excluir um arquivo]]).</li>
<li>Adicione um arquivo C# class Chamado <tt>ModEntry.cs</tt> ao seu projeto (Veja [[Modding:IDE reference#Add a file|como adicionar um arquivo]]).</li>
+
<li>Adicione um arquivo C# class Chamado <samp>ModEntry.cs</samp> ao seu projeto (Veja [[Modding:IDE reference#Add a file|como adicionar um arquivo]]).</li>
<li>Coloque este código no arquivo (replace <tt>YourProjectName</tt> with the name of your project):
+
<li>Coloque este código no arquivo (replace <samp>YourProjectName</samp> with the name of your project):
 
<syntaxhighlight lang="c#">
 
<syntaxhighlight lang="c#">
 
using System;
 
using System;
Linha 129: Linha 129:  
# <code>using X;</code> (see [https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/using-directive using directive]) makes classes in that namespace available in your code.
 
# <code>using X;</code> (see [https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/using-directive using directive]) makes classes in that namespace available in your code.
 
# <code>namespace YourProjectName</code> (see [https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/namespace namespace keyword]) defines the scope for your mod code. Don't worry about this when you're starting out, Visual Studio or MonoDevelop will add it automatically when you add a file.
 
# <code>namespace YourProjectName</code> (see [https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/namespace namespace keyword]) defines the scope for your mod code. Don't worry about this when you're starting out, Visual Studio or MonoDevelop will add it automatically when you add a file.
# <code>public class ModEntry : Mod</code> (see [https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/class class keyword]) creates your mod's main class, and subclasses SMAPI's <tt>Mod</tt> class. SMAPI will detect your <tt>Mod</tt> subclass automatically, and <tt>Mod</tt> gives you access to SMAPI's APIs.
+
# <code>public class ModEntry : Mod</code> (see [https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/class class keyword]) creates your mod's main class, and subclasses SMAPI's <samp>Mod</samp> class. SMAPI will detect your <samp>Mod</samp> subclass automatically, and <samp>Mod</samp> gives you access to SMAPI's APIs.
 
# <code>public override void Entry(IModHelper helper)</code> is the method SMAPI will call when your mod is loaded into the game. The <code>helper</code> provides convenient access to many of SMAPI's APIs.
 
# <code>public override void Entry(IModHelper helper)</code> is the method SMAPI will call when your mod is loaded into the game. The <code>helper</code> provides convenient access to many of SMAPI's APIs.
# <code>helper.Events.Input.ButtonPressed += this.OnButtonPressed;</code> adds an 'event handler' (i.e. a method to call) when the button-pressed event happens. In other words, when a button is pressed (the <tt>helper.Events.Input.ButtonPressed</tt> event), SMAPI will call your <tt>this.OnButtonPressed</tt> method. See [[Modding:Modder Guide/APIs/Events|events in the SMAPI reference]] for more info.
+
# <code>helper.Events.Input.ButtonPressed += this.OnButtonPressed;</code> adds an 'event handler' (i.e. a method to call) when the button-pressed event happens. In other words, when a button is pressed (the <samp>helper.Events.Input.ButtonPressed</samp> event), SMAPI will call your <samp>this.OnButtonPressed</samp> method. See [[Modding:Modder Guide/APIs/Events|events in the SMAPI reference]] for more info.
    
===Add your manifest===
 
===Add your manifest===
Linha 137: Linha 137:     
<ol>
 
<ol>
<li>Add a file named <tt>manifest.json</tt> to your project.</li>
+
<li>Add a file named <samp>manifest.json</samp> to your project.</li>
<li>Paste this code into the file (replacing the <tt>&lt;...&gt;</tt> placeholders):
+
<li>Paste this code into the file (replacing the <samp>&lt;...&gt;</samp> placeholders):
 
<syntaxhighlight lang="json">
 
<syntaxhighlight lang="json">
 
{
 
{
Linha 156: Linha 156:     
=== Experimente o seu mod ===
 
=== Experimente o seu mod ===
# Construa o projeto. <br /> <small>Se você executou as etapas ''[[#Criar o projeto|crie o projeto]]'' corretamente, isso adicionará automaticamente seu mod aos <tt>Mods do jogo</tt>.</small>
+
# Construa o projeto. <br /> <small>Se você executou as etapas ''[[#Criar o projeto|crie o projeto]]'' corretamente, isso adicionará automaticamente seu mod aos <samp>Mods do jogo</samp>.</small>
 
# Execute o jogo através do SMAPI.
 
# Execute o jogo através do SMAPI.
   Linha 181: Linha 181:  
<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 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 <tt>Path.Combine</tt> to build file paths, don't hardcode path separators since they won't work on all platforms.
+
<li>Use <samp>Path.Combine</samp> to build file paths, don't hardcode path separators since they won't work on all platforms.
    
<syntaxhighlight lang="c#">
 
<syntaxhighlight lang="c#">
Linha 191: Linha 191:  
</syntaxhighlight></li>
 
</syntaxhighlight></li>
   −
<li>Use <tt>Helper.DirectoryPath</tt>, don't try to determine the mod path yourself.
+
<li>Use <samp>Helper.DirectoryPath</samp>, don't try to determine the mod path yourself.
    
<syntaxhighlight lang="c#">
 
<syntaxhighlight lang="c#">
Linha 207: Linha 207:  
To decompile the game code so you can read it (though it won't be fully functional due to decompiler limitations):
 
To decompile the game code so you can read it (though it won't be fully functional due to decompiler limitations):
 
* On Windows:
 
* On Windows:
*# Open <tt>StardewValley.exe</tt> in [https://www.jetbrains.com/decompiler/ dotPeek].
+
*# Open <samp>StardewValley.exe</samp> in [https://www.jetbrains.com/decompiler/ dotPeek].
 
*# Right-click on ''Stardew Valley'' and choose ''Export to Project''. Accept the default options to create a decompiled project you can open in Visual Studio.
 
*# Right-click on ''Stardew Valley'' and choose ''Export to Project''. Accept the default options to create a decompiled project you can open in Visual Studio.
 
* On Linux/Mac:
 
* On Linux/Mac:
*# Open <tt>StardewValley.exe</tt> in MonoDevelop through ''File &gt; Open''.
+
*# Open <samp>StardewValley.exe</samp> in MonoDevelop through ''File &gt; Open''.
 
*# Change ''Language'' from ''Summary'' to ''C#''.
 
*# Change ''Language'' from ''Summary'' to ''C#''.
  
106 033

edições