diff options
Diffstat (limited to 'indra/newview/scripts/lua/LLDebugSettings.lua')
-rw-r--r-- | indra/newview/scripts/lua/LLDebugSettings.lua | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/indra/newview/scripts/lua/LLDebugSettings.lua b/indra/newview/scripts/lua/LLDebugSettings.lua new file mode 100644 index 0000000000..c1d74fe00a --- /dev/null +++ b/indra/newview/scripts/lua/LLDebugSettings.lua @@ -0,0 +1,24 @@ +leap = require 'leap' + +local function check_response(res) + if res.error then + error(res.error) + end + return res +end + +local LLDebugSettings = {} + +function LLDebugSettings.set(name, value) + check_response(leap.request('LLViewerControl', {op='set', group='Global', key=name, value=value})) +end + +function LLDebugSettings.toggle(name) + check_response(leap.request('LLViewerControl', {op='toggle', group='Global', key=name})) +end + +function LLDebugSettings.get(name) + return check_response(leap.request('LLViewerControl', {op='get', group='Global', key=name}))['value'] +end + +return LLDebugSettings |