Message config - ability to set anchoring of on screen messages. TODO: hook up anchoring to display system

This commit is contained in:
andres.delikat 2011-06-16 02:39:35 +00:00
parent 882562c452
commit 1db89f5c1f
6 changed files with 2811 additions and 2627 deletions

View File

@ -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;

View File

@ -68,6 +68,10 @@
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.PositionGroupBox = new System.Windows.Forms.GroupBox();
this.BR = new System.Windows.Forms.RadioButton();
this.BL = new System.Windows.Forms.RadioButton();
this.TR = new System.Windows.Forms.RadioButton();
this.TL = new System.Windows.Forms.RadioButton();
this.AlertColorDialog = new System.Windows.Forms.ColorDialog();
this.LInputColorDialog = new System.Windows.Forms.ColorDialog();
this.MessageTypeBox.SuspendLayout();
@ -83,7 +87,7 @@
// OK
//
this.OK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.OK.Location = new System.Drawing.Point(340, 371);
this.OK.Location = new System.Drawing.Point(418, 371);
this.OK.Name = "OK";
this.OK.Size = new System.Drawing.Size(75, 23);
this.OK.TabIndex = 1;
@ -409,7 +413,7 @@
//
this.Cancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.Cancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.Cancel.Location = new System.Drawing.Point(421, 371);
this.Cancel.Location = new System.Drawing.Point(499, 371);
this.Cancel.Name = "Cancel";
this.Cancel.Size = new System.Drawing.Size(75, 23);
this.Cancel.TabIndex = 5;
@ -431,7 +435,7 @@
// PositionPanel
//
this.PositionPanel.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.PositionPanel.Location = new System.Drawing.Point(16, 18);
this.PositionPanel.Location = new System.Drawing.Point(22, 18);
this.PositionPanel.Name = "PositionPanel";
this.PositionPanel.Size = new System.Drawing.Size(264, 248);
this.PositionPanel.TabIndex = 0;
@ -445,7 +449,7 @@
// XNumeric
//
this.XNumeric.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.XNumeric.Location = new System.Drawing.Point(28, 271);
this.XNumeric.Location = new System.Drawing.Point(43, 271);
this.XNumeric.Maximum = new decimal(new int[] {
256,
0,
@ -464,7 +468,7 @@
// YNumeric
//
this.YNumeric.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.YNumeric.Location = new System.Drawing.Point(91, 271);
this.YNumeric.Location = new System.Drawing.Point(106, 271);
this.YNumeric.Maximum = new decimal(new int[] {
256,
0,
@ -484,7 +488,7 @@
//
this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(12, 274);
this.label1.Location = new System.Drawing.Point(27, 274);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(12, 13);
this.label1.TabIndex = 3;
@ -494,7 +498,7 @@
//
this.label2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(77, 273);
this.label2.Location = new System.Drawing.Point(92, 273);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(12, 13);
this.label2.TabIndex = 4;
@ -502,6 +506,10 @@
//
// PositionGroupBox
//
this.PositionGroupBox.Controls.Add(this.BR);
this.PositionGroupBox.Controls.Add(this.BL);
this.PositionGroupBox.Controls.Add(this.TR);
this.PositionGroupBox.Controls.Add(this.TL);
this.PositionGroupBox.Controls.Add(this.label2);
this.PositionGroupBox.Controls.Add(this.label1);
this.PositionGroupBox.Controls.Add(this.YNumeric);
@ -509,18 +517,65 @@
this.PositionGroupBox.Controls.Add(this.PositionPanel);
this.PositionGroupBox.Location = new System.Drawing.Point(195, 12);
this.PositionGroupBox.Name = "PositionGroupBox";
this.PositionGroupBox.Size = new System.Drawing.Size(301, 299);
this.PositionGroupBox.Size = new System.Drawing.Size(307, 299);
this.PositionGroupBox.TabIndex = 3;
this.PositionGroupBox.TabStop = false;
this.PositionGroupBox.Text = "Position";
//
// BR
//
this.BR.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.BR.AutoSize = true;
this.BR.Location = new System.Drawing.Point(289, 253);
this.BR.Name = "BR";
this.BR.Size = new System.Drawing.Size(14, 13);
this.BR.TabIndex = 8;
this.BR.TabStop = true;
this.BR.UseVisualStyleBackColor = true;
this.BR.Click += new System.EventHandler(this.BR_CheckedChanged);
//
// BL
//
this.BL.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.BL.AutoSize = true;
this.BL.Location = new System.Drawing.Point(6, 253);
this.BL.Name = "BL";
this.BL.Size = new System.Drawing.Size(14, 13);
this.BL.TabIndex = 7;
this.BL.TabStop = true;
this.BL.UseVisualStyleBackColor = true;
this.BL.Click += new System.EventHandler(this.BL_CheckedChanged);
//
// TR
//
this.TR.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.TR.AutoSize = true;
this.TR.Location = new System.Drawing.Point(288, 18);
this.TR.Name = "TR";
this.TR.Size = new System.Drawing.Size(14, 13);
this.TR.TabIndex = 6;
this.TR.TabStop = true;
this.TR.UseVisualStyleBackColor = true;
this.TR.Click += new System.EventHandler(this.TR_CheckedChanged);
//
// TL
//
this.TL.AutoSize = true;
this.TL.Location = new System.Drawing.Point(6, 18);
this.TL.Name = "TL";
this.TL.Size = new System.Drawing.Size(14, 13);
this.TL.TabIndex = 5;
this.TL.TabStop = true;
this.TL.UseVisualStyleBackColor = true;
this.TL.Click += new System.EventHandler(this.TL_CheckedChanged);
//
// MessageConfig
//
this.AcceptButton = this.OK;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.Cancel;
this.ClientSize = new System.Drawing.Size(534, 406);
this.ClientSize = new System.Drawing.Size(612, 406);
this.Controls.Add(this.ResetDefaultsButton);
this.Controls.Add(this.Cancel);
this.Controls.Add(this.groupBox2);
@ -591,5 +646,9 @@
private System.Windows.Forms.Panel LInputColorPanel;
private System.Windows.Forms.ColorDialog AlertColorDialog;
private System.Windows.Forms.ColorDialog LInputColorDialog;
private System.Windows.Forms.RadioButton BR;
private System.Windows.Forms.RadioButton BL;
private System.Windows.Forms.RadioButton TR;
private System.Windows.Forms.RadioButton TL;
}
}

View File

@ -29,6 +29,14 @@ namespace BizHawk.MultiClient
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;
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 Brush brush = Brushes.Black;
int px = 0;
@ -52,17 +60,17 @@ namespace BizHawk.MultiClient
private void SetMaxXY()
{
XNumeric.Maximum = Global.Emulator.VideoProvider.BufferWidth-8;
YNumeric.Maximum = Global.Emulator.VideoProvider.BufferHeight-8;
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;
width = Global.Emulator.VideoProvider.BufferWidth + 44;
else
width = 128+32;
width = 128 + 44;
PositionGroupBox.Size = new Size(width, Global.Emulator.VideoProvider.BufferHeight + 56);
PositionGroupBox.Size = new Size(width, Global.Emulator.VideoProvider.BufferHeight + 52);
}
private void SetColorBox()
@ -80,6 +88,22 @@ namespace BizHawk.MultiClient
LInputText.Text = String.Format("{0:X8}", LastInputColor);
}
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 SetPositionInfo()
{
if (FPSRadio.Checked)
@ -88,6 +112,7 @@ namespace BizHawk.MultiClient
YNumeric.Value = DispFPSy;
px = DispFPSx;
py = DispFPSy;
SetAnchorRadio(DispFPSanchor);
}
else if (FrameCounterRadio.Checked)
{
@ -95,6 +120,7 @@ namespace BizHawk.MultiClient
YNumeric.Value = DispFrameCy;
px = DispFrameCx;
py = DispFrameCy;
SetAnchorRadio(DispFrameanchor);
}
else if (LagCounterRadio.Checked)
{
@ -102,6 +128,7 @@ namespace BizHawk.MultiClient
YNumeric.Value = DispLagy;
px = DispLagx;
py = DispLagy;
SetAnchorRadio(DispLaganchor);
}
else if (InputDisplayRadio.Checked)
{
@ -109,6 +136,7 @@ namespace BizHawk.MultiClient
XNumeric.Value = DispInpy;
px = DispInpx;
py = DispInpy;
SetAnchorRadio(DispInputanchor);
}
else if (MessagesRadio.Checked)
{
@ -135,6 +163,12 @@ namespace BizHawk.MultiClient
Global.Config.MessagesColor = MessageColor;
Global.Config.AlertMessageColor = AlertColor;
Global.Config.LastInputColor = LastInputColor;
Global.Config.DispFPSanchor = DispFPSanchor;
Global.Config.DispFPSanchor = DispFrameanchor;
Global.Config.DispLaganchor = DispLaganchor;
Global.Config.DispInpanchor = DispInputanchor;
Global.Config.DispRecanchor = DispRecanchor;
}
private void OK_Click(object sender, EventArgs e)
@ -302,6 +336,12 @@ namespace BizHawk.MultiClient
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;
@ -314,6 +354,14 @@ namespace BizHawk.MultiClient
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);
@ -340,5 +388,65 @@ namespace BizHawk.MultiClient
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;
}
}
}
}

View File

@ -149,6 +149,7 @@
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
//
@ -157,6 +158,7 @@
| 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
//
@ -246,25 +248,25 @@
// removeToolStripMenuItem
//
this.removeToolStripMenuItem.Name = "removeToolStripMenuItem";
this.removeToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
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(149, 6);
this.toolStripSeparator2.Size = new System.Drawing.Size(138, 6);
//
// moveUpToolStripMenuItem
//
this.moveUpToolStripMenuItem.Name = "moveUpToolStripMenuItem";
this.moveUpToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
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(152, 22);
this.moveDownToolStripMenuItem.Size = new System.Drawing.Size(141, 22);
this.moveDownToolStripMenuItem.Text = "Move Down";
this.moveDownToolStripMenuItem.Click += new System.EventHandler(this.moveDownToolStripMenuItem_Click);
//

View File

@ -227,5 +227,15 @@ namespace BizHawk.MultiClient
{
}
private void saveToolStripMenuItem_Click(object sender, EventArgs e)
{
}
private void saveAsToolStripMenuItem_Click(object sender, EventArgs e)
{
}
}
}

View File

@ -533,7 +533,7 @@ namespace BizHawk.MultiClient
}
List<int> i = new List<int>();
for (int z = 0; z < indexes.Count; z++)
i.Add(indexes[z]-1);
i.Add(indexes[z] - 1);
WatchListView.SelectedIndices.Clear();
for (int z = 0; z < i.Count; z++)
@ -1054,7 +1054,7 @@ namespace BizHawk.MultiClient
private void RamWatch_DragEnter(object sender, DragEventArgs e)
{
e.Effect = e.Data.GetDataPresent(DataFormats.FileDrop) ? DragDropEffects.Copy : DragDropEffects.None;string[] filePaths = (string[]) e.Data.GetData(DataFormats.FileDrop);
e.Effect = e.Data.GetDataPresent(DataFormats.FileDrop) ? DragDropEffects.Copy : DragDropEffects.None; string[] filePaths = (string[])e.Data.GetData(DataFormats.FileDrop);
}
private void ClearChangeCounts()
@ -1328,7 +1328,7 @@ namespace BizHawk.MultiClient
if (Global.Config.RamWatchNotesIndex >= lowIndex && Global.Config.RamWatchNotesIndex <= highIndex)
Global.Config.RamWatchNotesIndex += changeIndex;
if(header.Text == "Address")
if (header.Text == "Address")
Global.Config.RamWatchAddressIndex = e.NewDisplayIndex;
else if (header.Text == "Value")
Global.Config.RamWatchValueIndex = e.NewDisplayIndex;