From 26ce33d8ead68c2dbcc37b2b1e040c072866fe5b Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Tue, 9 Apr 2024 15:21:05 -0400 Subject: Add Lua Floater class to simplify Lua script showing floaters. Add test_luafloater_demo2.lua and test_luafloater_gesture_list2.lua examples. --- indra/newview/scripts/lua/leap.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'indra/newview/scripts/lua/leap.lua') diff --git a/indra/newview/scripts/lua/leap.lua b/indra/newview/scripts/lua/leap.lua index d19273e8bc..ade91789f0 100644 --- a/indra/newview/scripts/lua/leap.lua +++ b/indra/newview/scripts/lua/leap.lua @@ -183,14 +183,15 @@ function leap.generate(pump, data, checklast) -- bearing that reqid. Stamp the outbound request with that reqid, and -- send it. local reqid, waitfor = requestSetup(pump, data) - local ok, response + local ok, response, resumed_with repeat ok, response = pcall(waitfor.wait, waitfor) if not ok then break end - coroutine.yield(response) - until checklast and checklast(response) + -- can resume(false) to terminate generate() and clean up + resumed_with = coroutine.yield(response) + until (checklast and checklast(response)) or (resumed_with == false) -- If we break the above loop, whether or not due to error, clean up. pending[reqid] = nil if not ok then -- cgit v1.2.3