From fc484df925e6d5f7912ffc4b9a29aee837222e36 Mon Sep 17 00:00:00 2001 From: adelikat Date: Tue, 4 Dec 2012 23:12:04 +0000 Subject: [PATCH] Controller Config - show conflicts with in a particular controller itself --- .../ControllerConfig/ControllerConfigPanel.cs | 19 +++++++++++++++---- BizHawk.MultiClient/config/InputWidget.cs | 9 +++++++++ 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/BizHawk.MultiClient/config/ControllerConfig/ControllerConfigPanel.cs b/BizHawk.MultiClient/config/ControllerConfig/ControllerConfigPanel.cs index 29c77c7274..2beace2722 100644 --- a/BizHawk.MultiClient/config/ControllerConfig/ControllerConfigPanel.cs +++ b/BizHawk.MultiClient/config/ControllerConfig/ControllerConfigPanel.cs @@ -45,9 +45,9 @@ namespace BizHawk.MultiClient for (int i = 0; i < Inputs.Count; i++) { - if (!String.IsNullOrWhiteSpace(Inputs[0].Text)) + if (!String.IsNullOrWhiteSpace(Inputs[i].Text)) { - string[] bindings = Inputs[0].Text.Split(','); + string[] bindings = Inputs[i].Text.Split(','); foreach (string binding in bindings) { BindingList.Add(new KeyValuePair(i, binding)); @@ -59,7 +59,7 @@ namespace BizHawk.MultiClient foreach (string binding in uniqueBindings) { List> kvps = BindingList.Where(x => x.Value == binding).ToList(); - if (kvps.Count > 0) + if (kvps.Count > 1) { foreach(KeyValuePair kvp in kvps) { @@ -146,9 +146,10 @@ namespace BizHawk.MultiClient iw.Size = new Size(InputSize, 23); iw.TabIndex = i; iw.BringToFront(); + iw.Enter += new System.EventHandler(this.InputWidget_Enter); + iw.Leave += new System.EventHandler(this.InputWidget_Leave); Controls.Add(iw); Inputs.Add(iw); - Label l = new Label(); l.Location = new Point(x + InputSize + LabelPadding, y + 3); l.Text = buttons[i].Replace('_', ' ').Trim(); @@ -158,6 +159,16 @@ namespace BizHawk.MultiClient } } + private void InputWidget_Enter(object sender, EventArgs e) + { + DoConflicts(); + } + + private void InputWidget_Leave(object sender, EventArgs e) + { + DoConflicts(); + } + public void SetAutoTab(bool value) { foreach (InputWidget i in Inputs) diff --git a/BizHawk.MultiClient/config/InputWidget.cs b/BizHawk.MultiClient/config/InputWidget.cs index 03d18a98c1..09f1275a30 100644 --- a/BizHawk.MultiClient/config/InputWidget.cs +++ b/BizHawk.MultiClient/config/InputWidget.cs @@ -42,6 +42,15 @@ namespace BizHawk.MultiClient _highlight_color = Color.LightCyan; _no_highlight_color = SystemColors.Window; } + + if (Focused) + { + Highlight(); + } + else + { + UnHighlight(); + } } }