> For the complete documentation index, see [llms.txt](https://jiffyjrdevelopment.gitbook.io/jiffyjrdevelopmentdocs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://jiffyjrdevelopment.gitbook.io/jiffyjrdevelopmentdocs/jiffy-jr-development-docs/jiffy-minigames/configuration.md).

# Configuration

All settings live in `editable/config.lua`. This file is **not obfuscated** — you can edit it freely after purchase. It is loaded as a shared script so both the client and server can read it.

***

## General

| Key                         | Type   | Default       | Description                                                                                                  |
| --------------------------- | ------ | ------------- | ------------------------------------------------------------------------------------------------------------ |
| `Config.Debug`              | bool   | `false`       | Print verbose logs to the client/server console. Errors and warnings always show regardless of this flag.    |
| `Config.Framework`          | string | `'auto'`      | `'auto'` detects QBCore or ESX at runtime. Force with `'qb'`, `'esx'`, or `'standalone'`.                    |
| `Config.EnableTestCommands` | bool   | `false`       | Register `/jmg_*` test commands. **Keep `false` on live servers.**                                           |
| `Config.TestCommandAce`     | table  | *(see below)* | Ace permissions that grant access to test commands. Any one match is sufficient.                             |
| `Config.AllowCancel`        | bool   | `true`        | Let players cancel a running game with ESC (counts as a fail). Per-game option `allowCancel` overrides this. |
| `Config.AllowConcurrent`    | bool   | `false`       | Allow more than one game to run simultaneously. Leave `false` unless you have a specific reason.             |
| `Config.LogCompatCalls`     | bool   | `true`        | Log every compatibility adapter invocation. Useful during migration.                                         |

### TestCommandAce defaults

```lua
Config.TestCommandAce = {
    'jiffy-minigames.test', -- dedicated ace (grant per player in server.cfg)
    'qbcore.god',
    'qbcore.admin',
    'superadmin',
    'admin',
    'mod',
}
```

To grant access to a specific player:

```cfg
# server.cfg
add_ace identifier.license:YOUR_LICENSE jiffy-minigames.test allow
```

***

## Style

All values are forwarded to the NUI as CSS custom properties. Change them to re-skin the UI without touching any source files. See [Styling & Theming](/jiffyjrdevelopmentdocs/jiffy-jr-development-docs/jiffy-minigames/styling.md) for details.

```lua
Config.Style = {
    AccentColor = '#ff1f1f',  -- brand color: zones, highlights, active states
    Background  = '#0c0c0d',
    Panel       = '#161617',
    Text        = '#f5f5f5',
    Muted       = '#8a8a8f',
    Success     = '#37d67a',
    Danger      = '#ff1f1f',
}
```

***

## Difficulties

Four built-in presets. Any per-game option can still be overridden per-call regardless of the difficulty chosen.

| Preset   | rounds | speed | time | mistakes | pins |
| -------- | ------ | ----- | ---- | -------- | ---- |
| `easy`   | 2      | 0.8   | 30 s | 3        | 3    |
| `medium` | 3      | 1.0   | 20 s | 2        | 4    |
| `hard`   | 4      | 1.25  | 15 s | 1        | 5    |
| `insane` | 5      | 1.5   | 10 s | 0        | 7    |

`Config.DefaultDifficulty = 'medium'` — used when no difficulty is specified in the call.

**Option merge order (later wins):**

```
per-game defaults  →  difficulty preset  →  per-call overrides
```

Example — start from `hard` but override just the timer:

```lua
exports['jiffy-minigames']:Circle({
    difficulty = 'hard',
    time       = 25,   -- overrides the hard preset's 15 s
})
```

***

## Per-Game Defaults

Baseline values for each game. Set these to tune server-wide defaults without touching every call in your scripts.

```lua
Config.GameDefaults = {
    circle      = { rounds = 3, speed = 1.0, key = 'E', zone = 0.18 },
    skillbar    = { rounds = 3, speed = 1.0, size = 'medium', key = 'E' },
    lockpick    = { pins = 3, time = 30, breakChance = 0 },
    safecrack   = { pins = 4, time = 60 },
    keypad      = { length = 5, time = 15, showFor = 1.2 },
    pattern     = { grid = 4, rounds = 3, time = 20, showFor = 0.7 },
    fingerprint = { time = 20, mistakes = 2 },
    thermite    = { time = 25, allowCancel = false },
    wirecutting = { rounds = 3, time = 25, wires = 5 },
    memory      = { pairs = 6, time = 60 },
    hackgrid    = { size = 5, daemons = 2, seqLen = 3, buffer = 8, time = 45 },
    typer       = { rounds = 3, time = 30, mistakes = 3 },
}
```

***

## Compatibility Toggles

Enable or disable each built-in adapter. Toggling one off stops it from registering its legacy event listeners.

```lua
Config.Compatibility = {
    mhacking    = true,
    skillbar    = true,
    safecracker = true,
    datacrack   = true,
    psui        = true,
    lockpick    = true,
    qbminigames = true,
    xmmx        = true,
}
```

Standalone shims (`compat/pd-safe`, etc.) have no toggle here — they are enabled simply by starting their resource in `server.cfg`.
