summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--release-notes.md3
-rw-r--r--src/TrainerMod/TrainerMod.cs10
2 files changed, 11 insertions, 2 deletions
diff --git a/release-notes.md b/release-notes.md
index 2d88d197..c1d2c13f 100644
--- a/release-notes.md
+++ b/release-notes.md
@@ -18,7 +18,8 @@ For players:
* SMAPI now remembers if your game crashed and offers help next time you relaunch.
For mod developers:
-* SMAPI now logs basic context info to simplify troubleshooting, and more detailed logging can be enabled by setting `VerboseLogging: true` in `StardewModdingAPI.config.json`.
+* Added log entries for basic context changes (e.g. loaded save) to simplify troubleshooting. More detailed logging can be enabled by setting `VerboseLogging: true` in `StardewModdingAPI.config.json`.
+* Added `debug` console command to TrainerMod which lets you pass debug commands to the game (e.g. `debug warp FarmHouse 1 1` warps the player to the farmhouse).
## 1.12
See [log](https://github.com/Pathoschild/SMAPI/compare/1.11...1.12).
diff --git a/src/TrainerMod/TrainerMod.cs b/src/TrainerMod/TrainerMod.cs
index 168b7e8e..95c7cbaf 100644
--- a/src/TrainerMod/TrainerMod.cs
+++ b/src/TrainerMod/TrainerMod.cs
@@ -111,7 +111,9 @@ namespace TrainerMod
.Add("world_setminelevel", "Sets the mine level?\n\nUsage: world_setminelevel <value>\n- value: The target level (a number between 1 and 120).", this.HandleCommand)
.Add("show_game_files", "Opens the game folder.", this.HandleCommand)
- .Add("show_data_files", "Opens the folder containing the save and log files.", this.HandleCommand);
+ .Add("show_data_files", "Opens the folder containing the save and log files.", this.HandleCommand)
+
+ .Add("debug", "Run one of the game's debug commands; for example, 'debug warp FarmHouse 1 1' warps the player to the farmhouse.", this.HandleCommand);
}
/// <summary>Handle a TrainerMod command.</summary>
@@ -121,6 +123,12 @@ namespace TrainerMod
{
switch (command)
{
+ case "debug":
+ string debugCommand = string.Join(" ", args);
+ this.Monitor.Log($"Sending debug command to the game: {debugCommand}...", LogLevel.Info);
+ Game1.game1.parseDebugInput(debugCommand);
+ break;
+
case "save":
this.Monitor.Log("Saving the game...", LogLevel.Info);
SaveGame.Save();