diff options
author | Mnikolenko Productengine <mnikolenko@productengine.com> | 2024-10-22 15:03:19 +0300 |
---|---|---|
committer | Mnikolenko Productengine <mnikolenko@productengine.com> | 2024-10-22 15:03:19 +0300 |
commit | 850bdf4ce335049a75e1c4f6400b627bf328a264 (patch) | |
tree | 5de2dae9a233c99d42f8e7276013bc4509861bed /indra | |
parent | a86c53c212f9c80f710477816dccda9abce576ef (diff) |
#2245 Allow Lua scripts to be run from the Conversations floater
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llfloaterimnearbychat.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
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 <boost/regex.hpp> 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 |