summaryrefslogtreecommitdiff
path: root/indra/newview/scripts/lua/require
AgeCommit message (Collapse)Author
2024-09-26update LLListener and related scriptsMnikolenko Productengine
2024-09-26Use event pump to get autopilot status, when it's terminated; add demo scriptMnikolenko Productengine
2024-09-26Lua api for autopilot functionsMnikolenko Productengine
2024-09-19Make login.lua enhance plain grid='agni' to required form.Nat Goodspeed
2024-09-12Support "LLTeleportHandler" "teleport" regionname="home".Nat Goodspeed
2024-09-12Add LLAgent.teleport() Lua functionNat Goodspeed
that wraps existing "LLTeleportHandler" LEAP listener.
2024-09-06Remove Lua floaters from menu_viewer.xml; re-add if Lua enabled.Nat Goodspeed
Add a menus.lua autorun script that waits until login, then adds the Lua floaters back into the Develop->Consoles menu where they were originally. Extend UI.addMenuItem() and addMenuSeparator() to support pos argument.
2024-09-04Merge branch 'release/luau-scripting' into lua-resultsetNat Goodspeed
2024-09-04`result_view()`'s table's `close()` method need not be further wrapped.Nat Goodspeed
`LL.setdtor(desc, table, func)` eventually calls `func(table)`. So the `close()` method on the table returned by `result_view()` can be directly passed to `setdtor()`, instead of wrapped in a new anonymous function whose only job is to pass the table to it. Moreover, there's no need for the table returned by LLInventory.lua's `result()` function to lazily instantiate the `result_view()` for `categories` or `items`: neither `result_view` will fetch a slice unless asked. Just return `{categories=result_view(...), items=result_view(...), close=...}`. This dramatically simplifies the `result()` function. Since that table also defines a `close()` function, that too can be passed directly to `setdtor()` without being wrapped in a new anonymous function.
2024-09-03Use Lua result-set logic for "LLFloaterReg"s "getFloaterNames" op.Nat Goodspeed
This is the query that produced so many results that, before we lifted the infinite-loop interrupt limit, inspect(result) hit the limit and terminated.
2024-09-03Generalize Lua-side result-set machinery for other use cases.Nat Goodspeed
Change `result_view()` from a simple function to a callable table so we can add conventional/default functions to it: `result_view.fetch()` is a generic `fetch()` function suitable for use with `result_view()`, and `result_view.close()` is a variadic function that closes result sets for whichever keys are passed. This arises from the fact that any `LL::ResultSet` subclass is accessed generically through its base class, therefore we don't need distinct "getSlice" and "closeResult" operations for different `LLEventAPI` listeners. (It might make sense to relocate those operations to a new generic listener, but for now "LLInventory" works.) That lets `result_view()`'s caller omit the `fetch` parameter unless it requires special behavior. Omitting it uses the generic `result_view.fetch()` function. Moreover, every view returned by `result_view()` now contains a close() function that closes that view's result set. The table returned by LLInventory.lua's `result()` function has a `close()` method; that method can now call `result_view.close()` with the two keys of interest. That table's `__index()` metamethod can now leverage `result_view()`'s default `fetch` function.
2024-09-03result_view() now reuses same metatable instance for every table.Nat Goodspeed
2024-09-03Add test_result_view.lua; fix minor bugs in result_view.lua.Nat Goodspeed
2024-09-02Introduce result_view.lua, and use it in LLInventory.lua.Nat Goodspeed
result_view(key_length, fetch) returns a virtual view of a potentially-large C++ result set. Given the result-set key, its total length and a function fetch(key, start) => (slice, adjusted start), the read-only table returned by result_view() manages indexed access and table iteration over the entire result set, fetching a slice at a time as required. Change LLInventory to use result_view() instead of only ever fetching the first slice of a result set. TODO: This depends on the viewer's "LLInventory" listener returning the total result set length as well as the result set key. It does not yet return the length.
2024-08-31Give certain LLInventory queries an API based on result sets.Nat Goodspeed
Introduce abstract base class InvResultSet, derived from LLIntTracker so each instance has a unique int key. InvResultSet supports virtual getLength() and getSlice() operations. getSlice() returns an LLSD array limited to MAX_ITEM_LIMIT result set entries. It permits retrieving a "slice" of the contained result set starting at an arbitrary index. A sequence of getSlice() calls can eventually retrieve a whole result set. InvResultSet has subclasses CatResultSet containing cat_array_t, and ItemResultSet containing item_array_t. Each implements a virtual method that produces an LLSD map from a single array item. Make LLInventoryListener::getItemsInfo(), getDirectDescendants() and collectDescendantsIf() instantiate heap CatResultSet and ItemResultSet objects containing the resultant LLPointer arrays, and return their int keys for categories and items. Add LLInventoryListener::getSlice() and closeResult() methods that accept the int keys of result sets. getSlice() returns the requested LLSD array to its caller, while closeResult() is fire-and-forget. Because bulk data transfer is now performed by getSlice() rather than by collectDescendantsIf(), change the latter's "limit" default to unlimited. Allow the C++ code to collect an arbitrary number of LLPointer array entries, as long as getSlice() limits retrieval overhead. Spell "descendants" correctly, unlike the "descendents" spelling embedded in the rest of the viewer... sigh. Make the Lua module provide both spellings. Make MAX_ITEM_LIMIT a U32 instead of F32. In LLInventory.lua, store int result set keys from 'getItemsInfo', 'getDirectDescendants' and 'collectDescendantsIf' in a table with a close() function. The close() function invokes 'closeResult' with the bound int keys. Give that table an __index() metamethod that recognizes only 'categories' and 'items' keys: anything else returns nil. For either of the recognized keys, call 'getSlice' with the corresponding result set key to retrieve (the initial slice of) the actual result set. Cache that result. Lazy retrieval means that if the caller only cares about categories, or only about items, the other result set need never be retrieved at all. This is a first step: like the previous code, it still retrieves only up to the first 100 result set entries. But the C++ code now supports retrieval of additional slices, so extending result set retrieval is mostly Lua work. Finally, wrap the table-with-metamethod in an LL.setdtor() proxy whose destructor calls its close() method to tell LLInventoryListener to destroy the CatResultSet and ItemResultSet with the bound keys.
2024-08-30Add throttle for playing an animation; add demo scriptMnikolenko Productengine
2024-08-30Add Lua api to start/stop playing animationMnikolenko Productengine
2024-08-28Merge pull request #2416 from secondlife/lua-lazymodnat-goodspeed
Allow UI to have lazily-loaded submodules.
2024-08-27code clean upMnikolenko Productengine
2024-08-24Update test scripts to reference UI.Floater, not standalone Floater.Nat Goodspeed
2024-08-23Massage results from UI.popup() for ease of use.Nat Goodspeed
In particular, where the raw leap.request().response call would return {OK_okcancelbuttons=true}, just return the string 'OK' or 'Cancel'. Update existing consumer scripts.
2024-08-23Encapsulate the lazy submodule idiom as util.submoduledir().Nat Goodspeed
2024-08-23Look for lazy UI submodules in a require/UI subdirectory.Nat Goodspeed
This way encourages "UI = require 'UI'; UI.Floater" instead of just "Floater = require 'Floater'". Moreover, now we don't need UI to maintain a list of allowed submodules; that's effected by membership in the subdirectory.
2024-08-23Allow UI to have lazily-loaded submodules.Nat Goodspeed
Equip UI with an __index metamethod. When someone references an unknown key/field in UI, require() that module and cache it for future reference. Add util.setmetamethods() as a way to find or create a metatable on a specified table containing specified metamethods. Exercise the new functionality by referencing UI.popup in test_popup.lua.
2024-08-21Merge branch 'release/luau-scripting' into lua-inventoryMaxim Nikolenko
2024-08-21Add item limit for collectDescendentsIf func; add demo scriptMnikolenko Productengine
2024-08-20Defend timers.Timer(iterate=True) against long callbacks.Nat Goodspeed
Specifically, defend against a callback that runs so long it suspends at a point after the next timer tick.
2024-08-20Add collectDescendentsIf api for LuaMnikolenko Productengine
2024-08-15First batch of Inventory api; raise interrupts limitMnikolenko Productengine
2024-08-13clean up and add commentMnikolenko Productengine
2024-08-09add demo script for sending group chat messagesMnikolenko Productengine
2024-08-09Lua api for sending group messagesMnikolenko Productengine
2024-08-07Fix omission in login.savedLogins().Nat Goodspeed
Also add Region.lua.
2024-08-07Rename 'UI' 'getParents' op to 'getTopMenus', add UI.lua function.Nat Goodspeed
Also update the 'UI' help text to reflect its more general nature. Mention 0-relative rank in the xxToolbarBtn operation help text.
2024-08-06code clean upMnikolenko Productengine
2024-08-06Merge branch 'release/luau-scripting' into lua-ui-visibilityMaxim Nikolenko
2024-08-05Allow getting the list of floater names, hide top menu items; add demo scriptMnikolenko Productengine
2024-08-05Fix a couple problems with "LLPanelLogin" listener (thanks Maxim!).Nat Goodspeed
Convert plain grid (e.g. "agni") to domain form (e.g. "util.agni.lindenlab.com"). Fix a typo in `savedLogins()`: "login_list", not "login.list". login.lua now returns a table with two functions: `login.login()` and `login.savedLogins()`. Defend Lua caller against trying to engage login features too late in startup sequence: in addition to waiting for "STATE_LOGIN_WAIT", produce an error if `startup.state()` is beyond that state. Since by then `LLPanelLogin` is destroyed, `leap.request("LLPanelLogin", ...)` would get no response, causing the calling Lua script to hang until viewer shutdown.
2024-08-02Add 'LLPanelLogin' 'login', 'savedLogins' operations.Nat Goodspeed
'login' accepts optional 'username', 'slurl', 'grid'. 'savedLogins' returns the list of saved usernames in both display form and internal form. Make LLPanelLogin::getUserName() accept (const LLPointer<LLCredential>&). There's a whole separate discussion pending as to whether const LLPointer<T> should provide access to non-const T methods. Similarly, make LLCredential::getIdentifier() a const method. These two changes enable read-only access to credentials. Make LLPanelLogin methods capture and reuse LLGridManager::instance() as appropriate. Add require/login.lua and test_login.lua.
2024-08-02Lua api for showing/hiding floater; rename demo scriptsMnikolenko Productengine
2024-08-02Lua api for adjusting toolbarsMnikolenko Productengine
2024-08-01Add UI.callables() and corresponding entry point.Nat Goodspeed
2024-08-01Merge remote-tracking branch 'origin/lua-top-menu' into lua-callables.Nat Goodspeed
We want to base lua-callables on lua-top-menu.
2024-07-26Add api for more script camera paramsMnikolenko Productengine
2024-07-25Lua api for Follow Camera controlMnikolenko Productengine
2024-07-17Lua api for adding new menu items to the Top menuMaxim Nikolenko
2024-07-10Merge branch 'lua-atexit-run' into lua-no-reuse.Nat Goodspeed
We couldn't discard the "p.s." fiber.run() call from LuaState::expr() until we could count on fiber.lua's LL.atexit(fiber.run) call being executed after each Lua script or chunk, and we couldn't count on that until we made LLLUAmanager::runScriptFile() instantiate and destroy its LuaState on the C++ Lua-specific coroutine. Now that we've done that, use LL.atexit(fiber.run) instead of the whole special-case "p.s." in LuaState::expr().
2024-07-10Simplify passing keys to leap.requestMnikolenko Productengine
2024-07-09Merge branch 'release/luau-scripting' into lua-snapshotNat Goodspeed
2024-07-08Lua api for Snapshot and demo scriptMnikolenko Productengine