diff options
author | Nat Goodspeed <nat@lindenlab.com> | 2023-09-30 11:51:09 -0400 |
---|---|---|
committer | Nat Goodspeed <nat@lindenlab.com> | 2023-09-30 11:51:09 -0400 |
commit | de61551df3219dae2238591bae5fa7b6c857e6b0 (patch) | |
tree | f862de93761661afba4cd3299507b3e6f2ebfd8d /indra/llui | |
parent | 48dc344a9e65451c9e2b267fba7d3e01bdbbf801 (diff) |
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.
Diffstat (limited to 'indra/llui')
-rw-r--r-- | indra/llui/lltexteditor.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/indra/llui/lltexteditor.h b/indra/llui/lltexteditor.h index f3939248c2..ec2b9a4b7d 100644 --- a/indra/llui/lltexteditor.h +++ b/indra/llui/lltexteditor.h @@ -241,7 +241,9 @@ protected: // Undoable operations void addChar(llwchar c); // at mCursorPos S32 addChar(S32 pos, llwchar wc); +public: void addLineBreakChar(BOOL group_together = FALSE); +protected: S32 overwriteChar(S32 pos, llwchar wc); void removeChar(); S32 removeChar(S32 pos); |