Implemented rebinding inputs from UI (controller only so far) and built minimal UI for doing so

This commit is contained in:
Mr-Wiseguy
2024-01-15 21:06:52 -05:00
parent 457bc878e9
commit 6ebc7256eb
7 changed files with 426 additions and 116 deletions
+10
View File
@@ -6,6 +6,7 @@
#include <filesystem>
#include "recomp_ui.h"
#include "recomp_input.h"
#include "concurrentqueue.h"
@@ -677,6 +678,7 @@ struct {
else {
current_document = nullptr;
}
prev_focused = nullptr;
}
void swap_config_menu(recomp::ConfigSubmenu submenu) {
@@ -686,6 +688,7 @@ struct {
Rml::ElementTabSet* config_tabset = rmlui_dynamic_cast<Rml::ElementTabSet*>(config_tabset_base);
if (config_tabset != nullptr) {
config_tabset->SetActiveTab(static_cast<int>(submenu));
prev_focused = nullptr;
}
}
}
@@ -714,6 +717,8 @@ struct {
for (auto& [menu, controller]: menus) {
documents.emplace(menu, controller->load_document(context));
}
prev_focused = nullptr;
}
void make_event_listeners() {
@@ -917,6 +922,11 @@ void draw_hook(RT64::RenderCommandList* command_list, RT64::RenderTexture* swap_
}
}
recomp::InputField scanned_field = recomp::get_scanned_input();
if (scanned_field != recomp::InputField{}) {
recomp::finish_scanning_input(scanned_field);
}
UIContext.rml.update_focus(mouse_moved);
if (cur_menu != recomp::Menu::None) {