Summary
Hooks
cwDynamicAdverts.storedList.cwDynamicAdverts.storedList to the schema data for the current map.Hooks
cwDynamicAdverts:CacheMaterial(data)
client gamemodes/catwork/plugins/dynamicadverts/plugin/cl_plugin.lua:45Downloads an advert's image and stores it as a material on the advert.
The image is cached under data/catwork/schemas/<schema>/plugins/adverts/<map>/ by the CRC of its URL
and reused from there when present. Only png and jpg/jpeg URLs are supported; other extensions,
and adverts that already have a material, are left alone. The download is asynchronous, so
data.material is set some time after the call. A response that is not a png or jpg image is not
cached.
Parameters
- data Map The advert:
urlis read,material(anIMaterial) is set once loaded
cwDynamicAdverts:ClockworkInitPostEntity()
server gamemodes/catwork/plugins/dynamicadverts/plugin/sv_hooks.lua:5Implements hook ClockworkInitPostEntity
Called after Catwork has loaded all of its entities; loads the map's saved adverts.
cwDynamicAdverts:LoadDynamicAdverts()
server gamemodes/catwork/plugins/dynamicadverts/plugin/sv_plugin.lua:7Loads the current map's adverts from the schema data into cwDynamicAdverts.storedList.
cwDynamicAdverts:PlayerSendDataStreamInfo(player)
server gamemodes/catwork/plugins/dynamicadverts/plugin/sv_hooks.lua:10Implements hook PlayerSendDataStreamInfo
Called when a player's data stream info should be sent; sends them every advert.
Parameters
- player Player The player receiving the data
cwDynamicAdverts:PostDrawTranslucentRenderables(bDrawingDepth, bDrawingSkybox, bDrawing3DSkybox)
client gamemodes/catwork/plugins/dynamicadverts/plugin/cl_hooks.lua:11Called after translucent renderables are drawn; draws every advert whose material has loaded.
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
cwDynamicAdverts:SaveDynamicAdverts()
server gamemodes/catwork/plugins/dynamicadverts/plugin/sv_plugin.lua:12Saves cwDynamicAdverts.storedList to the schema data for the current map.