-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFrameActionWrapper.lua
More file actions
31 lines (25 loc) · 882 Bytes
/
FrameActionWrapper.lua
File metadata and controls
31 lines (25 loc) · 882 Bytes
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
require("Actions")
local FrameActionWrapperIndex = { isFrameActionWrapper = true }
local FrameActionWrapperMT = {__index = FrameActionWrapperIndex}
function FrameActionWrapperIndex:addFrameAction()
self.frame_action_marker = Actions.addFrameAction(self.frame_action)
end
function FrameActionWrapperIndex:removeFrameAction()
Actions.removeFrameAction(self.frame_action_marker)
end
function FrameActionWrapperIndex:start()
self:addFrameAction()
end
function FrameActionWrapperIndex:stop()
self:removeFrameAction()
end
FrameActionWrapper = function(wrapper)
--"constructor" - main function to create Lua objects
--here you can set vars, example:
wrapper.frame_action = wrapper.frame_action or nil
wrapper.frame_action_marker = nil
--we must set the metatable - so it can find its methods
setmetatable(wrapper, FrameActionWrapperMT)
--return obj
return wrapper
end