Custom buttons: sanitize image/shape on the one screen that didn't

CustomButtonMappingScreen indexes customKeyImages[36] and customKeyShapes[11] with
values read straight from the ini, and it's reachable from the main menu - so
neither GamepadEmu nor TouchControlLayoutScreen, which both sanitize first, need
have run. Those two had the same fixup copy-pasted; hoisted it into a Sanitize()
next to the tables and called it from all three.
This commit is contained in:
Henrik Rydgård
2026-09-02 18:06:47 +02:00
parent 329b7a15bd
commit dcbfa7d3ee
4 changed files with 17 additions and 12 deletions
+3
View File
@@ -138,6 +138,9 @@ void CustomButtonMappingScreen::CreateDialogViews(UI::ViewGroup *parent) {
bool *show = nullptr;
memset(array, 0, sizeof(array));
cfg = &g_Config.CustomButton[id_];
// This screen is reachable from the main menu, so neither GamepadEmu nor the layout screen
// need have sanitized these yet - and everything below indexes the tables with them.
CustomKeyData::Sanitize(*cfg);
show = &touch.touchCustom[id_].show;
for (int i = 0; i < ARRAY_SIZE(g_customKeyList); i++)
array[i] = (0x01 == ((g_Config.CustomButton[id_].key >> i) & 0x01));