Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Valkirie committed Jan 18, 2022
2 parents ad51363 + df9a0cb commit 9b4454c
Show file tree
Hide file tree
Showing 24 changed files with 2,199 additions and 1,164 deletions.
8 changes: 4 additions & 4 deletions ControllerCommon/HIDmode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ namespace ControllerCommon
{
public enum HIDmode
{
[Description("No emulation")]
None = 0,
[Description("DualShock 4 emulation")]
DualShock4Controller = 0,
DualShock4Controller = 1,
[Description("Xbox 360 emulation")]
Xbox360Controller = 1,
[Description("No emulation")]
None = 2,
Xbox360Controller = 2,
}
}
27 changes: 21 additions & 6 deletions ControllerHelper/ControllerHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -870,8 +870,21 @@ private void cB_HidMode_SelectedIndexChanged(object sender, EventArgs e)
// update UI icon to match HIDmode
BeginInvoke((MethodInvoker)delegate ()
{
Icon myIcon = HIDmode == HIDmode.DualShock4Controller ? Properties.Resources.HIDicon0 : Properties.Resources.HIDicon1;
Bitmap myImage = HIDmode == HIDmode.DualShock4Controller ? Properties.Resources.HIDmode0 : Properties.Resources.HIDmode1;
Bitmap myImage = new(1,1);

switch (HIDmode)
{
case HIDmode.DualShock4Controller:
myImage = Properties.Resources.HIDmode1;
break;
case HIDmode.Xbox360Controller:
myImage = Properties.Resources.HIDmode2;
break;
case HIDmode.None:
break;
}

// Update image next to dropdown selection
this.pB_HidMode.BackgroundImage = myImage;

UpdateIcon();
Expand Down Expand Up @@ -1028,18 +1041,20 @@ private void UpdateIcon()

switch (HIDmode)
{
case HIDmode.DualShock4Controller:
case HIDmode.None:
myIcon = ServiceManager.status == ServiceControllerStatus.Running ? Properties.Resources.HID0StatusIconOn : Properties.Resources.HID0StatusIconOff;
break;
case HIDmode.Xbox360Controller:
case HIDmode.DualShock4Controller:
myIcon = ServiceManager.status == ServiceControllerStatus.Running ? Properties.Resources.HID1StatusIconOn : Properties.Resources.HID1StatusIconOff;
break;
case HIDmode.None:
myIcon = Properties.Resources.LogoApplicationIcon;
case HIDmode.Xbox360Controller:
myIcon = ServiceManager.status == ServiceControllerStatus.Running ? Properties.Resources.HID2StatusIconOn : Properties.Resources.HID2StatusIconOff;
break;
}

// Application icon, indicates controller and service status
this.Icon = myIcon;
// Tray icon, indicates controller and service status
this.notifyIcon1.Icon = myIcon;
});
}
Expand Down
3 changes: 3 additions & 0 deletions ControllerHelper/ControllerHelper.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,9 @@
<None Update="Resources\HIDmode1.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="Resources\HIDmode2.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="Resources\Toast.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
Expand Down
2,987 changes: 1,989 additions & 998 deletions ControllerHelper/ControllerHelper.resx

Large diffs are not rendered by default.

32 changes: 26 additions & 6 deletions ControllerHelper/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 9b4454c

Please sign in to comment.