Lua Cosnole - output message at bottom of dialog to show if changes have occured and saved messages (same as other tool dialogs such as ram watch). Better minimize size parameters of dialog.
This commit is contained in:
parent
cba68551d0
commit
602ee06ffc
|
@ -82,6 +82,7 @@
|
||||||
this.clearToolStripMenuItem2 = new System.Windows.Forms.ToolStripMenuItem();
|
this.clearToolStripMenuItem2 = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.groupBox1 = new System.Windows.Forms.GroupBox();
|
this.groupBox1 = new System.Windows.Forms.GroupBox();
|
||||||
this.NumberOfScripts = new System.Windows.Forms.Label();
|
this.NumberOfScripts = new System.Windows.Forms.Label();
|
||||||
|
this.OutputMessages = new System.Windows.Forms.Label();
|
||||||
this.toolStrip1 = new ToolStripEx();
|
this.toolStrip1 = new ToolStripEx();
|
||||||
this.openToolStripButton = new System.Windows.Forms.ToolStripButton();
|
this.openToolStripButton = new System.Windows.Forms.ToolStripButton();
|
||||||
this.copyToolStripButton = new System.Windows.Forms.ToolStripButton();
|
this.copyToolStripButton = new System.Windows.Forms.ToolStripButton();
|
||||||
|
@ -506,7 +507,7 @@
|
||||||
this.OutputBox.Location = new System.Drawing.Point(6, 17);
|
this.OutputBox.Location = new System.Drawing.Point(6, 17);
|
||||||
this.OutputBox.Name = "OutputBox";
|
this.OutputBox.Name = "OutputBox";
|
||||||
this.OutputBox.ReadOnly = true;
|
this.OutputBox.ReadOnly = true;
|
||||||
this.OutputBox.Size = new System.Drawing.Size(246, 259);
|
this.OutputBox.Size = new System.Drawing.Size(246, 283);
|
||||||
this.OutputBox.TabIndex = 2;
|
this.OutputBox.TabIndex = 2;
|
||||||
this.OutputBox.Text = "";
|
this.OutputBox.Text = "";
|
||||||
//
|
//
|
||||||
|
@ -531,7 +532,7 @@
|
||||||
this.groupBox1.Controls.Add(this.OutputBox);
|
this.groupBox1.Controls.Add(this.OutputBox);
|
||||||
this.groupBox1.Location = new System.Drawing.Point(310, 71);
|
this.groupBox1.Location = new System.Drawing.Point(310, 71);
|
||||||
this.groupBox1.Name = "groupBox1";
|
this.groupBox1.Name = "groupBox1";
|
||||||
this.groupBox1.Size = new System.Drawing.Size(258, 280);
|
this.groupBox1.Size = new System.Drawing.Size(258, 304);
|
||||||
this.groupBox1.TabIndex = 3;
|
this.groupBox1.TabIndex = 3;
|
||||||
this.groupBox1.TabStop = false;
|
this.groupBox1.TabStop = false;
|
||||||
this.groupBox1.Text = "Output";
|
this.groupBox1.Text = "Output";
|
||||||
|
@ -545,6 +546,16 @@
|
||||||
this.NumberOfScripts.TabIndex = 4;
|
this.NumberOfScripts.TabIndex = 4;
|
||||||
this.NumberOfScripts.Text = "0 script ";
|
this.NumberOfScripts.Text = "0 script ";
|
||||||
//
|
//
|
||||||
|
// OutputMessages
|
||||||
|
//
|
||||||
|
this.OutputMessages.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||||
|
this.OutputMessages.AutoSize = true;
|
||||||
|
this.OutputMessages.Location = new System.Drawing.Point(13, 384);
|
||||||
|
this.OutputMessages.Name = "OutputMessages";
|
||||||
|
this.OutputMessages.Size = new System.Drawing.Size(106, 13);
|
||||||
|
this.OutputMessages.TabIndex = 6;
|
||||||
|
this.OutputMessages.Text = " ";
|
||||||
|
//
|
||||||
// toolStrip1
|
// toolStrip1
|
||||||
//
|
//
|
||||||
this.toolStrip1.ClickThrough = true;
|
this.toolStrip1.ClickThrough = true;
|
||||||
|
@ -666,7 +677,7 @@
|
||||||
this.LuaListView.Location = new System.Drawing.Point(13, 71);
|
this.LuaListView.Location = new System.Drawing.Point(13, 71);
|
||||||
this.LuaListView.Name = "LuaListView";
|
this.LuaListView.Name = "LuaListView";
|
||||||
this.LuaListView.selectedItem = -1;
|
this.LuaListView.selectedItem = -1;
|
||||||
this.LuaListView.Size = new System.Drawing.Size(291, 280);
|
this.LuaListView.Size = new System.Drawing.Size(291, 304);
|
||||||
this.LuaListView.TabIndex = 0;
|
this.LuaListView.TabIndex = 0;
|
||||||
this.LuaListView.UseCompatibleStateImageBehavior = false;
|
this.LuaListView.UseCompatibleStateImageBehavior = false;
|
||||||
this.LuaListView.View = System.Windows.Forms.View.Details;
|
this.LuaListView.View = System.Windows.Forms.View.Details;
|
||||||
|
@ -688,7 +699,8 @@
|
||||||
this.AllowDrop = true;
|
this.AllowDrop = true;
|
||||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
this.ClientSize = new System.Drawing.Size(584, 366);
|
this.ClientSize = new System.Drawing.Size(584, 402);
|
||||||
|
this.Controls.Add(this.OutputMessages);
|
||||||
this.Controls.Add(this.toolStrip1);
|
this.Controls.Add(this.toolStrip1);
|
||||||
this.Controls.Add(this.groupBox1);
|
this.Controls.Add(this.groupBox1);
|
||||||
this.Controls.Add(this.NumberOfScripts);
|
this.Controls.Add(this.NumberOfScripts);
|
||||||
|
@ -696,7 +708,7 @@
|
||||||
this.Controls.Add(this.LuaListView);
|
this.Controls.Add(this.LuaListView);
|
||||||
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
|
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
|
||||||
this.MainMenuStrip = this.menuStrip1;
|
this.MainMenuStrip = this.menuStrip1;
|
||||||
this.MinimumSize = new System.Drawing.Size(356, 132);
|
this.MinimumSize = new System.Drawing.Size(400, 180);
|
||||||
this.Name = "LuaConsole";
|
this.Name = "LuaConsole";
|
||||||
this.Text = "Lua Console";
|
this.Text = "Lua Console";
|
||||||
this.Load += new System.EventHandler(this.LuaConsole_Load);
|
this.Load += new System.EventHandler(this.LuaConsole_Load);
|
||||||
|
@ -781,5 +793,6 @@
|
||||||
private System.Windows.Forms.ToolStripButton resumePauseButton1;
|
private System.Windows.Forms.ToolStripButton resumePauseButton1;
|
||||||
private System.Windows.Forms.ToolStripMenuItem resumePauseToolStripMenuItem;
|
private System.Windows.Forms.ToolStripMenuItem resumePauseToolStripMenuItem;
|
||||||
public System.Windows.Forms.RichTextBox OutputBox;
|
public System.Windows.Forms.RichTextBox OutputBox;
|
||||||
|
private System.Windows.Forms.Label OutputMessages;
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -16,6 +16,7 @@ namespace BizHawk.MultiClient
|
||||||
//options - autoload session
|
//options - autoload session
|
||||||
//TODO: remember column widths
|
//TODO: remember column widths
|
||||||
//TODO: restore column width on restore default settings
|
//TODO: restore column width on restore default settings
|
||||||
|
//TODO: don't call asksave without looking at the surpress asksave config item
|
||||||
|
|
||||||
int defaultWidth; //For saving the default size of the dialog, so the user can restore if desired
|
int defaultWidth; //For saving the default size of the dialog, so the user can restore if desired
|
||||||
int defaultHeight;
|
int defaultHeight;
|
||||||
|
@ -54,6 +55,20 @@ namespace BizHawk.MultiClient
|
||||||
LuaListView.VirtualMode = true;
|
LuaListView.VirtualMode = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void Changes(bool changesOccured)
|
||||||
|
{
|
||||||
|
if (changesOccured)
|
||||||
|
{
|
||||||
|
changes = true;
|
||||||
|
OutputMessages.Text = "* " + Path.GetFileName(currentSessionFile);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
changes = false;
|
||||||
|
OutputMessages.Text = Path.GetFileName(currentSessionFile);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void LuaListView_QueryItemBkColor(int index, int column, ref Color color)
|
private void LuaListView_QueryItemBkColor(int index, int column, ref Color color)
|
||||||
{
|
{
|
||||||
if (column == 0)
|
if (column == 0)
|
||||||
|
@ -87,25 +102,20 @@ namespace BizHawk.MultiClient
|
||||||
private void StopScript(int x)
|
private void StopScript(int x)
|
||||||
{
|
{
|
||||||
luaList[x].Stop();
|
luaList[x].Stop();
|
||||||
//LuaImp.Close();
|
Changes(true);
|
||||||
//LuaImp = new LuaImplementation(this);
|
|
||||||
changes = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void StopAllScripts()
|
private void StopAllScripts()
|
||||||
{
|
{
|
||||||
for (int x = 0; x < luaList.Count; x++)
|
for (int x = 0; x < luaList.Count; x++)
|
||||||
luaList[x].Enabled = false;
|
luaList[x].Enabled = false;
|
||||||
//LuaImp.Close();
|
Changes(true);
|
||||||
//LuaImp = new LuaImplementation(this);
|
|
||||||
changes = true;
|
|
||||||
UpdateNumberOfScripts();
|
UpdateNumberOfScripts();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Restart()
|
public void Restart()
|
||||||
{
|
{
|
||||||
StopAllScripts();
|
StopAllScripts();
|
||||||
//LuaImp = new LuaImplementation(this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SaveConfigSettings()
|
private void SaveConfigSettings()
|
||||||
|
@ -192,7 +202,7 @@ namespace BizHawk.MultiClient
|
||||||
}
|
}
|
||||||
else l.Enabled = false;
|
else l.Enabled = false;
|
||||||
l.Paused = false;
|
l.Paused = false;
|
||||||
changes = true;
|
Changes(true);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -203,7 +213,7 @@ namespace BizHawk.MultiClient
|
||||||
luaList[i].Toggle();
|
luaList[i].Toggle();
|
||||||
RunLuaScripts();
|
RunLuaScripts();
|
||||||
LuaListView.Refresh();
|
LuaListView.Refresh();
|
||||||
changes = true;
|
Changes(true);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -276,7 +286,7 @@ namespace BizHawk.MultiClient
|
||||||
}
|
}
|
||||||
LuaListView.Refresh();
|
LuaListView.Refresh();
|
||||||
UpdateNumberOfScripts();
|
UpdateNumberOfScripts();
|
||||||
changes = true;
|
Changes(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void RunLuaScripts()
|
public void RunLuaScripts()
|
||||||
|
@ -355,7 +365,8 @@ namespace BizHawk.MultiClient
|
||||||
if (changes)
|
if (changes)
|
||||||
{
|
{
|
||||||
SaveSession(currentSessionFile);
|
SaveSession(currentSessionFile);
|
||||||
AddText('\n' + Path.GetFileName(currentSessionFile) + " saved.");
|
Changes(false);
|
||||||
|
OutputMessages.Text = Path.GetFileName(currentSessionFile) + " saved.";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -381,7 +392,7 @@ namespace BizHawk.MultiClient
|
||||||
luaList.Clear();
|
luaList.Clear();
|
||||||
DisplayLuaList();
|
DisplayLuaList();
|
||||||
UpdateNumberOfScripts();
|
UpdateNumberOfScripts();
|
||||||
changes = false;
|
Changes(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -408,7 +419,7 @@ namespace BizHawk.MultiClient
|
||||||
private void RemoveScript()
|
private void RemoveScript()
|
||||||
{
|
{
|
||||||
if (luaList.Count == 0) return;
|
if (luaList.Count == 0) return;
|
||||||
changes = true;
|
Changes(true);
|
||||||
ListView.SelectedIndexCollection indexes = LuaListView.SelectedIndices;
|
ListView.SelectedIndexCollection indexes = LuaListView.SelectedIndices;
|
||||||
if (indexes.Count > 0)
|
if (indexes.Count > 0)
|
||||||
{
|
{
|
||||||
|
@ -449,7 +460,7 @@ namespace BizHawk.MultiClient
|
||||||
luaList.Add(f);
|
luaList.Add(f);
|
||||||
DisplayLuaList();
|
DisplayLuaList();
|
||||||
LuaListView.Refresh();
|
LuaListView.Refresh();
|
||||||
changes = true;
|
Changes(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void insertSeperatorToolStripMenuItem1_Click(object sender, EventArgs e)
|
private void insertSeperatorToolStripMenuItem1_Click(object sender, EventArgs e)
|
||||||
|
@ -470,7 +481,7 @@ namespace BizHawk.MultiClient
|
||||||
|
|
||||||
//Note: here it will get flagged many times redundantly potentially,
|
//Note: here it will get flagged many times redundantly potentially,
|
||||||
//but this avoids it being flagged falsely when the user did not select an index
|
//but this avoids it being flagged falsely when the user did not select an index
|
||||||
changes = true;
|
Changes(true);
|
||||||
}
|
}
|
||||||
List<int> i = new List<int>();
|
List<int> i = new List<int>();
|
||||||
for (int z = 0; z < indexes.Count; z++)
|
for (int z = 0; z < indexes.Count; z++)
|
||||||
|
@ -502,7 +513,7 @@ namespace BizHawk.MultiClient
|
||||||
|
|
||||||
//Note: here it will get flagged many times redundantly potnetially,
|
//Note: here it will get flagged many times redundantly potnetially,
|
||||||
//but this avoids it being flagged falsely when the user did not select an index
|
//but this avoids it being flagged falsely when the user did not select an index
|
||||||
changes = true;
|
Changes(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
List<int> i = new List<int>();
|
List<int> i = new List<int>();
|
||||||
|
@ -778,7 +789,7 @@ namespace BizHawk.MultiClient
|
||||||
}
|
}
|
||||||
Global.Config.RecentLuaSession.Add(path);
|
Global.Config.RecentLuaSession.Add(path);
|
||||||
currentSessionFile = path;
|
currentSessionFile = path;
|
||||||
changes = false;
|
Changes(false);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -899,7 +910,7 @@ namespace BizHawk.MultiClient
|
||||||
currentSessionFile = file.FullName;
|
currentSessionFile = file.FullName;
|
||||||
AddText('\n' + Path.GetFileName(currentSessionFile) + " saved.");
|
AddText('\n' + Path.GetFileName(currentSessionFile) + " saved.");
|
||||||
Global.Config.RecentLuaSession.Add(file.FullName);
|
Global.Config.RecentLuaSession.Add(file.FullName);
|
||||||
changes = false;
|
Changes(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -925,7 +936,7 @@ namespace BizHawk.MultiClient
|
||||||
sw.WriteLine(str);
|
sw.WriteLine(str);
|
||||||
}
|
}
|
||||||
|
|
||||||
changes = false;
|
Changes(false);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -993,7 +1004,7 @@ namespace BizHawk.MultiClient
|
||||||
UpdateNumberOfScripts();
|
UpdateNumberOfScripts();
|
||||||
//ClearOutput();
|
//ClearOutput();
|
||||||
currentSessionFile = file;
|
currentSessionFile = file;
|
||||||
changes = false;
|
Changes(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1154,7 +1165,7 @@ namespace BizHawk.MultiClient
|
||||||
for (int x = 0; x < indexes.Count; x++)
|
for (int x = 0; x < indexes.Count; x++)
|
||||||
{
|
{
|
||||||
var item = luaList[indexes[x]];
|
var item = luaList[indexes[x]];
|
||||||
if(!item.IsSeparator)
|
if (!item.IsSeparator)
|
||||||
item.TogglePause();
|
item.TogglePause();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue