OPX//77
opx_infinityhud

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.

Sideclient
Requirescharacter (hard)
Optionalneeds, downed
Contracthud v1 — client
Configconfig/hud.lua (shared)
Datanone
  • 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.

KeyDefaultEffect
enabledtruefalse 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_OFFSET120Pixels between the chip strip and the gauges. Absent: the needs OFFSET.
VEHICLE_ANCHOR'bottom-center'Corner of the speed dial.
WIDTH210Gauge column width in pixels (1920-wide surface).
SEGMENTS10Segments per gauge.
VOICE_SEGMENTS8Segments of the voice meter.
VITALS_MS33Milliseconds between two samples of the gauges.
WIDGET_MS100Milliseconds between two samples of the voice and vehicle blocks.
TONE_WARN33Percent at or under which a gauge takes the warn tone.
TONE_BAD15Percent at or under which a gauge takes the bad tone.
GAUGEShealth, armor, stamina, hunger, thirstThe 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_JOBtrueDraw 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_CREDtrueDraw 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.
VANILLAsee VANILLAComponents of the game's own HUD: true leaves one to the game, false hides it.

GAUGES

config/hud.lua — one GAUGES row
{ ID = 'armor', SOURCE = 'armor', ICON = 'armor',
  LABEL = 'hud.gauge.armor', ALERT = false, HIDE_AT_ZERO = true },
  • ID
  • SOURCE: health, armor, stamina or any need name.
  • LABEL: locale key.
  • ICON: health, armor, stamina, hunger, thirst; anything else draws no glyph.
  • Optional: TONE (tone above TONE_WARN), ALERT = false (never toned), HIDE_AT_ZERO, HIDE_ABOVE.
  • Shipped: armor has ALERT = false, HIDE_AT_ZERO = true; stamina has HIDE_ABOVE = 99.
  • A gauge whose source is not readable is not drawn, so without needs there are no hunger and thirst gauges.

VANILLA

  • Shipped: minimap = true; compass, clock, health, stamina, weapon, speedometer, questTracker, vanillaNotifications, hubMenu, crosshair, scanner, phone all false.
  • When the client reports its component list (Open77.hud.components()), every component not named in VANILLA is hidden too. Name a component true to 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.

On this page