Skip to content

HUD and theme ​

The target is a player or dlmp.root, and the last write wins. A write to the root overwrites the widget for everyone and also applies to players who join later; a write to a player lasts until the next write to the root, and removing it does not restore the root's widget. Any resource may overwrite an entry and then owns it; stopping a resource removes only the entries it still owns.

ProgressSpec ​

Fields

  • value number — Current fill of the bar, 0..1.
  • to (optional) number — Fill the bar moves to on its own, 0..1; requires duration_ms.
  • duration_ms (optional) integer — Time to reach to.
  • label (optional) string
  • color (optional) integer — Bar color, 0xRRGGBB; defaults to the theme's line color.

NotificationSpec ​

Fields

  • text string
  • color (optional) integer — 0xRRGGBB; defaults to the theme's text color.
  • duration_ms (optional) integer — Defaults to 5000.

AnnouncementSpec ​

Fields

  • title string — Non-empty, up to 63 bytes, single line.
  • subtitle (optional) string — Up to 127 bytes, single line.
  • color (optional) integer — Title color, 0xRRGGBB; defaults to the theme's text color.
  • duration_ms integer — 1..300000; the client hides the announcement on its own after this time.

CountdownSpec ​

Fields

  • duration_ms integer — 1..86400000.
  • label (optional) string — Shown above the time; up to 63 bytes, single line.

StatusLineSpec ​

Fields

  • label (optional) string — What the value is; up to 31 bytes, single line.
  • text string — The value; non-empty, up to 63 bytes, single line.
  • color (optional) integer — Value color, 0xRRGGBB; defaults to the theme's text color.

KillFeedEntry ​

Fields

  • killer (optional) Player — Omit for a death with no killer. The nick is captured at call time and stays in the row after the player leaves.
  • victim Player
  • cause integer — 0..255: a weapon id or another cause from player_death; a cause with no client icon is shown as a skull.

dlmp.show_announcement ​

Shows a centered title and subtitle, replacing the previous announcement. The client hides it after duration_ms.

Parameters

Returns ok boolean|nil, err string|nil

dlmp.hide_announcement ​

Parameters

Returns ok boolean|nil, err string|nil

dlmp.show_countdown ​

Starts a countdown, replacing the previous one. The client counts down on its own and hides it at zero. Reaching zero raises no event and ends nothing: keep your own timer for what follows.

Parameters

Returns ok boolean|nil, err string|nil

dlmp.hide_countdown ​

Parameters

Returns ok boolean|nil, err string|nil

dlmp.set_status_line ​

Sets a status line. Writing the same line again sends nothing, so a script may rewrite it every tick.

Parameters

Returns ok boolean|nil, err string|nil

dlmp.clear_status_line ​

Parameters

Returns ok boolean|nil, err string|nil

dlmp.add_kill_feed ​

Adds a kill feed row. The feed keeps the last five rows, and the client shows each for 15 seconds. The core does not post deaths on its own: call this from player_death. The row keeps the nicks and player colors as of the call.

Parameters

Returns ok boolean|nil, err string|nil

dlmp.clear_kill_feed ​

Parameters

Returns ok boolean|nil, err string|nil

dlmp.show_progress ​

Shows a progress bar, replacing the previous one. With to and duration_ms, the client moves the bar to to on its own, in either direction, with no further packets: call again only when the course changes (for example, a capture stops or reverses). Reaching to raises no event and does not hide the bar: the gamemode tracks the time and hides it. For a bar that is not moving, repeating the same values sends nothing. A value outside 0..1, a duration outside 1..=3600000 ms, a label over 64 bytes or an invalid color fails with nil, err; to without duration_ms, or the reverse, raises an error.

Parameters

Returns ok boolean|nil, err string|nil

dlmp.hide_progress ​

Parameters

Returns ok boolean|nil, err string|nil

dlmp.add_notification ​

Adds a short notification at the side of the screen. Up to four are shown at once; a new one pushes out the oldest. The client hides each after duration_ms (5000 by default). An empty text, a text over 96 bytes, a duration outside 1..=30000 ms or an invalid color fails with nil, err. Under load, a new notification may be dropped.

Parameters

Returns ok boolean|nil, err string|nil

dlmp.clear_notifications ​

Parameters

Returns ok boolean|nil, err string|nil

GaugeSpec ​

Fields

  • value number — 0..1; a value out of range fails with nil, err.
  • icon UiIcon|nil — Any other name raises a Lua error.
  • label string|nil — Up to 31 bytes.
  • color integer|nil — 0xRRGGBB; defaults to the theme's line color.

dlmp.set_gauge ​

Sets one gauge in the block beside the radar, for example hunger, stamina, fuel or capture progress. Slots 1..6 set the order, top first. The client decides where the block is placed. Writing an unchanged gauge sends nothing, so a script may repeat the call.

Parameters

  • target Player|Element — A player or dlmp.root; the root also applies to players who join later.
  • slot integer
  • spec GaugeSpec

Returns ok boolean|nil, err string|nil

dlmp.clear_gauge ​

Parameters

Returns ok boolean|nil, err string|nil

dlmp.set_speedometer ​

Sets the gamemode's speedometer fields, replacing the previous ones: fuel 0..1 and locked, each drawn only when set. The client computes the speed itself and never sends it to the server; the widget is shown only when the theme enables show_speedometer.

Parameters

  • target Player|Element
  • spec {fuel: number|nil, locked: boolean|nil}

Returns ok boolean|nil, err string|nil

dlmp.clear_speedometer ​

Parameters

Returns ok boolean|nil, err string|nil

DlmpUiTheme ​

The appearance of the built-in UI. Positions and width are fractions of the screen; font_size is in pixels at 1080p and scales with the screen height; opacity applies to panel backgrounds; colors are 0xRRGGBB.

Fields

  • show_chat boolean|nil
  • show_nametags boolean|nil
  • show_hud boolean|nil
  • show_player_list boolean|nil
  • show_announcement boolean|nil
  • show_countdown boolean|nil
  • show_status boolean|nil
  • show_kill_feed boolean|nil
  • show_gauges boolean|nil
  • show_speedometer boolean|nil — Off by default.
  • speed_unit "kmh"|"mph"|nil — Defaults to "kmh".
  • label string|nil — Name in the corner label, drawn in color_text; up to 31 bytes, longer raises a Lua error. If both this and label_accent are empty, the DarqlineMP wordmark is shown.
  • label_accent string|nil — Rest of the name, drawn in color_accent; up to 31 bytes.
  • label_note string|nil — Text after the name, up to 31 bytes; if empty, the player's nick is shown.
  • style_kill_feed "rail"|"chip"|"board"|nil — Defaults to "rail".
  • style_status "rail"|"chip"|"board"|nil — Defaults to "rail".
  • style_countdown "rail"|"chip"|"board"|nil — Defaults to "chip".
  • font "sans"|"mono"|nil
  • font_size integer|nil — 10..48
  • chat_rows integer|nil — 1..40
  • chat_width number|nil — 0.1..1
  • opacity number|nil — 0..1, darkness of bands and panels; below about 0.5, text on a bright frame relies on its shadow
  • glow number|nil — 0..1, glow strength of the line, 0 for none; a player's own setting can lower it further
  • color_text integer|nil
  • color_name integer|nil
  • color_time integer|nil
  • color_line integer|nil — start of the line
  • color_accent integer|nil — end of the line, its node and group titles
  • color_panel integer|nil
  • color_icon integer|nil — cause icon in the kill feed
  • color_health integer|nil — health bar on nametags

dlmp.set_ui_theme ​

Sets fields of the built-in UI theme on every client, on top of the current values. An unknown field or a wrong type raises a Lua error; a value out of range fails with nil, err. The calling resource holds the theme until it calls dlmp.reset_ui_theme or stops (the default is then restored); calls from other resources fail meanwhile. A hidden widget still receives its data.

Parameters

Returns ok boolean|nil, err string|nil

dlmp.reset_ui_theme ​

Restores the default theme and releases it; fails while another resource holds the theme.

Returns ok boolean|nil, err string|nil

dlmp.ui_theme ​

Returns the current built-in UI theme with every field set.

Returns DlmpUiTheme

Documentation licensed under CC BY 4.0. DarqlineMP is not affiliated with Rockstar Games or Take-Two Interactive. Grand Theft Auto is a trademark of Take-Two Interactive Software, Inc.