Summary
Hooks
cwAreaDisplays.activeDisplays.cwShowAreas client convar as CW_CONVAR_SHOWAREAS.plugins/areas/<map> into cwAreaDisplays.storedList.PlayerEnteredArea there with the player as the first argument.cwAreaDisplays.storedList to the schema data file plugins/areas/<map>.cwAreaDisplays.storedList.Hooks
cwAreaDisplays:AddAreaDisplayDisplay(areaTable)
client gamemodes/catwork/plugins/areadisplays/plugin/cl_plugin.lua:45Starts 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,positionand, for 3D displays,anglesandscale
cwAreaDisplays:CalculateDisplayAlpha(displayInfo, index)
client gamemodes/catwork/plugins/areadisplays/plugin/cl_plugin.lua:77Fades 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,fadeTimeandgoBackTimeare updated - index String The display's key in
cwAreaDisplays.activeDisplays
cwAreaDisplays:ClockworkInitPostEntity()
server gamemodes/catwork/plugins/areadisplays/plugin/sv_hooks.lua:4Implements 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:133Draws 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,nameandalpha
cwAreaDisplays:DrawDisplayScrolling(displayInfo, info)
client gamemodes/catwork/plugins/areadisplays/plugin/cl_plugin.lua:161Draws 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,nameandalpha; its scroll state is stored in it - info Map Drawing position with
xandy;yis moved below the drawn text
cwAreaDisplays:HandleAreaTable(areaTable, index)
client gamemodes/catwork/plugins/areadisplays/plugin/cl_plugin.lua:107Handles 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
truewhen the hook was run, otherwisenil
cwAreaDisplays:HasExpired(areaDisplay)
client gamemodes/catwork/plugins/areadisplays/plugin/cl_plugin.lua:247Returns whether an expiring area has already been shown to this client.
Parameters
- areaDisplay Map The area
Returns
- Boolean
truewhen the area expires and its name is recorded at its position as seen
cwAreaDisplays:HUDPaintForeground()
client gamemodes/catwork/plugins/areadisplays/plugin/cl_hooks.lua:45Implements 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:37Loads 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:17Implements 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:25Implements 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:8Implements 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:33Called 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:42Saves cwAreaDisplays.storedList to the schema data file plugins/areas/<map>.
cwAreaDisplays:SetExpired(index)
client gamemodes/catwork/plugins/areadisplays/plugin/cl_plugin.lua:264Marks 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.