diff --git a/Hg.SaveHistory/API/Engine.cs b/Hg.SaveHistory/API/Engine.cs index 25e8b7b..ad3141c 100644 --- a/Hg.SaveHistory/API/Engine.cs +++ b/Hg.SaveHistory/API/Engine.cs @@ -49,7 +49,6 @@ public class Engine public event MessageEventHandler OnMessage; - /// /// First LoadProfile event /// After engine and profile loaded from file @@ -65,6 +64,13 @@ public class Engine public event EventHandlerSnapshotsChanged OnSnapshotsChanges; + /// + /// Return the content of the README + /// Provides help on how to use the engine + /// + /// Must return a string value + public LuaFunction ReadMe; + public List Categories { get; } = new List(); public string Description { get; } @@ -88,7 +94,6 @@ public class Engine public string Title { get; } - [LuaHide] public EngineWatcher Watcher { get; set; } #endregion diff --git a/Hg.SaveHistory/Forms/FormMain.Designer.cs b/Hg.SaveHistory/Forms/FormMain.Designer.cs index 7ec178a..f706d8d 100644 --- a/Hg.SaveHistory/Forms/FormMain.Designer.cs +++ b/Hg.SaveHistory/Forms/FormMain.Designer.cs @@ -124,6 +124,8 @@ private void InitializeComponent() this.buttonActionAuto = new System.Windows.Forms.Button(); this.groupBox1 = new System.Windows.Forms.GroupBox(); this.flowLayoutPanelConfig = new System.Windows.Forms.FlowLayoutPanel(); + this.tabPageUsage = new System.Windows.Forms.TabPage(); + this.richTextBoxUsage = new System.Windows.Forms.RichTextBox(); this.imageListMessageType = new System.Windows.Forms.ImageList(this.components); this.statusStrip1.SuspendLayout(); this.menuStrip.SuspendLayout(); @@ -162,6 +164,7 @@ private void InitializeComponent() this.groupBox2.SuspendLayout(); this.tableLayoutPanel1.SuspendLayout(); this.groupBox1.SuspendLayout(); + this.tabPageUsage.SuspendLayout(); this.SuspendLayout(); // // statusStrip1 @@ -233,33 +236,33 @@ private void InitializeComponent() // newProfileToolStripMenuItem // this.newProfileToolStripMenuItem.Name = "newProfileToolStripMenuItem"; - this.newProfileToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.newProfileToolStripMenuItem.Size = new System.Drawing.Size(140, 22); this.newProfileToolStripMenuItem.Text = "New Profile"; this.newProfileToolStripMenuItem.Click += new System.EventHandler(this.newProfileToolStripMenuItem_Click); // // openProfileToolStripMenuItem // this.openProfileToolStripMenuItem.Name = "openProfileToolStripMenuItem"; - this.openProfileToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.openProfileToolStripMenuItem.Size = new System.Drawing.Size(140, 22); this.openProfileToolStripMenuItem.Text = "Open Profile"; this.openProfileToolStripMenuItem.Click += new System.EventHandler(this.openProfileToolStripMenuItem_Click); // // closeProfileToolStripMenuItem // this.closeProfileToolStripMenuItem.Name = "closeProfileToolStripMenuItem"; - this.closeProfileToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.closeProfileToolStripMenuItem.Size = new System.Drawing.Size(140, 22); this.closeProfileToolStripMenuItem.Text = "Close Profile"; this.closeProfileToolStripMenuItem.Click += new System.EventHandler(this.closeProfileToolStripMenuItem_Click); // // toolStripSeparator4 // this.toolStripSeparator4.Name = "toolStripSeparator4"; - this.toolStripSeparator4.Size = new System.Drawing.Size(177, 6); + this.toolStripSeparator4.Size = new System.Drawing.Size(137, 6); // // toolStripMenuItem2 // this.toolStripMenuItem2.Name = "toolStripMenuItem2"; - this.toolStripMenuItem2.Size = new System.Drawing.Size(180, 22); + this.toolStripMenuItem2.Size = new System.Drawing.Size(140, 22); this.toolStripMenuItem2.Text = "Exit"; this.toolStripMenuItem2.Click += new System.EventHandler(this.toolStripMenuItem2_Click); // @@ -283,7 +286,7 @@ private void InitializeComponent() this.soundToolStripMenuItem, this.setKeysToolStripMenuItem}); this.hotKeysToolStripMenuItem.Name = "hotKeysToolStripMenuItem"; - this.hotKeysToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.hotKeysToolStripMenuItem.Size = new System.Drawing.Size(176, 22); this.hotKeysToolStripMenuItem.Text = "Hot keys"; // // activeToolStripMenuItem @@ -313,7 +316,7 @@ private void InitializeComponent() this.messageBoxToolStripMenuItem, this.statusBarToolStripMenuItem}); this.toolStripMenuItem3.Name = "toolStripMenuItem3"; - this.toolStripMenuItem3.Size = new System.Drawing.Size(180, 22); + this.toolStripMenuItem3.Size = new System.Drawing.Size(176, 22); this.toolStripMenuItem3.Text = "Notification mode"; // // messageBoxToolStripMenuItem @@ -337,7 +340,7 @@ private void InitializeComponent() this.giflowSizeToolStripMenuItem, this.pnghugeSizeToolStripMenuItem}); this.screenshotsQualityToolStripMenuItem.Name = "screenshotsQualityToolStripMenuItem"; - this.screenshotsQualityToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.screenshotsQualityToolStripMenuItem.Size = new System.Drawing.Size(176, 22); this.screenshotsQualityToolStripMenuItem.Text = "Screenshots quality"; // // jpgmediumToolStripMenuItem @@ -367,7 +370,7 @@ private void InitializeComponent() this.toolStripSeparator3, this.highlightColorToolStripMenuItem}); this.snapshotToolStripMenuItem.Name = "snapshotToolStripMenuItem"; - this.snapshotToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.snapshotToolStripMenuItem.Size = new System.Drawing.Size(176, 22); this.snapshotToolStripMenuItem.Text = "Snapshot"; // // soundNotificationToolStripMenuItem @@ -406,12 +409,12 @@ private void InitializeComponent() // toolStripSeparator1 // this.toolStripSeparator1.Name = "toolStripSeparator1"; - this.toolStripSeparator1.Size = new System.Drawing.Size(177, 6); + this.toolStripSeparator1.Size = new System.Drawing.Size(173, 6); // // clearSettingsToolStripMenuItem // this.clearSettingsToolStripMenuItem.Name = "clearSettingsToolStripMenuItem"; - this.clearSettingsToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.clearSettingsToolStripMenuItem.Size = new System.Drawing.Size(176, 22); this.clearSettingsToolStripMenuItem.Text = "Clear settings"; this.clearSettingsToolStripMenuItem.Click += new System.EventHandler(this.clearSettingsToolStripMenuItem_Click); // @@ -442,14 +445,14 @@ private void InitializeComponent() // checkForUpdateToolStripMenuItem // this.checkForUpdateToolStripMenuItem.Name = "checkForUpdateToolStripMenuItem"; - this.checkForUpdateToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.checkForUpdateToolStripMenuItem.Size = new System.Drawing.Size(165, 22); this.checkForUpdateToolStripMenuItem.Text = "Check for update"; this.checkForUpdateToolStripMenuItem.Click += new System.EventHandler(this.checkForUpdateToolStripMenuItem_Click); // // aboutToolStripMenuItem // this.aboutToolStripMenuItem.Name = "aboutToolStripMenuItem"; - this.aboutToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.aboutToolStripMenuItem.Size = new System.Drawing.Size(165, 22); this.aboutToolStripMenuItem.Text = "About"; this.aboutToolStripMenuItem.Click += new System.EventHandler(this.aboutToolStripMenuItem_Click); // @@ -493,6 +496,7 @@ private void InitializeComponent() // this.tabControlMain.Controls.Add(this.tabPageHome); this.tabControlMain.Controls.Add(this.tabPageProfile); + this.tabControlMain.Controls.Add(this.tabPageUsage); this.tabControlMain.Dock = System.Windows.Forms.DockStyle.Fill; this.tabControlMain.Location = new System.Drawing.Point(0, 0); this.tabControlMain.Name = "tabControlMain"; @@ -1107,6 +1111,28 @@ private void InitializeComponent() this.flowLayoutPanelConfig.Size = new System.Drawing.Size(781, 37); this.flowLayoutPanelConfig.TabIndex = 0; // + // tabPageUsage + // + this.tabPageUsage.Controls.Add(this.richTextBoxUsage); + this.tabPageUsage.Location = new System.Drawing.Point(4, 22); + this.tabPageUsage.Name = "tabPageUsage"; + this.tabPageUsage.Padding = new System.Windows.Forms.Padding(3); + this.tabPageUsage.Size = new System.Drawing.Size(803, 512); + this.tabPageUsage.TabIndex = 2; + this.tabPageUsage.Text = "Engine: README"; + this.tabPageUsage.UseVisualStyleBackColor = true; + // + // richTextBoxUsage + // + this.richTextBoxUsage.BackColor = System.Drawing.SystemColors.Window; + this.richTextBoxUsage.Dock = System.Windows.Forms.DockStyle.Fill; + this.richTextBoxUsage.Location = new System.Drawing.Point(3, 3); + this.richTextBoxUsage.Name = "richTextBoxUsage"; + this.richTextBoxUsage.ReadOnly = true; + this.richTextBoxUsage.Size = new System.Drawing.Size(797, 506); + this.richTextBoxUsage.TabIndex = 0; + this.richTextBoxUsage.Text = ""; + // // imageListMessageType // this.imageListMessageType.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageListMessageType.ImageStream"))); @@ -1173,6 +1199,7 @@ private void InitializeComponent() this.groupBox2.ResumeLayout(false); this.tableLayoutPanel1.ResumeLayout(false); this.groupBox1.ResumeLayout(false); + this.tabPageUsage.ResumeLayout(false); this.ResumeLayout(false); this.PerformLayout(); @@ -1274,6 +1301,8 @@ private void InitializeComponent() private System.Windows.Forms.ColumnHeader columnHeader3; private System.Windows.Forms.ColumnHeader columnHeader4; public System.Windows.Forms.PictureBox pictureBoxScreenshot; + private System.Windows.Forms.TabPage tabPageUsage; + private System.Windows.Forms.RichTextBox richTextBoxUsage; } } diff --git a/Hg.SaveHistory/Forms/FormMain.cs b/Hg.SaveHistory/Forms/FormMain.cs index 8492835..76ccbd3 100644 --- a/Hg.SaveHistory/Forms/FormMain.cs +++ b/Hg.SaveHistory/Forms/FormMain.cs @@ -162,6 +162,7 @@ public FormMain() ApplyStyle(); HideProfilePage(); + HideReadMePage(); } public void CategorySelectNext() @@ -947,12 +948,12 @@ private void CloseProfile() ReleaseHotKeysHook(); HideProfilePage(); - + HideReadMePage(); GC.Collect(); GC.WaitForPendingFinalizers(); - Logger.Information("---------------------------------------------------------------------------------"); + Logger.Information("---------------------------------Close---------------------------------"); } private void closeProfileToolStripMenuItem_Click(object sender, EventArgs e) @@ -1144,6 +1145,15 @@ private void HideProfilePage() tabControlMain.Controls.Remove(tabPageProfile); } + private void HideReadMePage() + { + richTextBoxUsage.Text = ""; + if (tabControlMain.Controls.Contains(tabPageUsage)) + { + tabControlMain.Controls.Remove(tabPageUsage); + } + } + private void highlightColorToolStripMenuItem_Click(object sender, EventArgs e) { ColorDialog colorDialog = new ColorDialog @@ -1827,7 +1837,7 @@ private void OnKeyUp(object sender, KeyEventArgs e, HotKeyToAction hotKeyToActio private void OpenProfile(string path) { - Logger.Information("---------------------------------------------------------------------------------"); + Logger.Information("---------------------------------Open---------------------------------"); Logger.Information(MethodBase.GetCurrentMethod().DeclaringType.Name, ".", MethodBase.GetCurrentMethod().Name); Cursor.Current = Cursors.WaitCursor; @@ -1852,8 +1862,21 @@ private void OpenProfile(string path) tabPageProfile.Text = @"Profile: " + profileFile.Name; ShowProfilePage(); - tabControlMain.SelectedTab = tabPageProfile; - tabControlSaves_Selected(null, null); + if (_luaManager.ActiveEngine.ReadMe?.Call().First() is string usageContent) + { + ShowReadMePage(usageContent); + } + + if (_activeProfileFile.FirstTimeRun && tabControlMain.Controls.Contains(tabPageUsage)) + { + tabControlMain.SelectedTab = tabPageUsage; + _activeProfileFile.FirstTimeRun = false; + } + else + { + tabControlMain.SelectedTab = tabPageProfile; + tabControlSaves_Selected(null, null); + } CreateHotKeysHook(); @@ -2276,7 +2299,7 @@ private void SetAutoBackupMessage() private void SetButtonStyle(Button button, IconChar iconChar, Color color) { - button.Image = iconChar.ToBitmap(32, color); + button.Image = iconChar.ToBitmap(color, 32); button.ImageAlign = ContentAlignment.MiddleRight; button.TextImageRelation = TextImageRelation.ImageBeforeText; } @@ -2285,6 +2308,11 @@ private void SetComparer() { Logger.Information(MethodBase.GetCurrentMethod().Name, " ", _sortKey, " ", _sortOrder); + if (_sortKey == null) + { + _sortKey = "SavedAt"; + } + switch (_sortKey) { case "SavedAt": @@ -2340,6 +2368,7 @@ private void SetComparer() }; break; default: + _comparer = (s1, s2) => { if (s1 == null && s2 == null) @@ -2357,16 +2386,45 @@ private void SetComparer() return 1; } - EngineSnapshotCustomValueBase c1 = s1.CustomValues[_sortKey]; - EngineSnapshotCustomValueBase c2 = s2.CustomValues[_sortKey]; + EngineSnapshotCustomValueBase c1 = null; + if (s1.CustomValues.ContainsKey(_sortKey)) + { + c1 = s1.CustomValues[_sortKey]; + } + + EngineSnapshotCustomValueBase c2 = null; + if (s2.CustomValues.ContainsKey(_sortKey)) + { + c2 = s2.CustomValues[_sortKey]; + } + + if (c1 == null && c2 == null) + { + return 0; + } + + int result; + if (c1 == null) + { + result = -1; + } + else if (c2 == null) + { + result = 1; + } + else + { + result = c1.CompareTo(c2); + } if (_sortOrder == SortOrder.Ascending) { - return c1.CompareTo(c2); + return result; } - return c2.CompareTo(c1); + return -result; }; + break; } } @@ -2391,7 +2449,7 @@ private void setKeysToolStripMenuItem_Click(object sender, EventArgs e) private void SetPictureBoxStyle(PictureBox pictureBox, IconChar iconChar, Color color) { - pictureBox.Image = iconChar.ToBitmap(32, color); + pictureBox.Image = iconChar.ToBitmap(color, 32); pictureBox.SizeMode = PictureBoxSizeMode.CenterImage; } @@ -2520,21 +2578,39 @@ private void SetSnapshotInfo(EngineSnapshot snapshot) private void SetToolStripHotKeyStyle(ToolStripStatusLabel toolStripStatusLabel, IconChar iconChar, Color color) { - toolStripStatusLabel.Image = iconChar.ToBitmap(20, color); + toolStripStatusLabel.Image = iconChar.ToBitmap(color, 20); toolStripStatusLabel.ImageAlign = ContentAlignment.BottomLeft; toolStripStatusLabel.TextImageRelation = TextImageRelation.TextBeforeImage; } private void SetToolStripStatusStyle(ToolStripStatusLabel toolStripStatusLabel, IconChar iconChar, Color color) { - toolStripStatusLabel.Image = iconChar.ToBitmap(20, color); + toolStripStatusLabel.Image = iconChar.ToBitmap(color, 20); toolStripStatusLabel.ImageAlign = ContentAlignment.BottomLeft; toolStripStatusLabel.TextImageRelation = TextImageRelation.ImageBeforeText; } private void ShowProfilePage() { - tabControlMain.Controls.Add(tabPageProfile); + if (!tabControlMain.Controls.Contains(tabPageProfile)) + { + tabControlMain.Controls.Add(tabPageProfile); + } + } + + private void ShowReadMePage(string content) + { + richTextBoxUsage.Text = ""; + if (!string.IsNullOrEmpty(content)) + { + if (!tabControlMain.Controls.Contains(tabPageUsage)) + { + tabControlMain.Controls.Add(tabPageUsage); + } + + // plain text for now + richTextBoxUsage.Text = content; + } } private bool SnapshotNuke(EngineSnapshot snapshot) diff --git a/Hg.SaveHistory/Forms/FormMain.resx b/Hg.SaveHistory/Forms/FormMain.resx index ad209a5..5c7e640 100644 --- a/Hg.SaveHistory/Forms/FormMain.resx +++ b/Hg.SaveHistory/Forms/FormMain.resx @@ -140,7 +140,7 @@ AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAA+ - SQAAAk1TRnQBSQFMAgEBBAEAAfgBAQH4AQEBIAEAASABAAT/ARkBAAj/AUIBTQE2BwABNgMAASgDAAGA + SQAAAk1TRnQBSQFMAgEBBAEAAQgBAgEIAQIBIAEAASABAAT/ARkBAAj/AUIBTQE2BwABNgMAASgDAAGA AwABQAMAAQEBAAEYBgABYP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A /wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AEIAIfsB1AHY AesBdAF/AcgBVwFkAb0BLQE+Aa0BLQE+Aa0BLQE+Aa0BLQE+Aa0BWwFnAb0BdgGAAckB2gHdAfAe+wP6 diff --git a/Hg.SaveHistory/Hg.SaveHistory.csproj b/Hg.SaveHistory/Hg.SaveHistory.csproj index 75c71f8..41e0e26 100644 --- a/Hg.SaveHistory/Hg.SaveHistory.csproj +++ b/Hg.SaveHistory/Hg.SaveHistory.csproj @@ -65,26 +65,27 @@ Hg.SaveHistory.Program - - ..\packages\AeroWizard.2.2.7\lib\net45\AeroWizard.dll + + ..\packages\AeroWizard.2.2.9\lib\net45\AeroWizard.dll - - ..\packages\BouncyCastle.1.8.6.1\lib\BouncyCastle.Crypto.dll + + ..\packages\BouncyCastle.1.8.9\lib\BouncyCastle.Crypto.dll - - ..\packages\FontAwesome.Sharp.5.13.0\lib\net472\FontAwesome.Sharp.dll + + ..\packages\FontAwesome.Sharp.5.15.3\lib\net472\FontAwesome.Sharp.dll - - ..\packages\KeraLua.1.2.4\lib\net45\KeraLua.dll + + ..\packages\KeraLua.1.2.12\lib\net46\KeraLua.dll - - ..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll + + ..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll - - ..\packages\NLua.1.5.0\lib\net45\NLua.dll + + ..\packages\NLua.1.5.7\lib\net46\NLua.dll + @@ -338,11 +339,11 @@ $(SolutionDir)\Hash\bin\Debug\Hash.exe $(ProjectDir)\Scripts $(ProjectDir)\ScriptsHash.cs - + Ce projet fait référence à des packages NuGet qui sont manquants sur cet ordinateur. Utilisez l'option de restauration des packages NuGet pour les télécharger. Pour plus d'informations, consultez http://go.microsoft.com/fwlink/?LinkID=322105. Le fichier manquant est : {0}. - + \ No newline at end of file diff --git a/Hg.SaveHistory/Properties/AssemblyInfo.cs b/Hg.SaveHistory/Properties/AssemblyInfo.cs index deb54b8..3b8b766 100644 --- a/Hg.SaveHistory/Properties/AssemblyInfo.cs +++ b/Hg.SaveHistory/Properties/AssemblyInfo.cs @@ -14,5 +14,5 @@ [assembly: Guid("fea44985-2a16-4626-87dd-cf9c5e27a686")] -[assembly: AssemblyVersion("0.7.0.0")] -[assembly: AssemblyFileVersion("0.7.0.0")] \ No newline at end of file +[assembly: AssemblyVersion("0.7.1.0")] +[assembly: AssemblyFileVersion("0.7.1.0")] \ No newline at end of file diff --git a/Hg.SaveHistory/Scripts/DOOM2016/Engine.lua b/Hg.SaveHistory/Scripts/DOOM2016/Engine.lua index f0a4b17..6c34e42 100644 --- a/Hg.SaveHistory/Scripts/DOOM2016/Engine.lua +++ b/Hg.SaveHistory/Scripts/DOOM2016/Engine.lua @@ -539,3 +539,28 @@ end engine.OnActionSnapshotRestore = function(actionSource, snapshot) return snapshotRestore(actionSource, snapshot) end + +engine.ReadMe = function() + local content = +[[DOOM 2016 + +Manual backup: +This will backup the current save files of the selected slot. +If the save files have already been backed-up, nothing happens. + +Automatic backup: +This will backup the current save files of the selected slot everytime a in-game checkpoint is reached. +Death checkpoints can be distinguished from progression checkpoints and backed-up or not. + +Manual restore: +Restore the selected snapshot and override the current save files for the selected slot. +For DOOM 2016 to take the restored files into account, you must be on the main game menu before restoring. + +Screenshot: +Screenshot will only work if the game uses OpenGL or run windowed. + + +Enjoy!]] + + return content; +end diff --git a/Hg.SaveHistory/Scripts/DOOMEternal/Engine.lua b/Hg.SaveHistory/Scripts/DOOMEternal/Engine.lua index 8ce504e..9d892e1 100644 --- a/Hg.SaveHistory/Scripts/DOOMEternal/Engine.lua +++ b/Hg.SaveHistory/Scripts/DOOMEternal/Engine.lua @@ -562,3 +562,28 @@ end engine.OnActionSnapshotRestore = function(actionSource, snapshot) return snapshotRestore(actionSource, snapshot) end + +engine.ReadMe = function() + local content = +[[DOOM Enternal + +Manual backup: +This will backup the current save files of the selected slot. +If the save files have already been backed-up, nothing happens. + +Automatic backup: +This will backup the current save files of the selected slot everytime a in-game checkpoint is reached. +Death checkpoints can be distinguished from progression checkpoints and backed-up or not. + +Manual restore: +Restore the selected snapshot and override the current save files for the selected slot. +Unfortunately, you must restart DOOM Eternal to see the restored save. + +Screenshot: +Screenshot will only work if the game uses OpenGL or run windowed. + + +Enjoy!]] + + return content; +end diff --git a/Hg.SaveHistory/Scripts/Satisfactory/Engine.lua b/Hg.SaveHistory/Scripts/Satisfactory/Engine.lua index 97149b5..0b93d04 100644 --- a/Hg.SaveHistory/Scripts/Satisfactory/Engine.lua +++ b/Hg.SaveHistory/Scripts/Satisfactory/Engine.lua @@ -464,3 +464,26 @@ end engine.OnActionSnapshotRestore = function(actionSource, snapshot) return snapshotRestore(actionSource, snapshot) end + +engine.ReadMe = function() + local content = +[[Satisfactory + +Manual backup: +This will backup all available save files in the save folder. +If a save file has already been backed-up, it is ignored. +Note that the first manual backup may take some time if you have a lot of save files. + +Automatic backup: +When active, everytime a save file changes, either from autosave or from manual save, a backup will be made. +Autosave backup will be marked as such. + +Manual restore: +This will copy the selected snapshot file into your save folder with the following naming scheme: "SessionName_yyyyMMdd-HHmmss". +You will need to re-open the "Load" menu and select the correct session to see the restored save which should be at the top. + + +Enjoy!]] + + return content; +end diff --git a/Hg.SaveHistory/ScriptsHash.cs b/Hg.SaveHistory/ScriptsHash.cs index 02d698d..f24ee9e 100644 --- a/Hg.SaveHistory/ScriptsHash.cs +++ b/Hg.SaveHistory/ScriptsHash.cs @@ -15,14 +15,14 @@ public class ScriptsHash public static Dictionary FilesHashes = new Dictionary() { {"DOOM2016\\DOOM2016.toc","e6eb6d55549edf0d9330d5c632570a60bd1149f7096a516905daabb5b90d1891"}, - {"DOOM2016\\Engine.lua","82832bba1897f986f49645001bf5aa55e072f4aa8bcdb061002268a329efba7d"}, + {"DOOM2016\\Engine.lua","e2b0cbcad84e82590b815b9a951b7d8dba5f187d6197479dbd4e8c4779bf76a9"}, {"DOOM2016\\Setup.lua","b876fa8241e9efc6e522116160ad8322dc3bd8f81e35947c6c65c181d3de7d90"}, {"DOOM2016\\Utility.lua","3d1837390bb53c3e9459afc6a38289b1bc6443ae4c23be07eca53e7e8f38e758"}, {"DOOMEternal\\DOOMEternal.toc","9ddd6726afedbe13a3e8966e86bbabcf034423228b44ac4d7a32ecfbe5b82ff7"}, - {"DOOMEternal\\Engine.lua","7b24ccf835677c9f6fc149d78cf38262f5f8447c03e8bd296ea6abdec97e3912"}, + {"DOOMEternal\\Engine.lua","a86f43da63f15ca897314b7212f10d6a19e2aab80b7f40c589b59c1fa62e872f"}, {"DOOMEternal\\Setup.lua","967c968598b0b83adfa838b056a8899dd6bee79fb8dc15408f1efe1497d0bc21"}, {"DOOMEternal\\Utility.lua","3d1837390bb53c3e9459afc6a38289b1bc6443ae4c23be07eca53e7e8f38e758"}, - {"Satisfactory\\Engine.lua","5420f7315fe9d05424b61ad0e5f82cdf08c6e51f741e5d97e8934daaa49345b2"}, + {"Satisfactory\\Engine.lua","8f625d002a3c4b501f53d2f7c8362f1f04f4d006bb06e9726ac0aeed31b70675"}, {"Satisfactory\\Satisfactory.toc","f9935001bd02d9ecf0fd4bbd8d5810aaab87d261d1a3283d504615785eb6fb0e"}, {"Satisfactory\\Setup.lua","cb4966e526ff8307d02d95c8ac91e4b8d6101fdd267858ff961d6c1b06f7f0d8"}, {"Satisfactory\\Utility.lua","3d1837390bb53c3e9459afc6a38289b1bc6443ae4c23be07eca53e7e8f38e758"} diff --git a/Hg.SaveHistory/Types/ProfileFile.cs b/Hg.SaveHistory/Types/ProfileFile.cs index b6d7495..6405c3c 100644 --- a/Hg.SaveHistory/Types/ProfileFile.cs +++ b/Hg.SaveHistory/Types/ProfileFile.cs @@ -17,6 +17,8 @@ public class ProfileFile public string FilePath; + public bool FirstTimeRun = true; + // Display name of profile public string Name; @@ -40,6 +42,10 @@ public static ProfileFile FromJson(string content) { ProfileFile profileFile = JsonConvert.DeserializeObject(content, new JsonSerializerSettings {TypeNameHandling = TypeNameHandling.Auto}); + + if (profileFile != null && string.IsNullOrEmpty(profileFile.SortKey)) + profileFile.SortKey = "SavedAt"; + return profileFile; } diff --git a/Hg.SaveHistory/Wizards/FormWizardNewProfile.Designer.cs b/Hg.SaveHistory/Wizards/FormWizardNewProfile.Designer.cs index 3c76899..d48a271 100644 --- a/Hg.SaveHistory/Wizards/FormWizardNewProfile.Designer.cs +++ b/Hg.SaveHistory/Wizards/FormWizardNewProfile.Designer.cs @@ -47,7 +47,7 @@ private void InitializeComponent() this.panelSetup = new System.Windows.Forms.Panel(); this.wizardPageSave = new AeroWizard.WizardPage(); this.panelSave = new System.Windows.Forms.Panel(); - this.textBoxSummary = new System.Windows.Forms.TextBox(); + this.richTextBoxSummary = new System.Windows.Forms.RichTextBox(); this.groupBoxInfo = new System.Windows.Forms.GroupBox(); this.buttonSaveBrowse = new System.Windows.Forms.Button(); this.label2 = new System.Windows.Forms.Label(); @@ -246,7 +246,7 @@ private void InitializeComponent() // // panelSave // - this.panelSave.Controls.Add(this.textBoxSummary); + this.panelSave.Controls.Add(this.richTextBoxSummary); this.panelSave.Controls.Add(this.groupBoxInfo); this.panelSave.Dock = System.Windows.Forms.DockStyle.Fill; this.panelSave.Location = new System.Drawing.Point(0, 0); @@ -254,16 +254,16 @@ private void InitializeComponent() this.panelSave.Size = new System.Drawing.Size(546, 316); this.panelSave.TabIndex = 1; // - // textBoxSummary + // richTextBoxSummary // - this.textBoxSummary.Dock = System.Windows.Forms.DockStyle.Fill; - this.textBoxSummary.Enabled = false; - this.textBoxSummary.Location = new System.Drawing.Point(0, 0); - this.textBoxSummary.Multiline = true; - this.textBoxSummary.Name = "textBoxSummary"; - this.textBoxSummary.ReadOnly = true; - this.textBoxSummary.Size = new System.Drawing.Size(546, 201); - this.textBoxSummary.TabIndex = 4; + this.richTextBoxSummary.BackColor = System.Drawing.SystemColors.Window; + this.richTextBoxSummary.Dock = System.Windows.Forms.DockStyle.Fill; + this.richTextBoxSummary.Location = new System.Drawing.Point(0, 0); + this.richTextBoxSummary.Name = "richTextBoxSummary"; + this.richTextBoxSummary.ReadOnly = true; + this.richTextBoxSummary.Size = new System.Drawing.Size(546, 201); + this.richTextBoxSummary.TabIndex = 4; + this.richTextBoxSummary.Text = ""; // // groupBoxInfo // @@ -360,7 +360,6 @@ private void InitializeComponent() this.wizardPageSetup.ResumeLayout(false); this.wizardPageSave.ResumeLayout(false); this.panelSave.ResumeLayout(false); - this.panelSave.PerformLayout(); this.groupBoxInfo.ResumeLayout(false); this.groupBoxInfo.PerformLayout(); this.ResumeLayout(false); @@ -387,12 +386,12 @@ private void InitializeComponent() private TextBox textBoxName; private Label label1; private Panel panelSave; - private TextBox textBoxSummary; private SaveFileDialog saveFileDialog; private Button buttonSaveBrowse; private Label label2; private TextBox textBoxSaveFolder; private FolderBrowserDialog folderBrowserDialog; public ToolTip toolTipHelp; + private RichTextBox richTextBoxSummary; } } \ No newline at end of file diff --git a/Hg.SaveHistory/Wizards/FormWizardNewProfile.cs b/Hg.SaveHistory/Wizards/FormWizardNewProfile.cs index 89615b8..d160499 100644 --- a/Hg.SaveHistory/Wizards/FormWizardNewProfile.cs +++ b/Hg.SaveHistory/Wizards/FormWizardNewProfile.cs @@ -317,7 +317,17 @@ private void wizardPageSave_Initialize(object sender, WizardPageInitEventArgs e) } } - textBoxSummary.Text = sb.ToString(); + if (_luaManager.ActiveEngine.ReadMe?.Call().First() is string content) + { + sb.AppendLine(); + sb.AppendLine("-= README =-"); + foreach (string line in content.Split('\n')) + { + sb.AppendLine(line); + } + } + + richTextBoxSummary.Text = sb.ToString(); if (_luaManager.ActiveEngine.OnSetupSuggestProfileName != null) { diff --git a/Hg.SaveHistory/packages.config b/Hg.SaveHistory/packages.config index d76583e..1c06e88 100644 --- a/Hg.SaveHistory/packages.config +++ b/Hg.SaveHistory/packages.config @@ -1,9 +1,9 @@  - - - - - - + + + + + + \ No newline at end of file diff --git a/README.md b/README.md index a2267f7..84a42a8 100644 --- a/README.md +++ b/README.md @@ -26,17 +26,20 @@ Thank you! - Events Sound notifications - Attach notes to snapshots + ## Supported Games and Applications ### Official Engines +#### Games - DOOM 2016 - DOOM Eternal, with DLC1 and DLC2 - Satisfactory +#### Applications +- None yet ### Third Party Engines - - None yet @@ -64,9 +67,10 @@ On first run, the app will ask where you want to save the app settings, either: Start by creating a backup profile using the built-in wizard. 1. Choose a engine -2. Setup the profile: each engine require its own settings +2. Setup the profile: each engine requires its own settings 3. Choose a name and a location to save the profile -4. You are done! +4. Be sure to read the engine README if one is provided! +5. You are done! ### Open an existing backup profile @@ -116,7 +120,7 @@ To unpin a profile, click the trash can icon. This can happens if the target folder is currently open in a windows explorer (even if not selected) or if you don't have write persmission to the destination. -This may be the case if steam is installed inside "Program Files". You can either move you're steam installation folder or launch SaveHistory as administrator. +This may be the case if steam is installed inside "Program Files". You can either move your steam installation folder or launch SaveHistory as administrator. ## TODO: @@ -154,6 +158,13 @@ The first beta tester was [RedW4rr10r](https://www.twitch.tv/redw4rr10r) who fou # Version History +## v0.7.1 + +- \+ Add README feature +- \+ Add README content for all 3 engines +- \* Update NuGet packages +- \* Small fixes + ## v0.7.0 - \* Add support for Satisfactory and DOOM Eternal DLC2 diff --git a/Tests/Data/DOOM2016/Original/DOOM2016_Create.shp b/Tests/Data/DOOM2016/Original/DOOM2016_Create.shp index 1e79c95..7a3ce29 100644 --- a/Tests/Data/DOOM2016/Original/DOOM2016_Create.shp +++ b/Tests/Data/DOOM2016/Original/DOOM2016_Create.shp @@ -1,6 +1,7 @@ { "EngineScriptName": "DOOM2016", "FilePath": "%SOURCEFOLDER%\\DOOM2016_Create.shp", + "FirstTimeRun": true, "Name": "DOOM2016", "RootFolder": null, "Settings": [ diff --git a/Tests/Data/DOOM2016/Original/DOOM2016_Open.shp b/Tests/Data/DOOM2016/Original/DOOM2016_Open.shp index bec30f6..95d52cb 100644 --- a/Tests/Data/DOOM2016/Original/DOOM2016_Open.shp +++ b/Tests/Data/DOOM2016/Original/DOOM2016_Open.shp @@ -1,6 +1,7 @@ { "EngineScriptName": "DOOM2016", "FilePath": "%SOURCEFOLDER%\\DOOM2016_Open.shp", + "FirstTimeRun": true, "Name": "DOOM2016", "RootFolder": "%SOURCEFOLDER%", "Settings": [ @@ -30,6 +31,6 @@ } ], "Snapshots": [], - "SortKey": null, + "SortKey": "SavedAt", "SortOrder": 0 } \ No newline at end of file diff --git a/Tests/Data/DOOMEternal/Bethesda/Original/DOOMEternal_Bethesda_Create.shp b/Tests/Data/DOOMEternal/Bethesda/Original/DOOMEternal_Bethesda_Create.shp index 799eb05..3f72c78 100644 --- a/Tests/Data/DOOMEternal/Bethesda/Original/DOOMEternal_Bethesda_Create.shp +++ b/Tests/Data/DOOMEternal/Bethesda/Original/DOOMEternal_Bethesda_Create.shp @@ -1,6 +1,7 @@ { "EngineScriptName": "DOOMEternal", "FilePath": "%SOURCEFOLDER%\\DOOMEternal_Bethesda_Create.shp", + "FirstTimeRun": true, "Name": "DOOMEternal_Bethesda", "RootFolder": null, "Settings": [ diff --git a/Tests/Data/DOOMEternal/Bethesda/Original/DOOMEternal_Bethesda_Open.shp b/Tests/Data/DOOMEternal/Bethesda/Original/DOOMEternal_Bethesda_Open.shp index 80ab96e..e7c4f54 100644 --- a/Tests/Data/DOOMEternal/Bethesda/Original/DOOMEternal_Bethesda_Open.shp +++ b/Tests/Data/DOOMEternal/Bethesda/Original/DOOMEternal_Bethesda_Open.shp @@ -1,6 +1,7 @@ { "EngineScriptName": "DOOMEternal", "FilePath": "%SOURCEFOLDER%\\DOOMEternal_Bethesda_Open.shp", + "FirstTimeRun": true, "Name": "DOOMEternal_Bethesda", "RootFolder": "%SOURCEFOLDER%", "Settings": [ @@ -48,6 +49,6 @@ } ], "Snapshots": [], - "SortKey": null, + "SortKey": "SavedAt", "SortOrder": 0 } \ No newline at end of file diff --git a/Tests/Data/DOOMEternal/Steam/Original/DOOMEternal_Steam_Create.shp b/Tests/Data/DOOMEternal/Steam/Original/DOOMEternal_Steam_Create.shp index b2ad099..97521f6 100644 --- a/Tests/Data/DOOMEternal/Steam/Original/DOOMEternal_Steam_Create.shp +++ b/Tests/Data/DOOMEternal/Steam/Original/DOOMEternal_Steam_Create.shp @@ -1,6 +1,7 @@ { "EngineScriptName": "DOOMEternal", "FilePath": "%SOURCEFOLDER%\\DOOMEternal_Steam_Create.shp", + "FirstTimeRun": true, "Name": "DOOMEternal_Steam", "RootFolder": null, "Settings": [ diff --git a/Tests/Data/DOOMEternal/Steam/Original/DOOMEternal_Steam_Open.shp b/Tests/Data/DOOMEternal/Steam/Original/DOOMEternal_Steam_Open.shp index 22419ec..d4a6781 100644 --- a/Tests/Data/DOOMEternal/Steam/Original/DOOMEternal_Steam_Open.shp +++ b/Tests/Data/DOOMEternal/Steam/Original/DOOMEternal_Steam_Open.shp @@ -1,6 +1,7 @@ { "EngineScriptName": "DOOMEternal", "FilePath": "%SOURCEFOLDER%\\DOOMEternal_Steam_Open.shp", + "FirstTimeRun": true, "Name": "DOOMEternal_Steam", "RootFolder": "%SOURCEFOLDER%", "Settings": [ @@ -48,6 +49,6 @@ } ], "Snapshots": [], - "SortKey": null, + "SortKey": "SavedAt", "SortOrder": 0 } \ No newline at end of file diff --git a/Tests/Data/Satisfactory/Original/Satisfactory_Create.shp b/Tests/Data/Satisfactory/Original/Satisfactory_Create.shp index e74bebb..4ccf7a9 100644 --- a/Tests/Data/Satisfactory/Original/Satisfactory_Create.shp +++ b/Tests/Data/Satisfactory/Original/Satisfactory_Create.shp @@ -1,6 +1,7 @@ { "EngineScriptName": "Satisfactory", "FilePath": "%SOURCEFOLDER%\\Satisfactory_Create.shp", + "FirstTimeRun": true, "Name": "Satisfactory", "RootFolder": null, "Settings": [ diff --git a/Tests/Data/Satisfactory/Original/Satisfactory_Open.shp b/Tests/Data/Satisfactory/Original/Satisfactory_Open.shp index 9ea1da8..f1c4ff7 100644 --- a/Tests/Data/Satisfactory/Original/Satisfactory_Open.shp +++ b/Tests/Data/Satisfactory/Original/Satisfactory_Open.shp @@ -1,6 +1,7 @@ { "EngineScriptName": "Satisfactory", "FilePath": "%SOURCEFOLDER%\\Satisfactory_Open.shp", + "FirstTimeRun": true, "Name": "Satisfactory", "RootFolder": "%SOURCEFOLDER%", "Settings": [ diff --git a/Tests/Scripts/EngineScriptTests.cs b/Tests/Scripts/EngineScriptTests.cs index c8525ad..246fa7b 100644 --- a/Tests/Scripts/EngineScriptTests.cs +++ b/Tests/Scripts/EngineScriptTests.cs @@ -176,6 +176,15 @@ protected void CreateProfile(DataSet dataSet) }); } + if (luaManager.ActiveEngine.ReadMe != null) + { + Assert.DoesNotThrow(() => + { + string s = luaManager.ActiveEngine.ReadMe.Call().First() as string; + Assert.IsFalse(string.IsNullOrEmpty(s)); + }); + } + var profileFile = new ProfileFile {EngineScriptName = engineScript.Name, Name = dataSet.ProfileName}; luaManager.SaveSnapshots(profileFile); diff --git a/Tests/Tests.csproj b/Tests/Tests.csproj index 812c1d8..98b01dc 100644 --- a/Tests/Tests.csproj +++ b/Tests/Tests.csproj @@ -1,7 +1,7 @@  - - + + Debug @@ -43,14 +43,14 @@ ..\packages\JetBrains.dotMemoryUnit.3.1.20200127.214830\lib\net35\dotMemory.Unit.dll - - ..\packages\KeraLua.1.2.4\lib\net45\KeraLua.dll + + ..\packages\KeraLua.1.2.12\lib\net46\KeraLua.dll - - ..\packages\NLua.1.5.0\lib\net45\NLua.dll + + ..\packages\NLua.1.5.7\lib\net46\NLua.dll - - ..\packages\NUnit.3.12.0\lib\net45\nunit.framework.dll + + ..\packages\NUnit.3.13.1\lib\net45\nunit.framework.dll @@ -154,13 +154,13 @@ + Ce projet fait référence à des packages NuGet qui sont manquants sur cet ordinateur. Utilisez l'option de restauration des packages NuGet pour les télécharger. Pour plus d'informations, consultez http://go.microsoft.com/fwlink/?LinkID=322105. Le fichier manquant est : {0}. - - - + + + - \ No newline at end of file diff --git a/Tests/packages.config b/Tests/packages.config index 33c450d..5e0632c 100644 --- a/Tests/packages.config +++ b/Tests/packages.config @@ -1,15 +1,15 @@  - - - - - + + + + + - + \ No newline at end of file