Skip to content

Commit

Permalink
[UI][Enhancement] Implement keybind migrator (#5431)
Browse files Browse the repository at this point in the history
Co-authored-by: Madmadness65 <[email protected]>
  • Loading branch information
Xavion3 and Madmadness65 authored Feb 27, 2025
1 parent 9ff20af commit 078c3d0
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/inputs-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -564,6 +564,15 @@ export class InputsController {
if (!this.configs[selectedDevice]) {
this.configs[selectedDevice] = {};
}
// A proper way of handling migrating keybinds would be much better
const mappingOverrides = {
"BUTTON_CYCLE_VARIANT": "BUTTON_CYCLE_TERA",
};
for (const key in mappingConfigs.custom) {
if (mappingConfigs.custom[key] in mappingOverrides) {
mappingConfigs.custom[key] = mappingOverrides[mappingConfigs.custom[key]];
}
}
this.configs[selectedDevice].custom = mappingConfigs.custom;
}

Expand Down

0 comments on commit 078c3d0

Please sign in to comment.