Defines the client-side cw.PlayerInfoText library, the lines of text shown in the local player's information box.

The text is cleared every frame, so lines and sub text are added with cw.PlayerInfoText:Add and cw.PlayerInfoText:AddSub from the GetPlayerInfoText hook.

Summary

Methods

Adds a line of text to the local player's information box.
Adds a line of sub text, shown under the player's name, to the information box.
Removes a line from the information box.
Removes a line of sub text from the information box.
Returns whether there is any text for the local player's information box.
Returns a line of the local player's information box.
Returns a line of sub text of the information box.

Methods

cw.PlayerInfoText:Add(uniqueID, text)

client gamemodes/catwork/gamemode/core/libraries/cl_playerinfotext.lua:31

Adds a line of text to the local player's information box.

The text is cleared and rebuilt every frame, so call this from the GetPlayerInfoText hook. Does nothing when text is nil.

function PLUGIN:GetPlayerInfoText(playerInfoText)
  playerInfoText:Add('CASH', 'Cash: '..cw.player:GetCash())
end

Parameters

  • uniqueID String Unique ID of the line
  • text String Text of the line

See also

cw.PlayerInfoText:AddSub(uniqueID, text, priority)

client gamemodes/catwork/gamemode/core/libraries/cl_playerinfotext.lua:58

Adds a line of sub text, shown under the player's name, to the information box.

Call this from the GetPlayerInfoText hook. Lines with a higher priority are drawn first. Does nothing when text is nil.

Parameters

  • uniqueID String Unique ID of the line
  • text String Text of the line
  • priority Number optional, defaults to 0 Sort priority

cw.PlayerInfoText:Destroy(uniqueID)

client gamemodes/catwork/gamemode/core/libraries/cl_playerinfotext.lua:83

Removes a line from the information box.

Call this from the DestroyPlayerInfoText hook.

Parameters

  • uniqueID String Unique ID of the line

cw.PlayerInfoText:DestroySub(uniqueID)

client gamemodes/catwork/gamemode/core/libraries/cl_playerinfotext.lua:96

Removes a line of sub text from the information box.

Call this from the DestroyPlayerInfoText hook.

Parameters

  • uniqueID String Unique ID of the line

Returns whether there is any text for the local player's information box.

Returns

  • Boolean Whether any text or sub text has been added this frame

Returns a line of the local player's information box.

Parameters

  • uniqueID String Unique ID of the line

Returns

  • Map The line (uniqueID, text), or nil if there is none

cw.PlayerInfoText:GetSub(uniqueID)

client gamemodes/catwork/gamemode/core/libraries/cl_playerinfotext.lua:71

Returns a line of sub text of the information box.

Parameters

  • uniqueID String Unique ID of the line

Returns

  • Map The line (uniqueID, text, priority), or nil if there is none

Defined in