> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nexdev.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Configuration

> Walk the config.lua table for nex_scalemenu — scaling ranges, gender, weapon block, camera, UI tokens, presets, and locales.

`config.lua` returns a single Lua table with every knob in one place. Permissions have their own page — see [Permissions](/nex_scalemenu/permissions). This page covers everything else.

<Info>
  `config.lua` is listed under `escrow_ignore`, so you can edit it freely even on an escrow-protected build.
</Info>

## Locale

The first line of the table loads a language file. See [Localization](#localization) below.

```lua theme={null}
locale = LoadLocale("en"),
```

## Commands

Each command can be toggled and renamed. The `command` value is the in-game name without the slash.

```lua theme={null}
commands = {
    openMenu   = { enabled = true, command = "scale" },
    resetScale = { enabled = true, command = "resetscale" },
},
```

| Key          | Default command | Purpose                   |
| ------------ | --------------- | ------------------------- |
| `openMenu`   | `scale`         | Opens the scale menu      |
| `resetScale` | `resetscale`    | Resets a scale to default |

See [Commands](/nex_scalemenu/commands) for the full command reference.

## Scaling

Defines the slider ranges. `height` controls the ped's vertical scale, `body` controls the width/depth multiplier.

```lua theme={null}
scaling = {
    height = { min = 0.25, max = 2.0 },
    body   = { min = 0.75, max = 1.30 },
    scaleSpeed = {
        enabled = false,
        inverse = true,
    },
},
```

| Key                         | Default         | Description                                        |
| --------------------------- | --------------- | -------------------------------------------------- |
| `height.min` / `height.max` | `0.25` / `2.0`  | Vertical scale range                               |
| `body.min` / `body.max`     | `0.75` / `1.30` | Width/depth multiplier range                       |
| `scaleSpeed.enabled`        | `false`         | Scale movement/animation speed with the ped's size |
| `scaleSpeed.inverse`        | `true`          | When speed scaling is on, invert the relationship  |

## Gender

Lock the menu to specific ped genders. Set a gender to `false` to block it.

```lua theme={null}
gender = {
    male   = true,
    female = true,
},
```

## Weapon block

When `true`, attack, aim, melee, and weapon-wheel controls are disabled while the menu is open.

```lua theme={null}
blockWeapons = true,
```

## Camera

Tunes the cinematic camera shown while the menu is open.

```lua theme={null}
camera = {
    enabled = true,
    distance = 3.0,
    height = 0.4,
    lookAtHeight = 0.2,
    lookAtSide = 0.0, -- 0 = centered; positive shifts ped left of frame, negative right
    fov = 50.0,
    inDuration = 500,
    outDuration = 400,
},
```

| Key            | Default | Description                                                                     |
| -------------- | ------- | ------------------------------------------------------------------------------- |
| `enabled`      | `true`  | Turn the cinematic camera on or off                                             |
| `distance`     | `3.0`   | Distance from the ped                                                           |
| `height`       | `0.4`   | Camera height offset                                                            |
| `lookAtHeight` | `0.2`   | Vertical point the camera looks at                                              |
| `lookAtSide`   | `0.0`   | Horizontal framing — `0` centered, positive shifts the ped left, negative right |
| `fov`          | `50.0`  | Field of view                                                                   |
| `inDuration`   | `500`   | Fly-in duration in milliseconds                                                 |
| `outDuration`  | `400`   | Fly-out duration in milliseconds                                                |

## UI tokens

Theme tokens forwarded to the NUI. Colors are hex strings.

```lua theme={null}
ui = {
    title    = "Character Scale",
    subtitle = "Adjust your character's height and build",
    brand    = "#becfff",
    panelBg  = "#0B0E13",
    surfaceBg = "#10141B",
    presets = {
        { name = "Child",    height = 0.65 },
        { name = "Petite",   height = 0.88 },
        { name = "Default",  height = 1.00 },
        { name = "Tall",     height = 1.12 },
        { name = "Towering", height = 1.25 },
        { name = "Giant",    height = 1.40 },
    },
},
```

| Key         | Default                                    | Description              |
| ----------- | ------------------------------------------ | ------------------------ |
| `title`     | `Character Scale`                          | Menu title               |
| `subtitle`  | `Adjust your character's height and build` | Menu subtitle            |
| `brand`     | `#becfff`                                  | Accent color             |
| `panelBg`   | `#0B0E13`                                  | Panel background color   |
| `surfaceBg` | `#10141B`                                  | Surface background color |
| `presets`   | see below                                  | Preset palette           |

### Presets

Presets are quick height shortcuts. Each has a `name` and a target `height`.

<Info>
  Presets affect **height only**. Applying a preset leaves the body slider untouched, so a player can pick a height preset and still fine-tune build separately.
</Info>

| Preset   | Height |
| -------- | ------ |
| Child    | `0.65` |
| Petite   | `0.88` |
| Default  | `1.00` |
| Tall     | `1.12` |
| Towering | `1.25` |
| Giant    | `1.40` |

Add, remove, or rename presets freely. Keep each `height` inside `scaling.height.min`/`max` so the slider can reach it.

## Localization

Locale strings live in `locales/<lang>.json`. To switch language, change the one `LoadLocale` line in `config.lua`:

```lua theme={null}
locale = LoadLocale("es"), -- en, es, or your own
```

The resource ships with `en.json` and `es.json`. `LoadLocale` reads `locales/<code>.json` from the resource. To add a language, drop `locales/<code>.json` in the folder using the same keys as `en.json`, then point `LoadLocale` at your code:

```json theme={null}
{
    "height_scale": "Height Scale",
    "current_scale": "Current Scale",
    "range": "Range",
    "close": "Close",
    "apply": "Apply"
}
```

<Warning>
  If the chosen locale file is missing, the resource prints `locale not found` and falls back to empty strings. Match the language code in `LoadLocale` to a file that exists in `locales/`.
</Warning>
