summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--release-notes.md1
-rw-r--r--src/TrainerMod/TrainerMod.cs20
2 files changed, 21 insertions, 0 deletions
diff --git a/release-notes.md b/release-notes.md
index 1fb72dd1..6189b386 100644
--- a/release-notes.md
+++ b/release-notes.md
@@ -4,6 +4,7 @@
See [log](https://github.com/Pathoschild/SMAPI/compare/stable...develop).
For players:
+* Added console commands to open the game & data folders in the system's file browser.
* Fixed issue where the installer couldn't find the game for some players on 32-bit Windows.
* Fixed issue where SMAPI couldn't be launched from Steam for some Linux players.
* Fixed issue where values in `config.json` were duplicated in some cases.
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
****/