summaryrefslogtreecommitdiff
path: root/indra/newview/scripts/lua/LLDebugSettings.lua
blob: c809dfff91aa3c080ec1854dc9574ace5707b020 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
leap = require 'leap'

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