Skip to content

Commit

Permalink
Versioning and pseudo read-only fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Jiiks committed Apr 2, 2019
1 parent ee88a3e commit 0b40fa0
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
4 changes: 2 additions & 2 deletions SekiroSpeedrunUtil/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
19 changes: 17 additions & 2 deletions SekiroSpeedrunUtil/ui/MainSaveMan.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 0b40fa0

Please sign in to comment.