From 21d7f5c79f141c8b3e10927a70042de361eb78b8 Mon Sep 17 00:00:00 2001 From: "andres.delikat" Date: Sun, 13 Mar 2011 03:32:30 +0000 Subject: [PATCH] NES PPU - fix Pattern view palette selection via click --- BizHawk.MultiClient/NEStools/NESPPU.Designer.cs | 2 +- BizHawk.MultiClient/NEStools/NESPPU.cs | 14 ++++++++++++-- BizHawk.MultiClient/NEStools/PatternViewer.cs | 12 +----------- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/BizHawk.MultiClient/NEStools/NESPPU.Designer.cs b/BizHawk.MultiClient/NEStools/NESPPU.Designer.cs index 0d5d91ea66..4985c156d3 100644 --- a/BizHawk.MultiClient/NEStools/NESPPU.Designer.cs +++ b/BizHawk.MultiClient/NEStools/NESPPU.Designer.cs @@ -183,7 +183,7 @@ this.PatternView.Name = "PatternView"; this.PatternView.Size = new System.Drawing.Size(256, 128); this.PatternView.TabIndex = 0; - this.PatternView.Click += new System.EventHandler(this.PatternView_Click); + this.PatternView.MouseClick += new System.Windows.Forms.MouseEventHandler(this.PatternView_Click); // // NESPPU // diff --git a/BizHawk.MultiClient/NEStools/NESPPU.cs b/BizHawk.MultiClient/NEStools/NESPPU.cs index 4b08d513a3..9e1bfae4ed 100644 --- a/BizHawk.MultiClient/NEStools/NESPPU.cs +++ b/BizHawk.MultiClient/NEStools/NESPPU.cs @@ -179,9 +179,19 @@ namespace BizHawk.MultiClient saveWindowPositionToolStripMenuItem.Checked = Global.Config.NESPPUSaveWindowPosition; } - private void PatternView_Click(object sender, EventArgs e) + private void PatternView_Click(object sender, MouseEventArgs e) { - //TODO: these values are off by 1 because it gets triggered before the PatternViewer_Click event + if (e.X < PatternView.Width / 2) + { + PatternView.Pal0++; + if (PatternView.Pal0 > 7) PatternView.Pal0 = 0; + } + else + { + PatternView.Pal1++; + if (PatternView.Pal1 > 7) PatternView.Pal1 = 0; + } + PatternView.Refresh(); Table1PaletteLabel.Text = "Palette: " + PatternView.Pal0; Table2PaletteLabel.Text = "Palette: " + PatternView.Pal1; } diff --git a/BizHawk.MultiClient/NEStools/PatternViewer.cs b/BizHawk.MultiClient/NEStools/PatternViewer.cs index ae3bd230de..502ead3ffe 100644 --- a/BizHawk.MultiClient/NEStools/PatternViewer.cs +++ b/BizHawk.MultiClient/NEStools/PatternViewer.cs @@ -55,17 +55,7 @@ namespace BizHawk.MultiClient private void PatternViewer_Click(object sender, MouseEventArgs e) { - if (e.X < (this.Size.Width / 2)) - { - Pal0++; - if (Pal0 > 7) Pal0 = 0; - } - else - { - Pal1++; - if (Pal1 > 7) Pal1 = 0; - } - this.Refresh(); + //Moved to parent event handler } } }