Skip to main content

Gameplay Integration

If you want your radial menu to feel like an official Rockstar wheel (such as GTA V's native weapon wheel or RDR2's item wheel), you will want:

  1. Hold-to-open lifecycle (holding a key like L1 / TAB opens the wheel, releasing selects).
  2. Cinematic Slow Motion (Game.TimeScale = 0.2f).
  3. Control Blocking (preventing weapons from firing or punches while selecting).
  4. Safety Guards (instantly closing on pause, cutscenes, player death or ragdoll).

RadialMenuUI provides RadialMenuGameplayHost to do all of this in two lines of code.


Using RadialMenuGameplayHost

using GTA;
using RadialMenuUI;
using RadialMenuUI.Gameplay;

public class MyModScript : Script
{
private readonly RadialMenuController _controller;
private readonly RadialMenuGameplayHost _host;

public MyModScript()
{
var input = new GtaRadialMenuInput();
_controller = new RadialMenuController(input);

// Create the gameplay host
_host = new RadialMenuGameplayHost(
controller: _controller,
input: input,
openControl: Control.SelectWeapon, // Hold L1 / TAB to open
useSlowMotion: true, // Enable cinematic slow-mo
slowMotionScale: 0.25f // 4x slow motion
);

_controller.ResultConfirmed += OnResultConfirmed;
Tick += OnTick;
}

private void OnTick(object sender, EventArgs e)
{
// Simply call Process every frame!
_host.Process(
canOpen: () => Game.Player.CanControlCharacter && !Game.Player.Character.IsDead,
buildMenu: BuildMainMenu
);
}
}

How it Works

1. Control Blocking

While open, RadialMenuGameplayHost calls native DISABLE_CONTROL_ACTION on:

  • All weapon select and switch controls (SelectWeapon, NextWeapon, PrevWeapon, etc.).
  • Attack controls (Attack, Attack2, MeleeAttack1, MeleeAttack2).
  • Native weapon wheel HUD suppression (HUD_FORCE_WEAPON_WHEEL and HUD_SUPPRESS_WEAPON_WHEEL_RESULTS_THIS_FRAME).

Not configurable: this list is hardcoded in RadialMenuGameplayHost. You cannot choose which controls it blocks — enable or disable blocking as a whole by using the host or not. The RadialMenuConfig.BlockFire, BlockCamera, BlockWeaponWheel, SlowMotion and SlowMotionScale fields are legacy and currently unread by the library (slow motion is instead controlled by the host's useSlowMotion / slowMotionScale constructor parameters).

2. TimeScale Ownership

  • When opened, the host saves Game.TimeScale and sets it to the target slow-motion value.
  • To prevent external trainers or native game events from resetting time scale, it re-asserts the slow-motion value each frame while open.
  • When closed (via selection, cancellation, pause, or death), it immediately restores the previous time scale.