Fixes to ram watch and cheats closing events and restarting and asking to save changes, some of these are regressions from refactoring, some from the rewrite of these tools, and some have been this way since day 1
This commit is contained in:
parent
2da8696b8d
commit
0a0487850d
|
@ -100,11 +100,18 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
Closing += (o, e) =>
|
Closing += (o, e) =>
|
||||||
{
|
{
|
||||||
Global.CheatList.SaveOnClose();
|
if (GlobalWin.Tools.AskSave())
|
||||||
CloseGame();
|
{
|
||||||
Global.MovieSession.Movie.Stop();
|
Global.CheatList.SaveOnClose();
|
||||||
GlobalWin.Tools.Close();
|
CloseGame();
|
||||||
SaveConfig();
|
Global.MovieSession.Movie.Stop();
|
||||||
|
GlobalWin.Tools.Close();
|
||||||
|
SaveConfig();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
e.Cancel = true;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
ResizeBegin += (o, e) =>
|
ResizeBegin += (o, e) =>
|
||||||
|
@ -3726,21 +3733,24 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
public void CloseROM(bool clearSRAM = false)
|
public void CloseROM(bool clearSRAM = false)
|
||||||
{
|
{
|
||||||
CloseGame(clearSRAM);
|
if (GlobalWin.Tools.AskSave())
|
||||||
Global.CoreComm = new CoreComm();
|
{
|
||||||
CoreFileProvider.SyncCoreCommInputSignals();
|
CloseGame(clearSRAM);
|
||||||
Global.Emulator = new NullEmulator(Global.CoreComm);
|
Global.CoreComm = new CoreComm();
|
||||||
Global.Game = GameInfo.GetNullGame();
|
CoreFileProvider.SyncCoreCommInputSignals();
|
||||||
|
Global.Emulator = new NullEmulator(Global.CoreComm);
|
||||||
|
Global.Game = GameInfo.GetNullGame();
|
||||||
|
|
||||||
GlobalWin.Tools.Restart();
|
GlobalWin.Tools.Restart();
|
||||||
|
|
||||||
RewireSound();
|
RewireSound();
|
||||||
ResetRewindBuffer();
|
ResetRewindBuffer();
|
||||||
Cheats_Restart();
|
Cheats_Restart();
|
||||||
Text = "BizHawk" + (INTERIM ? " (interim) " : "");
|
Text = "BizHawk" + (INTERIM ? " (interim) " : "");
|
||||||
HandlePlatformMenus();
|
HandlePlatformMenus();
|
||||||
StateSlots.Clear();
|
StateSlots.Clear();
|
||||||
UpdateDumpIcon();
|
UpdateDumpIcon();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SwapBackupSavestate(string path) //Move inside Saveslot Manager
|
private void SwapBackupSavestate(string path) //Move inside Saveslot Manager
|
||||||
|
|
|
@ -51,7 +51,18 @@ namespace BizHawk.Client.EmuHawk
|
||||||
public Cheats()
|
public Cheats()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
Closing += (o, e) => SaveConfigSettings();
|
Closing += (o, e) =>
|
||||||
|
{
|
||||||
|
if (AskSave())
|
||||||
|
{
|
||||||
|
SaveConfigSettings();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
e.Cancel = true;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
CheatListView.QueryItemText += CheatListView_QueryItemText;
|
CheatListView.QueryItemText += CheatListView_QueryItemText;
|
||||||
CheatListView.QueryItemBkColor += CheatListView_QueryItemBkColor;
|
CheatListView.QueryItemBkColor += CheatListView_QueryItemBkColor;
|
||||||
CheatListView.VirtualMode = true;
|
CheatListView.VirtualMode = true;
|
||||||
|
@ -75,15 +86,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
public void Restart()
|
public void Restart()
|
||||||
{
|
{
|
||||||
if (!IsHandleCreated || IsDisposed)
|
StartNewList();
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
NewList();
|
|
||||||
ToggleGameGenieButton();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void UpdateListView()
|
private void UpdateListView()
|
||||||
|
@ -152,6 +155,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
}
|
}
|
||||||
else if (result == DialogResult.No)
|
else if (result == DialogResult.No)
|
||||||
{
|
{
|
||||||
|
Global.CheatList.Changes = false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else if (result == DialogResult.Cancel)
|
else if (result == DialogResult.Cancel)
|
||||||
|
@ -545,6 +549,14 @@ namespace BizHawk.Client.EmuHawk
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void StartNewList()
|
||||||
|
{
|
||||||
|
Global.CheatList.NewList(GlobalWin.MainForm.GenerateDefaultCheatFilename());
|
||||||
|
UpdateListView();
|
||||||
|
UpdateMessageLabel();
|
||||||
|
ToggleGameGenieButton();
|
||||||
|
}
|
||||||
|
|
||||||
private void NewList()
|
private void NewList()
|
||||||
{
|
{
|
||||||
bool result = true;
|
bool result = true;
|
||||||
|
@ -555,9 +567,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
if (result)
|
if (result)
|
||||||
{
|
{
|
||||||
Global.CheatList.NewList(GlobalWin.MainForm.GenerateDefaultCheatFilename());
|
StartNewList();
|
||||||
UpdateListView();
|
|
||||||
UpdateMessageLabel();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -38,8 +38,18 @@ namespace BizHawk.Client.EmuHawk
|
||||||
WatchListView.QueryItemText += WatchListView_QueryItemText;
|
WatchListView.QueryItemText += WatchListView_QueryItemText;
|
||||||
WatchListView.QueryItemBkColor += WatchListView_QueryItemBkColor;
|
WatchListView.QueryItemBkColor += WatchListView_QueryItemBkColor;
|
||||||
WatchListView.VirtualMode = true;
|
WatchListView.VirtualMode = true;
|
||||||
Closing += (o, e) => SaveConfigSettings();
|
Closing += (o, e) =>
|
||||||
_sortedColumn = "";
|
{
|
||||||
|
if (AskSave())
|
||||||
|
{
|
||||||
|
SaveConfigSettings();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
e.Cancel = true;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
_sortedColumn = String.Empty;
|
||||||
_sortReverse = false;
|
_sortReverse = false;
|
||||||
|
|
||||||
TopMost = Global.Config.RamWatchAlwaysOnTop;
|
TopMost = Global.Config.RamWatchAlwaysOnTop;
|
||||||
|
@ -169,6 +179,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
}
|
}
|
||||||
else if (result == DialogResult.No)
|
else if (result == DialogResult.No)
|
||||||
{
|
{
|
||||||
|
Watches.Changes = false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else if (result == DialogResult.Cancel)
|
else if (result == DialogResult.Cancel)
|
||||||
|
@ -234,13 +245,6 @@ namespace BizHawk.Client.EmuHawk
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnClosing(CancelEventArgs e)
|
|
||||||
{
|
|
||||||
if (!AskSave())
|
|
||||||
e.Cancel = true;
|
|
||||||
base.OnClosing(e);
|
|
||||||
}
|
|
||||||
|
|
||||||
private int GetColumnWidth(string columnName)
|
private int GetColumnWidth(string columnName)
|
||||||
{
|
{
|
||||||
var width = Global.Config.RamWatchColumnWidths[columnName];
|
var width = Global.Config.RamWatchColumnWidths[columnName];
|
||||||
|
|
Loading…
Reference in New Issue