Skip to content

Commit

Permalink
Fix device type not being set when WinUSB backend starts
Browse files Browse the repository at this point in the history
  • Loading branch information
TheNathannator committed Nov 23, 2023
1 parent 3ee5dd7 commit 43d4f1e
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions Program/MainWindow/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,6 @@ private void Window_Loaded(object sender, RoutedEventArgs e)
SetPacketDebugLog(Settings.Default.packetDebugLog);
SetVerboseErrors(Settings.Default.verboseErrorLog);

// Load backend settings
SetPcapEnabled(Settings.Default.pcapEnabled);
SetUsbEnabled(Settings.Default.usbEnabled);
// Device type is set after initializing the clients

// Check for vJoy
bool vjoyFound = VjoyClient.Enabled;
if (vjoyFound)
Expand Down Expand Up @@ -143,9 +138,11 @@ private void Window_Loaded(object sender, RoutedEventArgs e)
vigemDeviceTypeOption.IsSelected = false;
}

// Set device type
var deviceType = (ControllerType)Settings.Default.controllerDeviceType;
SetDeviceType(deviceType);
// Load backend settings
// Done after initializing virtual controller clients
SetDeviceType((ControllerType)Settings.Default.controllerDeviceType);
SetPcapEnabled(Settings.Default.pcapEnabled);
SetUsbEnabled(Settings.Default.usbEnabled);

// Exit if neither ViGEmBus nor vJoy are installed
if (!vjoyFound && !vigemFound)
Expand Down

0 comments on commit 43d4f1e

Please sign in to comment.