Skip to content

Commit

Permalink
Gun4IR get order
Browse files Browse the repository at this point in the history
  • Loading branch information
Tartifless committed Dec 30, 2023
1 parent f0df594 commit f44e79a
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions EmulatorLauncher.Common/Lightguns/RawLightGun.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ private static RawLightgun[] GetRawLightgunsInternal()
index++;
}

// Sort by, (sinden) lightgun, thenby wiimotes, then by physical index
// Sort by, gun4IR, thenby (sinden) lightgun, thenby wiimotes, then by physical index
mouseNames.Sort((x, y) => x.GetGunPriority().CompareTo(y.GetGunPriority()));

return mouseNames.ToArray();
Expand All @@ -100,10 +100,19 @@ private int GetGunPriority()
switch (Type)
{
case RawLighGunType.Gun4Ir:
return Index;
if (DevicePath != null && DevicePath.Contains("VID_2341&PID_8042"))
return 1;
else if (DevicePath != null && DevicePath.Contains("VID_2341&PID_8043"))
return 2;
else if (DevicePath != null && DevicePath.Contains("VID_2341&PID_8044"))
return 3;
else if (DevicePath != null && DevicePath.Contains("VID_2341&PID_8045"))
return 4;
else
return 5 + Index;

case RawLighGunType.SindenLightgun:
return 10 + Index;
return 20 + Index;

case RawLighGunType.MayFlashWiimote:
return 100 + Index;
Expand Down

0 comments on commit f44e79a

Please sign in to comment.