Summary

Hooks

Called when the chat box is closed; tells the server the player stopped typing.
Called when the chat box text changes; tells the server which kind of message the player is typing.
Called when a player stops typing; plays their rank's or faction's endChatNoise if a message was sent.
Called when a player starts typing; plays their rank's or faction's startChatNoise.
Called after translucent renderables are drawn; draws the typing indicator above typing players' heads.

Hooks

cwDisplayTyping:ChatBoxClosed(textTyped)

client gamemodes/catwork/plugins/displaytyping/plugin/cl_hooks.lua:130

Implements hook ChatBoxClosed

Called when the chat box is closed; tells the server the player stopped typing.

Parameters

  • textTyped Boolean Whether the player sent a message, which plays the faction's end chat noise

cwDisplayTyping:ChatBoxTextChanged(previousText, newText)

client gamemodes/catwork/plugins/displaytyping/plugin/cl_hooks.lua:145

Implements hook ChatBoxTextChanged

Called when the chat box text changes; tells the server which kind of message the player is typing.

Runs cwTypingStart with a mode code picked from the command prefix (radio, me, pm, w, y), an OOC prefix, or plain text once the message reaches four characters.

Parameters

  • previousText String The chat box text before the change
  • newText String The chat box text after the change

cwDisplayTyping:PlayerFinishTypingDisplay(player, textTyped)

server gamemodes/catwork/plugins/displaytyping/plugin/sv_hooks.lua:51

Implements hook PlayerFinishTypingDisplay

Called when a player stops typing; plays their rank's or faction's endChatNoise if a message was sent.

The noise plays at most once a second.

Parameters

  • player Player The player who stopped typing
  • textTyped Boolean optional, defaults to nil True when the player sent the message instead of cancelling it

cwDisplayTyping:PlayerStartTypingDisplay(player, code)

server gamemodes/catwork/plugins/displaytyping/plugin/sv_hooks.lua:33

Implements hook PlayerStartTypingDisplay

Called when a player starts typing; plays their rank's or faction's startChatNoise.

Only plays for talking, yelling, whispering and radio codes, once per message and at most once a second, and not while noclipping.

Parameters

  • player Player The player who started typing
  • code String Typing mode code sent by the client: n, y, w, r, p or o

cwDisplayTyping:PostDrawTranslucentRenderables(bDrawingDepth, bDrawingSkybox, bDrawing3DSkybox)

client gamemodes/catwork/plugins/displaytyping/plugin/cl_hooks.lua:34

Called after translucent renderables are drawn; draws the typing indicator above typing players' heads.

Shows the text for the player's Typing net var (talking, whispering, yelling, radioing, performing or typing OOC) above the head bone, or at the position returned by the GetPlayerTypingDisplayPosition hook. The indicator fades with distance; the range depends on the talk_radius config and the typing mode. Skips the depth and 3D skybox passes.

Parameters

  • bDrawingDepth Boolean Whether this is the depth pass
  • bDrawingSkybox Boolean Whether the skybox is being drawn
  • bDrawing3DSkybox Boolean Whether the 3D skybox is being drawn

Defined in