cw.PlayerInfoText classclient
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
Methods
cw.PlayerInfoText:Add(uniqueID, text)
client gamemodes/catwork/gamemode/core/libraries/cl_playerinfotext.lua:31Adds 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:58Adds 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
0Sort priority
cw.PlayerInfoText:Destroy(uniqueID)
client gamemodes/catwork/gamemode/core/libraries/cl_playerinfotext.lua:83Removes 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:96Removes a line of sub text from the information box.
Call this from the DestroyPlayerInfoText hook.
Parameters
- uniqueID String Unique ID of the line
cw.PlayerInfoText:DoesAnyExist()
client gamemodes/catwork/gamemode/core/libraries/cl_playerinfotext.lua:13Returns 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
cw.PlayerInfoText:Get(uniqueID)
client gamemodes/catwork/gamemode/core/libraries/cl_playerinfotext.lua:43Returns a line of the local player's information box.
Parameters
- uniqueID String Unique ID of the line
Returns
- Map The line (
uniqueID,text), ornilif there is none
cw.PlayerInfoText:GetSub(uniqueID)
client gamemodes/catwork/gamemode/core/libraries/cl_playerinfotext.lua:71Returns a line of sub text of the information box.
Parameters
- uniqueID String Unique ID of the line
Returns
- Map The line (
uniqueID,text,priority), ornilif there is none