summaryrefslogtreecommitdiff
path: root/indra/newview/scripts/lua/test_luafloater_gesture_list2.lua
blob: d702d09c5156d177268e76d806cc5e1bbd977682 (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 Floater = require 'Floater'
local LLGesture = require 'LLGesture'
local startup = require 'startup'

local flt = Floater:new(
    "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()