API Reference
Complete reference of the classes, structures, and interfaces in RadialMenuUI.
1. RadialMenuDef
Represents the complete definition of a radial wheel.
| Member | Type | Description |
|---|---|---|
Id | string | Stable identifier of this menu. |
SlotCount | int | Number of sectors (3 to 10, or 12). |
Entries | List<RadialEntryDef> | List of entries placed on sectors. |
Theme | RadialMenuTheme | Optional theme override for this menu. |
AddEntry(entry) | RadialMenuDef | Adds an entry and returns the menu instance. |
WithCenterRuntimeIcon(dict, tex) | RadialMenuDef | Displays a GTA texture (e.g. headshot) in the hub. |
WithTheme(theme) | RadialMenuDef | Sets a custom theme. |
2. RadialEntryDef
Represents one selectable sector on the wheel.
| Member | Type | Description |
|---|---|---|
Id | string | Stable identifier returned upon confirmation. |
SlotIndex | int | Slot number (0 = top, clockwise). |
Label | string | Text displayed in the hub when hovered. |
IconKey | string | Theme icon key. |
IconFile | string | Direct relative path to a PNG icon. |
Enabled | bool | Whether this entry can be hovered and selected. |
Variants | List<RadialVariantDef> | List of selectable variants for this slot. |
Submenu | RadialMenuDef | Nested submenu opened by this entry. |
WithIcon(key) | RadialEntryDef | Sets the icon key. |
WithIconScale(float) | RadialEntryDef | Multiplier applied to icon size. |
WithSubmenu(submenu) | RadialEntryDef | Attaches a child submenu. |
AddVariant(id, label) | RadialEntryDef | Adds a horizontal variant. |
KeepOpenAfterConfirm() | RadialEntryDef | Keeps the wheel open after confirmation. |
OnConfirmed(action) | RadialEntryDef | Sets a local callback delegate for this action. |
3. RadialMenuController
Manages lifecycle, state, hovers, navigation stack, and rendering.
| Member | Type | Description |
|---|---|---|
IsOpen | bool | Whether the wheel is currently open. |
HoveredSlot | int | Currently hovered sector index (-1 if none). |
Current | RadialMenuDef | The menu definition currently active. |
Open(def) | void | Opens a menu definition. |
CancelAndClose() | void | Closes the menu without invoking callbacks. |
ConfirmAndClose(raiseEvent) | bool | Confirms the hovered entry and closes the menu. |
Update() | void | Processes input, hovers, and draws one frame. |
QueueWarmup(theme) | void | Queues progressive texture preloading. |
WarmupOneTexture() | void | Creates at most one ScriptHookV texture per call. |
ResultConfirmed | event | Fired when an entry is confirmed. |
SelectionChanged | event | Fired when the hovered slot changes. |
4. RadialMenuResult
Passed to callbacks when an action is confirmed.
| Property | Type | Description |
|---|---|---|
MenuId | string | The ID of the menu from which the action was confirmed. |
EntryId | string | The ID of the confirmed entry. |
SlotIndex | int | The slot number of the confirmed entry. |
EntryLabel | string | The label of the confirmed entry. |
VariantId | string | ID of the selected variant (or null). |
VariantLabel | string | Display label of the selected variant (or null). |
5. Input & Custom Input
The controller and the gameplay host only consume IRadialMenuInput, never GTA controls directly. Swapping the adapter changes every binding while keeping all navigation logic and the blocked-controls set untouched.
IRadialMenuInput
| Member | Description |
|---|---|
BeginFrame() | Starts a new input frame and clears adapter-specific edge state. |
ResetForOpen() | Recalibrates input when a wheel opens. |
TryGetDirection(out angleDegTopBased, out magnitude) | Reads the current direction as clockwise degrees from the top (0 = up) plus its magnitude; returns true when active outside the dead zone. |
NextVariantPressed() | True once when the next-variant command is pressed. |
PrevVariantPressed() | True once when the previous-variant command is pressed. |
OpenSubmenuPressed() | True once when the open-submenu command is pressed. |
BackToParentPressed() | True once when the back-to-parent command is pressed. |
ConfirmPressed() | True once when click-mode confirmation is pressed. |
HoldPressed() | True while the hold-to-open command remains pressed. |
ConfirmReleased() | True once when the hold-to-open command is released. |
CancelPressed() | True once when click-mode cancellation is pressed. |
Default Bindings (GtaRadialMenuInput)
| Command | Gamepad | Keyboard / Mouse |
|---|---|---|
| Hover direction | Right stick (ScriptRightAxisX/Y) | Mouse cursor (virtual 1280×720 canvas) — the most recently moved device wins |
| Confirm (click mode) | R2 / Attack, FrontendAccept | Enter or left-click |
| Confirm (hold mode) | Release SelectWeapon (L1 / TAB) | Release TAB |
| Hold to open/close | Hold SelectWeapon (L1 / TAB) | Hold TAB |
| Open submenu | Square / X (disabled Attack) | Left-click |
| Back to parent | L2 / LT (disabled Aim) | Right-click |
| Next variant | RB, D-pad right, SelectNextWeapon | Mouse wheel up, → |
| Previous variant | LB, D-pad left, SelectPrevWeapon | Mouse wheel down, ← |
| Cancel (click mode) | O / B (FrontendCancel) | ESC / Backspace |
These bindings are hardcoded in GtaRadialMenuInput and cannot be reconfigured through config flags. To change controls, implement your own IRadialMenuInput (see below).
Custom Input Example
The example below maps navigation to custom keys instead of the GTA defaults — the controller does not care which controls produce the commands:
using System.Windows.Forms;
using GTA;
using RadialMenuUI;
public class CustomInput : IRadialMenuInput
{
public void BeginFrame() { }
public void ResetForOpen() { }
public bool TryGetDirection(out float angleDegTopBased, out float magnitude)
{
magnitude = 1f;
if (Game.IsKeyPressed(Keys.Up)) { angleDegTopBased = 0f; return true; }
if (Game.IsKeyPressed(Keys.Right)) { angleDegTopBased = 90f; return true; }
if (Game.IsKeyPressed(Keys.Down)) { angleDegTopBased = 180f; return true; }
if (Game.IsKeyPressed(Keys.Left)) { angleDegTopBased = 270f; return true; }
angleDegTopBased = 0f;
return false;
}
public bool NextVariantPressed() => Game.IsKeyJustPressed(Keys.E);
public bool PrevVariantPressed() => Game.IsKeyJustPressed(Keys.Q);
public bool OpenSubmenuPressed() => Game.IsKeyJustPressed(Keys.Enter);
public bool BackToParentPressed() => Game.IsKeyJustPressed(Keys.Back);
public bool ConfirmPressed() => Game.IsControlJustPressed(Control.FrontendAccept);
public bool HoldPressed() => false;
public bool ConfirmReleased() => false;
public bool CancelPressed() => Game.IsKeyJustPressed(Keys.Escape);
}
var controller = new RadialMenuController(new CustomInput());
6. RadialMenuGameplayHost
Turnkey wrapper combining RadialMenuController, slow-motion, and GTA control handling.
| Member | Description |
|---|---|
Process(canOpen, buildMenu) | Main tick method handling opening, blocking, and closing. |
Open(menu) | Opens a menu with slow-motion and control blocks. |
Close() | Closes the menu and restores world time scale. |
IsOpen | Returns true if the hosted menu is visible. |