Add controller support and safe main menu hooks

Enable gamepad navigation for the PrismaUI server browser and install MainMenu input hooks safely. Poll XInput each game-thread tick and forward button/stick changes to the browser (ForwardButtonEvent / ForwardThumbstickEvent), allocate an input-enable layer to suppress vanilla kMenu events while the browser is open, and register polling via the F4SE task interface. Replace direct vtable writes that caused a loading-screen crash with REL::Relocation::write_vfunc on the MainMenu BSInputEventUser secondary vtable and install OnButton/OnThumbstick hooks once at plugin Install(). Add MainMenu API to suppress inputEventHandling and call it when showing/hiding the browser. Also update PrismaUI browser JS to support controller focus for direct-connect, filter activation/cycling, improved controller prompts, and add CSS for focused direct-connect fields. Files touched include plugin/src/F4TMenuInput.cpp, plugin/src/F4TMainMenuInject.cpp, plugin/include headers, PrismaUI view JS/components, styles, and documentation.
This commit is contained in:
2026-06-18 14:26:33 +12:00
parent 3d14918ee8
commit f720d35d2a
11 changed files with 626 additions and 102 deletions
+1
View File
@@ -8,5 +8,6 @@ namespace RE
namespace F4T::MainMenuInject
{
bool IsMainMenuOnMainPanel(const RE::UI* a_ui);
void SetMainMenuInputSuppressed(bool a_suppressed);
void Install();
}
+8
View File
@@ -1,7 +1,15 @@
#pragma once
namespace RE
{
class ButtonEvent;
class ThumbstickEvent;
}
namespace F4T::MenuInput
{
void Register();
void SetBrowserActive(bool a_active);
bool ForwardButtonEvent(const RE::ButtonEvent* a_event);
bool ForwardThumbstickEvent(const RE::ThumbstickEvent* a_event);
}