A single message of the chatbox (fl_chat_message): draws a message compiled by Chatbox.compile and fades out after the 'message_fade_delay' config, unless the chatbox is open. Steam avatars in the message are AvatarImage child panels that the message draws itself.

Summary

Methods

Creates an AvatarImage panel for every avatar piece of the compiled message, replacing the ones of the previous message.
eject()client
Removes the message from the chatbox history and deletes its panel, unless the ShouldMessageeject hook returns false.
Init()client
Records when the message was added and when it should start to fade out.
Draws the texts, images, icons and avatars of the compiled message, unless the ChatboxPrePaintMessage hook returns true.
Sets the compiled message to display, resizes the panel to its height and creates the panels of its avatars.
Think()client
Updates the visibility and opacity of the message: fully visible while the chatbox is open, dimmed while a command is being typed, fading out after the fade delay.

Methods

Creates an AvatarImage panel for every avatar piece of the compiled message, replacing the ones of the previous message. The panels are not drawn on their own: PANEL:Paint draws them along with the rest of the message, so that they fade with it. A piece that holds a SteamID64 shows the avatar even if that player is not on the server anymore.

Removes the message from the chatbox history and deletes its panel, unless the ShouldMessageeject hook returns false.

Records when the message was added and when it should start to fade out.

Draws the texts, images, icons and avatars of the compiled message, unless the ChatboxPrePaintMessage hook returns true.

Parameters

  • w Number
  • h Number

PANEL:set_message(msg_info)

client plugins/chatbox/plugin/views/cl_chatbox_message.lua:116

Sets the compiled message to display, resizes the panel to its height and creates the panels of its avatars. Does nothing if the chatbox panel does not exist.

Parameters

  • msg_info Map compiled message, as returned by Chatbox.compile

Updates the visibility and opacity of the message: fully visible while the chatbox is open, dimmed while a command is being typed, fading out after the fade delay.

Defined in