From 7ba0518bfdfc06f2e80b6a0891689beda7f43aa7 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Tue, 9 May 2017 17:16:13 -0400 Subject: add 'debug' console command --- src/TrainerMod/TrainerMod.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/TrainerMod/TrainerMod.cs') 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 \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); } /// Handle a TrainerMod command. @@ -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(); -- cgit