summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/newview/llinventorylistener.cpp6
-rw-r--r--indra/newview/scripts/lua/test_animation.lua18
2 files changed, 13 insertions, 11 deletions
diff --git a/indra/newview/llinventorylistener.cpp b/indra/newview/llinventorylistener.cpp
index 79726c3e0b..88b07c0b0b 100644
--- a/indra/newview/llinventorylistener.cpp
+++ b/indra/newview/llinventorylistener.cpp
@@ -116,7 +116,8 @@ struct CatResultSet: public LL::ResultSet
LLSD getSingle(int index) const override
{
auto cat = mCategories[index];
- return llsd::map("name", cat->getName(),
+ return llsd::map("id", cat->getUUID(),
+ "name", cat->getName(),
"parent_id", cat->getParentUUID(),
"type", LLFolderType::lookup(cat->getPreferredType()));
}
@@ -133,7 +134,8 @@ struct ItemResultSet: public LL::ResultSet
LLSD getSingle(int index) const override
{
auto item = mItems[index];
- return llsd::map("name", item->getName(),
+ return llsd::map("id", item->getUUID(),
+ "name", item->getName(),
"parent_id", item->getParentUUID(),
"desc", item->getDescription(),
"inv_type", LLInventoryType::lookup(item->getInventoryType()),
diff --git a/indra/newview/scripts/lua/test_animation.lua b/indra/newview/scripts/lua/test_animation.lua
index 37e7254a6c..ae5eabe148 100644
--- a/indra/newview/scripts/lua/test_animation.lua
+++ b/indra/newview/scripts/lua/test_animation.lua
@@ -7,8 +7,8 @@ animations_id = LLInventory.getBasicFolderID('animatn')
anims = LLInventory.collectDescendentsIf{folder_id=animations_id, type="animatn"}.items
local anim_ids = {}
-for key in pairs(anims) do
- table.insert(anim_ids, key)
+for _, key in pairs(anims) do
+ table.insert(anim_ids, {id = key.id, name = key.name})
end
if #anim_ids == 0 then
@@ -16,17 +16,17 @@ if #anim_ids == 0 then
else
-- Start playing a random animation
math.randomseed(os.time())
- local random_id = anim_ids[math.random(#anim_ids)]
- local anim_info = LLAgent.getAnimationInfo(random_id)
+ local random_anim = anim_ids[math.random(#anim_ids)]
+ local anim_info = LLAgent.getAnimationInfo(random_anim.id)
- print("Starting animation locally: " .. anims[random_id].name)
- print("Loop: " .. anim_info.is_loop .. " Joints: " .. anim_info.num_joints .. " Duration " .. tonumber(string.format("%.2f", anim_info.duration)))
- LLAgent.playAnimation{item_id=random_id}
+ print("Starting animation locally: " .. random_anim.name)
+ print("Loop: " .. tostring(anim_info.is_loop) .. " Joints: " .. anim_info.num_joints .. " Duration " .. tonumber(string.format("%.2f", anim_info.duration)))
+ LLAgent.playAnimation{item_id=random_anim.id}
-- Stop animation after 3 sec if it's looped or longer than 3 sec
- if anim_info.is_loop == 1 or anim_info.duration > 3 then
+ if anim_info.is_loop or anim_info.duration > 3 then
LL.sleep(3)
print("Stop animation.")
- LLAgent.stopAnimation(random_id)
+ LLAgent.stopAnimation(random_anim.id)
end
end