-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathcontroller.script
More file actions
27 lines (25 loc) · 820 Bytes
/
Copy pathcontroller.script
File metadata and controls
27 lines (25 loc) · 820 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
local function show(self, proxy)
if self.current_proxy then
msg.post(self.current_proxy, "unload")
end
msg.post(proxy, "async_load")
end
function init(self)
msg.post(".", "acquire_input_focus")
show(self, "#menuproxy")
msg.post("@render:", "clear_color", { color = vmath.vector4(0.15, 0.15, 0.15, 1.0) })
end
function on_message(self, message_id, message, sender)
if message_id == hash("proxy_loaded") then
self.current_proxy = sender
msg.post(sender, "enable")
elseif message_id == hash("show_menu") then
show(self, "#menuproxy")
elseif message_id == hash("show_components") then
show(self, "#componentsproxy")
elseif message_id == hash("show_dynamiclist") then
show(self, "#dynamiclistproxy")
elseif message_id == hash("show_horizontallist") then
show(self, "#horizontallistproxy")
end
end