hud
Last updated on
The player HUD — health and needs gauges, money and job read-out, status chips, microphone block and speed dial — and the hiding of the game's own HUD.
Draws the player's HUD on the overlay page: a column of gauges (health, armour, stamina, hunger, thirst), a read-out of money, job and street cred, the status chips published by needs, a microphone block and a vehicle speed dial. It owns no game state: it samples other modules and the engine, picks each gauge's tone, formats each number and pushes the result to the page. It also hides the game HUD components it replaces.
| Side | client |
| Requires | character (hard) |
| Optional | needs, downed |
| Contract | hud v1 — client |
| Config | config/hud.lua (shared) |
| Data | none |
- Steps aside while the player is down, and while the join screen, the spawn menu, a menu or the fitting room is open. During the game’s own loading screen it is hidden and stops sampling (see loading).
- No player command to toggle it; other modules hide it through
SetVisible.
Configuration
config/hud.lua sets OPX.Config.MODULES.hud. Shared script.
Anchors: bottom-left, bottom-right, top-left, top-right, top-center, bottom-center. The page falls back to its own default for an unknown name.
| Key | Default | Effect |
|---|---|---|
enabled | true | false switches the module off. |
ANCHOR | 'bottom-left' | Corner of the gauge column. |
INFO_ANCHOR | 'top-left' | Corner of the money/job read-out. |
STATUS_ANCHOR | 'bottom-left' | Corner of the chip strip. Absent: the needs module's ANCHOR. |
STATUS_OFFSET | 120 | Pixels between the chip strip and the gauges. Absent: the needs OFFSET. |
VEHICLE_ANCHOR | 'bottom-center' | Corner of the speed dial. |
WIDTH | 210 | Gauge column width in pixels (1920-wide surface). |
SEGMENTS | 10 | Segments per gauge. |
VOICE_SEGMENTS | 8 | Segments of the voice meter. |
VITALS_MS | 33 | Milliseconds between two samples of the gauges. |
WIDGET_MS | 100 | Milliseconds between two samples of the voice and vehicle blocks. |
TONE_WARN | 33 | Percent at or under which a gauge takes the warn tone. |
TONE_BAD | 15 | Percent at or under which a gauge takes the bad tone. |
GAUGES | health, armor, stamina, hunger, thirst | The gauges in drawing order. See GAUGES. |
MONEY | { 'EDDIES', 'BANK' } | Money lines in order. A held money type not listed is added after them, sorted. Zero amounts are not drawn. |
MONEY_SEPARATOR | ' ' | Thousands separator. |
INFO_EYEBROW | 'hud.info.eyebrow' | Locale key of the read-out title. |
SHOW_JOB | true | Draw the job line. The job and grade names come from the locale keys character.job.<job> / character.grade.<job>.<level> when they exist, else the config text (Translating labels). |
SHOW_CRED | true | Draw the street cred line (when cred is above 0). |
VOICE | { OPEN_VOICE = 'open-voice', DRIVER = 'open77_voice', HIDE_OPEN_VOICE = true } | Microphone block. The two names are platform voice resources read through their exports (not dependencies). HIDE_OPEN_VOICE hides open-voice's own HUD line. A non-table VOICE drops the block. |
VEHICLE | { PASSENGER = true, FUEL = true } | Speed dial. PASSENGER = false draws it for the driver only. FUEL = false leaves the fuel line off; it is drawn only for a vehicle whose tank was written, toned at TONE_WARN / TONE_BAD. |
VANILLA | see VANILLA | Components of the game's own HUD: true leaves one to the game, false hides it. |
GAUGES
{ ID = 'armor', SOURCE = 'armor', ICON = 'armor',
LABEL = 'hud.gauge.armor', ALERT = false, HIDE_AT_ZERO = true },IDSOURCE:health,armor,staminaor any need name.LABEL: locale key.ICON:health,armor,stamina,hunger,thirst; anything else draws no glyph.- Optional:
TONE(tone aboveTONE_WARN),ALERT = false(never toned),HIDE_AT_ZERO,HIDE_ABOVE. - Shipped:
armorhasALERT = false, HIDE_AT_ZERO = true;staminahasHIDE_ABOVE = 99. - A gauge whose source is not readable is not drawn, so without
needsthere are no hunger and thirst gauges.
VANILLA
- Shipped:
minimap = true;compass,clock,health,stamina,weapon,speedometer,questTracker,vanillaNotifications,hubMenu,crosshair,scanner,phoneallfalse. - When the client reports its component list (
Open77.hud.components()), every component not named inVANILLAis hidden too. Name a componenttrueto leave it to the game. - Hides are released by the platform when the resource stops.
Crosshair and scanner are hidden
The shipped config hides crosshair (weapons fire without a reticle) and scanner (the platform also refuses scanner activation). Set them to true to give them back.