From 8ca6b24614b6c17833600529673081bb9fb1a4aa Mon Sep 17 00:00:00 2001 From: adelikat Date: Sat, 2 Jun 2012 22:06:00 +0000 Subject: [PATCH] Cheats, Lua, Ram Search/Watch - flag changes when adding a separator, default to SaveAs if saving a new file, allow Save in menu item in this scenario --- BizHawk.MultiClient/tools/Cheats.cs | 3 ++- BizHawk.MultiClient/tools/LuaConsole.cs | 8 ++++---- BizHawk.MultiClient/tools/RamWatch.cs | 11 +++++++---- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/BizHawk.MultiClient/tools/Cheats.cs b/BizHawk.MultiClient/tools/Cheats.cs index a6449d4eaf..24c21b05e5 100644 --- a/BizHawk.MultiClient/tools/Cheats.cs +++ b/BizHawk.MultiClient/tools/Cheats.cs @@ -519,6 +519,7 @@ namespace BizHawk.MultiClient private void InsertSeparator() { + Changes(); Cheat c = new Cheat(); c.address = -1; @@ -806,7 +807,7 @@ namespace BizHawk.MultiClient private void fileToolStripMenuItem_DropDownOpened(object sender, EventArgs e) { - if (string.Compare(Global.CheatList.currentCheatFile, "") == 0 || !Global.CheatList.Changes) + if (!Global.CheatList.Changes) { saveToolStripMenuItem.Enabled = false; } diff --git a/BizHawk.MultiClient/tools/LuaConsole.cs b/BizHawk.MultiClient/tools/LuaConsole.cs index 7933901480..4cbbcdaed2 100644 --- a/BizHawk.MultiClient/tools/LuaConsole.cs +++ b/BizHawk.MultiClient/tools/LuaConsole.cs @@ -362,9 +362,9 @@ namespace BizHawk.MultiClient { if (changes) { - if (string.Compare(currentSessionFile, "") == 0) - SaveAs(); - else SaveSession(currentSessionFile); + if (string.Compare(currentSessionFile, "") == 0) + SaveAs(); + else SaveSession(currentSessionFile); Changes(false); OutputMessages.Text = Path.GetFileName(currentSessionFile) + " saved."; } @@ -968,7 +968,7 @@ namespace BizHawk.MultiClient private void fileToolStripMenuItem_DropDownOpened(object sender, EventArgs e) { - if (!changes || luaList.Count == 0) + if (!changes) { saveToolStripMenuItem.Enabled = false; } diff --git a/BizHawk.MultiClient/tools/RamWatch.cs b/BizHawk.MultiClient/tools/RamWatch.cs index d7458979e1..2ce6695aaa 100644 --- a/BizHawk.MultiClient/tools/RamWatch.cs +++ b/BizHawk.MultiClient/tools/RamWatch.cs @@ -629,9 +629,11 @@ namespace BizHawk.MultiClient private void saveToolStripMenuItem_Click(object sender, EventArgs e) { - if (string.Compare(currentWatchFile, "") == 0) return; - - if (changes) + if (string.Compare(currentWatchFile, "") == 0) + { + SaveAs(); + } + else if (changes) { SaveWatchFile(currentWatchFile); MessageLabel.Text = Path.GetFileName(currentWatchFile) + " saved."; @@ -741,7 +743,7 @@ namespace BizHawk.MultiClient else autoLoadToolStripMenuItem.Checked = false; - if (string.Compare(currentWatchFile, "") == 0 || !changes) + if (!changes) { saveToolStripMenuItem.Enabled = false; } @@ -862,6 +864,7 @@ namespace BizHawk.MultiClient private void InsertSeparator() { + Changes(); Watch w = new Watch(); w.type = atype.SEPARATOR;