diff --git a/Changelog.md b/Changelog.md index 272a078..25d30e2 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,5 +1,9 @@ # SnowRunner-Tool Changes +## v1.0.5.2 () +- Delete files using system´s recycle bin +- Copy a save game slot to another (empty) one + ## v1.0.5.1 (16.10.2022) - Fixed a bug which deleted backup files while moving old backups to new location at the first start of v1.0.5.0 - Fixed a bug preventing the tool to start if Steam client is not installed diff --git a/Readme.md b/Readme.md index 119d98b..642151b 100644 --- a/Readme.md +++ b/Readme.md @@ -33,6 +33,8 @@ or all slots) - Rename backup files from the UI - Cheat the amount of money you have in your pocket - Cheat your experience points (XP) +- Copy one save game to another + ![SnowRunner-Tool](images/SnowRunner-Tool_Screenshot.png) ## Installation @@ -69,6 +71,16 @@ After the start, *SnowRunner-Tool* discovers if you own the Steam- or Epic Games 2. Hit the function key `F2` for an instant backup while you play the game without leaving the game. 3. Let the tool create *regular backups* in the background while playing the game. +### Copy a save game slot to another + +Copying a save game slot to another one may be useful. E.g. I use it if I want to play my single player fleet in a multiplayer game hosted by a friend. + +To copy a save game slot to another, open the *File* menu and select *Copy save game*. Select a game slot as source and navigate to the submenu of the destination slot you want it to be copied to: + +![Copy Save Game](images/Copy_save_game.png) + +Note, that only existing game slot are selectable as source, and only empty slots as destination. If all destination slots are greyed out, use the game´s own function to delete a save game slot prior to copying. + #### Notes - **Backups can usually be created while the game is running**. If you have to master a risky maneuver, just switch to your *SnowRunner-Tool* and make a backup before you fail. Or even easier: Let the tool run in the background and use the instant-hotkey-backup (`F2`). diff --git a/SnowRunner-Tool/CheatGame.cs b/SnowRunner-Tool/CheatGame.cs index 2679638..1c40d3c 100644 --- a/SnowRunner-Tool/CheatGame.cs +++ b/SnowRunner-Tool/CheatGame.cs @@ -1,4 +1,5 @@ -using Serilog; +using ControlzEx.Standard; +using Serilog; using System; using System.Collections.Generic; using System.IO; @@ -181,5 +182,65 @@ public static string UnzipToTemp(string zipFile, string platform) } return returnPath; } + + /// + /// Copy a save game slot to another. Slots are 1-based integer. + /// + /// + /// + /// + public static bool CopySlotToOtherSlot(int slot1, int slot2, string SRProfile, string platform) + { + string sourcefile; + string destinationfile; + string filename; + string oldtext; + string newtext; + string extension; + if (platform == "steam") + { + extension = "cfg"; + } + else + { + extension = "dat"; + } + + if (slot1 > 1) + { + filename = string.Format("CompleteSave{0}.{1}", (slot1 - 1).ToString(), extension); + oldtext = string.Format("CompleteSave{0}", (slot1 - 1).ToString()); + } + else + { + filename = string.Format("CompleteSave.{0}", extension); + oldtext = "CompleteSave"; + } + sourcefile = Path.Combine(SRProfile, filename); + + if (slot2 > 1) + { + filename = string.Format("CompleteSave{0}.{1}", (slot2 - 1).ToString(), extension); + newtext = string.Format("CompleteSave{0}", (slot2 - 1).ToString()); + } + else + { + filename = string.Format("CompleteSave.{0}", extension); + newtext = "CompleteSave"; + } + destinationfile = Path.Combine(SRProfile, filename); + + string text = File.ReadAllText(sourcefile); + text = Regex.Replace(text, oldtext, newtext, RegexOptions.IgnoreCase); + try + { + File.WriteAllText(Path.Combine(SRProfile, destinationfile), text); + return true; + } + catch + { + return false; + } + } } } diff --git a/SnowRunner-Tool/MainWindow.xaml b/SnowRunner-Tool/MainWindow.xaml index 15351c2..34e8449 100644 --- a/SnowRunner-Tool/MainWindow.xaml +++ b/SnowRunner-Tool/MainWindow.xaml @@ -32,6 +32,102 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/images/Copy_save_game.png b/images/Copy_save_game.png new file mode 100644 index 0000000..d3d4e95 Binary files /dev/null and b/images/Copy_save_game.png differ diff --git a/images/SnowRunner-Tool_Screenshot.png b/images/SnowRunner-Tool_Screenshot.png index 6d58096..58d3da8 100644 Binary files a/images/SnowRunner-Tool_Screenshot.png and b/images/SnowRunner-Tool_Screenshot.png differ diff --git a/innosetup/setup.iss b/innosetup/setup.iss index 9759a66..c393212 100644 --- a/innosetup/setup.iss +++ b/innosetup/setup.iss @@ -3,7 +3,7 @@ #pragma include __INCLUDE__ + ";" + ReadReg(HKLM, "Software\Mitrich Software\Inno Download Plugin", "InstallDir") #include #define MyAppName "SnowRunner-Tool" -#define MyAppVersion "1.0.5.1" +#define MyAppVersion "1.0.5.2" #define MyAppPublisher "elpatron68" #define MyAppURL "https://github.com/elpatron68/SnowRunner-Tool" #define MyAppExeName "SnowRunner-Tool.exe"