-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathsurface-event-handler.lua
59 lines (44 loc) · 1.48 KB
/
surface-event-handler.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
--local Constants = require("constants")
--local Util = require("util")
--- @event on_surface_cleared
--- @param surface_index uint
--- @param name @defines.events
--- @param tick uint
--- NOTE: This is not called when the default surface is created as it will always exist.
--- @event on_surface_created
--- @param surface_index uint
--- @param name @defines.events
--- @param tick uint
--- @event on_surface_deleted
--- @param surface_index uint
--- @param name @defines.events
--- @param tick uint
--- @event on_surface_imported
--- @param surface_index uint
--- @param original_name string
--- @param name @defines.events
--- @param tick uint
--- @event on_surface_renamed
--- @param surface_index uint
--- @param old_name string
--- @param new_name string
--- @param name @defines.events
--- @param tick uint
-- module
local M = {}
function M.on_surface_cleared(event)
log("event: ".. tostring(event.name) .." surface: ".. tostring(event.surface_index))
end
function M.on_surface_created(event)
log("event: ".. tostring(event.name) .." surface: ".. tostring(event.surface_index))
end
function M.on_surface_deleted(event)
log("event: ".. tostring(event.name) .." surface: ".. tostring(event.surface_index))
end
function M.on_surface_imported(event)
log("event: ".. tostring(event.name) .." surface: ".. tostring(event.surface_index))
end
function M.on_surface_renamed(event)
log("event: ".. tostring(event.name) .." surface: ".. tostring(event.surface_index))
end
return M