summaryrefslogtreecommitdiff
path: root/indra/newview/llfloaterluadebug.h
AgeCommit message (Collapse)Author
2024-02-21Add the option to use clean lua_State in "Lua debug" floaterMnikolenko Productengine
2024-02-09Make LLFloaterLUADebug store a persistent LuaState.Nat Goodspeed
That means that as you use the floater, variables that you assign and functions that you define are available to subsequent Lua chunks.
2024-02-09When LLFloaterLUADebug script returns a value, display the value.Nat Goodspeed
The chunk: return 1, 2, {} differs in two ways from: print(1, 2, {}) First, print() engages the Lua tostring() builtin, so it displays values as Lua sees them. (For a table, tostring() displays "table: hex", which isn't so wonderful.) But LLFloaterLUADebug serializes the LLSD converted from the Lua return values. Second, we've overridden print() to engage a function that writes to the viewer log as well as displaying to LLFloaterLUADebug. (As we go forward, most Lua scripts won't be run manually by LLFloaterLUADebug.) The values returned by a Lua chunk aren't implicitly logged. Each C++ caller wanting to evaluate a Lua expression can choose whether to log the results.
2024-01-26DRTVWR-589: update to start using Luau libsMnikolenko Productengine
2023-09-30DRTVWR-589: Emulate print() better, show output on Lua floater.Nat Goodspeed
Break out a lua_print_msg() function common to print_debug(), print_info() and print_warning(). Instead of accepting a single argument, lua_print_msg() accepts arbitrary arguments, passing each to the Lua tostring() function and concatenating the results. In addition to returning the combined string to its caller for level-appropriate logging, it also posts the message to a "lua output" LLEventPump for any interested party. Make LLFloaterLUADebug listen on "lua output" when the floater is constructed, storing the connection in an LLTempBoundListener to stop listening when the floater is destroyed. Append each message to the floater's output panel with a line break. Make LLTextEditor::addLineBreakChar() public. insertText("\n") only appends a little rectangle glyph. Enlarge the text capacity of the floater's output panel to be able to report whatever messages a Lua script wants to print. Add diagnostic logging for posting events from Lua, and receiving events to forward to Lua. Since lua_pop() is a macro implemented on lua_settop(), replace the awkward construct lua_pop(L, lua_gettop(L)) with lua_settop(L, 0). Use lambdas instead of std::bind() to connect LuaListener and LLLeapListener.
2023-09-15DRTVWR-589 - lua file browser added run button to allow re-running same scriptBrad Payne (Vir Linden)
2023-09-05Initial prototype of embedded LUAMnikolenko Productengine