Message config - ability to set anchoring of on screen messages. TODO: hook up anchoring to display system
This commit is contained in:
parent
882562c452
commit
1db89f5c1f
|
@ -118,18 +118,23 @@
|
|||
public bool DisplayFPS = false;
|
||||
public int DispFPSx = 0;
|
||||
public int DispFPSy = 0;
|
||||
public int DispFPSanchor = 0; //0 = UL, 1 = UR, 2 = DL, 3 = DR
|
||||
public bool DisplayFrameCounter = false;
|
||||
public int DispFrameCx = 0;
|
||||
public int DispFrameCy = 12;
|
||||
public int DispFrameanchor = 0;
|
||||
public bool DisplayLagCounter = false;
|
||||
public int DispLagx = 0;
|
||||
public int DispLagy = 36;
|
||||
public int DispLaganchor = 0;
|
||||
public bool DisplayInput = false;
|
||||
public int DispInpx = 0;
|
||||
public int DispInpy = 24;
|
||||
public int DispInpanchor = 0;
|
||||
public bool DisplayRerecordCount = false;
|
||||
public int DispRecx = 0;
|
||||
public int DispRecy = 48;
|
||||
public int DispRecanchor = 0;
|
||||
public bool ForceGDI = false;
|
||||
public bool DisplayStatusBar = true;
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -9,336 +9,444 @@ using System.Windows.Forms;
|
|||
|
||||
namespace BizHawk.MultiClient
|
||||
{
|
||||
public partial class MessageConfig : Form
|
||||
{
|
||||
//TODO:
|
||||
//Implement message position as a variable
|
||||
//Make a checkbox to enable/disable the stacking effect of message label
|
||||
//Deal with typing into Numerics properly
|
||||
//Have some method of binding a display object to top/bottom/left/right instead of an absolute position
|
||||
//Bug: restore defaults doesn't restore the y value of whatever radio is checked
|
||||
public partial class MessageConfig : Form
|
||||
{
|
||||
//TODO:
|
||||
//Implement message position as a variable
|
||||
//Make a checkbox to enable/disable the stacking effect of message label
|
||||
//Deal with typing into Numerics properly
|
||||
//Have some method of binding a display object to top/bottom/left/right instead of an absolute position
|
||||
//Bug: restore defaults doesn't restore the y value of whatever radio is checked
|
||||
|
||||
int DispFPSx = Global.Config.DispFPSx;
|
||||
int DispFPSy = Global.Config.DispFPSy;
|
||||
int DispFrameCx = Global.Config.DispFrameCx;
|
||||
int DispFrameCy = Global.Config.DispFrameCy;
|
||||
int DispLagx = Global.Config.DispLagx;
|
||||
int DispLagy = Global.Config.DispLagy;
|
||||
int DispInpx = Global.Config.DispInpx;
|
||||
int DispInpy = Global.Config.DispInpy;
|
||||
int MessageColor = Global.Config.MessagesColor;
|
||||
int AlertColor = Global.Config.AlertMessageColor;
|
||||
int LastInputColor = Global.Config.LastInputColor;
|
||||
int DispFPSx = Global.Config.DispFPSx;
|
||||
int DispFPSy = Global.Config.DispFPSy;
|
||||
int DispFrameCx = Global.Config.DispFrameCx;
|
||||
int DispFrameCy = Global.Config.DispFrameCy;
|
||||
int DispLagx = Global.Config.DispLagx;
|
||||
int DispLagy = Global.Config.DispLagy;
|
||||
int DispInpx = Global.Config.DispInpx;
|
||||
int DispInpy = Global.Config.DispInpy;
|
||||
int MessageColor = Global.Config.MessagesColor;
|
||||
int AlertColor = Global.Config.AlertMessageColor;
|
||||
int LastInputColor = Global.Config.LastInputColor;
|
||||
int DispRecx = Global.Config.DispRecx;
|
||||
int DispRecy = Global.Config.DispRecy;
|
||||
|
||||
public Brush brush = Brushes.Black;
|
||||
int px = 0;
|
||||
int py = 0;
|
||||
bool mousedown = false;
|
||||
int DispFPSanchor = Global.Config.DispFPSanchor;
|
||||
int DispFrameanchor = Global.Config.DispFrameanchor;
|
||||
int DispLaganchor = Global.Config.DispLaganchor;
|
||||
int DispInputanchor = Global.Config.DispInpanchor;
|
||||
int DispRecanchor = Global.Config.DispRecanchor;
|
||||
|
||||
public MessageConfig()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
public Brush brush = Brushes.Black;
|
||||
int px = 0;
|
||||
int py = 0;
|
||||
bool mousedown = false;
|
||||
|
||||
private void MessageConfig_Load(object sender, EventArgs e)
|
||||
{
|
||||
SetMaxXY();
|
||||
MessageColorDialog.Color = Color.FromArgb(MessageColor);
|
||||
AlertColorDialog.Color = Color.FromArgb(AlertColor);
|
||||
LInputColorDialog.Color = Color.FromArgb(LastInputColor);
|
||||
SetColorBox();
|
||||
SetPositionInfo();
|
||||
}
|
||||
public MessageConfig()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void SetMaxXY()
|
||||
{
|
||||
XNumeric.Maximum = Global.Emulator.VideoProvider.BufferWidth-8;
|
||||
YNumeric.Maximum = Global.Emulator.VideoProvider.BufferHeight-8;
|
||||
PositionPanel.Size = new Size(Global.Emulator.VideoProvider.BufferWidth, Global.Emulator.VideoProvider.BufferHeight);
|
||||
|
||||
int width;
|
||||
if (Global.Emulator.VideoProvider.BufferWidth > 128)
|
||||
width = Global.Emulator.VideoProvider.BufferWidth + 32;
|
||||
else
|
||||
width = 128+32;
|
||||
|
||||
PositionGroupBox.Size = new Size(width, Global.Emulator.VideoProvider.BufferHeight + 56);
|
||||
}
|
||||
private void MessageConfig_Load(object sender, EventArgs e)
|
||||
{
|
||||
SetMaxXY();
|
||||
MessageColorDialog.Color = Color.FromArgb(MessageColor);
|
||||
AlertColorDialog.Color = Color.FromArgb(AlertColor);
|
||||
LInputColorDialog.Color = Color.FromArgb(LastInputColor);
|
||||
SetColorBox();
|
||||
SetPositionInfo();
|
||||
}
|
||||
|
||||
private void SetColorBox()
|
||||
{
|
||||
MessageColor = MessageColorDialog.Color.ToArgb();
|
||||
ColorPanel.BackColor = MessageColorDialog.Color;
|
||||
ColorText.Text = String.Format("{0:X8}", MessageColor);
|
||||
private void SetMaxXY()
|
||||
{
|
||||
XNumeric.Maximum = Global.Emulator.VideoProvider.BufferWidth - 8;
|
||||
YNumeric.Maximum = Global.Emulator.VideoProvider.BufferHeight - 8;
|
||||
PositionPanel.Size = new Size(Global.Emulator.VideoProvider.BufferWidth, Global.Emulator.VideoProvider.BufferHeight);
|
||||
|
||||
AlertColor = AlertColorDialog.Color.ToArgb();
|
||||
AlertColorPanel.BackColor = AlertColorDialog.Color;
|
||||
AlertColorText.Text = String.Format("{0:X8}", AlertColor);
|
||||
int width;
|
||||
if (Global.Emulator.VideoProvider.BufferWidth > 128)
|
||||
width = Global.Emulator.VideoProvider.BufferWidth + 44;
|
||||
else
|
||||
width = 128 + 44;
|
||||
|
||||
LastInputColor = LInputColorDialog.Color.ToArgb();
|
||||
LInputColorPanel.BackColor = LInputColorDialog.Color;
|
||||
LInputText.Text = String.Format("{0:X8}", LastInputColor);
|
||||
}
|
||||
PositionGroupBox.Size = new Size(width, Global.Emulator.VideoProvider.BufferHeight + 52);
|
||||
}
|
||||
|
||||
private void SetPositionInfo()
|
||||
{
|
||||
if (FPSRadio.Checked)
|
||||
{
|
||||
XNumeric.Value = DispFPSx;
|
||||
YNumeric.Value = DispFPSy;
|
||||
px = DispFPSx;
|
||||
py = DispFPSy;
|
||||
}
|
||||
else if (FrameCounterRadio.Checked)
|
||||
{
|
||||
XNumeric.Value = DispFrameCx;
|
||||
YNumeric.Value = DispFrameCy;
|
||||
px = DispFrameCx;
|
||||
py = DispFrameCy;
|
||||
}
|
||||
else if (LagCounterRadio.Checked)
|
||||
{
|
||||
XNumeric.Value = DispLagx;
|
||||
YNumeric.Value = DispLagy;
|
||||
px = DispLagx;
|
||||
py = DispLagy;
|
||||
}
|
||||
else if (InputDisplayRadio.Checked)
|
||||
{
|
||||
XNumeric.Value = DispInpx;
|
||||
XNumeric.Value = DispInpy;
|
||||
px = DispInpx;
|
||||
py = DispInpy;
|
||||
}
|
||||
else if (MessagesRadio.Checked)
|
||||
{
|
||||
XNumeric.Value = 0;
|
||||
YNumeric.Value = 0;
|
||||
px = 0;
|
||||
py = 0;
|
||||
}
|
||||
private void SetColorBox()
|
||||
{
|
||||
MessageColor = MessageColorDialog.Color.ToArgb();
|
||||
ColorPanel.BackColor = MessageColorDialog.Color;
|
||||
ColorText.Text = String.Format("{0:X8}", MessageColor);
|
||||
|
||||
PositionPanel.Refresh();
|
||||
SetPositionLabels();
|
||||
}
|
||||
AlertColor = AlertColorDialog.Color.ToArgb();
|
||||
AlertColorPanel.BackColor = AlertColorDialog.Color;
|
||||
AlertColorText.Text = String.Format("{0:X8}", AlertColor);
|
||||
|
||||
private void SaveSettings()
|
||||
{
|
||||
Global.Config.DispFPSx = DispFPSx;
|
||||
Global.Config.DispFPSy = DispFPSy;
|
||||
Global.Config.DispFrameCx = DispFrameCx;
|
||||
Global.Config.DispFrameCy = DispFrameCy;
|
||||
Global.Config.DispLagx = DispLagx;
|
||||
Global.Config.DispLagy = DispLagy;
|
||||
Global.Config.DispInpx = DispInpx;
|
||||
Global.Config.DispInpy = DispInpy;
|
||||
Global.Config.MessagesColor = MessageColor;
|
||||
Global.Config.AlertMessageColor = AlertColor;
|
||||
Global.Config.LastInputColor = LastInputColor;
|
||||
}
|
||||
LastInputColor = LInputColorDialog.Color.ToArgb();
|
||||
LInputColorPanel.BackColor = LInputColorDialog.Color;
|
||||
LInputText.Text = String.Format("{0:X8}", LastInputColor);
|
||||
}
|
||||
|
||||
private void OK_Click(object sender, EventArgs e)
|
||||
{
|
||||
SaveSettings();
|
||||
this.Close();
|
||||
}
|
||||
private void SetAnchorRadio(int anchor)
|
||||
{
|
||||
switch (anchor)
|
||||
{
|
||||
default:
|
||||
case 0:
|
||||
TL.Checked = true; break;
|
||||
case 1:
|
||||
TR.Checked = true; break;
|
||||
case 2:
|
||||
BL.Checked = true; break;
|
||||
case 3:
|
||||
BR.Checked = true; break;
|
||||
}
|
||||
}
|
||||
|
||||
private void button1_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (MessageColorDialog.ShowDialog() == DialogResult.OK)
|
||||
SetColorBox();
|
||||
}
|
||||
private void SetPositionInfo()
|
||||
{
|
||||
if (FPSRadio.Checked)
|
||||
{
|
||||
XNumeric.Value = DispFPSx;
|
||||
YNumeric.Value = DispFPSy;
|
||||
px = DispFPSx;
|
||||
py = DispFPSy;
|
||||
SetAnchorRadio(DispFPSanchor);
|
||||
}
|
||||
else if (FrameCounterRadio.Checked)
|
||||
{
|
||||
XNumeric.Value = DispFrameCx;
|
||||
YNumeric.Value = DispFrameCy;
|
||||
px = DispFrameCx;
|
||||
py = DispFrameCy;
|
||||
SetAnchorRadio(DispFrameanchor);
|
||||
}
|
||||
else if (LagCounterRadio.Checked)
|
||||
{
|
||||
XNumeric.Value = DispLagx;
|
||||
YNumeric.Value = DispLagy;
|
||||
px = DispLagx;
|
||||
py = DispLagy;
|
||||
SetAnchorRadio(DispLaganchor);
|
||||
}
|
||||
else if (InputDisplayRadio.Checked)
|
||||
{
|
||||
XNumeric.Value = DispInpx;
|
||||
XNumeric.Value = DispInpy;
|
||||
px = DispInpx;
|
||||
py = DispInpy;
|
||||
SetAnchorRadio(DispInputanchor);
|
||||
}
|
||||
else if (MessagesRadio.Checked)
|
||||
{
|
||||
XNumeric.Value = 0;
|
||||
YNumeric.Value = 0;
|
||||
px = 0;
|
||||
py = 0;
|
||||
}
|
||||
|
||||
private void FPSRadio_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
SetPositionInfo();
|
||||
}
|
||||
PositionPanel.Refresh();
|
||||
SetPositionLabels();
|
||||
}
|
||||
|
||||
private void FrameCounterRadio_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
SetPositionInfo();
|
||||
}
|
||||
private void SaveSettings()
|
||||
{
|
||||
Global.Config.DispFPSx = DispFPSx;
|
||||
Global.Config.DispFPSy = DispFPSy;
|
||||
Global.Config.DispFrameCx = DispFrameCx;
|
||||
Global.Config.DispFrameCy = DispFrameCy;
|
||||
Global.Config.DispLagx = DispLagx;
|
||||
Global.Config.DispLagy = DispLagy;
|
||||
Global.Config.DispInpx = DispInpx;
|
||||
Global.Config.DispInpy = DispInpy;
|
||||
Global.Config.MessagesColor = MessageColor;
|
||||
Global.Config.AlertMessageColor = AlertColor;
|
||||
Global.Config.LastInputColor = LastInputColor;
|
||||
|
||||
private void LagCounterRadio_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
SetPositionInfo();
|
||||
}
|
||||
Global.Config.DispFPSanchor = DispFPSanchor;
|
||||
Global.Config.DispFPSanchor = DispFrameanchor;
|
||||
Global.Config.DispLaganchor = DispLaganchor;
|
||||
Global.Config.DispInpanchor = DispInputanchor;
|
||||
Global.Config.DispRecanchor = DispRecanchor;
|
||||
}
|
||||
|
||||
private void InputDisplayRadio_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
SetPositionInfo();
|
||||
}
|
||||
private void OK_Click(object sender, EventArgs e)
|
||||
{
|
||||
SaveSettings();
|
||||
this.Close();
|
||||
}
|
||||
|
||||
private void MessagesRadio_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
SetPositionInfo();
|
||||
}
|
||||
private void button1_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (MessageColorDialog.ShowDialog() == DialogResult.OK)
|
||||
SetColorBox();
|
||||
}
|
||||
|
||||
private void XNumericChange()
|
||||
{
|
||||
px = (int)XNumeric.Value;
|
||||
SetPositionLabels();
|
||||
PositionPanel.Refresh();
|
||||
}
|
||||
private void FPSRadio_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
SetPositionInfo();
|
||||
}
|
||||
|
||||
private void YNumericChange()
|
||||
{
|
||||
py = (int)YNumeric.Value;
|
||||
SetPositionLabels();
|
||||
PositionPanel.Refresh();
|
||||
}
|
||||
private void FrameCounterRadio_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
SetPositionInfo();
|
||||
}
|
||||
|
||||
private void XNumeric_ValueChanged(object sender, EventArgs e)
|
||||
{
|
||||
XNumericChange();
|
||||
}
|
||||
private void LagCounterRadio_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
SetPositionInfo();
|
||||
}
|
||||
|
||||
private void YNumeric_ValueChanged(object sender, EventArgs e)
|
||||
{
|
||||
YNumericChange();
|
||||
}
|
||||
private void InputDisplayRadio_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
SetPositionInfo();
|
||||
}
|
||||
|
||||
private void Cancel_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
private void MessagesRadio_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
SetPositionInfo();
|
||||
}
|
||||
|
||||
private void PositionPanel_MouseEnter(object sender, EventArgs e)
|
||||
{
|
||||
this.Cursor = Cursors.Hand;
|
||||
}
|
||||
private void XNumericChange()
|
||||
{
|
||||
px = (int)XNumeric.Value;
|
||||
SetPositionLabels();
|
||||
PositionPanel.Refresh();
|
||||
}
|
||||
|
||||
private void PositionPanel_MouseLeave(object sender, EventArgs e)
|
||||
{
|
||||
this.Cursor = Cursors.Default;
|
||||
}
|
||||
private void YNumericChange()
|
||||
{
|
||||
py = (int)YNumeric.Value;
|
||||
SetPositionLabels();
|
||||
PositionPanel.Refresh();
|
||||
}
|
||||
|
||||
private void PositionPanel_Paint(object sender, PaintEventArgs e)
|
||||
{
|
||||
Pen p = new Pen(brush);
|
||||
e.Graphics.DrawLine(p, new Point(px - 2, py - 2), new Point(px + 2, py + 2));
|
||||
e.Graphics.DrawLine(p, new Point(px + 2, py - 2), new Point(px - 2, py + 2));
|
||||
}
|
||||
private void XNumeric_ValueChanged(object sender, EventArgs e)
|
||||
{
|
||||
XNumericChange();
|
||||
}
|
||||
|
||||
private void PositionPanel_MouseDown(object sender, MouseEventArgs e)
|
||||
{
|
||||
this.Cursor = Cursors.Arrow;
|
||||
mousedown = true;
|
||||
SetNewPosition(e.X, e.Y);
|
||||
}
|
||||
private void YNumeric_ValueChanged(object sender, EventArgs e)
|
||||
{
|
||||
YNumericChange();
|
||||
}
|
||||
|
||||
private void PositionPanel_MouseUp(object sender, MouseEventArgs e)
|
||||
{
|
||||
this.Cursor = Cursors.Hand;
|
||||
mousedown = false;
|
||||
}
|
||||
private void Cancel_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
|
||||
private void SetNewPosition(int mx, int my)
|
||||
{
|
||||
if (mx < 0) mx = 0;
|
||||
if (my < 0) my = 0;
|
||||
if (mx > XNumeric.Maximum) mx = (int)XNumeric.Maximum;
|
||||
if (my > YNumeric.Maximum) my = (int)YNumeric.Maximum;
|
||||
XNumeric.Value = mx;
|
||||
YNumeric.Value = my;
|
||||
px = mx;
|
||||
py = my;
|
||||
PositionPanel.Refresh();
|
||||
SetPositionLabels();
|
||||
}
|
||||
private void PositionPanel_MouseEnter(object sender, EventArgs e)
|
||||
{
|
||||
this.Cursor = Cursors.Hand;
|
||||
}
|
||||
|
||||
private void PositionPanel_MouseMove(object sender, MouseEventArgs e)
|
||||
{
|
||||
if (mousedown)
|
||||
{
|
||||
SetNewPosition(e.X, e.Y);
|
||||
}
|
||||
}
|
||||
private void PositionPanel_MouseLeave(object sender, EventArgs e)
|
||||
{
|
||||
this.Cursor = Cursors.Default;
|
||||
}
|
||||
|
||||
private void SetPositionLabels()
|
||||
{
|
||||
if (FPSRadio.Checked)
|
||||
{
|
||||
DispFPSx = px;
|
||||
DispFPSy = py;
|
||||
}
|
||||
else if (FrameCounterRadio.Checked)
|
||||
{
|
||||
DispFrameCx = px;
|
||||
DispFrameCy = py;
|
||||
}
|
||||
else if (LagCounterRadio.Checked)
|
||||
{
|
||||
DispLagx = px;
|
||||
DispLagy = py;
|
||||
}
|
||||
else if (InputDisplayRadio.Checked)
|
||||
{
|
||||
DispInpx = px;
|
||||
DispInpy = py;
|
||||
}
|
||||
else if (MessagesRadio.Checked)
|
||||
{
|
||||
//TODO
|
||||
}
|
||||
FpsPosLabel.Text = DispFPSx.ToString() + ", " + DispFPSy.ToString();
|
||||
FCLabel.Text = DispFrameCx.ToString() + ", " + DispFrameCy.ToString();
|
||||
LagLabel.Text = DispLagx.ToString() + ", " + DispLagy.ToString();
|
||||
InpLabel.Text = DispInpx.ToString() + ", " + DispInpy.ToString();
|
||||
MessLabel.Text = "0, 0";
|
||||
}
|
||||
private void PositionPanel_Paint(object sender, PaintEventArgs e)
|
||||
{
|
||||
Pen p = new Pen(brush);
|
||||
e.Graphics.DrawLine(p, new Point(px - 2, py - 2), new Point(px + 2, py + 2));
|
||||
e.Graphics.DrawLine(p, new Point(px + 2, py - 2), new Point(px - 2, py + 2));
|
||||
}
|
||||
|
||||
private void ResetDefaultsButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
Global.Config.DispFPSx = 0;
|
||||
Global.Config.DispFPSy = 0;
|
||||
Global.Config.DispFrameCx = 0;
|
||||
Global.Config.DispFrameCy = 12;
|
||||
Global.Config.DispLagx = 0;
|
||||
Global.Config.DispLagy = 36;
|
||||
Global.Config.DispInpx = 0;
|
||||
Global.Config.DispInpy = 24;
|
||||
Global.Config.MessagesColor = -1;
|
||||
Global.Config.AlertMessageColor = -65536;
|
||||
Global.Config.LastInputColor = -23296;
|
||||
private void PositionPanel_MouseDown(object sender, MouseEventArgs e)
|
||||
{
|
||||
this.Cursor = Cursors.Arrow;
|
||||
mousedown = true;
|
||||
SetNewPosition(e.X, e.Y);
|
||||
}
|
||||
|
||||
DispFPSx = Global.Config.DispFPSx;
|
||||
DispFPSy = Global.Config.DispFPSy;
|
||||
DispFrameCx = Global.Config.DispFrameCx;
|
||||
DispFrameCy = Global.Config.DispFrameCy;
|
||||
DispLagx = Global.Config.DispLagx;
|
||||
DispLagy = Global.Config.DispLagy;
|
||||
DispInpx = Global.Config.DispInpx;
|
||||
DispInpy = Global.Config.DispInpy;
|
||||
MessageColor = Global.Config.MessagesColor;
|
||||
AlertColor = Global.Config.AlertMessageColor;
|
||||
LastInputColor = Global.Config.LastInputColor;
|
||||
private void PositionPanel_MouseUp(object sender, MouseEventArgs e)
|
||||
{
|
||||
this.Cursor = Cursors.Hand;
|
||||
mousedown = false;
|
||||
}
|
||||
|
||||
private void SetNewPosition(int mx, int my)
|
||||
{
|
||||
if (mx < 0) mx = 0;
|
||||
if (my < 0) my = 0;
|
||||
if (mx > XNumeric.Maximum) mx = (int)XNumeric.Maximum;
|
||||
if (my > YNumeric.Maximum) my = (int)YNumeric.Maximum;
|
||||
XNumeric.Value = mx;
|
||||
YNumeric.Value = my;
|
||||
px = mx;
|
||||
py = my;
|
||||
PositionPanel.Refresh();
|
||||
SetPositionLabels();
|
||||
}
|
||||
|
||||
private void PositionPanel_MouseMove(object sender, MouseEventArgs e)
|
||||
{
|
||||
if (mousedown)
|
||||
{
|
||||
SetNewPosition(e.X, e.Y);
|
||||
}
|
||||
}
|
||||
|
||||
private void SetPositionLabels()
|
||||
{
|
||||
if (FPSRadio.Checked)
|
||||
{
|
||||
DispFPSx = px;
|
||||
DispFPSy = py;
|
||||
}
|
||||
else if (FrameCounterRadio.Checked)
|
||||
{
|
||||
DispFrameCx = px;
|
||||
DispFrameCy = py;
|
||||
}
|
||||
else if (LagCounterRadio.Checked)
|
||||
{
|
||||
DispLagx = px;
|
||||
DispLagy = py;
|
||||
}
|
||||
else if (InputDisplayRadio.Checked)
|
||||
{
|
||||
DispInpx = px;
|
||||
DispInpy = py;
|
||||
}
|
||||
else if (MessagesRadio.Checked)
|
||||
{
|
||||
//TODO
|
||||
}
|
||||
FpsPosLabel.Text = DispFPSx.ToString() + ", " + DispFPSy.ToString();
|
||||
FCLabel.Text = DispFrameCx.ToString() + ", " + DispFrameCy.ToString();
|
||||
LagLabel.Text = DispLagx.ToString() + ", " + DispLagy.ToString();
|
||||
InpLabel.Text = DispInpx.ToString() + ", " + DispInpy.ToString();
|
||||
MessLabel.Text = "0, 0";
|
||||
}
|
||||
|
||||
private void ResetDefaultsButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
Global.Config.DispFPSx = 0;
|
||||
Global.Config.DispFPSy = 0;
|
||||
Global.Config.DispFrameCx = 0;
|
||||
Global.Config.DispFrameCy = 12;
|
||||
Global.Config.DispLagx = 0;
|
||||
Global.Config.DispLagy = 36;
|
||||
Global.Config.DispInpx = 0;
|
||||
Global.Config.DispInpy = 24;
|
||||
Global.Config.MessagesColor = -1;
|
||||
Global.Config.AlertMessageColor = -65536;
|
||||
Global.Config.LastInputColor = -23296;
|
||||
|
||||
Global.Config.DispFPSanchor = 0;
|
||||
Global.Config.DispFrameanchor = 0;
|
||||
Global.Config.DispLaganchor = 0;
|
||||
Global.Config.DispInpanchor = 0;
|
||||
Global.Config.DispRecanchor = 0;
|
||||
|
||||
DispFPSx = Global.Config.DispFPSx;
|
||||
DispFPSy = Global.Config.DispFPSy;
|
||||
DispFrameCx = Global.Config.DispFrameCx;
|
||||
DispFrameCy = Global.Config.DispFrameCy;
|
||||
DispLagx = Global.Config.DispLagx;
|
||||
DispLagy = Global.Config.DispLagy;
|
||||
DispInpx = Global.Config.DispInpx;
|
||||
DispInpy = Global.Config.DispInpy;
|
||||
MessageColor = Global.Config.MessagesColor;
|
||||
AlertColor = Global.Config.AlertMessageColor;
|
||||
LastInputColor = Global.Config.LastInputColor;
|
||||
|
||||
DispFPSanchor = Global.Config.DispFPSanchor;
|
||||
DispFrameanchor = Global.Config.DispFrameanchor;
|
||||
DispLaganchor = Global.Config.DispLaganchor;
|
||||
DispInputanchor = Global.Config.DispInpanchor;
|
||||
DispRecanchor = Global.Config.DispRecanchor;
|
||||
|
||||
//TODO: anchors
|
||||
|
||||
|
||||
SetMaxXY();
|
||||
MessageColorDialog.Color = Color.FromArgb(MessageColor);
|
||||
AlertColorDialog.Color = Color.FromArgb(AlertColor);
|
||||
LInputColorDialog.Color = Color.FromArgb(LastInputColor);
|
||||
SetColorBox();
|
||||
SetPositionInfo();
|
||||
}
|
||||
SetMaxXY();
|
||||
MessageColorDialog.Color = Color.FromArgb(MessageColor);
|
||||
AlertColorDialog.Color = Color.FromArgb(AlertColor);
|
||||
LInputColorDialog.Color = Color.FromArgb(LastInputColor);
|
||||
SetColorBox();
|
||||
SetPositionInfo();
|
||||
}
|
||||
|
||||
private void ColorPanel_DoubleClick(object sender, EventArgs e)
|
||||
{
|
||||
if (MessageColorDialog.ShowDialog() == DialogResult.OK)
|
||||
SetColorBox();
|
||||
}
|
||||
private void ColorPanel_DoubleClick(object sender, EventArgs e)
|
||||
{
|
||||
if (MessageColorDialog.ShowDialog() == DialogResult.OK)
|
||||
SetColorBox();
|
||||
}
|
||||
|
||||
private void ChangeAlertColor_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (AlertColorDialog.ShowDialog() == DialogResult.OK)
|
||||
SetColorBox();
|
||||
}
|
||||
private void ChangeAlertColor_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (AlertColorDialog.ShowDialog() == DialogResult.OK)
|
||||
SetColorBox();
|
||||
}
|
||||
|
||||
private void ChangeLInput_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (LInputColorDialog.ShowDialog() == DialogResult.OK)
|
||||
SetColorBox();
|
||||
}
|
||||
}
|
||||
private void ChangeLInput_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (LInputColorDialog.ShowDialog() == DialogResult.OK)
|
||||
SetColorBox();
|
||||
}
|
||||
|
||||
private void TL_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (TL.Checked)
|
||||
{
|
||||
if (FPSRadio.Checked)
|
||||
DispFPSanchor = 0;
|
||||
else if (FrameCounterRadio.Checked)
|
||||
DispFrameanchor = 0;
|
||||
else if (LagCounterRadio.Checked)
|
||||
DispLaganchor = 0;
|
||||
else if (InputDisplayRadio.Checked)
|
||||
DispInputanchor = 0;
|
||||
}
|
||||
}
|
||||
|
||||
private void TR_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (TR.Checked)
|
||||
{
|
||||
if (FPSRadio.Checked)
|
||||
DispFPSanchor = 1;
|
||||
else if (FrameCounterRadio.Checked)
|
||||
DispFrameanchor = 1;
|
||||
else if (LagCounterRadio.Checked)
|
||||
DispLaganchor = 1;
|
||||
else if (InputDisplayRadio.Checked)
|
||||
DispInputanchor = 1;
|
||||
}
|
||||
}
|
||||
|
||||
private void BL_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (BL.Checked)
|
||||
{
|
||||
if (FPSRadio.Checked)
|
||||
DispFPSanchor = 2;
|
||||
else if (FrameCounterRadio.Checked)
|
||||
DispFrameanchor = 2;
|
||||
else if (LagCounterRadio.Checked)
|
||||
DispLaganchor = 2;
|
||||
else if (InputDisplayRadio.Checked)
|
||||
DispInputanchor = 2;
|
||||
}
|
||||
}
|
||||
|
||||
private void BR_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (BR.Checked)
|
||||
{
|
||||
if (FPSRadio.Checked)
|
||||
DispFPSanchor = 3;
|
||||
else if (FrameCounterRadio.Checked)
|
||||
DispFrameanchor = 3;
|
||||
else if (LagCounterRadio.Checked)
|
||||
DispLaganchor = 3;
|
||||
else if (InputDisplayRadio.Checked)
|
||||
DispInputanchor = 3;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,95 +28,95 @@
|
|||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.components = new System.ComponentModel.Container();
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(LuaConsole));
|
||||
this.LuaListView = new BizHawk.VirtualListView();
|
||||
this.Script = new System.Windows.Forms.ColumnHeader();
|
||||
this.PathName = new System.Windows.Forms.ColumnHeader();
|
||||
this.menuStrip1 = new System.Windows.Forms.MenuStrip();
|
||||
this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.newToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.openToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.saveToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.saveAsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.recentToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.noneToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator();
|
||||
this.clearToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
|
||||
this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.scriptToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.editToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.toggleToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.insertSeparatorToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.turnOffAllScriptsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.viewToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.removeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
|
||||
this.moveUpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.moveDownToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.optionsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.saveWindowPositionToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.restoreWindowSizeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.OutputBox = new System.Windows.Forms.RichTextBox();
|
||||
this.groupBox1 = new System.Windows.Forms.GroupBox();
|
||||
this.NumberOfScripts = new System.Windows.Forms.Label();
|
||||
this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components);
|
||||
this.menuStrip1.SuspendLayout();
|
||||
this.groupBox1.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// LuaListView
|
||||
//
|
||||
this.LuaListView.CheckBoxes = true;
|
||||
this.LuaListView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
|
||||
this.components = new System.ComponentModel.Container();
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(LuaConsole));
|
||||
this.LuaListView = new BizHawk.VirtualListView();
|
||||
this.Script = new System.Windows.Forms.ColumnHeader();
|
||||
this.PathName = new System.Windows.Forms.ColumnHeader();
|
||||
this.menuStrip1 = new System.Windows.Forms.MenuStrip();
|
||||
this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.newToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.openToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.saveToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.saveAsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.recentToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.noneToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator();
|
||||
this.clearToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
|
||||
this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.scriptToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.editToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.toggleToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.insertSeparatorToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.turnOffAllScriptsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.viewToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.removeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
|
||||
this.moveUpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.moveDownToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.optionsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.saveWindowPositionToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.restoreWindowSizeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.OutputBox = new System.Windows.Forms.RichTextBox();
|
||||
this.groupBox1 = new System.Windows.Forms.GroupBox();
|
||||
this.NumberOfScripts = new System.Windows.Forms.Label();
|
||||
this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components);
|
||||
this.menuStrip1.SuspendLayout();
|
||||
this.groupBox1.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// LuaListView
|
||||
//
|
||||
this.LuaListView.CheckBoxes = true;
|
||||
this.LuaListView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
|
||||
this.Script,
|
||||
this.PathName});
|
||||
this.LuaListView.GridLines = true;
|
||||
this.LuaListView.ItemCount = 0;
|
||||
this.LuaListView.Location = new System.Drawing.Point(12, 51);
|
||||
this.LuaListView.Name = "LuaListView";
|
||||
this.LuaListView.selectedItem = -1;
|
||||
this.LuaListView.Size = new System.Drawing.Size(293, 278);
|
||||
this.LuaListView.TabIndex = 0;
|
||||
this.LuaListView.UseCompatibleStateImageBehavior = false;
|
||||
this.LuaListView.View = System.Windows.Forms.View.Details;
|
||||
this.LuaListView.SelectedIndexChanged += new System.EventHandler(this.LuaListView_SelectedIndexChanged);
|
||||
this.LuaListView.DoubleClick += new System.EventHandler(this.LuaListView_DoubleClick);
|
||||
//
|
||||
// Script
|
||||
//
|
||||
this.Script.Text = "Script";
|
||||
this.Script.Width = 92;
|
||||
//
|
||||
// PathName
|
||||
//
|
||||
this.PathName.Text = "Path";
|
||||
this.PathName.Width = 195;
|
||||
//
|
||||
// menuStrip1
|
||||
//
|
||||
this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.LuaListView.GridLines = true;
|
||||
this.LuaListView.ItemCount = 0;
|
||||
this.LuaListView.Location = new System.Drawing.Point(12, 51);
|
||||
this.LuaListView.Name = "LuaListView";
|
||||
this.LuaListView.selectedItem = -1;
|
||||
this.LuaListView.Size = new System.Drawing.Size(293, 278);
|
||||
this.LuaListView.TabIndex = 0;
|
||||
this.LuaListView.UseCompatibleStateImageBehavior = false;
|
||||
this.LuaListView.View = System.Windows.Forms.View.Details;
|
||||
this.LuaListView.SelectedIndexChanged += new System.EventHandler(this.LuaListView_SelectedIndexChanged);
|
||||
this.LuaListView.DoubleClick += new System.EventHandler(this.LuaListView_DoubleClick);
|
||||
//
|
||||
// Script
|
||||
//
|
||||
this.Script.Text = "Script";
|
||||
this.Script.Width = 92;
|
||||
//
|
||||
// PathName
|
||||
//
|
||||
this.PathName.Text = "Path";
|
||||
this.PathName.Width = 195;
|
||||
//
|
||||
// menuStrip1
|
||||
//
|
||||
this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.toolStripMenuItem1,
|
||||
this.fileToolStripMenuItem,
|
||||
this.scriptToolStripMenuItem,
|
||||
this.viewToolStripMenuItem,
|
||||
this.optionsToolStripMenuItem});
|
||||
this.menuStrip1.Location = new System.Drawing.Point(0, 0);
|
||||
this.menuStrip1.Name = "menuStrip1";
|
||||
this.menuStrip1.Size = new System.Drawing.Size(598, 24);
|
||||
this.menuStrip1.TabIndex = 1;
|
||||
this.menuStrip1.Text = "menuStrip1";
|
||||
//
|
||||
// toolStripMenuItem1
|
||||
//
|
||||
this.toolStripMenuItem1.Name = "toolStripMenuItem1";
|
||||
this.toolStripMenuItem1.Size = new System.Drawing.Size(12, 20);
|
||||
//
|
||||
// fileToolStripMenuItem
|
||||
//
|
||||
this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.menuStrip1.Location = new System.Drawing.Point(0, 0);
|
||||
this.menuStrip1.Name = "menuStrip1";
|
||||
this.menuStrip1.Size = new System.Drawing.Size(598, 24);
|
||||
this.menuStrip1.TabIndex = 1;
|
||||
this.menuStrip1.Text = "menuStrip1";
|
||||
//
|
||||
// toolStripMenuItem1
|
||||
//
|
||||
this.toolStripMenuItem1.Name = "toolStripMenuItem1";
|
||||
this.toolStripMenuItem1.Size = new System.Drawing.Size(12, 20);
|
||||
//
|
||||
// fileToolStripMenuItem
|
||||
//
|
||||
this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.newToolStripMenuItem,
|
||||
this.openToolStripMenuItem,
|
||||
this.saveToolStripMenuItem,
|
||||
|
@ -124,226 +124,228 @@
|
|||
this.recentToolStripMenuItem,
|
||||
this.toolStripSeparator1,
|
||||
this.exitToolStripMenuItem});
|
||||
this.fileToolStripMenuItem.Name = "fileToolStripMenuItem";
|
||||
this.fileToolStripMenuItem.Size = new System.Drawing.Size(35, 20);
|
||||
this.fileToolStripMenuItem.Text = "&File";
|
||||
//
|
||||
// newToolStripMenuItem
|
||||
//
|
||||
this.newToolStripMenuItem.Name = "newToolStripMenuItem";
|
||||
this.newToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.N)));
|
||||
this.newToolStripMenuItem.Size = new System.Drawing.Size(204, 22);
|
||||
this.newToolStripMenuItem.Text = "&New";
|
||||
//
|
||||
// openToolStripMenuItem
|
||||
//
|
||||
this.openToolStripMenuItem.Name = "openToolStripMenuItem";
|
||||
this.openToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.O)));
|
||||
this.openToolStripMenuItem.Size = new System.Drawing.Size(204, 22);
|
||||
this.openToolStripMenuItem.Text = "&Open";
|
||||
this.openToolStripMenuItem.Click += new System.EventHandler(this.openToolStripMenuItem_Click);
|
||||
//
|
||||
// saveToolStripMenuItem
|
||||
//
|
||||
this.saveToolStripMenuItem.Name = "saveToolStripMenuItem";
|
||||
this.saveToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.S)));
|
||||
this.saveToolStripMenuItem.Size = new System.Drawing.Size(204, 22);
|
||||
this.saveToolStripMenuItem.Text = "&Save";
|
||||
//
|
||||
// saveAsToolStripMenuItem
|
||||
//
|
||||
this.saveAsToolStripMenuItem.Name = "saveAsToolStripMenuItem";
|
||||
this.saveAsToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)(((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Shift)
|
||||
| System.Windows.Forms.Keys.S)));
|
||||
this.saveAsToolStripMenuItem.Size = new System.Drawing.Size(204, 22);
|
||||
this.saveAsToolStripMenuItem.Text = "&Save As...";
|
||||
//
|
||||
// recentToolStripMenuItem
|
||||
//
|
||||
this.recentToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.fileToolStripMenuItem.Name = "fileToolStripMenuItem";
|
||||
this.fileToolStripMenuItem.Size = new System.Drawing.Size(35, 20);
|
||||
this.fileToolStripMenuItem.Text = "&File";
|
||||
//
|
||||
// newToolStripMenuItem
|
||||
//
|
||||
this.newToolStripMenuItem.Name = "newToolStripMenuItem";
|
||||
this.newToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.N)));
|
||||
this.newToolStripMenuItem.Size = new System.Drawing.Size(204, 22);
|
||||
this.newToolStripMenuItem.Text = "&New";
|
||||
//
|
||||
// openToolStripMenuItem
|
||||
//
|
||||
this.openToolStripMenuItem.Name = "openToolStripMenuItem";
|
||||
this.openToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.O)));
|
||||
this.openToolStripMenuItem.Size = new System.Drawing.Size(204, 22);
|
||||
this.openToolStripMenuItem.Text = "&Open";
|
||||
this.openToolStripMenuItem.Click += new System.EventHandler(this.openToolStripMenuItem_Click);
|
||||
//
|
||||
// saveToolStripMenuItem
|
||||
//
|
||||
this.saveToolStripMenuItem.Name = "saveToolStripMenuItem";
|
||||
this.saveToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.S)));
|
||||
this.saveToolStripMenuItem.Size = new System.Drawing.Size(204, 22);
|
||||
this.saveToolStripMenuItem.Text = "&Save";
|
||||
this.saveToolStripMenuItem.Click += new System.EventHandler(this.saveToolStripMenuItem_Click);
|
||||
//
|
||||
// saveAsToolStripMenuItem
|
||||
//
|
||||
this.saveAsToolStripMenuItem.Name = "saveAsToolStripMenuItem";
|
||||
this.saveAsToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)(((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Shift)
|
||||
| System.Windows.Forms.Keys.S)));
|
||||
this.saveAsToolStripMenuItem.Size = new System.Drawing.Size(204, 22);
|
||||
this.saveAsToolStripMenuItem.Text = "&Save As...";
|
||||
this.saveAsToolStripMenuItem.Click += new System.EventHandler(this.saveAsToolStripMenuItem_Click);
|
||||
//
|
||||
// recentToolStripMenuItem
|
||||
//
|
||||
this.recentToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.noneToolStripMenuItem,
|
||||
this.toolStripSeparator3,
|
||||
this.clearToolStripMenuItem});
|
||||
this.recentToolStripMenuItem.Name = "recentToolStripMenuItem";
|
||||
this.recentToolStripMenuItem.Size = new System.Drawing.Size(204, 22);
|
||||
this.recentToolStripMenuItem.Text = "Recent";
|
||||
//
|
||||
// noneToolStripMenuItem
|
||||
//
|
||||
this.noneToolStripMenuItem.Name = "noneToolStripMenuItem";
|
||||
this.noneToolStripMenuItem.Size = new System.Drawing.Size(110, 22);
|
||||
this.noneToolStripMenuItem.Text = "None";
|
||||
//
|
||||
// toolStripSeparator3
|
||||
//
|
||||
this.toolStripSeparator3.Name = "toolStripSeparator3";
|
||||
this.toolStripSeparator3.Size = new System.Drawing.Size(107, 6);
|
||||
//
|
||||
// clearToolStripMenuItem
|
||||
//
|
||||
this.clearToolStripMenuItem.Name = "clearToolStripMenuItem";
|
||||
this.clearToolStripMenuItem.Size = new System.Drawing.Size(110, 22);
|
||||
this.clearToolStripMenuItem.Text = "Clear";
|
||||
//
|
||||
// toolStripSeparator1
|
||||
//
|
||||
this.toolStripSeparator1.Name = "toolStripSeparator1";
|
||||
this.toolStripSeparator1.Size = new System.Drawing.Size(201, 6);
|
||||
//
|
||||
// exitToolStripMenuItem
|
||||
//
|
||||
this.exitToolStripMenuItem.Name = "exitToolStripMenuItem";
|
||||
this.exitToolStripMenuItem.Size = new System.Drawing.Size(204, 22);
|
||||
this.exitToolStripMenuItem.Text = "E&xit";
|
||||
this.exitToolStripMenuItem.Click += new System.EventHandler(this.exitToolStripMenuItem_Click);
|
||||
//
|
||||
// scriptToolStripMenuItem
|
||||
//
|
||||
this.scriptToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.recentToolStripMenuItem.Name = "recentToolStripMenuItem";
|
||||
this.recentToolStripMenuItem.Size = new System.Drawing.Size(204, 22);
|
||||
this.recentToolStripMenuItem.Text = "Recent";
|
||||
//
|
||||
// noneToolStripMenuItem
|
||||
//
|
||||
this.noneToolStripMenuItem.Name = "noneToolStripMenuItem";
|
||||
this.noneToolStripMenuItem.Size = new System.Drawing.Size(110, 22);
|
||||
this.noneToolStripMenuItem.Text = "None";
|
||||
//
|
||||
// toolStripSeparator3
|
||||
//
|
||||
this.toolStripSeparator3.Name = "toolStripSeparator3";
|
||||
this.toolStripSeparator3.Size = new System.Drawing.Size(107, 6);
|
||||
//
|
||||
// clearToolStripMenuItem
|
||||
//
|
||||
this.clearToolStripMenuItem.Name = "clearToolStripMenuItem";
|
||||
this.clearToolStripMenuItem.Size = new System.Drawing.Size(110, 22);
|
||||
this.clearToolStripMenuItem.Text = "Clear";
|
||||
//
|
||||
// toolStripSeparator1
|
||||
//
|
||||
this.toolStripSeparator1.Name = "toolStripSeparator1";
|
||||
this.toolStripSeparator1.Size = new System.Drawing.Size(201, 6);
|
||||
//
|
||||
// exitToolStripMenuItem
|
||||
//
|
||||
this.exitToolStripMenuItem.Name = "exitToolStripMenuItem";
|
||||
this.exitToolStripMenuItem.Size = new System.Drawing.Size(204, 22);
|
||||
this.exitToolStripMenuItem.Text = "E&xit";
|
||||
this.exitToolStripMenuItem.Click += new System.EventHandler(this.exitToolStripMenuItem_Click);
|
||||
//
|
||||
// scriptToolStripMenuItem
|
||||
//
|
||||
this.scriptToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.editToolStripMenuItem,
|
||||
this.toggleToolStripMenuItem,
|
||||
this.insertSeparatorToolStripMenuItem,
|
||||
this.turnOffAllScriptsToolStripMenuItem});
|
||||
this.scriptToolStripMenuItem.Name = "scriptToolStripMenuItem";
|
||||
this.scriptToolStripMenuItem.Size = new System.Drawing.Size(46, 20);
|
||||
this.scriptToolStripMenuItem.Text = "&Script";
|
||||
//
|
||||
// editToolStripMenuItem
|
||||
//
|
||||
this.editToolStripMenuItem.Name = "editToolStripMenuItem";
|
||||
this.editToolStripMenuItem.Size = new System.Drawing.Size(175, 22);
|
||||
this.editToolStripMenuItem.Text = "Edit";
|
||||
//
|
||||
// toggleToolStripMenuItem
|
||||
//
|
||||
this.toggleToolStripMenuItem.Name = "toggleToolStripMenuItem";
|
||||
this.toggleToolStripMenuItem.Size = new System.Drawing.Size(175, 22);
|
||||
this.toggleToolStripMenuItem.Text = "Toggle";
|
||||
//
|
||||
// insertSeparatorToolStripMenuItem
|
||||
//
|
||||
this.insertSeparatorToolStripMenuItem.Name = "insertSeparatorToolStripMenuItem";
|
||||
this.insertSeparatorToolStripMenuItem.Size = new System.Drawing.Size(175, 22);
|
||||
this.insertSeparatorToolStripMenuItem.Text = "Insert Separator";
|
||||
//
|
||||
// turnOffAllScriptsToolStripMenuItem
|
||||
//
|
||||
this.turnOffAllScriptsToolStripMenuItem.Name = "turnOffAllScriptsToolStripMenuItem";
|
||||
this.turnOffAllScriptsToolStripMenuItem.Size = new System.Drawing.Size(175, 22);
|
||||
this.turnOffAllScriptsToolStripMenuItem.Text = "Turn Off All Scripts";
|
||||
//
|
||||
// viewToolStripMenuItem
|
||||
//
|
||||
this.viewToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.scriptToolStripMenuItem.Name = "scriptToolStripMenuItem";
|
||||
this.scriptToolStripMenuItem.Size = new System.Drawing.Size(46, 20);
|
||||
this.scriptToolStripMenuItem.Text = "&Script";
|
||||
//
|
||||
// editToolStripMenuItem
|
||||
//
|
||||
this.editToolStripMenuItem.Name = "editToolStripMenuItem";
|
||||
this.editToolStripMenuItem.Size = new System.Drawing.Size(175, 22);
|
||||
this.editToolStripMenuItem.Text = "Edit";
|
||||
//
|
||||
// toggleToolStripMenuItem
|
||||
//
|
||||
this.toggleToolStripMenuItem.Name = "toggleToolStripMenuItem";
|
||||
this.toggleToolStripMenuItem.Size = new System.Drawing.Size(175, 22);
|
||||
this.toggleToolStripMenuItem.Text = "Toggle";
|
||||
//
|
||||
// insertSeparatorToolStripMenuItem
|
||||
//
|
||||
this.insertSeparatorToolStripMenuItem.Name = "insertSeparatorToolStripMenuItem";
|
||||
this.insertSeparatorToolStripMenuItem.Size = new System.Drawing.Size(175, 22);
|
||||
this.insertSeparatorToolStripMenuItem.Text = "Insert Separator";
|
||||
//
|
||||
// turnOffAllScriptsToolStripMenuItem
|
||||
//
|
||||
this.turnOffAllScriptsToolStripMenuItem.Name = "turnOffAllScriptsToolStripMenuItem";
|
||||
this.turnOffAllScriptsToolStripMenuItem.Size = new System.Drawing.Size(175, 22);
|
||||
this.turnOffAllScriptsToolStripMenuItem.Text = "Turn Off All Scripts";
|
||||
//
|
||||
// viewToolStripMenuItem
|
||||
//
|
||||
this.viewToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.removeToolStripMenuItem,
|
||||
this.toolStripSeparator2,
|
||||
this.moveUpToolStripMenuItem,
|
||||
this.moveDownToolStripMenuItem});
|
||||
this.viewToolStripMenuItem.Name = "viewToolStripMenuItem";
|
||||
this.viewToolStripMenuItem.Size = new System.Drawing.Size(41, 20);
|
||||
this.viewToolStripMenuItem.Text = "&View";
|
||||
//
|
||||
// removeToolStripMenuItem
|
||||
//
|
||||
this.removeToolStripMenuItem.Name = "removeToolStripMenuItem";
|
||||
this.removeToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
|
||||
this.removeToolStripMenuItem.Text = "Remove";
|
||||
//
|
||||
// toolStripSeparator2
|
||||
//
|
||||
this.toolStripSeparator2.Name = "toolStripSeparator2";
|
||||
this.toolStripSeparator2.Size = new System.Drawing.Size(149, 6);
|
||||
//
|
||||
// moveUpToolStripMenuItem
|
||||
//
|
||||
this.moveUpToolStripMenuItem.Name = "moveUpToolStripMenuItem";
|
||||
this.moveUpToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
|
||||
this.moveUpToolStripMenuItem.Text = "Move Up";
|
||||
this.moveUpToolStripMenuItem.Click += new System.EventHandler(this.moveUpToolStripMenuItem_Click);
|
||||
//
|
||||
// moveDownToolStripMenuItem
|
||||
//
|
||||
this.moveDownToolStripMenuItem.Name = "moveDownToolStripMenuItem";
|
||||
this.moveDownToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
|
||||
this.moveDownToolStripMenuItem.Text = "Move Down";
|
||||
this.moveDownToolStripMenuItem.Click += new System.EventHandler(this.moveDownToolStripMenuItem_Click);
|
||||
//
|
||||
// optionsToolStripMenuItem
|
||||
//
|
||||
this.optionsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.viewToolStripMenuItem.Name = "viewToolStripMenuItem";
|
||||
this.viewToolStripMenuItem.Size = new System.Drawing.Size(41, 20);
|
||||
this.viewToolStripMenuItem.Text = "&View";
|
||||
//
|
||||
// removeToolStripMenuItem
|
||||
//
|
||||
this.removeToolStripMenuItem.Name = "removeToolStripMenuItem";
|
||||
this.removeToolStripMenuItem.Size = new System.Drawing.Size(141, 22);
|
||||
this.removeToolStripMenuItem.Text = "Remove";
|
||||
//
|
||||
// toolStripSeparator2
|
||||
//
|
||||
this.toolStripSeparator2.Name = "toolStripSeparator2";
|
||||
this.toolStripSeparator2.Size = new System.Drawing.Size(138, 6);
|
||||
//
|
||||
// moveUpToolStripMenuItem
|
||||
//
|
||||
this.moveUpToolStripMenuItem.Name = "moveUpToolStripMenuItem";
|
||||
this.moveUpToolStripMenuItem.Size = new System.Drawing.Size(141, 22);
|
||||
this.moveUpToolStripMenuItem.Text = "Move Up";
|
||||
this.moveUpToolStripMenuItem.Click += new System.EventHandler(this.moveUpToolStripMenuItem_Click);
|
||||
//
|
||||
// moveDownToolStripMenuItem
|
||||
//
|
||||
this.moveDownToolStripMenuItem.Name = "moveDownToolStripMenuItem";
|
||||
this.moveDownToolStripMenuItem.Size = new System.Drawing.Size(141, 22);
|
||||
this.moveDownToolStripMenuItem.Text = "Move Down";
|
||||
this.moveDownToolStripMenuItem.Click += new System.EventHandler(this.moveDownToolStripMenuItem_Click);
|
||||
//
|
||||
// optionsToolStripMenuItem
|
||||
//
|
||||
this.optionsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.saveWindowPositionToolStripMenuItem,
|
||||
this.restoreWindowSizeToolStripMenuItem});
|
||||
this.optionsToolStripMenuItem.Name = "optionsToolStripMenuItem";
|
||||
this.optionsToolStripMenuItem.Size = new System.Drawing.Size(56, 20);
|
||||
this.optionsToolStripMenuItem.Text = "&Options";
|
||||
this.optionsToolStripMenuItem.DropDownOpened += new System.EventHandler(this.optionsToolStripMenuItem_DropDownOpened);
|
||||
//
|
||||
// saveWindowPositionToolStripMenuItem
|
||||
//
|
||||
this.saveWindowPositionToolStripMenuItem.Name = "saveWindowPositionToolStripMenuItem";
|
||||
this.saveWindowPositionToolStripMenuItem.Size = new System.Drawing.Size(190, 22);
|
||||
this.saveWindowPositionToolStripMenuItem.Text = "Save Window Position";
|
||||
this.saveWindowPositionToolStripMenuItem.Click += new System.EventHandler(this.saveWindowPositionToolStripMenuItem_Click);
|
||||
//
|
||||
// restoreWindowSizeToolStripMenuItem
|
||||
//
|
||||
this.restoreWindowSizeToolStripMenuItem.Name = "restoreWindowSizeToolStripMenuItem";
|
||||
this.restoreWindowSizeToolStripMenuItem.Size = new System.Drawing.Size(190, 22);
|
||||
this.restoreWindowSizeToolStripMenuItem.Text = "Restore Window Size";
|
||||
this.restoreWindowSizeToolStripMenuItem.Click += new System.EventHandler(this.restoreWindowSizeToolStripMenuItem_Click);
|
||||
//
|
||||
// OutputBox
|
||||
//
|
||||
this.OutputBox.Location = new System.Drawing.Point(6, 19);
|
||||
this.OutputBox.Name = "OutputBox";
|
||||
this.OutputBox.ReadOnly = true;
|
||||
this.OutputBox.Size = new System.Drawing.Size(246, 253);
|
||||
this.OutputBox.TabIndex = 2;
|
||||
this.OutputBox.Text = "";
|
||||
//
|
||||
// groupBox1
|
||||
//
|
||||
this.groupBox1.Controls.Add(this.OutputBox);
|
||||
this.groupBox1.Location = new System.Drawing.Point(311, 51);
|
||||
this.groupBox1.Name = "groupBox1";
|
||||
this.groupBox1.Size = new System.Drawing.Size(258, 278);
|
||||
this.groupBox1.TabIndex = 3;
|
||||
this.groupBox1.TabStop = false;
|
||||
this.groupBox1.Text = "Output";
|
||||
//
|
||||
// NumberOfScripts
|
||||
//
|
||||
this.NumberOfScripts.AutoSize = true;
|
||||
this.NumberOfScripts.Location = new System.Drawing.Point(12, 29);
|
||||
this.NumberOfScripts.Name = "NumberOfScripts";
|
||||
this.NumberOfScripts.Size = new System.Drawing.Size(66, 13);
|
||||
this.NumberOfScripts.TabIndex = 4;
|
||||
this.NumberOfScripts.Text = " 0 Scripts ";
|
||||
//
|
||||
// contextMenuStrip1
|
||||
//
|
||||
this.contextMenuStrip1.Name = "contextMenuStrip1";
|
||||
this.contextMenuStrip1.Size = new System.Drawing.Size(61, 4);
|
||||
//
|
||||
// LuaConsole
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(598, 359);
|
||||
this.Controls.Add(this.NumberOfScripts);
|
||||
this.Controls.Add(this.groupBox1);
|
||||
this.Controls.Add(this.LuaListView);
|
||||
this.Controls.Add(this.menuStrip1);
|
||||
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
|
||||
this.MainMenuStrip = this.menuStrip1;
|
||||
this.Name = "LuaConsole";
|
||||
this.Text = "Lua Console";
|
||||
this.Load += new System.EventHandler(this.LuaConsole_Load);
|
||||
this.menuStrip1.ResumeLayout(false);
|
||||
this.menuStrip1.PerformLayout();
|
||||
this.groupBox1.ResumeLayout(false);
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
this.optionsToolStripMenuItem.Name = "optionsToolStripMenuItem";
|
||||
this.optionsToolStripMenuItem.Size = new System.Drawing.Size(56, 20);
|
||||
this.optionsToolStripMenuItem.Text = "&Options";
|
||||
this.optionsToolStripMenuItem.DropDownOpened += new System.EventHandler(this.optionsToolStripMenuItem_DropDownOpened);
|
||||
//
|
||||
// saveWindowPositionToolStripMenuItem
|
||||
//
|
||||
this.saveWindowPositionToolStripMenuItem.Name = "saveWindowPositionToolStripMenuItem";
|
||||
this.saveWindowPositionToolStripMenuItem.Size = new System.Drawing.Size(190, 22);
|
||||
this.saveWindowPositionToolStripMenuItem.Text = "Save Window Position";
|
||||
this.saveWindowPositionToolStripMenuItem.Click += new System.EventHandler(this.saveWindowPositionToolStripMenuItem_Click);
|
||||
//
|
||||
// restoreWindowSizeToolStripMenuItem
|
||||
//
|
||||
this.restoreWindowSizeToolStripMenuItem.Name = "restoreWindowSizeToolStripMenuItem";
|
||||
this.restoreWindowSizeToolStripMenuItem.Size = new System.Drawing.Size(190, 22);
|
||||
this.restoreWindowSizeToolStripMenuItem.Text = "Restore Window Size";
|
||||
this.restoreWindowSizeToolStripMenuItem.Click += new System.EventHandler(this.restoreWindowSizeToolStripMenuItem_Click);
|
||||
//
|
||||
// OutputBox
|
||||
//
|
||||
this.OutputBox.Location = new System.Drawing.Point(6, 19);
|
||||
this.OutputBox.Name = "OutputBox";
|
||||
this.OutputBox.ReadOnly = true;
|
||||
this.OutputBox.Size = new System.Drawing.Size(246, 253);
|
||||
this.OutputBox.TabIndex = 2;
|
||||
this.OutputBox.Text = "";
|
||||
//
|
||||
// groupBox1
|
||||
//
|
||||
this.groupBox1.Controls.Add(this.OutputBox);
|
||||
this.groupBox1.Location = new System.Drawing.Point(311, 51);
|
||||
this.groupBox1.Name = "groupBox1";
|
||||
this.groupBox1.Size = new System.Drawing.Size(258, 278);
|
||||
this.groupBox1.TabIndex = 3;
|
||||
this.groupBox1.TabStop = false;
|
||||
this.groupBox1.Text = "Output";
|
||||
//
|
||||
// NumberOfScripts
|
||||
//
|
||||
this.NumberOfScripts.AutoSize = true;
|
||||
this.NumberOfScripts.Location = new System.Drawing.Point(12, 29);
|
||||
this.NumberOfScripts.Name = "NumberOfScripts";
|
||||
this.NumberOfScripts.Size = new System.Drawing.Size(66, 13);
|
||||
this.NumberOfScripts.TabIndex = 4;
|
||||
this.NumberOfScripts.Text = " 0 Scripts ";
|
||||
//
|
||||
// contextMenuStrip1
|
||||
//
|
||||
this.contextMenuStrip1.Name = "contextMenuStrip1";
|
||||
this.contextMenuStrip1.Size = new System.Drawing.Size(61, 4);
|
||||
//
|
||||
// LuaConsole
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(598, 359);
|
||||
this.Controls.Add(this.NumberOfScripts);
|
||||
this.Controls.Add(this.groupBox1);
|
||||
this.Controls.Add(this.LuaListView);
|
||||
this.Controls.Add(this.menuStrip1);
|
||||
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
|
||||
this.MainMenuStrip = this.menuStrip1;
|
||||
this.Name = "LuaConsole";
|
||||
this.Text = "Lua Console";
|
||||
this.Load += new System.EventHandler(this.LuaConsole_Load);
|
||||
this.menuStrip1.ResumeLayout(false);
|
||||
this.menuStrip1.PerformLayout();
|
||||
this.groupBox1.ResumeLayout(false);
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -11,221 +11,231 @@ using LuaInterface;
|
|||
|
||||
namespace BizHawk.MultiClient
|
||||
{
|
||||
public partial class LuaConsole : Form
|
||||
{
|
||||
//TODO: remember column widths
|
||||
//TODO: recent menu
|
||||
//TODO: drag & drop for .lua files
|
||||
public partial class LuaConsole : Form
|
||||
{
|
||||
//TODO: remember column widths
|
||||
//TODO: recent menu
|
||||
//TODO: drag & drop for .lua files
|
||||
|
||||
|
||||
int defaultWidth; //For saving the default size of the dialog, so the user can restore if desired
|
||||
int defaultHeight;
|
||||
int defaultWidth; //For saving the default size of the dialog, so the user can restore if desired
|
||||
int defaultHeight;
|
||||
|
||||
List<LuaFiles> luaList = new List<LuaFiles>();
|
||||
LuaImplementation LuaImp;
|
||||
string lastLuaFile = "";
|
||||
List<LuaFiles> luaList = new List<LuaFiles>();
|
||||
LuaImplementation LuaImp;
|
||||
string lastLuaFile = "";
|
||||
|
||||
private List<LuaFiles> GetLuaFileList()
|
||||
{
|
||||
List<LuaFiles> l = new List<LuaFiles>();
|
||||
for (int x = 0; x < luaList.Count; x++)
|
||||
l.Add(new LuaFiles(luaList[x]));
|
||||
private List<LuaFiles> GetLuaFileList()
|
||||
{
|
||||
List<LuaFiles> l = new List<LuaFiles>();
|
||||
for (int x = 0; x < luaList.Count; x++)
|
||||
l.Add(new LuaFiles(luaList[x]));
|
||||
|
||||
return l;
|
||||
}
|
||||
return l;
|
||||
}
|
||||
|
||||
public LuaConsole get()
|
||||
{
|
||||
return this;
|
||||
}
|
||||
public LuaConsole get()
|
||||
{
|
||||
return this;
|
||||
}
|
||||
|
||||
public void AddText(string s)
|
||||
{
|
||||
OutputBox.Text += s;
|
||||
}
|
||||
public void AddText(string s)
|
||||
{
|
||||
OutputBox.Text += s;
|
||||
}
|
||||
|
||||
public LuaConsole()
|
||||
{
|
||||
InitializeComponent();
|
||||
LuaImp = new LuaImplementation(this);
|
||||
Closing += (o, e) => SaveConfigSettings();
|
||||
LuaListView.QueryItemText += new QueryItemTextHandler(LuaListView_QueryItemText);
|
||||
LuaListView.QueryItemBkColor += new QueryItemBkColorHandler(LuaListView_QueryItemBkColor);
|
||||
LuaListView.VirtualMode = true;
|
||||
}
|
||||
public LuaConsole()
|
||||
{
|
||||
InitializeComponent();
|
||||
LuaImp = new LuaImplementation(this);
|
||||
Closing += (o, e) => SaveConfigSettings();
|
||||
LuaListView.QueryItemText += new QueryItemTextHandler(LuaListView_QueryItemText);
|
||||
LuaListView.QueryItemBkColor += new QueryItemBkColorHandler(LuaListView_QueryItemBkColor);
|
||||
LuaListView.VirtualMode = true;
|
||||
}
|
||||
|
||||
private void LuaListView_QueryItemBkColor(int index, int column, ref Color color)
|
||||
{
|
||||
if (luaList[index].IsSeparator)
|
||||
color = Color.DarkGray;
|
||||
else if (!luaList[index].Enabled)
|
||||
color = this.BackColor;
|
||||
}
|
||||
private void LuaListView_QueryItemBkColor(int index, int column, ref Color color)
|
||||
{
|
||||
if (luaList[index].IsSeparator)
|
||||
color = Color.DarkGray;
|
||||
else if (!luaList[index].Enabled)
|
||||
color = this.BackColor;
|
||||
}
|
||||
|
||||
private void LuaListView_QueryItemText(int index, int column, out string text)
|
||||
{
|
||||
text = "";
|
||||
if (column == 0)
|
||||
text = Path.GetFileNameWithoutExtension(luaList[index].Path); //TODO: how about a list of Names and allow the user to name them?
|
||||
if (column == 1)
|
||||
text = luaList[index].Path;
|
||||
private void LuaListView_QueryItemText(int index, int column, out string text)
|
||||
{
|
||||
text = "";
|
||||
if (column == 0)
|
||||
text = Path.GetFileNameWithoutExtension(luaList[index].Path); //TODO: how about a list of Names and allow the user to name them?
|
||||
if (column == 1)
|
||||
text = luaList[index].Path;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private void LuaConsole_Load(object sender, EventArgs e)
|
||||
{
|
||||
LoadConfigSettings();
|
||||
}
|
||||
private void LuaConsole_Load(object sender, EventArgs e)
|
||||
{
|
||||
LoadConfigSettings();
|
||||
}
|
||||
|
||||
public void Restart()
|
||||
{
|
||||
//Stop all Lua scripts
|
||||
for (int x = 0; x < luaList.Count; x++)
|
||||
luaList[x].Enabled = false;
|
||||
}
|
||||
public void Restart()
|
||||
{
|
||||
//Stop all Lua scripts
|
||||
for (int x = 0; x < luaList.Count; x++)
|
||||
luaList[x].Enabled = false;
|
||||
}
|
||||
|
||||
private void SaveConfigSettings()
|
||||
{
|
||||
Global.Config.LuaConsoleWndx = this.Location.X;
|
||||
Global.Config.LuaConsoleWndy = this.Location.Y;
|
||||
Global.Config.LuaConsoleWidth = this.Right - this.Left;
|
||||
Global.Config.LuaConsoleHeight = this.Bottom - this.Top;
|
||||
}
|
||||
private void SaveConfigSettings()
|
||||
{
|
||||
Global.Config.LuaConsoleWndx = this.Location.X;
|
||||
Global.Config.LuaConsoleWndy = this.Location.Y;
|
||||
Global.Config.LuaConsoleWidth = this.Right - this.Left;
|
||||
Global.Config.LuaConsoleHeight = this.Bottom - this.Top;
|
||||
}
|
||||
|
||||
private void LoadConfigSettings()
|
||||
{
|
||||
defaultWidth = Size.Width; //Save these first so that the user can restore to its original size
|
||||
defaultHeight = Size.Height;
|
||||
private void LoadConfigSettings()
|
||||
{
|
||||
defaultWidth = Size.Width; //Save these first so that the user can restore to its original size
|
||||
defaultHeight = Size.Height;
|
||||
|
||||
if (Global.Config.LuaConsoleSaveWindowPosition && Global.Config.LuaConsoleWndx >= 0 && Global.Config.LuaConsoleWndy >= 0)
|
||||
Location = new Point(Global.Config.LuaConsoleWndx, Global.Config.LuaConsoleWndy);
|
||||
if (Global.Config.LuaConsoleSaveWindowPosition && Global.Config.LuaConsoleWndx >= 0 && Global.Config.LuaConsoleWndy >= 0)
|
||||
Location = new Point(Global.Config.LuaConsoleWndx, Global.Config.LuaConsoleWndy);
|
||||
|
||||
if (Global.Config.LuaConsoleWidth >= 0 && Global.Config.LuaConsoleHeight >= 0)
|
||||
{
|
||||
Size = new System.Drawing.Size(Global.Config.LuaConsoleWidth, Global.Config.LuaConsoleHeight);
|
||||
}
|
||||
if (Global.Config.LuaConsoleWidth >= 0 && Global.Config.LuaConsoleHeight >= 0)
|
||||
{
|
||||
Size = new System.Drawing.Size(Global.Config.LuaConsoleWidth, Global.Config.LuaConsoleHeight);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private void exitToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
private void exitToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
|
||||
private void restoreWindowSizeToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.Size = new System.Drawing.Size(defaultWidth, defaultHeight);
|
||||
}
|
||||
private void restoreWindowSizeToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.Size = new System.Drawing.Size(defaultWidth, defaultHeight);
|
||||
}
|
||||
|
||||
private FileInfo GetFileFromUser()
|
||||
{
|
||||
var ofd = new OpenFileDialog();
|
||||
if (lastLuaFile.Length > 0)
|
||||
ofd.FileName = Path.GetFileNameWithoutExtension(lastLuaFile);
|
||||
ofd.InitialDirectory = Global.Config.LuaPath;
|
||||
ofd.Filter = "Lua Scripts (*.lua)|*.lua|All Files|*.*";
|
||||
ofd.RestoreDirectory = true;
|
||||
private FileInfo GetFileFromUser()
|
||||
{
|
||||
var ofd = new OpenFileDialog();
|
||||
if (lastLuaFile.Length > 0)
|
||||
ofd.FileName = Path.GetFileNameWithoutExtension(lastLuaFile);
|
||||
ofd.InitialDirectory = Global.Config.LuaPath;
|
||||
ofd.Filter = "Lua Scripts (*.lua)|*.lua|All Files|*.*";
|
||||
ofd.RestoreDirectory = true;
|
||||
|
||||
Global.Sound.StopSound();
|
||||
var result = ofd.ShowDialog();
|
||||
Global.Sound.StartSound();
|
||||
if (result != DialogResult.OK)
|
||||
return null;
|
||||
var file = new FileInfo(ofd.FileName);
|
||||
return file;
|
||||
}
|
||||
Global.Sound.StopSound();
|
||||
var result = ofd.ShowDialog();
|
||||
Global.Sound.StartSound();
|
||||
if (result != DialogResult.OK)
|
||||
return null;
|
||||
var file = new FileInfo(ofd.FileName);
|
||||
return file;
|
||||
}
|
||||
|
||||
private void LoadLuaFile(string path)
|
||||
{
|
||||
LuaFiles l = new LuaFiles("", path, true);
|
||||
luaList.Add(l);
|
||||
LuaListView.ItemCount = luaList.Count;
|
||||
LuaListView.Refresh();
|
||||
private void LoadLuaFile(string path)
|
||||
{
|
||||
LuaFiles l = new LuaFiles("", path, true);
|
||||
luaList.Add(l);
|
||||
LuaListView.ItemCount = luaList.Count;
|
||||
LuaListView.Refresh();
|
||||
|
||||
LuaImp.DoLuaFile(path);
|
||||
}
|
||||
LuaImp.DoLuaFile(path);
|
||||
}
|
||||
|
||||
private void OpenLuaFile()
|
||||
{
|
||||
var file = GetFileFromUser();
|
||||
if (file != null)
|
||||
{
|
||||
LoadLuaFile(file.FullName);
|
||||
//DisplayLuaList();
|
||||
}
|
||||
}
|
||||
private void OpenLuaFile()
|
||||
{
|
||||
var file = GetFileFromUser();
|
||||
if (file != null)
|
||||
{
|
||||
LoadLuaFile(file.FullName);
|
||||
//DisplayLuaList();
|
||||
}
|
||||
}
|
||||
|
||||
private void openToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
OpenLuaFile();
|
||||
}
|
||||
private void openToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
OpenLuaFile();
|
||||
}
|
||||
|
||||
private void optionsToolStripMenuItem_DropDownOpened(object sender, EventArgs e)
|
||||
{
|
||||
saveWindowPositionToolStripMenuItem.Checked = Global.Config.LuaConsoleSaveWindowPosition;
|
||||
}
|
||||
private void optionsToolStripMenuItem_DropDownOpened(object sender, EventArgs e)
|
||||
{
|
||||
saveWindowPositionToolStripMenuItem.Checked = Global.Config.LuaConsoleSaveWindowPosition;
|
||||
}
|
||||
|
||||
private void saveWindowPositionToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
Global.Config.LuaConsoleSaveWindowPosition ^= true;
|
||||
}
|
||||
private void saveWindowPositionToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
Global.Config.LuaConsoleSaveWindowPosition ^= true;
|
||||
}
|
||||
|
||||
private void Toggle()
|
||||
{
|
||||
ListView.SelectedIndexCollection indexes = LuaListView.SelectedIndices;
|
||||
if (indexes.Count > 0)
|
||||
{
|
||||
for (int x = 0; x < indexes.Count; x++)
|
||||
{
|
||||
if (luaList[indexes[x]].Enabled)
|
||||
luaList[indexes[x]].Enabled = false;
|
||||
else
|
||||
luaList[indexes[x]].Enabled = true;
|
||||
}
|
||||
LuaListView.Refresh();
|
||||
}
|
||||
UpdateNumberOfScripts();
|
||||
}
|
||||
private void Toggle()
|
||||
{
|
||||
ListView.SelectedIndexCollection indexes = LuaListView.SelectedIndices;
|
||||
if (indexes.Count > 0)
|
||||
{
|
||||
for (int x = 0; x < indexes.Count; x++)
|
||||
{
|
||||
if (luaList[indexes[x]].Enabled)
|
||||
luaList[indexes[x]].Enabled = false;
|
||||
else
|
||||
luaList[indexes[x]].Enabled = true;
|
||||
}
|
||||
LuaListView.Refresh();
|
||||
}
|
||||
UpdateNumberOfScripts();
|
||||
}
|
||||
|
||||
private void UpdateNumberOfScripts()
|
||||
{
|
||||
string message = "";
|
||||
int active = 0;
|
||||
for (int x = 0; x < luaList.Count; x++)
|
||||
{
|
||||
if (luaList[x].Enabled)
|
||||
active++;
|
||||
}
|
||||
private void UpdateNumberOfScripts()
|
||||
{
|
||||
string message = "";
|
||||
int active = 0;
|
||||
for (int x = 0; x < luaList.Count; x++)
|
||||
{
|
||||
if (luaList[x].Enabled)
|
||||
active++;
|
||||
}
|
||||
|
||||
int L = luaList.Count;
|
||||
if (L == 1)
|
||||
message += L.ToString() + " cheat (" + active.ToString() + " active)";
|
||||
else if (L == 0)
|
||||
message += L.ToString() + " cheats";
|
||||
else
|
||||
message += L.ToString() + " cheats (" + active.ToString() + " active)";
|
||||
int L = luaList.Count;
|
||||
if (L == 1)
|
||||
message += L.ToString() + " cheat (" + active.ToString() + " active)";
|
||||
else if (L == 0)
|
||||
message += L.ToString() + " cheats";
|
||||
else
|
||||
message += L.ToString() + " cheats (" + active.ToString() + " active)";
|
||||
|
||||
NumberOfScripts.Text = message;
|
||||
}
|
||||
NumberOfScripts.Text = message;
|
||||
}
|
||||
|
||||
private void LuaListView_DoubleClick(object sender, EventArgs e)
|
||||
{
|
||||
Toggle();
|
||||
}
|
||||
private void LuaListView_DoubleClick(object sender, EventArgs e)
|
||||
{
|
||||
Toggle();
|
||||
}
|
||||
|
||||
private void LuaListView_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
private void LuaListView_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private void moveUpToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
private void moveUpToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private void moveDownToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
private void moveDownToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void saveToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void saveAsToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue