Age | Commit message (Collapse) | Author |
|
|
|
|
|
|
|
The discussions we've read about Lua classes conventionally use
ClassName:new() as the constructor, and so far we've followed that convention.
But setting metaclass(ClassName).__call = ClassName.new permits Lua to respond
to calls of the form ClassName(ctor args) by implicitly calling
ClassName:new(ctor args).
Introduce util.classctor(). Calling util.classctor(ClassName) sets ClassName's
metaclass's __call to ClassName's constructor method. If the constructor method
is named something other than new(), pass ClassName.method as the second arg.
Use util.classctor() on each of our classes that defines a new() method.
Replace ClassName:new(args) calls with ClassName(args) calls throughout.
|
|
On Windows, std::filesystem::path::value_type is wchar_t, not char -- so
path::string_type is std::wstring, not std::string. So while Posix path
instances implicitly convert to string, Windows path instances do not. Add
explicit u8string() calls.
Also add LL.abspath() Lua entry point to further facilitate finding a resource
file relative to the calling Lua script. Use abspath() for both
test_luafloater_demo.lua and test_luafloater_gesture_list.lua.
|
|
This lets a calling script verify that it's running at the right point in the
viewer's life cycle. A script that wants to interact with the SL agent
wouldn't work if run from the viewer's command line -- unless it calls
startup.wait("STATE_STARTED"), which pauses until login is complete.
Modify test_luafloater_demo.lua and test_luafloater_gesture_list.lua to find
their respective floater XUI files in the same directory as themselves.
Make them both capture the reqid returned by the "showLuaFloater" operation,
and filter for events bearing the same reqid. This paves the way for a given
script to display more than one floater concurrently.
Make test_luafloater_demo.lua (which does not require in-world resources) wait
until 'STATE_LOGIN_WAIT', the point at which the viewer has presented the
login screen.
Make test_luafloater_gesture_list.lua (which interacts with the agent) wait
until 'STATE_STARTED', the point at which the viewer is fully in world.
Either or both can now be launched from the viewer's command line.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|