summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorMnikolenko Productengine <mnikolenko@productengine.com>2024-02-21 17:11:33 +0200
committerMnikolenko Productengine <mnikolenko@productengine.com>2024-02-21 17:11:33 +0200
commit32bf9c7b7a9d2b2428b052d74389ec48ccc427cf (patch)
treec0ae90a35ab3c2b617f068119a1c8f1fe304c940 /indra/newview
parent3a9d0e7fa9214b5f802dd558d1e4c7154bbadb3e (diff)
Add the option to use clean lua_State in "Lua debug" floater
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llfloaterluadebug.cpp12
-rw-r--r--indra/newview/llfloaterluadebug.h1
-rw-r--r--indra/newview/skins/default/xui/en/floater_lua_debug.xml9
3 files changed, 22 insertions, 0 deletions
diff --git a/indra/newview/llfloaterluadebug.cpp b/indra/newview/llfloaterluadebug.cpp
index 7d56d8e618..2d9dc89340 100644
--- a/indra/newview/llfloaterluadebug.cpp
+++ b/indra/newview/llfloaterluadebug.cpp
@@ -27,6 +27,7 @@
#include "llfloaterluadebug.h"
+#include "llcheckboxctrl.h"
#include "lllineeditor.h"
#include "lltexteditor.h"
#include "llviewermenufile.h" // LLFilePickerReplyThread
@@ -79,6 +80,7 @@ void LLFloaterLUADebug::onExecuteClicked()
mResultOutput->setValue("");
std::string cmd = mLineInput->getText();
+ cleanLuaState();
LLLUAmanager::runScriptLine(mState, cmd, [this](int count, const LLSD& result)
{
completion(count, result);
@@ -109,6 +111,7 @@ void LLFloaterLUADebug::runSelectedScript(const std::vector<std::string> &filena
if (!filepath.empty())
{
mScriptPath->setText(filepath);
+ cleanLuaState();
LLLUAmanager::runScriptFile(mState, filepath, [this](int count, const LLSD& result)
{
completion(count, result);
@@ -140,3 +143,12 @@ void LLFloaterLUADebug::completion(int count, const LLSD& result)
sep = ", ";
}
}
+
+void LLFloaterLUADebug::cleanLuaState()
+{
+ if(getChild<LLCheckBoxCtrl>("clean_lua_state")->get())
+ {
+ //Reinit to clean lua_State
+ mState.initLuaState();
+ }
+}
diff --git a/indra/newview/llfloaterluadebug.h b/indra/newview/llfloaterluadebug.h
index 69b334ae2d..7418174570 100644
--- a/indra/newview/llfloaterluadebug.h
+++ b/indra/newview/llfloaterluadebug.h
@@ -58,6 +58,7 @@ class LLFloaterLUADebug :
private:
void completion(int count, const LLSD& result);
+ void cleanLuaState();
LLTempBoundListener mOutConnection;
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 f03739f7c2..a028a1802c 100644
--- a/indra/newview/skins/default/xui/en/floater_lua_debug.xml
+++ b/indra/newview/skins/default/xui/en/floater_lua_debug.xml
@@ -25,6 +25,15 @@
width="100">
LUA string:
</text>
+ <check_box
+ follows="left|bottom"
+ height="15"
+ label="Use clean lua_State"
+ layout="topleft"
+ top="10"
+ right ="-70"
+ name="clean_lua_state"
+ width="70"/>
<line_editor
border_style="line"
border_thickness="1"