diff options
Diffstat (limited to 'indra/newview/scripts/lua')
-rw-r--r-- | indra/newview/scripts/lua/test_luafloater_demo.lua | 19 | ||||
-rw-r--r-- | indra/newview/scripts/lua/test_luafloater_gesture_list.lua | 14 |
2 files changed, 19 insertions, 14 deletions
diff --git a/indra/newview/scripts/lua/test_luafloater_demo.lua b/indra/newview/scripts/lua/test_luafloater_demo.lua index 2cbafcec14..308cebcb88 100644 --- a/indra/newview/scripts/lua/test_luafloater_demo.lua +++ b/indra/newview/scripts/lua/test_luafloater_demo.lua @@ -39,12 +39,19 @@ function handleEvents(event_data) elseif event_data.event == e.CLOSE_EVENT then print_warning("Floater was closed") leap.done() - --script received event pump name, after floater was built - elseif event_data.event == e.POST_BUILD_EVENT then - COMMAND_PUMP_NAME = event_data.command_name end end +local key = {xml_path = XML_FILE_PATH, op = "showLuaFloater"} +--sign for additional events for defined control {<control_name>= {action1, action2, ...}} +key.extra_events={show_time_lbl = {e.RIGHT_MOUSE_DOWN_EVENT, e.DOUBLE_CLICK_EVENT}} +coro.launch(function () + --script received event pump name, after floater was built + COMMAND_PUMP_NAME = leap.request("LLFloaterReg", key)["command_name"] + leap.done() +end) +leap.process() + catch_events = leap.WaitFor:new(-1, "all_events") function catch_events:filter(pump, data) return data @@ -58,12 +65,6 @@ function process_events(waitfor) end end -local key = {xml_path = XML_FILE_PATH, op = "showLuaFloater"} - ---sign for additional events for defined control {<control_name>= {action1, action2, ...}} -key.extra_events={show_time_lbl = {e.RIGHT_MOUSE_DOWN_EVENT, e.DOUBLE_CLICK_EVENT}} -leap.send("LLFloaterReg", key, "floater1") - coro.launch(process_events, catch_events) leap.process() print_warning("End of the script") diff --git a/indra/newview/scripts/lua/test_luafloater_gesture_list.lua b/indra/newview/scripts/lua/test_luafloater_gesture_list.lua index 5ea2b1e30d..57f737ce9b 100644 --- a/indra/newview/scripts/lua/test_luafloater_gesture_list.lua +++ b/indra/newview/scripts/lua/test_luafloater_gesture_list.lua @@ -40,6 +40,15 @@ function handleEvents(event_data) end end +local key = {xml_path = XML_FILE_PATH, op = "showLuaFloater"} +--receive additional events for defined control {<control_name>= {action1, action2, ...}} +key.extra_events={gesture_list = {e.DOUBLE_CLICK_EVENT}} +coro.launch(function () + handleEvents(leap.request("LLFloaterReg", key)) + leap.done() +end) +leap.process() + catch_events = leap.WaitFor:new(-1, "all_events") function catch_events:filter(pump, data) return data @@ -53,10 +62,5 @@ function process_events(waitfor) end end -local key = {xml_path = XML_FILE_PATH, op = "showLuaFloater"} ---receive additional events for defined control {<control_name>= {action1, action2, ...}} -key.extra_events={gesture_list = {e.DOUBLE_CLICK_EVENT}} -leap.send("LLFloaterReg", key, "floater1") - coro.launch(process_events, catch_events) leap.process() |