From 9316fe303827cb31f38f4a5bb068f8fa0190ac5e Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Fri, 27 Aug 2021 19:14:41 -0400 Subject: add hurry_all console command --- .../Framework/Commands/World/HurryAllCommand.cs | 54 ++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 src/SMAPI.Mods.ConsoleCommands/Framework/Commands/World/HurryAllCommand.cs (limited to 'src/SMAPI.Mods.ConsoleCommands') diff --git a/src/SMAPI.Mods.ConsoleCommands/Framework/Commands/World/HurryAllCommand.cs b/src/SMAPI.Mods.ConsoleCommands/Framework/Commands/World/HurryAllCommand.cs new file mode 100644 index 00000000..2deac5f8 --- /dev/null +++ b/src/SMAPI.Mods.ConsoleCommands/Framework/Commands/World/HurryAllCommand.cs @@ -0,0 +1,54 @@ +using System; +using StardewValley; + +namespace StardewModdingAPI.Mods.ConsoleCommands.Framework.Commands.World +{ + /// A command which immediately warps all NPCs to their scheduled positions. To hurry a single NPC, see debug hurry npc-name instead. + internal class HurryAllCommand : ConsoleCommand + { + /********* + ** Public methods + *********/ + /// Construct an instance. + public HurryAllCommand() + : base( + name: "hurry_all", + description: "Immediately warps all NPCs to their scheduled positions. (To hurry a single NPC, use `debug hurry npc-name` instead.)\n\n" + + "Usage: hurry_all" + ) + { } + + /// Handle the command. + /// Writes messages to the console and log file. + /// The command name. + /// The command arguments. + public override void Handle(IMonitor monitor, string command, ArgumentParser args) + { + // check context + if (!Context.IsWorldReady) + { + monitor.Log("You need to load a save to use this command.", LogLevel.Error); + return; + } + + // hurry all NPCs + foreach (NPC npc in Utility.getAllCharacters()) + { + if (!npc.isVillager()) + continue; + + monitor.Log($"Hurrying {npc.Name}..."); + try + { + npc.warpToPathControllerDestination(); + } + catch (Exception ex) + { + monitor.Log($"Failed hurrying {npc.Name}. Technical details:\n{ex}", LogLevel.Error); + } + } + + monitor.Log("Done!", LogLevel.Info); + } + } +} -- cgit From bbaa260007f67d6e3c88c1aae387b42b0c237063 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Thu, 2 Sep 2021 23:01:40 -0400 Subject: drop support for unofficial 64-bit mode --- src/SMAPI.Mods.ConsoleCommands/SMAPI.Mods.ConsoleCommands.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/SMAPI.Mods.ConsoleCommands') diff --git a/src/SMAPI.Mods.ConsoleCommands/SMAPI.Mods.ConsoleCommands.csproj b/src/SMAPI.Mods.ConsoleCommands/SMAPI.Mods.ConsoleCommands.csproj index 432fdc35..a187c1ff 100644 --- a/src/SMAPI.Mods.ConsoleCommands/SMAPI.Mods.ConsoleCommands.csproj +++ b/src/SMAPI.Mods.ConsoleCommands/SMAPI.Mods.ConsoleCommands.csproj @@ -19,7 +19,7 @@ - + -- cgit From 6d4ea7f0bd584602632e6e308d52bb369b30006f Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Fri, 3 Sep 2021 18:36:12 -0400 Subject: prepare for release --- src/SMAPI.Mods.ConsoleCommands/manifest.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/SMAPI.Mods.ConsoleCommands') diff --git a/src/SMAPI.Mods.ConsoleCommands/manifest.json b/src/SMAPI.Mods.ConsoleCommands/manifest.json index 540d0488..de223c01 100644 --- a/src/SMAPI.Mods.ConsoleCommands/manifest.json +++ b/src/SMAPI.Mods.ConsoleCommands/manifest.json @@ -1,9 +1,9 @@ { "Name": "Console Commands", "Author": "SMAPI", - "Version": "3.12.5", + "Version": "3.12.6", "Description": "Adds SMAPI console commands that let you manipulate the game.", "UniqueID": "SMAPI.ConsoleCommands", "EntryDll": "ConsoleCommands.dll", - "MinimumApiVersion": "3.12.5" + "MinimumApiVersion": "3.12.6" } -- cgit