mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2026-01-29 17:38:16 +03:00
Add controller button layout mappings
This adds mappings from SDL's Xbox-based SDL_GameControllerButton constants, to glyphs for the following layouts: - LAYOUT_NINTENDO_SWITCH_PRO, - LAYOUT_NINTENDO_SWITCH_JOYCON_L, - LAYOUT_NINTENDO_SWITCH_JOYCON_R, - LAYOUT_DECK, - LAYOUT_PLAYSTATION, - LAYOUT_XBOX, - LAYOUT_GENERIC, There may still be errors in these, but they should be mostly correct. I'm leaving it up to Ethan to make it show the correct button glyphs for the correct controllers being connected (and possibly to fix these mappings where needed).
This commit is contained in:
committed by
Misa Elizabeth Kai
parent
09365347b6
commit
e55e9efd9b
@@ -599,13 +599,42 @@ static void menurender(void)
|
||||
case 3:
|
||||
case 4:
|
||||
case 5:
|
||||
font::print(PR_CEN, -1, 75, loc::gettext("Flip is bound to: ") + std::string(help.GCString(game.controllerButton_flip)) , tr, tg, tb);
|
||||
font::print(PR_CEN, -1, 85, loc::gettext("Enter is bound to: ") + std::string(help.GCString(game.controllerButton_map)), tr, tg, tb);
|
||||
font::print(PR_CEN, -1, 95, loc::gettext("Menu is bound to: ") + std::string(help.GCString(game.controllerButton_esc)) , tr, tg, tb);
|
||||
font::print(PR_CEN, -1, 105, loc::gettext("Restart is bound to: ") + std::string(help.GCString(game.controllerButton_restart)) , tr, tg, tb);
|
||||
font::print(PR_CEN, -1, 115, loc::gettext("Interact is bound to: ") + std::string(help.GCString(game.controllerButton_interact)) , tr, tg, tb);
|
||||
{
|
||||
char buffer_a[SCREEN_WIDTH_CHARS + 1];
|
||||
char buffer_b[SCREEN_WIDTH_CHARS + 1];
|
||||
|
||||
SDL_snprintf(buffer_a, sizeof(buffer_a), "%s%s",
|
||||
loc::gettext("Flip is bound to: "),
|
||||
BUTTONGLYPHS_get_all_gamepad_buttons(buffer_b, sizeof(buffer_b), ActionSet_InGame, Action_InGame_ACTION)
|
||||
);
|
||||
font::print(PR_CEN, -1, 75, buffer_a, tr, tg, tb);
|
||||
|
||||
SDL_snprintf(buffer_a, sizeof(buffer_a), "%s%s",
|
||||
loc::gettext("Enter is bound to: "),
|
||||
BUTTONGLYPHS_get_all_gamepad_buttons(buffer_b, sizeof(buffer_b), ActionSet_InGame, Action_InGame_Map)
|
||||
);
|
||||
font::print(PR_CEN, -1, 85, buffer_a, tr, tg, tb);
|
||||
|
||||
SDL_snprintf(buffer_a, sizeof(buffer_a), "%s%s",
|
||||
loc::gettext("Menu is bound to: "),
|
||||
BUTTONGLYPHS_get_all_gamepad_buttons(buffer_b, sizeof(buffer_b), ActionSet_InGame, Action_InGame_Esc)
|
||||
);
|
||||
font::print(PR_CEN, -1, 95, buffer_a, tr, tg, tb);
|
||||
|
||||
SDL_snprintf(buffer_a, sizeof(buffer_a), "%s%s",
|
||||
loc::gettext("Restart is bound to: "),
|
||||
BUTTONGLYPHS_get_all_gamepad_buttons(buffer_b, sizeof(buffer_b), ActionSet_InGame, Action_InGame_Restart)
|
||||
);
|
||||
font::print(PR_CEN, -1, 105, buffer_a, tr, tg, tb);
|
||||
|
||||
SDL_snprintf(buffer_a, sizeof(buffer_a), "%s%s",
|
||||
loc::gettext("Interact is bound to: "),
|
||||
BUTTONGLYPHS_get_all_gamepad_buttons(buffer_b, sizeof(buffer_b), ActionSet_InGame, Action_InGame_Interact)
|
||||
);
|
||||
font::print(PR_CEN, -1, 115, buffer_a, tr, tg, tb);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user