From de61551df3219dae2238591bae5fa7b6c857e6b0 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Sat, 30 Sep 2023 11:51:09 -0400 Subject: DRTVWR-589: Emulate print() better, show output on Lua floater. 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. --- indra/newview/skins/default/xui/en/floater_lua_debug.xml | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview/skins/default/xui/en/floater_lua_debug.xml') diff --git a/indra/newview/skins/default/xui/en/floater_lua_debug.xml b/indra/newview/skins/default/xui/en/floater_lua_debug.xml index 0de26161e7..f03739f7c2 100644 --- a/indra/newview/skins/default/xui/en/floater_lua_debug.xml +++ b/indra/newview/skins/default/xui/en/floater_lua_debug.xml @@ -55,6 +55,7 @@ layout="topleft" name="result_text" follows="left|top" + max_length="65536" width="515" top_delta="40" word_wrap="true" /> -- cgit v1.2.3