Ticket #966: api_projectile_destroyer_reciever_example.lua

File api_projectile_destroyer_reciever_example.lua, 727 bytes (added by Bluestone, 7 years ago)

widget part

Line 
1--------------------------------------------------------------------------------
2--------------------------------------------------------------------------------
3
4function widget:GetInfo()
5 return {
6 name = "Example",
7 desc = "",
8 author = "",
9 date = "",
10 license = "",
11 layer = 0,
12 enabled = true, -- loaded by default?
13 }
14end
15
16function widget:Initialize()
17 widgetHandler:RegisterGlobal("ReceiveProjectileDestroyed", RecieveProjectileDestroyed)
18end
19
20function widget:Shutdown()
21 widgetHandler:DeregisterGlobal("ReceiveProjectileDestroyed")
22end
23
24function RecieveProjectileDestroyed(proID, x, y, z)
25 Spring.Echo("widget",proID,x,y,z)
26end
27
28