Clean up toggle/refresh buttons in Lua Console
This commit is contained in:
parent
0a9d496ece
commit
3fee117c5f
|
@ -310,11 +310,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
{
|
{
|
||||||
// Even after _watches is cleared, these callbacks hang around! So this check is necessary
|
// Even after _watches is cleared, these callbacks hang around! So this check is necessary
|
||||||
var script = LuaImp.ScriptList.FirstOrDefault(s => s.Path == e.FullPath && s.Enabled);
|
var script = LuaImp.ScriptList.FirstOrDefault(s => s.Path == e.FullPath && s.Enabled);
|
||||||
|
if (script != null) Invoke((MethodInvoker) (() => RefreshLuaScript(script)));
|
||||||
if (script != null)
|
|
||||||
{
|
|
||||||
Invoke(new MethodInvoker(delegate { RefreshScriptMenuItem_Click(null, null); }));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void LoadLuaFile(string path)
|
public void LoadLuaFile(string path)
|
||||||
|
@ -1416,8 +1412,12 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
private void RefreshScriptMenuItem_Click(object sender, EventArgs e)
|
private void RefreshScriptMenuItem_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
ToggleScriptMenuItem_Click(sender, e);
|
if (!(LuaImp is Win32LuaLibraries luaLibsImpl)) return;
|
||||||
ToggleScriptMenuItem_Click(sender, e);
|
var files = !SelectedFiles.Any() && Settings.ToggleAllIfNoneSelected
|
||||||
|
? luaLibsImpl.ScriptList
|
||||||
|
: SelectedFiles;
|
||||||
|
foreach (var file in files) RefreshLuaScript(file);
|
||||||
|
UpdateDialog();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void InputBox_KeyDown(object sender, KeyEventArgs e)
|
private void InputBox_KeyDown(object sender, KeyEventArgs e)
|
||||||
|
@ -1566,6 +1566,12 @@ namespace BizHawk.Client.EmuHawk
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void RefreshLuaScript(LuaFile file)
|
||||||
|
{
|
||||||
|
ToggleLuaScript(file);
|
||||||
|
ToggleLuaScript(file);
|
||||||
|
}
|
||||||
|
|
||||||
[RestoreDefaults]
|
[RestoreDefaults]
|
||||||
private void RestoreDefaults()
|
private void RestoreDefaults()
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue