diff options
author | Jesse Plamondon-Willard <github@jplamondonw.com> | 2017-01-14 13:46:00 -0500 |
---|---|---|
committer | Jesse Plamondon-Willard <github@jplamondonw.com> | 2017-01-14 13:46:00 -0500 |
commit | 2d824b34e478bd53a9cfae85332669755b326d84 (patch) | |
tree | edc6de7f7b2b7e660915f4960b52d451da00d5e9 /src | |
parent | 9d1b6a1af2f21dff9904d03daaf6f1ce6409d7f8 (diff) | |
download | SMAPI-2d824b34e478bd53a9cfae85332669755b326d84.tar.gz SMAPI-2d824b34e478bd53a9cfae85332669755b326d84.tar.bz2 SMAPI-2d824b34e478bd53a9cfae85332669755b326d84.zip |
add console commands to open game & date folders (#172)
Diffstat (limited to 'src')
-rw-r--r-- | src/TrainerMod/TrainerMod.cs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/TrainerMod/TrainerMod.cs b/src/TrainerMod/TrainerMod.cs index f0c7549f..c76bb78c 100644 --- a/src/TrainerMod/TrainerMod.cs +++ b/src/TrainerMod/TrainerMod.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Diagnostics; using System.Linq; using Microsoft.Xna.Framework; using StardewModdingAPI; @@ -108,6 +109,9 @@ namespace TrainerMod Command.RegisterCommand("world_setseason", "Sets the season to the specified value | world_setseason <value>", new[] { "(winter, spring, summer, fall)<value> The target season" }).CommandFired += this.HandleWorldSetSeason; Command.RegisterCommand("world_downminelevel", "Goes down one mine level? | world_downminelevel", new[] { "" }).CommandFired += this.HandleWorldDownMineLevel; Command.RegisterCommand("world_setminelevel", "Sets mine level? | world_setminelevel", new[] { "(Int32)<value> The target level" }).CommandFired += this.HandleWorldSetMineLevel; + + Command.RegisterCommand("show_game_files", "Opens the game folder. | show_game_files").CommandFired += this.HandleShowGameFiles; + Command.RegisterCommand("show_data_files", "Opens the folder containing the save and log files. | show_data_files").CommandFired += this.HandleShowDataFiles; } /**** @@ -695,6 +699,22 @@ namespace TrainerMod this.LogValueNotSpecified(); } + /// <summary>The event raised when the 'show_game_files' command is triggered.</summary> + /// <param name="sender">The event sender.</param> + /// <param name="e">The event arguments.</param> + private void HandleShowGameFiles(object sender, EventArgsCommand e) + { + Process.Start(Constants.ExecutionPath); + } + + /// <summary>The event raised when the 'show_data_files' command is triggered.</summary> + /// <param name="sender">The event sender.</param> + /// <param name="e">The event arguments.</param> + private void HandleShowDataFiles(object sender, EventArgsCommand e) + { + Process.Start(Constants.DataPath); + } + /**** ** Helpers ****/ |