[UI] Add simple support for controller usage in UI
- Disabled unnecessary hotkeys thread when it is not used - Removed problematic xam_exports static initialization - Moved xam_dialogs_shown_ and xam_nui_dialogs_shown_ to XamState
This commit is contained in:
committed by
Radosław Gliński
parent
2e9c459846
commit
9054a29483
@@ -18,6 +18,7 @@
|
||||
#include <vector>
|
||||
|
||||
#include "third_party/imgui/imgui.h"
|
||||
#include "xenia/hid/input_system.h"
|
||||
#include "xenia/ui/immediate_drawer.h"
|
||||
#include "xenia/ui/presenter.h"
|
||||
#include "xenia/ui/window.h"
|
||||
@@ -89,6 +90,9 @@ class ImGuiDrawer : public WindowInputListener, public UIDrawer {
|
||||
return GetIO().Fonts->Fonts[1];
|
||||
}
|
||||
|
||||
void LoadInputSystem(hid::InputSystem* input_system);
|
||||
void SetGuideButtonAction(std::function<void(uint8_t)> func);
|
||||
|
||||
protected:
|
||||
void OnKeyDown(KeyEvent& e) override;
|
||||
void OnKeyUp(KeyEvent& e) override;
|
||||
@@ -119,6 +123,7 @@ class ImGuiDrawer : public WindowInputListener, public UIDrawer {
|
||||
|
||||
bool IsDrawingDialogs() const { return dialog_loop_next_index_ != SIZE_MAX; }
|
||||
void DetachIfLastWindowRemoved();
|
||||
void UpdateGamepads();
|
||||
|
||||
std::optional<ImGuiKey> VirtualKeyToImGuiKey(VirtualKey vkey);
|
||||
|
||||
@@ -126,7 +131,9 @@ class ImGuiDrawer : public WindowInputListener, public UIDrawer {
|
||||
size_t z_order_;
|
||||
|
||||
ImGuiContext* internal_state_ = nullptr;
|
||||
hid::InputSystem* input_system_ = nullptr;
|
||||
|
||||
std::function<void(uint8_t)> onGuidePressFunction_;
|
||||
// All currently-attached dialogs that get drawn.
|
||||
std::vector<ImGuiDialog*> dialogs_;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user