summaryrefslogtreecommitdiff
path: root/indra/newview/scripts/lua/test_luafloater_gesture_list.lua
blob: 5f929c0d0c804ca430df61550ca55a59c5e3e6a4 (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
25
26
27
local LLGesture = require 'LLGesture'
local startup = require 'startup'
local UI = require 'UI'

local flt = UI.Floater(
    "luafloater_gesture_list.xml",
    {gesture_list = {"double_click"}})

function flt:post_build(event_data)
    local gestures_uuid = LLGesture.getActiveGestures()
    local action_data = {}
    action_data.action = "add_list_element"
    action_data.ctrl_name = "gesture_list"
    local gestures = {}
    for uuid, info in pairs(gestures_uuid) do
      table.insert(gestures, {value = uuid, columns={column = "gesture_name", value = info.name}})
    end
    action_data.value = gestures
    self:post(action_data)
end

function flt:double_click_gesture_list(event_data)
    LLGesture.startGesture(event_data.value)
end

startup.wait('STATE_STARTED')
flt:show()