Summary

Hooks

Starts showing an area's name.
Fades an active display in over 4 seconds, holds it for 6 and fades it out over 2, then removes it from cwAreaDisplays.activeDisplays.
Called after Catwork has loaded all map entities; loads the current map's areas.
Draws a 3D display's name in the world at its position and angles, using the large 3D2D font.
Draws a scrolling display's name, typing it out one character every 0.1 seconds with a sound and erasing it the same way once it starts fading out.
Handles the local player entering an area.
Returns whether an expiring area has already been shown to this client.
Called when the foreground HUD is painted; draws and fades the active scrolling area displays.
Called when the client initializes; creates the cwShowAreas client convar as CW_CONVAR_SHOWAREAS.
Loads the current map's areas from the schema data file plugins/areas/<map> into cwAreaDisplays.storedList.
Called when the local player enters an area; tells the server, which runs PlayerEnteredArea there with the player as the first argument.
Called when the local player leaves an area; forgets the current area.
Called when a player's initial data is sent; sends them every stored area.
Called after translucent renderables are drawn; draws and fades the active 3D area displays.
Saves cwAreaDisplays.storedList to the schema data file plugins/areas/<map>.
Marks an expiring area as seen and removes it from cwAreaDisplays.storedList.
Tick()client
Called every tick; once a second, checks which stored area the local player is in.

Hooks

cwAreaDisplays:AddAreaDisplayDisplay(areaTable)

client gamemodes/catwork/plugins/areadisplays/plugin/cl_plugin.lua:45

Starts showing an area's name.

%t in the name is replaced with the current in-game time. Cinematic areas are shown as cinematic text; Scrolling (the default) and 3D areas are added to cwAreaDisplays.activeDisplays, keyed by position, unless that position is already showing.

Parameters

  • areaTable Map The area, with name, class, position and, for 3D displays, angles and scale

cwAreaDisplays:CalculateDisplayAlpha(displayInfo, index)

client gamemodes/catwork/plugins/areadisplays/plugin/cl_plugin.lua:77

Fades an active display in over 4 seconds, holds it for 6 and fades it out over 2, then removes it from cwAreaDisplays.activeDisplays.

Parameters

  • displayInfo Map The active display; alpha, targetAlpha, fadeTime and goBackTime are updated
  • index String The display's key in cwAreaDisplays.activeDisplays

cwAreaDisplays:ClockworkInitPostEntity()

server gamemodes/catwork/plugins/areadisplays/plugin/sv_hooks.lua:4

Implements hook ClockworkInitPostEntity

Called after Catwork has loaded all map entities; loads the current map's areas.

cwAreaDisplays:DrawDisplay3D(displayInfo)

client gamemodes/catwork/plugins/areadisplays/plugin/cl_plugin.lua:133

Draws a 3D display's name in the world at its position and angles, using the large 3D2D font.

Parameters

  • displayInfo Map The active display, with areaTable, name and alpha

cwAreaDisplays:DrawDisplayScrolling(displayInfo, info)

client gamemodes/catwork/plugins/areadisplays/plugin/cl_plugin.lua:161

Draws a scrolling display's name, typing it out one character every 0.1 seconds with a sound and erasing it the same way once it starts fading out.

Parameters

  • displayInfo Map The active display, with areaTable, name and alpha; its scroll state is stored in it
  • info Map Drawing position with x and y; y is moved below the drawn text

cwAreaDisplays:HandleAreaTable(areaTable, index)

client gamemodes/catwork/plugins/areadisplays/plugin/cl_plugin.lua:107

Handles the local player entering an area.

For areas that do not expire, records the area as current and runs the PlayerEnteredArea hook. The name is shown when the cwShowAreas setting is on or the area expires, and an expiring area is then marked as seen with cwAreaDisplays:SetExpired.

Parameters

  • areaTable Map The area that was entered
  • index Number The area's index in cwAreaDisplays.storedList

Returns

  • Boolean true when the hook was run, otherwise nil

cwAreaDisplays:HasExpired(areaDisplay)

client gamemodes/catwork/plugins/areadisplays/plugin/cl_plugin.lua:247

Returns whether an expiring area has already been shown to this client.

Parameters

  • areaDisplay Map The area

Returns

  • Boolean true when the area expires and its name is recorded at its position as seen

cwAreaDisplays:HUDPaintForeground()

client gamemodes/catwork/plugins/areadisplays/plugin/cl_hooks.lua:45

Implements hook HUDPaintForeground

Called when the foreground HUD is painted; draws and fades the active scrolling area displays.

Called when the client initializes; creates the cwShowAreas client convar as CW_CONVAR_SHOWAREAS.

cwAreaDisplays:LoadAreaDisplays()

server gamemodes/catwork/plugins/areadisplays/plugin/sv_plugin.lua:37

Loads the current map's areas from the schema data file plugins/areas/<map> into cwAreaDisplays.storedList.

cwAreaDisplays:PlayerEnteredArea(name, minimum, maximum)

client gamemodes/catwork/plugins/areadisplays/plugin/cl_hooks.lua:17

Implements hook PlayerEnteredArea

Called when the local player enters an area; tells the server, which runs PlayerEnteredArea there with the player as the first argument.

Parameters

  • name String The area's name
  • minimum Vector One corner of the area's box
  • maximum Vector The opposite corner of the area's box

cwAreaDisplays:PlayerExitedArea(name, minimum, maximum)

client gamemodes/catwork/plugins/areadisplays/plugin/cl_hooks.lua:25

Implements hook PlayerExitedArea

Called when the local player leaves an area; forgets the current area.

Parameters

  • name String The area's name
  • minimum Vector One corner of the area's box
  • maximum Vector The opposite corner of the area's box

cwAreaDisplays:PlayerSendDataStreamInfo(player)

server gamemodes/catwork/plugins/areadisplays/plugin/sv_hooks.lua:8

Implements hook PlayerSendDataStreamInfo

Called when a player's initial data is sent; sends them every stored area.

Parameters

  • player Player The player receiving the data

cwAreaDisplays:PostDrawTranslucentRenderables(bDrawingDepth, bDrawingSkybox, bDrawing3DSkybox)

client gamemodes/catwork/plugins/areadisplays/plugin/cl_hooks.lua:33

Called after translucent renderables are drawn; draws and fades the active 3D area displays.

Parameters

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

cwAreaDisplays:SaveAreaDisplays()

server gamemodes/catwork/plugins/areadisplays/plugin/sv_plugin.lua:42

Saves cwAreaDisplays.storedList to the schema data file plugins/areas/<map>.

cwAreaDisplays:SetExpired(index)

client gamemodes/catwork/plugins/areadisplays/plugin/cl_plugin.lua:264

Marks an expiring area as seen and removes it from cwAreaDisplays.storedList.

The seen areas are saved to the schema data file plugins/displays/<map> on the client, so they are not shown again. Areas that do not expire are left alone.

Parameters

  • index Number The area's index in cwAreaDisplays.storedList

Called every tick; once a second, checks which stored area the local player is in.

Entering a new area runs cwAreaDisplays:HandleAreaTable, and leaving the current area runs the PlayerExitedArea hook.

Defined in