summaryrefslogtreecommitdiff
path: root/indra/newview/scripts/lua/LLDebugSettings.lua
blob: c1d74fe00a643d5a7bf08ec3cd299d4c91fb198c (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'

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