Merge pull request #142 from agustinmorantes/SameLEDs

Same joycon LEDs when joined (thanks agustinmorantes)
This commit is contained in:
David Khachaturov 2019-04-20 15:03:26 +01:00 committed by GitHub
commit c53d00c545
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 20 additions and 3 deletions

View file

@ -151,6 +151,13 @@ namespace BetterJoyForCemu {
v.other = jc;
jc.other = v;
//Set both Joycon LEDs to the one with the lowest ID
byte led = jc.LED <= v.LED ? jc.LED : v.LED;
jc.LED = led;
v.LED = led;
jc.SetLED(led);
v.SetLED(led);
v.xin.Dispose();
v.xin = null;
@ -184,6 +191,12 @@ namespace BetterJoyForCemu {
if (b.Tag == v.other)
b.BackgroundImage = v.other.isLeft ? Properties.Resources.jc_left_s : Properties.Resources.jc_right_s;
//Set original Joycon LEDs
v.other.LED = (byte)(0x1 << v.other.PadId);
v.LED = (byte)(0x1 << v.PadId);
v.other.SetLED(v.other.LED);
v.SetLED(v.LED);
v.other.other = null;
v.other = null;
}

View file

@ -765,9 +765,6 @@
<metadata name="btnTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>247, 17</value>
</metadata>
<metadata name="btnTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>247, 17</value>
</metadata>
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
AAABAAUAEBAAAAEAIABoBAAAVgAAABgYAAABACAAiAkAAL4EAAAgIAAAAQAgAKgQAABGDgAAMDAAAAEA

View file

@ -221,6 +221,13 @@ namespace BetterJoyForCemu {
temp.other = v;
v.other = temp;
//Set both Joycon LEDs to the one with the lowest ID
byte led = temp.LED <= v.LED ? temp.LED : v.LED;
temp.LED = led;
v.LED = led;
temp.SetLED(led);
v.SetLED(led);
temp.xin.Dispose();
temp.xin = null;