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:
- Hold-to-open lifecycle (holding a key like
L1 / TABopens the wheel, releasing selects). - Cinematic Slow Motion (
Game.TimeScale = 0.2f). - Control Blocking (preventing weapons from firing or punches while selecting).
- 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_WHEELandHUD_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. TheRadialMenuConfig.BlockFire,BlockCamera,BlockWeaponWheel,SlowMotionandSlowMotionScalefields are legacy and currently unread by the library (slow motion is instead controlled by the host'suseSlowMotion/slowMotionScaleconstructor parameters).
2. TimeScale Ownership
- When opened, the host saves
Game.TimeScaleand 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.