diff options
author | Mnikolenko Productengine <mnikolenko@productengine.com> | 2024-07-05 16:03:51 +0300 |
---|---|---|
committer | Mnikolenko Productengine <mnikolenko@productengine.com> | 2024-07-05 16:03:51 +0300 |
commit | ece0f4eb566af937d724f60f934beb6dfcb4d493 (patch) | |
tree | f9f875a4ce16ec8c5528aa90d729d0ba8ebf96e4 /indra/newview/scripts/lua | |
parent | fb11243dd0b3445ae8ad03faf09927f542412b46 (diff) |
clean up and rename demo script
Diffstat (limited to 'indra/newview/scripts/lua')
-rw-r--r-- | indra/newview/scripts/lua/require/LLAppearance.lua | 28 | ||||
-rw-r--r-- | indra/newview/scripts/lua/test_LLAppearance.lua (renamed from indra/newview/scripts/lua/test_outfits_list.lua) | 8 |
2 files changed, 15 insertions, 21 deletions
diff --git a/indra/newview/scripts/lua/require/LLAppearance.lua b/indra/newview/scripts/lua/require/LLAppearance.lua index 165bb6d06f..f533d22daf 100644 --- a/indra/newview/scripts/lua/require/LLAppearance.lua +++ b/indra/newview/scripts/lua/require/LLAppearance.lua @@ -1,29 +1,23 @@ -leap = require 'leap' +local leap = require 'leap' local LLAppearance = {} -function LLAppearance.addOutfit(folder) - leap.request('LLAppearance', {op='wearOutfit', append = true, folder_id=folder}) +function LLAppearance.wearOutfit(folder, action) + action = action or 'add' + leap.request('LLAppearance', {op='wearOutfit', append = (action == 'add'), folder_id=folder}) end -function LLAppearance.replaceOutfit(folder) - leap.request('LLAppearance', {op='wearOutfit', append = false, folder_id=folder}) +function LLAppearance.wearOutfitByName(folder, action) + action = action or 'add' + leap.request('LLAppearance', {op='wearOutfit', append = (action == 'add'), folder_name=folder}) end -function LLAppearance.addOutfitByName(folder) - leap.request('LLAppearance', {op='wearOutfitByName', append = true, folder_name=folder}) +function LLAppearance.wearItems(items_id, replace) + leap.send('LLAppearance', {op='wearItems', replace = replace, items_id=items_id}) end -function LLAppearance.replaceOutfitByName(folder) - leap.request('LLAppearance', {op='wearOutfitByName', append = false, folder_name=folder}) -end - -function LLAppearance.wearItem(item_id, replace) - leap.send('LLAppearance', {op='wearItem', replace = replace, item_id=item_id}) -end - -function LLAppearance.detachItem(item_id) - leap.send('LLAppearance', {op='detachItem', item_id=item_id}) +function LLAppearance.detachItems(items_id) + leap.send('LLAppearance', {op='detachItems', items_id=items_id}) end function LLAppearance.getOutfitsList() diff --git a/indra/newview/scripts/lua/test_outfits_list.lua b/indra/newview/scripts/lua/test_LLAppearance.lua index 1011029f34..5ddd9f15ff 100644 --- a/indra/newview/scripts/lua/test_outfits_list.lua +++ b/indra/newview/scripts/lua/test_LLAppearance.lua @@ -82,17 +82,17 @@ end function flt:commit_replace_btn(event_data) if SHOW_OUTFITS then - LLAppearance.replaceOutfit(get_selected_id()) + LLAppearance.wearOutfit(get_selected_id(), 'replace') else - LLAppearance.wearItem(get_selected_id(), false) + LLAppearance.wearItems(get_selected_id(), false) end end function flt:commit_add_btn(event_data) if SHOW_OUTFITS then - LLAppearance.addOutfit(get_selected_id()) + LLAppearance.wearOutfit(get_selected_id(), 'add') else - LLAppearance.detachItem(get_selected_id()) + LLAppearance.detachItems(get_selected_id()) end end |