summaryrefslogtreecommitdiff
path: root/indra/newview/llappviewerlistener.cpp
diff options
context:
space:
mode:
authorMnikolenko Productengine <mnikolenko@productengine.com>2024-04-29 16:24:43 +0300
committerMnikolenko Productengine <mnikolenko@productengine.com>2024-04-29 16:24:43 +0300
commit0868427913e0a1411bc857b227dad82414e42457 (patch)
tree534192cfed60752fa0f1d78a83e13fc066d81444 /indra/newview/llappviewerlistener.cpp
parent6d860672ec3e05660844a40c56b8644130a1f6b6 (diff)
Allow changing debug settings via Lua script
Diffstat (limited to 'indra/newview/llappviewerlistener.cpp')
-rw-r--r--indra/newview/llappviewerlistener.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/indra/newview/llappviewerlistener.cpp b/indra/newview/llappviewerlistener.cpp
index 2380a8ebf0..bd0c6955b1 100644
--- a/indra/newview/llappviewerlistener.cpp
+++ b/indra/newview/llappviewerlistener.cpp
@@ -35,6 +35,7 @@
// external library headers
// other Linden headers
#include "llappviewer.h"
+#include "llviewercontrol.h"
LLAppViewerListener::LLAppViewerListener(const LLAppViewerGetter& getter):
LLEventAPI("LLAppViewer",
@@ -48,6 +49,10 @@ LLAppViewerListener::LLAppViewerListener(const LLAppViewerGetter& getter):
add("forceQuit",
"Quit abruptly",
&LLAppViewerListener::forceQuit);
+
+ add("setDebugSetting",
+ "Apply specified [\"value\"] to the debug [\"setting\"] (this change won't persist across sessions)",
+ &LLAppViewerListener::setDebugSetting, llsd::map("setting", LLSD(), "value", LLSD()));
}
void LLAppViewerListener::requestQuit(const LLSD& event)
@@ -61,3 +66,12 @@ void LLAppViewerListener::forceQuit(const LLSD& event)
LL_INFOS() << "Listener requested force quit" << LL_ENDL;
mAppViewerGetter()->forceQuit();
}
+
+void LLAppViewerListener::setDebugSetting(const LLSD &event)
+{
+ auto setting_name = event["setting"].asString();
+ auto value = event["value"];
+ LL_WARNS("LLAppViewerListener") << "Changing debug setting \"" << setting_name << "\" to " << value << LL_ENDL;
+ //don't save this change between sesssions
+ gSavedSettings.setUntypedValue(setting_name, value, false);
+}