> For the complete documentation index, see [llms.txt](https://devmosaic.gitbook.io/devmosaic/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://devmosaic.gitbook.io/devmosaic/resources/devmosaic-dm-hud/policy-and-locks.md).

# Policy And Locks

Hide an element, grey out a setting, or force a value — in shared/policy.lua.

Three tools, one file: `shared/policy.lua`. **Pick the one that matches what you want.**

<table><thead><tr><th width="130">You want to</th><th width="150">Use</th><th>Result</th></tr></thead><tbody><tr><td>Make something invisible</td><td><code>DashPolicy.hidden</code></td><td>Gone from the screen. Still runs underneath</td></tr><tr><td>Stop players changing a setting</td><td><code>DashPolicy.locked</code></td><td>Greyed out in the menu, stuck on your default</td></tr><tr><td>Both, in one line</td><td><code>DashPolicy.forced</code></td><td>Sets the value <em>and</em> locks it</td></tr></tbody></table>

{% hint style="info" %}
**Hidden is not the same as off.** A hidden seatbelt icon still buckles. A hidden fuel gauge still tracks fuel. To stop a feature running at all, set its module to `false` in [config.lua](/devmosaic/resources/devmosaic-dm-hud/configuration.md#turning-features-off).
{% endhint %}

## Hiding things

Uncomment a line. That is the whole job.

```lua
DashPolicy.hidden = {
    'info.cash',
    'info.bank',
    'weapon',
}
```

### Whole elements

| Id           | Hides                              |
| ------------ | ---------------------------------- |
| `logo`       | Your logo, top-left                |
| `info`       | The whole chip row, top-right      |
| `minimap`    | The map                            |
| `compass`    | The compass strip along the top    |
| `vitals`     | The whole status bar row           |
| `speedo`     | The speedometer and aircraft panel |
| `voice`      | The voice meter                    |
| `weapon`     | The ammo counter                   |
| `waypoint`   | Distance to your waypoint          |
| `speedlimit` | The speed limit sign               |

### Single chips

`info.job` · `info.gang` · `info.id` · `info.clock` · `info.cash` · `info.bank`

### Single status bars

`vitals.health` · `vitals.armour` · `vitals.food` · `vitals.water` · `vitals.stamina` · `vitals.oxygen` · `vitals.stress`

### Things you added yourself

Use the id you registered it with:

```lua
'vitals.radiation',
'info.crew',
```

## Locking settings

A locked setting shows in the menu, greyed out, on the value from [`shared/defaults.lua`](/devmosaic/resources/devmosaic-dm-hud/defaults.md). Players see it. They cannot move it.

```lua
DashPolicy.locked = {
    'general.speedUnit',
    'minimap.shape',
}
```

{% hint style="success" %}
**Naming a group locks everything inside it.**

```lua
'minimap',
```

That one line locks shape, on-foot, in-vehicle, north blip and zoom together.
{% endhint %}

### Every path you can lock

<details>

<summary>General — 8 paths</summary>

`general` · `general.performance` · `general.speedUnit` · `general.distanceUnit` · `general.scale` · `general.opacity` · `general.ignoreAspectLimit` · `general.realTimeClock`

</details>

<details>

<summary>Minimap and compass — 12 paths</summary>

`minimap` · `minimap.shape` · `minimap.onFoot` · `minimap.inVehicle` · `minimap.northBlip` · `minimap.zoom`

`compass` · `compass.style` · `compass.followsCamera` · `compass.showCrossing` · `compass.showPostal` · `compass.onFoot`

</details>

<details>

<summary>Status bars — 5 paths, plus ranges and colours</summary>

`vitals` · `vitals.statStyle` · `vitals.ringSize` · `vitals.showLogo` · `vitals.logoSize`

**Ranges** — when each bar appears, as `{ from, to }`:

`vitals.ranges` · `vitals.ranges.health` · `vitals.ranges.armour` · `vitals.ranges.food` · `vitals.ranges.water` · `vitals.ranges.stamina` · `vitals.ranges.oxygen` · `vitals.ranges.stress`

**Colours** — lock a whole stat, or one channel of it:

`vitals.colours` · `vitals.colours.health` · `vitals.colours.armour` · `vitals.colours.food` · `vitals.colours.water` · `vitals.colours.stamina` · `vitals.colours.oxygen` · `vitals.colours.stress`

Down to a single channel: `vitals.colours.health.progress`

</details>

<details>

<summary>Vehicles — 16 paths</summary>

`vehicle` · `vehicle.layout` · `vehicle.bikeLayout` · `vehicle.speedColour` · `vehicle.speedLimitStyle` · `vehicle.flashSpeedLimit` · `vehicle.showCadence` · `vehicle.showPulse` · `vehicle.showHorizon` · `vehicle.showHeading` · `vehicle.showTrim` · `vehicle.showWaypoint` · `vehicle.showFuel` · `vehicle.showEngine` · `vehicle.showAltitude` · `vehicle.showClimb` · `vehicle.showGear`

</details>

<details>

<summary>Sound — 7 paths</summary>

`sound` · `sound.master` · `sound.volume` · `sound.signalTick` · `sound.beltOn` · `sound.beltOff` · `sound.beltAlarm`

</details>

<details>

<summary>Chips, weapon and controls — 11 paths</summary>

`money` · `money.showCash` · `money.showBank`

`identity` · `identity.showVoice` · `identity.showId` · `identity.showClock` · `identity.showJob` · `identity.showGang`

`weapon` · `weapon.show` · `weapon.colour`

`controls` · `controls.dimScreen`

</details>

<details>

<summary>Layout</summary>

`layout` — stops players moving anything in the layout editor.

</details>

## Forcing a value

`forced` sets the value **and** locks it. Use it when you want a specific answer, not just "whatever the default happens to be".

```lua
DashPolicy.forced = {
    ['general.speedUnit'] = 'kmh',
    ['vehicle.speedLimitStyle'] = 'eu',
    ['general.performance'] = 'saver',
}
```

Any path from the locked list works. **You do not also need to list it in `locked`** — forcing already locks it.

### Values you can force

| Path                      | Values                                                   |
| ------------------------- | -------------------------------------------------------- |
| `general.performance`     | `ultra` · `balanced` · `performance` · `saver`           |
| `general.speedUnit`       | `mph` · `kmh`                                            |
| `general.distanceUnit`    | `ft` · `m`                                               |
| `general.scale`           | `70` to `130`                                            |
| `general.opacity`         | `30` to `100`                                            |
| `minimap.shape`           | `square` · `circle`                                      |
| `minimap.zoom`            | `600` to `1600`                                          |
| `compass.style`           | `ruler` · `chips`                                        |
| `vitals.statStyle`        | `halo` · `hex` · `badge` · `ledger` · `wave` · `pitline` |
| `vitals.ringSize`         | `30` to `70`                                             |
| `vitals.logoSize`         | `30` to `160`                                            |
| `vehicle.layout`          | `racing` · `sprint` · `corner` · `sport`                 |
| `vehicle.bikeLayout`      | `runway` · `corner` · `sport` · `racing`                 |
| `vehicle.speedLimitStyle` | `us` · `eu` · `off`                                      |
| `sound.volume`            | `0` to `100`                                             |
| Anything else             | `true` or `false`, or a `#hex` colour                    |

Ranges and colours take their own shapes:

```lua
['vitals.ranges.health'] = { 0, 100 },
['vitals.colours.health.progress'] = '#6cd444',
```

## Worked examples

{% tabs %}
{% tab title="Serious RP server" %}
No cash on screen, metric units everywhere, nobody moves anything.

```lua
DashPolicy.hidden = {
    'info.cash',
    'info.bank',
    'info.id',
}

DashPolicy.forced = {
    ['general.speedUnit'] = 'kmh',
    ['general.distanceUnit'] = 'm',
    ['vehicle.speedLimitStyle'] = 'eu',
}

DashPolicy.locked = {
    'layout',
}
```

{% endtab %}

{% tab title="Low-spec player base" %}
Cheapest update rate, locked so nobody can raise it.

```lua
DashPolicy.forced = {
    ['general.performance'] = 'saver',
}

DashPolicy.hidden = {
    'compass',
}
```

{% endtab %}

{% tab title="Minimal HUD" %}
Map and speedometer only.

```lua
DashPolicy.hidden = {
    'logo',
    'info',
    'vitals',
    'compass',
    'weapon',
    'voice',
}
```

{% endtab %}
{% endtabs %}

## The shortcut in config.lua

```lua
DashCfg.locked = { 'minimap.shape' }
```

Same system, same paths. It exists so you can lock one or two things without opening a second file. Use `policy.lua` for anything more.
