diff options
author | Mnikolenko Productengine <mnikolenko@productengine.com> | 2024-04-29 19:56:41 +0300 |
---|---|---|
committer | Mnikolenko Productengine <mnikolenko@productengine.com> | 2024-04-29 19:56:41 +0300 |
commit | 76d36fe7210443b4564d2646a2fe5aa6d7c490fc (patch) | |
tree | fe7a62e7bf7cd2713ad5ee680dc398f675193ab1 | |
parent | 0868427913e0a1411bc857b227dad82414e42457 (diff) |
Allow getting the value of debug settings via Lua script
-rw-r--r-- | indra/newview/llappviewerlistener.cpp | 9 | ||||
-rw-r--r-- | indra/newview/llappviewerlistener.h | 1 | ||||
-rw-r--r-- | indra/newview/scripts/lua/LLDebugSettings.lua | 13 |
3 files changed, 23 insertions, 0 deletions
diff --git a/indra/newview/llappviewerlistener.cpp b/indra/newview/llappviewerlistener.cpp index bd0c6955b1..35732d8949 100644 --- a/indra/newview/llappviewerlistener.cpp +++ b/indra/newview/llappviewerlistener.cpp @@ -53,6 +53,10 @@ LLAppViewerListener::LLAppViewerListener(const LLAppViewerGetter& getter): add("setDebugSetting", "Apply specified [\"value\"] to the debug [\"setting\"] (this change won't persist across sessions)", &LLAppViewerListener::setDebugSetting, llsd::map("setting", LLSD(), "value", LLSD())); + + add("getDebugSetting", + "Return the value of specified debug [\"setting\"]", + &LLAppViewerListener::getDebugSetting, llsd::map("setting", LLSD(), "reply", LLSD())); } void LLAppViewerListener::requestQuit(const LLSD& event) @@ -75,3 +79,8 @@ void LLAppViewerListener::setDebugSetting(const LLSD &event) //don't save this change between sesssions gSavedSettings.setUntypedValue(setting_name, value, false); } + +void LLAppViewerListener::getDebugSetting(const LLSD &event) +{ + Response response(llsd::map("value", gSavedSettings.getLLSD(event["setting"])), event); +} diff --git a/indra/newview/llappviewerlistener.h b/indra/newview/llappviewerlistener.h index 8b38636bd1..897e4105ac 100644 --- a/indra/newview/llappviewerlistener.h +++ b/indra/newview/llappviewerlistener.h @@ -48,6 +48,7 @@ private: void forceQuit(const LLSD& event); void setDebugSetting(const LLSD &event); + void getDebugSetting(const LLSD &event); LLAppViewerGetter mAppViewerGetter; }; diff --git a/indra/newview/scripts/lua/LLDebugSettings.lua b/indra/newview/scripts/lua/LLDebugSettings.lua new file mode 100644 index 0000000000..71a12a2ca2 --- /dev/null +++ b/indra/newview/scripts/lua/LLDebugSettings.lua @@ -0,0 +1,13 @@ +leap = require 'leap' + +local LLDebugSettings = {} + +function LLDebugSettings.set(name, value) + leap.send('LLAppViewer', {op='setDebugSetting', setting=name, value=value}) +end + +function LLDebugSettings.get(name) + return leap.request('LLAppViewer', {op='getDebugSetting', setting=name})['value'] +end + +return LLDebugSettings |