summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--release-notes.md1
-rw-r--r--src/TrainerMod/TrainerMod.cs26
2 files changed, 25 insertions, 2 deletions
diff --git a/release-notes.md b/release-notes.md
index 628757ae..1b44b57a 100644
--- a/release-notes.md
+++ b/release-notes.md
@@ -16,6 +16,7 @@ See [log](https://github.com/Pathoschild/SMAPI/compare/1.9...1.10).
For players:
* Added support for Stardew Valley 1.2 beta.
* Added logic to rewrite many mods for compatibility with game updates, though some mods may still need an update.
+* Added `world_setyear` console command to TrainerMod.
* Fixed some players getting `SEHException` errors.
* Fixed rare issue where the installer would crash trying to delete a bundled mod from `%appdata%`.
diff --git a/src/TrainerMod/TrainerMod.cs b/src/TrainerMod/TrainerMod.cs
index 7187a358..465567f7 100644
--- a/src/TrainerMod/TrainerMod.cs
+++ b/src/TrainerMod/TrainerMod.cs
@@ -102,10 +102,11 @@ namespace TrainerMod
.Add("list_items", "Lists and searches items in the game data.\n\nUsage: list_items [search]\n- search (optional): an arbitrary search string to filter by.", this.HandleCommand)
- .Add("world_settime", "Sets the time to the specified value.\n\nUsage: world_settime <value>\n- value: the target time in military time (like 0600 for 6am and 1800 for 6pm)", this.HandleCommand)
.Add("world_freezetime", "Freezes or resumes time.\n\nUsage: world_freezetime [value]\n- value: one of 0 (resume), 1 (freeze), or blank (toggle).", this.HandleCommand)
+ .Add("world_settime", "Sets the time to the specified value.\n\nUsage: world_settime <value>\n- value: the target time in military time (like 0600 for 6am and 1800 for 6pm)", this.HandleCommand)
.Add("world_setday", "Sets the day to the specified value.\n\nUsage: world_setday <value>.\n- value: the target day (a number from 1 to 28).", this.HandleCommand)
- .Add("world_setseason", "Sets the season to the specified value.\n\nUsage: world_setseason <season>\n- value: the target season (one of 'spring', 'summer', 'fall', 'winter').", this.HandleCommand)
+ .Add("world_setseason", "Sets the season to the specified value.\n\nUsage: world_setseason <season>\n- season: the target season (one of 'spring', 'summer', 'fall', 'winter').", this.HandleCommand)
+ .Add("world_setyear", "Sets the year to the specified value.\n\nUsage: world_setyear <year>\n- year: the target year (a number starting from 1).", this.HandleCommand)
.Add("world_downminelevel", "Goes down one mine level?", this.HandleCommand)
.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)
@@ -489,6 +490,27 @@ namespace TrainerMod
this.Monitor.Log($"The current season is {Game1.currentSeason}. Specify a value to change it.", LogLevel.Info);
break;
+ case "world_setyear":
+ if (args.Any())
+ {
+ int year;
+ if (int.TryParse(args[0], out year))
+ {
+ if (year >= 1)
+ {
+ Game1.year = year;
+ this.Monitor.Log($"OK, the year is now {Game1.year}.", LogLevel.Info);
+ }
+ else
+ this.LogUsageError("That isn't a valid year.", command);
+ }
+ else
+ this.LogArgumentNotInt(command);
+ }
+ else
+ this.Monitor.Log($"The current year is {Game1.year}. Specify a value to change the year.", LogLevel.Info);
+ break;
+
case "player_sethealth":
if (args.Any())
{