diff options
| author | lempamo <[email protected]> | 2017-11-05 09:25:55 -0500 |
|---|---|---|
| committer | GitHub <[email protected]> | 2017-11-05 09:25:55 -0500 |
| commit | f0e2d14a959db1e5d35c4dc5f77ed3523c93200a (patch) | |
| tree | 7ae4244e5f5c3dc38f4b228f15efe4ea5be0fe3a /Histacom2/GlobalPrograms/WinClassicNotepad.cs | |
| parent | 458cc4ee0dbc67f547ea851b5a67a88af119a4c0 (diff) | |
| parent | 55bc23bd3797debcfc461ef23df344d16212f235 (diff) | |
| download | histacom2-f0e2d14a959db1e5d35c4dc5f77ed3523c93200a.tar.gz histacom2-f0e2d14a959db1e5d35c4dc5f77ed3523c93200a.tar.bz2 histacom2-f0e2d14a959db1e5d35c4dc5f77ed3523c93200a.zip | |
Merge pull request #180 from Alex-TIMEHACK/master
ClassicTextBox and ClassicDropDown
Diffstat (limited to 'Histacom2/GlobalPrograms/WinClassicNotepad.cs')
| -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 != "") { |
