Fix "light panels" getting stuck on if the controller is disconnected while the button is pressed.
This commit is contained in:
parent
672541015f
commit
12794762a8
@ -201,6 +201,8 @@ namespace smx_config
|
|||||||
SMX.SMX.ForceRecalibration(pad);
|
SMX.SMX.ForceRecalibration(pad);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Note that we won't get a MouseUp if the display is hidden due to a controller
|
||||||
|
// disconnection while the mouse is held. We handle this in Refresh().
|
||||||
Button LightAll = Template.FindName("LightAll", this) as Button;
|
Button LightAll = Template.FindName("LightAll", this) as Button;
|
||||||
LightAll.PreviewMouseDown += delegate(object sender, MouseButtonEventArgs e)
|
LightAll.PreviewMouseDown += delegate(object sender, MouseButtonEventArgs e)
|
||||||
{
|
{
|
||||||
@ -257,6 +259,12 @@ namespace smx_config
|
|||||||
|
|
||||||
RefreshSelectedPanel();
|
RefreshSelectedPanel();
|
||||||
|
|
||||||
|
// Make sure SetShowAllLights is disabled if the controller is disconnected, since
|
||||||
|
// we can miss mouse up events.
|
||||||
|
bool EitherControllerConnected = args.controller[0].info.connected || args.controller[1].info.connected;
|
||||||
|
if(!EitherControllerConnected)
|
||||||
|
SetShowAllLights?.Invoke(false);
|
||||||
|
|
||||||
P1Diagnostics.Visibility = args.controller[0].info.connected? Visibility.Visible:Visibility.Collapsed;
|
P1Diagnostics.Visibility = args.controller[0].info.connected? Visibility.Visible:Visibility.Collapsed;
|
||||||
P2Diagnostics.Visibility = args.controller[1].info.connected? Visibility.Visible:Visibility.Collapsed;
|
P2Diagnostics.Visibility = args.controller[1].info.connected? Visibility.Visible:Visibility.Collapsed;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user