Skip to main content

API Reference

Complete reference of the classes, structures, and interfaces in RadialMenuUI.


1. RadialMenuDef

Represents the complete definition of a radial wheel.

MemberTypeDescription
IdstringStable identifier of this menu.
SlotCountintNumber of sectors (3 to 10, or 12).
EntriesList<RadialEntryDef>List of entries placed on sectors.
ThemeRadialMenuThemeOptional theme override for this menu.
AddEntry(entry)RadialMenuDefAdds an entry and returns the menu instance.
WithCenterRuntimeIcon(dict, tex)RadialMenuDefDisplays a GTA texture (e.g. headshot) in the hub.
WithTheme(theme)RadialMenuDefSets a custom theme.

2. RadialEntryDef

Represents one selectable sector on the wheel.

MemberTypeDescription
IdstringStable identifier returned upon confirmation.
SlotIndexintSlot number (0 = top, clockwise).
LabelstringText displayed in the hub when hovered.
IconKeystringTheme icon key.
IconFilestringDirect relative path to a PNG icon.
EnabledboolWhether this entry can be hovered and selected.
VariantsList<RadialVariantDef>List of selectable variants for this slot.
SubmenuRadialMenuDefNested submenu opened by this entry.
WithIcon(key)RadialEntryDefSets the icon key.
WithIconScale(float)RadialEntryDefMultiplier applied to icon size.
WithSubmenu(submenu)RadialEntryDefAttaches a child submenu.
AddVariant(id, label)RadialEntryDefAdds a horizontal variant.
KeepOpenAfterConfirm()RadialEntryDefKeeps the wheel open after confirmation.
OnConfirmed(action)RadialEntryDefSets a local callback delegate for this action.

3. RadialMenuController

Manages lifecycle, state, hovers, navigation stack, and rendering.

MemberTypeDescription
IsOpenboolWhether the wheel is currently open.
HoveredSlotintCurrently hovered sector index (-1 if none).
CurrentRadialMenuDefThe menu definition currently active.
Open(def)voidOpens a menu definition.
CancelAndClose()voidCloses the menu without invoking callbacks.
ConfirmAndClose(raiseEvent)boolConfirms the hovered entry and closes the menu.
Update()voidProcesses input, hovers, and draws one frame.
QueueWarmup(theme)voidQueues progressive texture preloading.
WarmupOneTexture()voidCreates at most one ScriptHookV texture per call.
ResultConfirmedeventFired when an entry is confirmed.
SelectionChangedeventFired when the hovered slot changes.

4. RadialMenuResult

Passed to callbacks when an action is confirmed.

PropertyTypeDescription
MenuIdstringThe ID of the menu from which the action was confirmed.
EntryIdstringThe ID of the confirmed entry.
SlotIndexintThe slot number of the confirmed entry.
EntryLabelstringThe label of the confirmed entry.
VariantIdstringID of the selected variant (or null).
VariantLabelstringDisplay 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

MemberDescription
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)

CommandGamepadKeyboard / Mouse
Hover directionRight stick (ScriptRightAxisX/Y)Mouse cursor (virtual 1280×720 canvas) — the most recently moved device wins
Confirm (click mode)R2 / Attack, FrontendAcceptEnter or left-click
Confirm (hold mode)Release SelectWeapon (L1 / TAB)Release TAB
Hold to open/closeHold SelectWeapon (L1 / TAB)Hold TAB
Open submenuSquare / X (disabled Attack)Left-click
Back to parentL2 / LT (disabled Aim)Right-click
Next variantRB, D-pad right, SelectNextWeaponMouse wheel up,
Previous variantLB, D-pad left, SelectPrevWeaponMouse 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.

MemberDescription
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.
IsOpenReturns true if the hosted menu is visible.