> For the complete documentation index, see [llms.txt](https://code-after-sex.gitbook.io/script-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://code-after-sex.gitbook.io/script-documentation/cas-radial-menu-v2/configuration.md).

# Configuration

Every setting in the CAS Radial Menu's config.lua, the open key, the language, job gating, favourites and history. Edit, restart, done.

Everything lives in **`config.lua`**, which is left unprotected so you can edit it. Change a value, `restart cas-radialmenu`, and it is live, the menu is pushed to the UI on every open, so nothing needs rebuilding.

`locale.lua` is the other editable file; see [Language](#language).

## The key

RedM has no key bindings page in the pause menu, so `RegisterKeyMapping` has nowhere for a player to assign anything and never fires. This resource opens off a real input instead, and there are two ways to set one.

```lua
Config.OpenRawKey = 'F3'    -- a raw keyboard key, F1-F12. This is the default.
Config.OpenControl = nil    -- a game input: works on controller too
```

**`Config.OpenRawKey`** is a raw keyboard key and is what ships. F3 is chosen because RDR2 binds nothing to it, so there is no vanilla action firing alongside. Keyboard only, a gamepad cannot reach a raw key.

**`Config.OpenControl`** is a game input, which does work on a controller and follows whatever the player rebound it to in the game's own settings. Set it to one of the names in `client/controls.lua`:

| Name                | Keyboard / Pad  | Note                      |
| ------------------- | --------------- | ------------------------- |
| `OPEN_WHEEL_MENU`   | Tab / LB        | the game's own item wheel |
| `PLAYER_MENU`       | L / Dpad Left   |                           |
| `OPEN_SATCHEL_MENU` | B / Dpad Right  |                           |
| `QUICK_USE_ITEM`    | I / Dpad Right  |                           |
| `OPEN_JOURNAL`      | J / Dpad Left   | not live in vehicles      |
| `MULTIPLAYER_INFO`  | Alt / Dpad Down |                           |

Set both and either opens the wheel, which is how you give keyboard players F3 and controller players a pad button at the same time.

```lua
Config.SuppressDefaultAction = true  -- take the input off the game so the
                                     -- vanilla wheel does not open too
Config.HoldToOpen = false            -- true = hold to keep it up, RDR2 style
Config.HoldGraceMs = 180             -- so a quick tap in hold mode does not
                                     -- open and shut in one breath
Config.DisableCombatWhileOpen = true -- block shooting/aiming; movement stays on
```

{% hint style="info" %}
`Config.Key = 'F5'` does **not** bind anything. It registers a `+casRadial` command so you can bind a key from the client console while testing: `bind keyboard F5 "+casRadial"`. Set it to `nil` to skip registering it.
{% endhint %}

## Language

```lua
Config.Locale = 'en'   -- en, es, de, fr, pl, th
```

All six languages are in **`locale.lua`**. English is the default and is also what `config.lua` itself is written in, so a translation only lists what it changes, anything it leaves out falls back to the English in the config. That means adding a menu item does not break any language.

To add one, copy the `en` block in `locale.lua`, give it a key, and translate what you want. Run `casradial_locale <code>` in the client console to switch for the session and print what the language is still missing.

## Job gating

```lua
Config.Jobs = {
    police  = { 'Police' },
    doctor  = { 'doctor' },
    billing = { 'sheriff' },
}
```

These are the **other resource's** name for the job, not this one's. They are listed separately because they commonly disagree: `vorp_police` says `Police`, `vorp_medic` says `doctor`, `cas-billing` says `sheriff`. Match each to the matching resource's own config and the slices appear for the right people.

Only the job **name** is checked, never the grade. Every command behind these slices does its own permission check on the server, so a second set of grade rules here would only be a second place to get them wrong. The gate exists so a player is not shown a slot that cannot work.

A sub-wheel whose every item is gated away is dropped rather than opened onto an empty ring.

## Favourites and History

Both are tabs that fill themselves in; their `items` in `Config.Menu` stay empty.

```lua
Config.Favorites = {
    enabled = true,
    tab     = 'favorites',  -- which tab id it takes over
    size    = 8,            -- 8 fills one wheel; more simply pages
    persist = true,         -- kept across reconnects (KVP, per machine)
    markMs  = 1000,         -- confirmation ring after V; 0 hides it
}

Config.History = {
    enabled = true,
    tab     = 'history',
    size    = 8,
    persist = true,
    ignore  = {},           -- id prefixes never recorded
}
```

Hover any slice and press **V** to favourite it; V again takes it back out.

## The rest

| Setting                                    | What it does                                                                                                                                                                                       |
| ------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Config.Waypoint3D`                        | The map waypoint pin: colour, size, text scale. `enabled = false` removes the slot.                                                                                                                |
| `Config.HudSettingsCommand`                | The command the **Edit HUD** slice runs. This resource draws no settings panel of its own, it hands over to whatever owns your HUD (`hudsettings` is `cas-metabolism`'s). `nil` disables the slot. |
| `Config.Hud`                               | An optional built in status HUD. Ships **off** (`enabled = false`) because `cas-metabolism` owns the HUD on a typical CAS stack.                                                                   |
| `Config.Sounds`                            | The game's own menu sounds, by soundset and name.                                                                                                                                                  |
| `Config.ScreenEffect`, `Config.CameraZoom` | The blur and slight zoom while the wheel is up.                                                                                                                                                    |
| `Config.WalkStyles`                        | The walk, stance and pace lists, and whether picks persist.                                                                                                                                        |
| `Config.Emotes`                            | Which emotes the Emotes wheel offers.                                                                                                                                                              |
| `Config.Debug`                             | Prints every open, close and selection to the client console. Ships **off**.                                                                                                                       |
| `Config.Menu`                              | The menu itself, see [Editing the menu](broken://pages/editing-the-menu).                                                                                                                          |
