From 6ab1468786f1e865e9ff408d32149f9c9620d844 Mon Sep 17 00:00:00 2001 From: Alex-TIMEHACK Date: Sat, 4 Nov 2017 09:43:02 +0000 Subject: Fix bugs ...and get rid of all == false and == true --- Histacom2/GlobalPrograms/WinClassicNotepad.cs | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'Histacom2/GlobalPrograms/WinClassicNotepad.cs') diff --git a/Histacom2/GlobalPrograms/WinClassicNotepad.cs b/Histacom2/GlobalPrograms/WinClassicNotepad.cs index 1a58d8e..de838e0 100644 --- a/Histacom2/GlobalPrograms/WinClassicNotepad.cs +++ b/Histacom2/GlobalPrograms/WinClassicNotepad.cs @@ -100,16 +100,21 @@ namespace Histacom2.GlobalPrograms private void saveToolStripMenuItem_Click(object sender, EventArgs e) { - if (CurrentFilePath == "") + try { - // We aren't in a file right now + if (CurrentFilePath == "") + { + // We aren't in a file right now - SaveAs(); - } else { + SaveAs(); + } + else + { - File.Delete(CurrentFilePath); - SaveSystem.CreateWindowsFile(new FileInfo(CurrentFilePath).Directory.FullName, CurrentFilePath.Split('\\').Last(), mainText.Text, 12, mainText.Text.Length); - } + File.Delete(CurrentFilePath); + SaveSystem.CreateWindowsFile(new FileInfo(CurrentFilePath).Directory.FullName, CurrentFilePath.Split('\\').Last(), mainText.Text, 12, mainText.Text.Length); + } + } catch { } // This try catch loop was added due the game crashing if the desktop is updating the same time the notepad is saving... which I got! } void SaveAs() @@ -118,6 +123,7 @@ namespace Histacom2.GlobalPrograms { ActivateSaveFileDialog(".txt"); string selectedPath = Program.OpenFileExplorerAsDialogAndReturnGivenPath(); + DeactivateFileDialog(); if (selectedPath != "") { -- cgit v1.2.3