From 0b40fa02d71b4dab5383901cf3d9ff9b797a4123 Mon Sep 17 00:00:00 2001 From: Jiiks Date: Wed, 3 Apr 2019 00:20:45 +0300 Subject: [PATCH] Versioning and pseudo read-only fix --- SekiroSpeedrunUtil/Properties/AssemblyInfo.cs | 4 ++-- SekiroSpeedrunUtil/ui/MainSaveMan.cs | 19 +++++++++++++++++-- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/SekiroSpeedrunUtil/Properties/AssemblyInfo.cs b/SekiroSpeedrunUtil/Properties/AssemblyInfo.cs index 3f19107..bf2c105 100644 --- a/SekiroSpeedrunUtil/Properties/AssemblyInfo.cs +++ b/SekiroSpeedrunUtil/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("0.3.1.0")] -[assembly: AssemblyFileVersion("0.3.1.0")] +[assembly: AssemblyVersion("0.3.2.0")] +[assembly: AssemblyFileVersion("0.3.2.0")] diff --git a/SekiroSpeedrunUtil/ui/MainSaveMan.cs b/SekiroSpeedrunUtil/ui/MainSaveMan.cs index c2b39ae..4f84edc 100644 --- a/SekiroSpeedrunUtil/ui/MainSaveMan.cs +++ b/SekiroSpeedrunUtil/ui/MainSaveMan.cs @@ -214,7 +214,7 @@ private string SaveDir() { } private string ProfileDir(string name = null) { - _smQuickLoadLastProfile = smProfiles.SelectedItem.ToString(); + if(name != null) _smQuickLoadLastProfile = smProfiles.SelectedItem.ToString(); var dir = name == null ? $"{SaveDir()}/{smProfiles.SelectedItem}" : $"{SaveDir()}/{name}"; if (!Directory.Exists(dir)) Directory.CreateDirectory(dir); return dir; @@ -272,7 +272,22 @@ private void SmPseudoReadonlyHandler(object sender, GlobalEventArgs e) { if (b == 0) { if (_smSelfWrite) return; _smSelfWrite = true; - QuickLoad(); + //QuickLoad(); + + if (_smQuickLoadLastItem == string.Empty || _smQuickLoadLastProfile == string.Empty) return; + try { + var fPath = $"{ProfileDir(_smQuickLoadLastProfile)}/{_smQuickLoadLastItem.Replace(" ", "_")}"; + File.Copy(fPath, $"{_sekiroDir}/S0000.sl2", true); + Toast("Quickload Success!", Color.MediumAquamarine, Color.Black); + } catch (Exception ex) { + MetroMessageBox.Show(this, + ex.Message, + "Error", + MessageBoxButtons.OK, + MessageBoxIcon.Error + ); + } + } else { _smSelfWrite = false; }