Skip to main content

Lobbychatline

Based on game build 714014 | Last updated: 2026-03-08

Overview

LobbyChatLine is a UI widget responsible for displaying a single chat message in the lobby interface. It handles different message types (user messages, chatter messages, system messages, and announcements—including special skin announcements) and dynamically renders associated UI elements such as badges, usernames, and message content. The widget also manages multi-line truncation, indentation for wrapped lines, focus-based sizing, and visibility state tracking via a show count.

Usage example

local line = LobbyChatLine(chat_font, ChatTypes.Message, "Hello world!", m_colour, "Player1", s_colour, flair_icon, bg_icon)
TheFrontEnd:AddWidget(line)
line:UpdatePositions()
line:IncrementShowCount()

Dependencies & tags

Components used: None (pure UI widget, no components required) Tags: None identified.

Properties

PropertyTypeDefault ValueDescription
show_countnumber0Tracks how many times the line has been shown; determines visibility (visible if > 0).
rootWidgetRoot container widget for all child elements.
iconWidget or ImageButtonnilFlair badge or button (depending on message type).
messageTextnilMain message text (for standard messages).
userTextnilUsername text (for messages with sender).
skin_btnImageButtonnilClickable button for skin announcements.
skin_txtTextnilSecondary text (e.g., skin name) in skin announcements.
typestringChat type identifier (ChatTypes.*).
multiline_indent_strstringPrecomputed whitespace/tab string for indenting continuation lines.
inital_updatebooleanfalseFlag indicating whether initial position update has been performed.
extra_line_countnumber0Number of additional wrapped lines beyond the first.
space_width, first_tab_width, tab_widthnumberMeasured widths of space, first tab, and subsequent tab characters for layout.

Main functions

UpdatePositions()

  • Description: Arranges child widgets (icon, username, message, skin components) based on type and dynamic sizing. Computes and sets positions to ensure correct alignment, indentation of wrapped lines, and multi-line truncation.
  • Parameters: None.
  • Returns: Nothing.
  • Error states: Sets inital_update = true after first run to adjust future layout behavior.

GetExtraLineCount()

  • Description: Returns the number of wrapped lines beyond the first line.
  • Parameters: None.
  • Returns: number — extra line count.

UpdateSkinAnnouncementSize(size)

  • Description: Adjusts font size of the skin announcement button and embedded text, then re-applies positioning. Used to scale up/down on focus.
  • Parameters: size (number) — new font size (e.g., chat_size or focus_chat_size).
  • Returns: Nothing.

OnGainFocus()

  • Description: Handles focus gain: brings the line to front and scales skin announcements up to focus_chat_size.
  • Parameters: None.
  • Returns: Nothing.

OnLoseFocus()

  • Description: Handles focus loss: scales skin announcements back to chat_size.
  • Parameters: None.
  • Returns: Nothing.

OnHide()

  • Description: Prevents hiding if show_count is positive; forces Show() to be called if currently hidden.
  • Parameters: None.
  • Returns: Nothing.

IncrementShowCount()

  • Description: Increases the show_count and ensures visibility if show_count > 0.
  • Parameters: None.
  • Returns: Nothing.

DecrementShowCount()

  • Description: Decreases the show_count and hides the widget when it reaches zero.
  • Parameters: None.
  • Returns: Nothing.

Events & listeners

None identified.