From 6cedaecad9c4830aa29068b90611b8b9da301ac9 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Mon, 25 Mar 2024 20:41:33 +0200 Subject: Update test scripts to call leap.request() from main thread --- indra/newview/scripts/lua/test_luafloater_demo.lua | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) (limited to 'indra/newview/scripts/lua/test_luafloater_demo.lua') diff --git a/indra/newview/scripts/lua/test_luafloater_demo.lua b/indra/newview/scripts/lua/test_luafloater_demo.lua index 22ed7d7b3a..f2cf34206e 100644 --- a/indra/newview/scripts/lua/test_luafloater_demo.lua +++ b/indra/newview/scripts/lua/test_luafloater_demo.lua @@ -6,12 +6,7 @@ coro = require 'coro' --event pump for sending actions to the floater COMMAND_PUMP_NAME = "" --table of floater UI events -event_list={} -coro.launch(function () - event_list = leap.request("LLFloaterReg", {op="getFloaterEvents"})["events"] - leap.done() -end) -leap.process() +event_list=leap.request("LLFloaterReg", {op="getFloaterEvents"}).events local function _event(event_name) if not table.find(event_list, event_name) then @@ -53,12 +48,7 @@ end local key = {xml_path = XML_FILE_PATH, op = "showLuaFloater"} --sign for additional events for defined control {= {action1, action2, ...}} key.extra_events={show_time_lbl = {_event("right_mouse_down"), _event("double_click")}} -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() +COMMAND_PUMP_NAME = leap.request("LLFloaterReg", key).command_name catch_events = leap.WaitFor:new(-1, "all_events") function catch_events:filter(pump, data) @@ -74,5 +64,3 @@ function process_events(waitfor) end coro.launch(process_events, catch_events) -leap.process() -print_warning("End of the script") -- cgit v1.2.3