Lua Console - fix behavior of Save Changes nag, fix deleting of items
This commit is contained in:
parent
5bbed4a58f
commit
3d48a0b39e
|
@ -11,7 +11,7 @@ namespace BizHawk.Client.Common
|
|||
public LuaFileList() : base() { }
|
||||
|
||||
private string _filename = String.Empty;
|
||||
private bool _changes = false;
|
||||
private bool _changes;
|
||||
|
||||
public Action ChangedCallback;
|
||||
public Action LoadCallback;
|
||||
|
|
|
@ -132,7 +132,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
public bool AskSave()
|
||||
{
|
||||
if (Global.Config.SupressAskSave) //User has elected to not be nagged
|
||||
if (Global.Config.SupressAskSave)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -47,7 +47,17 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
InitializeComponent();
|
||||
LuaImp = new EmuLuaLibrary(this);
|
||||
Closing += (o, e) => SaveConfigSettings();
|
||||
Closing += (o, e) =>
|
||||
{
|
||||
if (AskSave())
|
||||
{
|
||||
SaveConfigSettings();
|
||||
}
|
||||
else
|
||||
{
|
||||
e.Cancel = true;
|
||||
}
|
||||
};
|
||||
LuaListView.QueryItemText += LuaListView_QueryItemText;
|
||||
LuaListView.QueryItemBkColor += LuaListView_QueryItemBkColor;
|
||||
LuaListView.VirtualMode = true;
|
||||
|
@ -492,6 +502,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
else if (result == DialogResult.No)
|
||||
{
|
||||
_luaList.Changes = false;
|
||||
return true;
|
||||
}
|
||||
else if (result == DialogResult.Cancel)
|
||||
|
@ -692,9 +703,10 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
private void RemoveScriptMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (SelectedItems.Any())
|
||||
var items = SelectedItems.ToList();
|
||||
if (items.Any())
|
||||
{
|
||||
foreach (var item in SelectedItems)
|
||||
foreach (var item in items)
|
||||
{
|
||||
_luaList.Remove(item);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue