View Single Post
09/04/21, 06:18 PM   #1
Leonardo1123
AddOn Author - Click to view addons
Join Date: Aug 2021
Posts: 19
Acessing list of unlocked costumes / polymorphs?

Hey all,

I'm working on my wardrobe mod and I want to expand it from only outfits to also have support for costumes and polymorphs. The LAM work is going to be enough of an uphill battle, but I'm actually stuck on simply searching for collectibles.

The closes thing I found to a cohesive solution is this post about querying unlocked mounts. Could this be tweaked to return costumes and polys? I couldn't find great documentation on how to work with collectibles... Code linked below:

Lua Code:
  1. --Table will contain [collectibleIdOfOwnedMount] = "Mount name",
  2.     local MountData = {}
  3.  
  4.     local function IsNotMountCategory(categoryData)
  5.         return not categoryData:IsOutfitStylesCategory() and not categoryData:IsHousingCategory()
  6.     end
  7.  
  8.     local function IsMount(collectibleData)
  9.         return collectibleData:IsCategoryType(COLLECTIBLE_CATEGORY_TYPE_MOUNT)
  10.     end
  11.  
  12.     --Iterate over the main categories and do not use outfits or houses
  13.     for idx, categoryData in ZO_COLLECTIBLE_DATA_MANAGER:CategoryIterator({IsNotMountCategory}) do
  14.         --Iterate over the sub-categories of the current main category and do not use outfits or houses
  15.         for _, subCategoryData in categoryData:SubcategoryIterator({IsNotMountCategory}) do
  16.             --Iterate over the sub-categorie's collectibles and only check for mounts collectible type
  17.             for _, subCatCollectibleData in subCategoryData:CollectibleIterator({IsMount}) do
  18.                 --Check if the mount is owned/unlocked and not blocked
  19.                 if subCatCollectibleData:IsUnlocked() and not subCatCollectibleData:IsBlocked() then
  20.                     MountData[subCatCollectibleData:GetId()] = subCatCollectibleData:GetFormattedName()
  21.                 end
  22.             end
  23.         end
  24.     end
  Reply With Quote