From 0f00dc2f658869cc73a18b03b024a6cc88964e0b Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Wed, 22 May 2024 20:29:55 +0300 Subject: Add support for sending messages to Nearby chat from Lua script --- indra/llui/llchat.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'indra/llui') diff --git a/indra/llui/llchat.h b/indra/llui/llchat.h index 56105add7e..8fd92c2550 100644 --- a/indra/llui/llchat.h +++ b/indra/llui/llchat.h @@ -89,7 +89,8 @@ public: mPosAgent(), mURL(), mChatStyle(CHAT_STYLE_NORMAL), - mSessionID() + mSessionID(), + mIsScript(false) { } std::string mText; // UTF-8 line of text @@ -107,6 +108,9 @@ public: std::string mURL; EChatStyle mChatStyle; LLUUID mSessionID; + + bool mIsScript; }; +static const std::string LUA_PREFIX("[LUA]"); #endif -- cgit v1.2.3 From b0ef843fe0702482e843379b4975b2dda4d58935 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Fri, 24 May 2024 09:22:40 -0400 Subject: Nat's ideas from PR #1547 --- indra/llui/llchat.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'indra/llui') diff --git a/indra/llui/llchat.h b/indra/llui/llchat.h index 8fd92c2550..70d7e82970 100644 --- a/indra/llui/llchat.h +++ b/indra/llui/llchat.h @@ -113,4 +113,17 @@ public: }; static const std::string LUA_PREFIX("[LUA]"); +inline +std::string without_LUA_PREFIX(const std::string& string, bool is_lua) +{ + if (is_lua) + { + return string.substr(LUA_PREFIX.size()); + } + else + { + return string; + } +} + #endif -- cgit v1.2.3