Add active_binding_input and active_binding_slot bindings in controls UI

This commit is contained in:
Mr-Wiseguy
2024-01-17 02:22:36 -05:00
parent 23f0235996
commit d0e01cdec1
4 changed files with 37 additions and 7 deletions
+14 -2
View File
@@ -64,6 +64,14 @@ static const std::array n64_button_values = {
static const std::vector<std::string> input_names = {
DEFINE_ALL_INPUTS()
};
#undef DEFINE_INPUT
// Make the input enum name array.
#define DEFINE_INPUT(name, value, readable) #name,
static const std::vector<std::string> input_enum_names = {
DEFINE_ALL_INPUTS()
};
#undef DEFINE_INPUT
void recomp::init_control_mappings() {
// TODO load from a file if one exists.
@@ -104,8 +112,12 @@ size_t recomp::get_num_inputs() {
return (size_t)GameInput::COUNT;
}
const std::vector<std::string>& recomp::get_input_names() {
return input_names;
const std::string& recomp::get_input_name(size_t input_index) {
return input_names.at(input_index);
}
const std::string& recomp::get_input_enum_name(size_t input_index) {
return input_enum_names.at(input_index);
}
// Due to an RmlUi limitation this can't be const. Ideally it would return a const reference or even just a straight up copy.