From 850bdf4ce335049a75e1c4f6400b627bf328a264 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Tue, 22 Oct 2024 15:03:19 +0300 Subject: #2245 Allow Lua scripts to be run from the Conversations floater --- indra/newview/llfloaterimnearbychat.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'indra') diff --git a/indra/newview/llfloaterimnearbychat.cpp b/indra/newview/llfloaterimnearbychat.cpp index 6c3e8391cd..b580b19b19 100644 --- a/indra/newview/llfloaterimnearbychat.cpp +++ b/indra/newview/llfloaterimnearbychat.cpp @@ -55,6 +55,7 @@ #include "llfloaterimnearbychatlistener.h" #include "llagent.h" // gAgent #include "llgesturemgr.h" +#include "llluamanager.h" #include "llmultigesture.h" #include "llkeyboard.h" #include "llanimationstates.h" @@ -69,6 +70,7 @@ #include "lltranslate.h" #include "llautoreplace.h" #include "lluiusage.h" +#include S32 LLFloaterIMNearbyChat::sLastSpecialChatChannel = 0; @@ -606,6 +608,13 @@ void LLFloaterIMNearbyChat::sendChat( EChatType type ) if(!LLGestureMgr::instance().triggerAndReviseString(utf8text, &utf8_revised_text)) { utf8_revised_text = utf8text; + // check if the message is /filename.lua and execute the Lua script + static const boost::regex is_lua_script("^/.*\\.luau?$"); + if (boost::regex_match(utf8text, is_lua_script)) + { + LLLUAmanager::runScriptFile(utf8text.substr(1)); + utf8_revised_text.clear(); + } } } else -- cgit v1.2.3 From 5484f34f9945a6f0060dd74d07ff2701d393f37b Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Fri, 25 Oct 2024 16:56:58 +0300 Subject: #2245 allow passing command-line arguments --- indra/newview/llfloaterimnearbychat.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'indra') diff --git a/indra/newview/llfloaterimnearbychat.cpp b/indra/newview/llfloaterimnearbychat.cpp index b580b19b19..f108b5198e 100644 --- a/indra/newview/llfloaterimnearbychat.cpp +++ b/indra/newview/llfloaterimnearbychat.cpp @@ -37,6 +37,7 @@ #include "llfloatersidepanelcontainer.h" #include "llfocusmgr.h" #include "lllogchat.h" +#include "llregex.h" #include "llresizebar.h" #include "llresizehandle.h" #include "lldraghandle.h" @@ -70,7 +71,6 @@ #include "lltranslate.h" #include "llautoreplace.h" #include "lluiusage.h" -#include S32 LLFloaterIMNearbyChat::sLastSpecialChatChannel = 0; @@ -609,8 +609,8 @@ void LLFloaterIMNearbyChat::sendChat( EChatType type ) { utf8_revised_text = utf8text; // check if the message is /filename.lua and execute the Lua script - static const boost::regex is_lua_script("^/.*\\.luau?$"); - if (boost::regex_match(utf8text, is_lua_script)) + static const boost::regex is_lua_script("^/.*\\.luau?(?:\\s+\\S+)*$"); + if (ll_regex_match(utf8text, is_lua_script)) { LLLUAmanager::runScriptFile(utf8text.substr(1)); utf8_revised_text.clear(); -- cgit v1.2.3