gb gpu view: save position and autoload. they fit perfectly in the last few pixels of available real-estate in the form

This commit is contained in:
goyuken 2012-11-09 18:55:59 +00:00
parent f1dbf23bce
commit ae82ec5de0
4 changed files with 78 additions and 0 deletions

View File

@ -417,6 +417,13 @@ namespace BizHawk.MultiClient
public int NESTopLine = 8;
public int NESBottomLine = 231;
// gb gpu view settings
public bool AutoLoadGBGPUView = false;
public bool GBGPUViewSaveWindowPosition = true;
public int GBGPUViewWndx = -1;
public int GBGPUViewWndy = -1;
// SNES Graphics Debugger Dialog Settings
public bool AutoLoadSNESGraphicsDebugger = false;
public bool SNESGraphicsDebuggerSaveWindowPosition = true;

View File

@ -61,6 +61,9 @@
this.bmpViewTiles2 = new BizHawk.MultiClient.GBtools.BmpView();
this.bmpViewBG = new BizHawk.MultiClient.GBtools.BmpView();
this.bmpViewWin = new BizHawk.MultiClient.GBtools.BmpView();
this.groupBox7 = new System.Windows.Forms.GroupBox();
this.checkBoxAutoLoad = new System.Windows.Forms.CheckBox();
this.checkBoxSavePos = new System.Windows.Forms.CheckBox();
this.groupBox1.SuspendLayout();
this.groupBox2.SuspendLayout();
this.groupBox3.SuspendLayout();
@ -69,6 +72,7 @@
this.groupBoxDetails.SuspendLayout();
this.groupBoxMemory.SuspendLayout();
this.groupBox6.SuspendLayout();
this.groupBox7.SuspendLayout();
this.SuspendLayout();
//
// label1
@ -435,11 +439,45 @@
this.bmpViewWin.MouseLeave += new System.EventHandler(this.bmpViewWin_MouseLeave);
this.bmpViewWin.MouseMove += new System.Windows.Forms.MouseEventHandler(this.bmpViewWin_MouseMove);
//
// groupBox7
//
this.groupBox7.Controls.Add(this.checkBoxSavePos);
this.groupBox7.Controls.Add(this.checkBoxAutoLoad);
this.groupBox7.Location = new System.Drawing.Point(350, 312);
this.groupBox7.Name = "groupBox7";
this.groupBox7.Size = new System.Drawing.Size(192, 41);
this.groupBox7.TabIndex = 24;
this.groupBox7.TabStop = false;
this.groupBox7.Text = "Config";
//
// checkBoxAutoLoad
//
this.checkBoxAutoLoad.AutoSize = true;
this.checkBoxAutoLoad.Location = new System.Drawing.Point(6, 19);
this.checkBoxAutoLoad.Name = "checkBoxAutoLoad";
this.checkBoxAutoLoad.Size = new System.Drawing.Size(75, 17);
this.checkBoxAutoLoad.TabIndex = 0;
this.checkBoxAutoLoad.Text = "Auto-Load";
this.checkBoxAutoLoad.UseVisualStyleBackColor = true;
this.checkBoxAutoLoad.CheckedChanged += new System.EventHandler(this.checkBoxAutoLoad_CheckedChanged);
//
// checkBoxSavePos
//
this.checkBoxSavePos.AutoSize = true;
this.checkBoxSavePos.Location = new System.Drawing.Point(87, 19);
this.checkBoxSavePos.Name = "checkBoxSavePos";
this.checkBoxSavePos.Size = new System.Drawing.Size(90, 17);
this.checkBoxSavePos.TabIndex = 1;
this.checkBoxSavePos.Text = "Save position";
this.checkBoxSavePos.UseVisualStyleBackColor = true;
this.checkBoxSavePos.CheckedChanged += new System.EventHandler(this.checkBoxSavePos_CheckedChanged);
//
// GBGPUView
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(834, 524);
this.Controls.Add(this.groupBox7);
this.Controls.Add(this.groupBox6);
this.Controls.Add(this.groupBoxMemory);
this.Controls.Add(this.groupBoxDetails);
@ -451,6 +489,7 @@
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.Name = "GBGPUView";
this.Text = "GameBoy GPU Viewer";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.GBGPUView_FormClosing);
this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.GBGPUView_FormClosed);
this.Load += new System.EventHandler(this.GBGPUView_Load);
this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.GBGPUView_KeyDown);
@ -469,6 +508,8 @@
this.groupBoxMemory.PerformLayout();
this.groupBox6.ResumeLayout(false);
this.groupBox6.PerformLayout();
this.groupBox7.ResumeLayout(false);
this.groupBox7.PerformLayout();
this.ResumeLayout(false);
}
@ -508,5 +549,8 @@
private System.Windows.Forms.Label label7;
private System.Windows.Forms.GroupBox groupBox6;
private System.Windows.Forms.Label labelClipboard;
private System.Windows.Forms.GroupBox groupBox7;
private System.Windows.Forms.CheckBox checkBoxSavePos;
private System.Windows.Forms.CheckBox checkBoxAutoLoad;
}
}

View File

@ -49,6 +49,9 @@ namespace BizHawk.MultiClient.GBtools
messagetimer.Interval = 5000;
messagetimer.Tick += new EventHandler(messagetimer_Tick);
checkBoxAutoLoad.Checked = Global.Config.AutoLoadGBGPUView;
checkBoxSavePos.Checked = Global.Config.GBGPUViewSaveWindowPosition;
}
public void Restart()
@ -449,6 +452,12 @@ namespace BizHawk.MultiClient.GBtools
private void GBGPUView_Load(object sender, EventArgs e)
{
if (Global.Config.GBGPUViewSaveWindowPosition)
{
Point p = new Point(Global.Config.GBGPUViewWndx, Global.Config.GBGPUViewWndy);
if (p.X >= 0 && p.Y >= 0)
Location = p;
}
Restart();
}
@ -886,5 +895,21 @@ namespace BizHawk.MultiClient.GBtools
#endregion
private void GBGPUView_FormClosing(object sender, FormClosingEventArgs e)
{
Global.Config.GBGPUViewWndx = Location.X;
Global.Config.GBGPUViewWndy = Location.Y;
}
private void checkBoxAutoLoad_CheckedChanged(object sender, EventArgs e)
{
Global.Config.AutoLoadGBGPUView = (sender as CheckBox).Checked;
}
private void checkBoxSavePos_CheckedChanged(object sender, EventArgs e)
{
Global.Config.GBGPUViewSaveWindowPosition = (sender as CheckBox).Checked;
}
}
}

View File

@ -282,6 +282,8 @@ namespace BizHawk.MultiClient
LoadNESDebugger();
if (Global.Config.NESGGAutoload && Global.Emulator is NES)
LoadGameGenieEC();
if (Global.Config.AutoLoadGBGPUView && Global.Emulator is Gameboy)
LoadGBGPUView();
if (Global.Config.AutoloadTAStudio)
{