[UI][Enhancement] Implement keybind migrator (#5431)

Co-authored-by: Madmadness65 <59298170+Madmadness65@users.noreply.github.com>
This commit is contained in:
Xavion3 2025-02-28 09:22:09 +11:00 committed by GitHub
parent 9ff20af8b7
commit 078c3d00ce
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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;
}