Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

common-hid-packet-parser.js: Fix regression for resolving decks in getActiveFieldGroup #12406

Merged
merged 1 commit into from
Dec 18, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions res/controllers/common-hid-packet-parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -1711,10 +1711,8 @@ class HIDController {
return this.resolveGroup(field.mapped_group);
}
const group = field.group;
if (group === undefined) {
if (this.activeDeck !== undefined) {
return `[Channel${this.activeDeck}]`;
}
if (group === "deck" || group === "deck1" || group === "deck2") {
return group;
}
return this.resolveGroup(group);
}
Expand Down Expand Up @@ -2077,6 +2075,9 @@ class HIDController {
continue;
}
const bitControlGroup = this.resolveGroup(bit.mapped_group);
if (bitControlGroup === undefined) {
console.warn("HIDController.switchDeck: resolvedGroup(bit.mapped_group) returned undefined");
}
engine.connectControl(
bitControlGroup, bit.mapped_name, bit.mapped_callback, true);
engine.connectControl(new_group, bit.mapped_name, bit.mapped_callback);
Expand All @@ -2100,6 +2101,9 @@ class HIDController {
continue;
}
const fieldControlGroup = this.resolveGroup(field.mapped_group);
if (fieldControlGroup === undefined) {
console.warn("HIDController.switchDeck: resolvedGroup(field.mapped_group) returned undefined");
}
engine.connectControl(
fieldControlGroup, field.mapped_name, field.mapped_callback, true);
engine.connectControl(new_group, field.mapped_name, field.mapped_callback);
Expand Down Expand Up @@ -2142,6 +2146,9 @@ class HIDController {
return;
}
const controlgroup = this.resolveGroup(m_group);
if (controlgroup === undefined) {
console.warn("HIDController.linkOutput: resolvedGroup(m_group) returned undefined");
}
field.mapped_group = m_group;
field.mapped_name = m_name;
field.mapped_callback = callback;
Expand Down Expand Up @@ -2169,6 +2176,9 @@ class HIDController {
return;
}
const controlgroup = this.resolveGroup(field.mapped_group);
if (controlgroup === undefined) {
console.warn("HIDController.unlinkOutput: resolvedGroup(field.mapped_group) returned undefined");
}
engine.connectControl(controlgroup, field.mapped_name, callback, true);
field.mapped_group = undefined;
field.mapped_name = undefined;
Expand Down
Loading