Lua Console - refresh things better

This commit is contained in:
adelikat 2013-12-19 00:54:35 +00:00
parent ac97e62ed1
commit b604d81d10
2 changed files with 9 additions and 5 deletions

View File

@ -115,7 +115,7 @@
this.ScriptContextSeparator,
this.StopAllScriptsContextItem});
this.ScriptListContextMenu.Name = "contextMenuStrip1";
this.ScriptListContextMenu.Size = new System.Drawing.Size(165, 164);
this.ScriptListContextMenu.Size = new System.Drawing.Size(165, 142);
this.ScriptListContextMenu.Opening += new System.ComponentModel.CancelEventHandler(this.ScriptListContextMenu_Opening);
//
// ToggleScriptContextItem

View File

@ -90,7 +90,6 @@ namespace BizHawk.Client.EmuHawk
var luaFile = new LuaFile(String.Empty, path);
_luaList.Add(luaFile);
LuaListView.ItemCount = _luaList.Count;
LuaListView.Refresh();
Global.Config.RecentLua.Add(path);
if (!Global.Config.DisableLuaScriptsOnLoad)
@ -110,6 +109,7 @@ namespace BizHawk.Client.EmuHawk
else MessageBox.Show(e.ToString());
}
}
else luaFile.Enabled = false;
luaFile.Paused = false;
}
@ -122,8 +122,10 @@ namespace BizHawk.Client.EmuHawk
}
RunLuaScripts();
UpdateDialog();
}
UpdateDialog();
}
public void UpdateDialog()
@ -131,6 +133,7 @@ namespace BizHawk.Client.EmuHawk
LuaListView.ItemCount = _luaList.Count;
LuaListView.Refresh();
UpdateNumberOfScripts();
UpdateRegisteredFunctionsDialog();
}
public void RunLuaScripts()
@ -698,19 +701,20 @@ namespace BizHawk.Client.EmuHawk
}
UpdateRegisteredFunctionsDialog();
}
item.Stop();
}
}
LuaListView.Refresh();
_luaList.Changes = true;
UpdateDialog();
}
private void PauseScriptMenuItem_Click(object sender, EventArgs e)
{
SelectedFiles.ToList().ForEach(x => x.TogglePause());
LuaListView.Refresh();
UpdateDialog();
}
private void EditScriptMenuItem_Click(object sender, EventArgs e)