diff options
| author | Alex-TIMEHACK <[email protected]> | 2017-11-04 09:43:02 +0000 |
|---|---|---|
| committer | Alex-TIMEHACK <[email protected]> | 2017-11-04 09:43:02 +0000 |
| commit | 6ab1468786f1e865e9ff408d32149f9c9620d844 (patch) | |
| tree | 45bac91aba019027213bdd37bac9f43c0a93853e /Histacom2/GlobalPrograms | |
| parent | 2a473d05a34afe51cf0f5340cbdd48ad4e771657 (diff) | |
| download | histacom2-6ab1468786f1e865e9ff408d32149f9c9620d844.tar.gz histacom2-6ab1468786f1e865e9ff408d32149f9c9620d844.tar.bz2 histacom2-6ab1468786f1e865e9ff408d32149f9c9620d844.zip | |
Fix bugs
...and get rid of all == false and == true
Diffstat (limited to 'Histacom2/GlobalPrograms')
| -rw-r--r-- | Histacom2/GlobalPrograms/WinClassicNotepad.cs | 20 |
1 files changed, 13 insertions, 7 deletions
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 != "") { |
