Compare commits

..

2 Commits

Author SHA1 Message Date
briaguya
d0a5237c4f
Merge b9a7b81a1c into 4abd0fe720 2024-06-22 13:01:26 +00:00
briaguya
b9a7b81a1c feat: allow configuring menu accept/apply buttons 2024-06-22 09:01:20 -04:00
2 changed files with 18 additions and 0 deletions

View File

@ -54,6 +54,9 @@ enum class InputType {
};
void set_scanned_input(recomp::InputField value) {
if (value.input_type == 4) {
printf("scanned input for analog");
}
scanning_device.store(recomp::InputDevice::COUNT);
scanned_input.store(value);
}

View File

@ -164,6 +164,21 @@ static bool cont_active = true;
static recomp::InputDevice cur_device = recomp::InputDevice::Controller;
void recomp::finish_scanning_input(recomp::InputField scanned_field) {
if (scanned_input_index == static_cast<int>(GameInput::ACCEPT_MENU) && (
// scanned_field.input_type == 4 /* magic number: InputType::ControllerAnalog */ || (
// https://github.com/Zelda64Recomp/Zelda64Recomp/issues/411
scanned_field.input_type == 3 /* magic number: InputType::ControllerDigital */ && (
scanned_field.input_id == SDL_GameControllerButton::SDL_CONTROLLER_BUTTON_DPAD_UP ||
scanned_field.input_id == SDL_GameControllerButton::SDL_CONTROLLER_BUTTON_DPAD_DOWN ||
scanned_field.input_id == SDL_GameControllerButton::SDL_CONTROLLER_BUTTON_DPAD_LEFT ||
scanned_field.input_id == SDL_GameControllerButton::SDL_CONTROLLER_BUTTON_DPAD_RIGHT
)
// )
)) {
start_scanning_input(cur_device);
return;
}
recomp::set_input_binding(static_cast<recomp::GameInput>(scanned_input_index), scanned_binding_index, cur_device, scanned_field);
scanned_input_index = -1;
scanned_binding_index = -1;