Fixed radial menu input

This commit is contained in:
2026-05-25 23:13:25 +03:00
parent 2f88028b95
commit ce85ea1300
8 changed files with 131 additions and 10 deletions
@@ -36,6 +36,20 @@ protected:
virtual void NativeOnDeactivated() override;
virtual void NativeTick(const FGeometry& MyGeometry, float InDeltaTime) override;
// Left-click confirm. Handled directly here rather than as a CommonUI action
// binding, because CommonUI routes left mouse through its Default Click Action
// system (separate from RegisterUIActionBinding), so a click-mapped action
// never reaches a normal binding. Intercepting the pointer event sidesteps that.
virtual FReply NativeOnMouseButtonDown(const FGeometry& InGeometry,
const FPointerEvent& InMouseEvent) override;
// Gamepad slice selection. When this widget is the active CommonUI node, the
// analog sticks are routed here (NOT to the PlayerController), which is why
// GetInputAnalogStickState returns 0 from the controller while a menu is up.
// We read the right stick from the analog event and drive hover directly.
virtual FReply NativeOnAnalogValueChanged(const FGeometry& InGeometry,
const FAnalogInputEvent& InAnalogEvent) override;
// CommonUI focus: returning the root keeps gamepad/keyboard focus on us so
// the bound actions fire while the wheel is open.
virtual UWidget* NativeGetDesiredFocusTarget() const override;
@@ -85,4 +99,9 @@ private:
FUIActionBindingHandle BackHandle;
int32 HoveredIndex = -1;
// Latest right-stick axis values, cached across single-axis analog events so
// we can recompute the full 2D direction whenever either axis updates.
float RightStickX = 0.f;
float RightStickY = 0.f;
};