From ae82ec5de003a3ab39ce40085daef70df8d7ed57 Mon Sep 17 00:00:00 2001 From: goyuken Date: Fri, 9 Nov 2012 18:55:59 +0000 Subject: [PATCH] gb gpu view: save position and autoload. they fit perfectly in the last few pixels of available real-estate in the form --- BizHawk.MultiClient/Config.cs | 7 +++ .../GBtools/GBGPUView.Designer.cs | 44 +++++++++++++++++++ BizHawk.MultiClient/GBtools/GBGPUView.cs | 25 +++++++++++ BizHawk.MultiClient/MainForm.cs | 2 + 4 files changed, 78 insertions(+) diff --git a/BizHawk.MultiClient/Config.cs b/BizHawk.MultiClient/Config.cs index 5aadd2c057..9b99150eee 100644 --- a/BizHawk.MultiClient/Config.cs +++ b/BizHawk.MultiClient/Config.cs @@ -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; diff --git a/BizHawk.MultiClient/GBtools/GBGPUView.Designer.cs b/BizHawk.MultiClient/GBtools/GBGPUView.Designer.cs index 28b12c3324..e8a775bf15 100644 --- a/BizHawk.MultiClient/GBtools/GBGPUView.Designer.cs +++ b/BizHawk.MultiClient/GBtools/GBGPUView.Designer.cs @@ -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; } } \ No newline at end of file diff --git a/BizHawk.MultiClient/GBtools/GBGPUView.cs b/BizHawk.MultiClient/GBtools/GBGPUView.cs index 41eb4e4575..e77194bf4f 100644 --- a/BizHawk.MultiClient/GBtools/GBGPUView.cs +++ b/BizHawk.MultiClient/GBtools/GBGPUView.cs @@ -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; + } } } diff --git a/BizHawk.MultiClient/MainForm.cs b/BizHawk.MultiClient/MainForm.cs index 380078bcf1..cf196df8dc 100644 --- a/BizHawk.MultiClient/MainForm.cs +++ b/BizHawk.MultiClient/MainForm.cs @@ -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) {