VirtualPad Analog button - show when the virtualpad is stickying the float value

This commit is contained in:
adelikat 2014-07-04 15:34:07 +00:00
parent 90df58abfa
commit c3b57a6ddf
1 changed files with 19 additions and 0 deletions

View File

@ -1,4 +1,5 @@
using System; using System;
using System.Drawing;
using System.Windows.Forms; using System.Windows.Forms;
using BizHawk.Client.Common; using BizHawk.Client.Common;
@ -13,6 +14,21 @@ namespace BizHawk.Client.EmuHawk
private bool _programmaticallyChangingValue; private bool _programmaticallyChangingValue;
private bool _readonly; private bool _readonly;
private bool _isSet = false;
private bool IsSet
{
get
{
return _isSet;
}
set
{
_isSet = value;
ValueLabel.ForeColor = DisplayNameLabel.ForeColor = _isSet ? SystemColors.HotTrack : SystemColors.WindowText;
}
}
public VirtualPadAnalogButton() public VirtualPadAnalogButton()
{ {
InitializeComponent(); InitializeComponent();
@ -23,6 +39,7 @@ namespace BizHawk.Client.EmuHawk
public void Clear() public void Clear()
{ {
Global.StickyXORAdapter.Unset(Name); Global.StickyXORAdapter.Unset(Name);
IsSet = false;
} }
public void Set(IController controller) public void Set(IController controller)
@ -132,6 +149,8 @@ namespace BizHawk.Client.EmuHawk
val = value; val = value;
} }
IsSet = true;
_programmaticallyChangingValue = true; _programmaticallyChangingValue = true;
AnalogTrackBar.Value = val; AnalogTrackBar.Value = val;
ValueLabel.Text = AnalogTrackBar.Value.ToString(); ValueLabel.Text = AnalogTrackBar.Value.ToString();