summaryrefslogtreecommitdiff
path: root/indra/newview/scripts/lua/test_outfits_list.lua
diff options
context:
space:
mode:
authorMnikolenko Productengine <mnikolenko@productengine.com>2024-06-21 17:42:45 +0300
committerMnikolenko Productengine <mnikolenko@productengine.com>2024-06-21 17:42:45 +0300
commitb8e0c16ab1eb3cdd1d11e869bd3fd6196de51d4b (patch)
treeb144db5b438b02a112cd4371fd9dda62abe38c9e /indra/newview/scripts/lua/test_outfits_list.lua
parentb16209f86a376cadfcc9f43604618de7fdc789e7 (diff)
Add Appearance listener
Diffstat (limited to 'indra/newview/scripts/lua/test_outfits_list.lua')
-rw-r--r--indra/newview/scripts/lua/test_outfits_list.lua27
1 files changed, 27 insertions, 0 deletions
diff --git a/indra/newview/scripts/lua/test_outfits_list.lua b/indra/newview/scripts/lua/test_outfits_list.lua
new file mode 100644
index 0000000000..5875fd51da
--- /dev/null
+++ b/indra/newview/scripts/lua/test_outfits_list.lua
@@ -0,0 +1,27 @@
+local Floater = require 'Floater'
+local LLAppearance = require 'LLAppearance'
+local startup = require 'startup'
+
+local flt = Floater:new(
+ "luafloater_outfits_list.xml",
+ {outfits_list = {"double_click"}})
+
+function flt:post_build(event_data)
+ local outfits_map = LLAppearance.getOutfitsList()
+ local action_data = {}
+ action_data.action = "add_list_element"
+ action_data.ctrl_name = "outfits_list"
+ local outfits = {}
+ for uuid, name in pairs(outfits_map) do
+ table.insert(outfits, {value = uuid, columns={column = "outfit_name", value = name}})
+ end
+ action_data.value = outfits
+ self:post(action_data)
+end
+
+function flt:double_click_outfits_list(event_data)
+ LLAppearance.replaceOutfit(event_data.value)
+end
+
+startup.wait('STATE_STARTED')
+flt:show()