summaryrefslogtreecommitdiff
path: root/src/TrainerMod/TrainerMod.cs
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <github@jplamondonw.com>2017-04-23 22:13:49 -0400
committerJesse Plamondon-Willard <github@jplamondonw.com>2017-04-23 22:13:49 -0400
commitc1926f263c21147047b23d91c11dac6478fa1211 (patch)
tree7bfdfdc9690706f0515fb0b8b40b96ab3080330d /src/TrainerMod/TrainerMod.cs
parent085ae07251c9972bed941e33103f41724d8cd320 (diff)
downloadSMAPI-c1926f263c21147047b23d91c11dac6478fa1211.tar.gz
SMAPI-c1926f263c21147047b23d91c11dac6478fa1211.tar.bz2
SMAPI-c1926f263c21147047b23d91c11dac6478fa1211.zip
add world_setyear command to TrainerMod
Diffstat (limited to 'src/TrainerMod/TrainerMod.cs')
-rw-r--r--src/TrainerMod/TrainerMod.cs26
1 files changed, 24 insertions, 2 deletions
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())
{