| 44 | } |
| 45 | |
| 46 | recomp::GameInput recomp::get_input_from_enum_name(const std::string_view enum_name) { |
| 47 | auto find_it = std::find(input_enum_names.begin(), input_enum_names.end(), enum_name); |
| 48 | if (find_it == input_enum_names.end()) { |
| 49 | return recomp::GameInput::COUNT; |
| 50 | } |
| 51 | |
| 52 | return static_cast<recomp::GameInput>(find_it - input_enum_names.begin()); |
| 53 | } |
| 54 | |
| 55 | // Due to an RmlUi limitation this can't be const. Ideally it would return a const reference or even just a straight up copy. |
| 56 | recomp::InputField& recomp::get_input_binding(GameInput input, size_t binding_index, recomp::InputDevice device) { |