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 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 |
local STORE_ITEM_HEADER_DEFAULT_PADDING = 60
local STORE_ITEM_HEADER_SELECTED_DEFAULT_PADDING = 0
local STABLE_ITEM_POST_PADDING = 20
local STORE_WEAPON_GROUP = 1
local STORE_HEAVY_ARMOR_GROUP = 2
local STORE_MEDIUM_ARMOR_GROUP = 3
local STORE_LIGHT_ARMOR_GROUP = 4
local STORE_JEWELRY_GROUP = 5
local STORE_SUPPLIES_GROUP = 6
local STORE_MATERIALS_GROUP = 7
local STORE_QUICKSLOTS_GROUP = 8
local STORE_COLLECTIBLE_GROUP = 9
local STORE_QUEST_ITEMS_GROUP = 10
local STORE_OTHER_GROUP = 11
local groupCategoryDictionary = {
[ STORE_WEAPON_GROUP ] = GAMEPAD_ITEM_CATEGORY_WEAPONS ,
[ STORE_HEAVY_ARMOR_GROUP ] = GAMEPAD_ITEM_CATEGORY_HEAVY_ARMOR ,
[ STORE_MEDIUM_ARMOR_GROUP ] = GAMEPAD_ITEM_CATEGORY_MEDIUM_ARMOR ,
[ STORE_LIGHT_ARMOR_GROUP ] = GAMEPAD_ITEM_CATEGORY_LIGHT_ARMOR ,
[ STORE_JEWELRY_GROUP ] = GAMEPAD_ITEM_CATEGORY_JEWELRY
}
-------------------
--Utility functions
-------------------
if itemData . entryType == STORE_ENTRY_TYPE_COLLECTIBLE then
return STORE_COLLECTIBLE_GROUP
elseif itemData . entryType == STORE_ENTRY_TYPE_QUEST_ITEM then
return STORE_QUEST_ITEMS_GROUP
elseif itemData . equipType == EQUIP_TYPE_RING or itemData . equipType == EQUIP_TYPE_NECK then
return STORE_JEWELRY_GROUP
elseif itemData . itemType == ITEMTYPE_WEAPON or itemData . displayFilter == ITEMFILTERTYPE_WEAPONS then
return STORE_WEAPON_GROUP
elseif itemData . itemType == ITEMTYPE_ARMOR or itemData . displayFilter == ITEMFILTERTYPE_ARMOR then
local armorType
if itemData . bagId and itemData . slotIndex then
else
end
if armorType == ARMORTYPE_HEAVY then
return STORE_HEAVY_ARMOR_GROUP
elseif armorType == ARMORTYPE_MEDIUM then
return STORE_MEDIUM_ARMOR_GROUP
elseif armorType == ARMORTYPE_LIGHT then
return STORE_LIGHT_ARMOR_GROUP
end
return STORE_SUPPLIES_GROUP
return STORE_MATERIALS_GROUP
return STORE_QUICKSLOTS_GROUP
end
return STORE_OTHER_GROUP
end
if itemData . storeGroup == STORE_COLLECTIBLE_GROUP then
elseif itemData . storeGroup == STORE_QUEST_ITEMS_GROUP then
else
end
end
local defaultSortKeys =
{
bestGamepadItemCategoryName = { tiebreaker = "name" } ,
requiredLevel = { tiebreaker = "requiredChampionPoints" , isNumeric = true } ,
requiredChampionPoints = { tiebreaker = "iconFile" , isNumeric = true } ,
iconFile = { tiebreaker = "uniqueId" } ,
uniqueId = { isId64 = true } ,
}
return ZO_TableOrderingFunction ( data1 , data2 , "bestGamepadItemCategoryName" , defaultSortKeys , ZO_SORT_ORDER_UP )
end
local BagSortKeys =
{
bagId = { tiebreaker = "name" , isNumeric = true } ,
}
end
local displayFilter = ITEMFILTERTYPE_MISCELLANEOUS
if filter >= ITEMFILTERTYPE_WEAPONS and filter <= ITEMFILTERTYPE_MISCELLANEOUS then
displayFilter = filter
break
end
end
return displayFilter
end
--- Gamepad versions have extra data / differently named values in templates
itemData . pressedIcon = itemData . icon
itemData . stackCount = itemData . stack
itemData . sellPrice = itemData . price
if itemData . sellPrice == 0 then
itemData . sellPrice = itemData . stackBuyPriceCurrency1
end
itemData . unselectedNameColor = ZO_DISABLED_TEXT
if itemData . entryType == STORE_ENTRY_TYPE_COLLECTIBLE then
end
end
return items
end
local unequippedItems = { }
--- Setup sort filter
if itemData . bagId ~= BAG_WORN and not itemData . stolen and not itemData . isPlayerLocked then
itemData . isEquipped = false
itemData . meetsRequirementsToBuy = true
itemData . meetsRequirementsToEquip = itemData . meetsUsageRequirements
end
end
return unequippedItems
end
local bagId = BAG_BUYBACK
local items = { }
local icon , name , stackCount , price , quality , meetsRequirementsToEquip = GetBuybackItemInfo ( entryIndex )
if ( stackCount > 0 ) then
local totalPrice = price * stackCount
local buybackData =
{
slotIndex = entryIndex ,
icon = icon ,
stackCount = stackCount ,
price = price ,
sellPrice = totalPrice ,
quality = quality ,
meetsRequirementsToBuy = true ,
meetsRequirementsToEquip = meetsRequirementsToEquip ,
stackBuyPrice = totalPrice ,
bagId = bagId ,
itemLink = itemLink ,
itemType = itemType ,
}
end
end
return items
end
local slotType = SLOT_TYPE_REPAIR
for slotIndex = 0 , bagSlots - 1 do
if stackCount > 0 then
if repairCost > 0 then
damagedItem . condition = condition
damagedItem . repairCost = repairCost
damagedItem . isEquippedInCurrentCategory = damagedItem . bagId == BAG_WORN
end
end
end
end
end
local items = { }
return items
end
-- optFilterFunction is an optional additional check to make when gathering all the stolen items
-- ... are bag ids to get items from
local isStolen = itemData . stolen
else
return isStolen
end
end
local unequippedItems = { }
--- Setup sort filter
itemData . isEquipped = false
itemData . meetsRequirementsToBuy = true
itemData . meetsRequirementsToEquip = itemData . meetsUsageRequirements
end
return unequippedItems
end
return itemData . sellPrice > 0
end
-- can't sell stolen things from BAG_WORN so just check BACKPACK
end
local NO_ADDED_FILTER = nil
end
local TRAIN_ORDER = { RIDING_TRAIN_SPEED , RIDING_TRAIN_STAMINA , RIDING_TRAIN_CARRYING_CAPACITY }
local items = { }
for i = 1 , # TRAIN_ORDER do
local trainingType = TRAIN_ORDER [ i ]
local extraData =
{
trainingType = trainingType ,
bonus = bonus ,
maxBonus = maxBonus ,
isSkillTrainable = canBeTrained and ( bonus < maxBonus ) ,
}
local itemData =
{
iconFile = STABLE_TRAINING_TEXTURES_GAMEPAD [ trainingType ] ,
bestGamepadItemCategoryName = header ,
ignoreStoreVisualInit = true ,
}
end
return items , 0 , STABLE_ITEM_POST_PADDING
end
--When using the ItemSortFunc, you'll want to ensure that your updateFunc provides an itemData.bestGamepadItemCategoryName
--When using the BagItemSortFunc you'll want to ensure that your updateFunc does *NOT* provide an itemData.bestGamepadItemCategoryName
--Typically bestGamepadItemCategoryName is acquired like so:
--e.g.: itemData.storeGroup = GetItemStoreGroup(itemData, IS_STORE_ITEM)
-- itemData.bestGamepadItemCategoryName = GetBestItemCategoryDescription(itemData)
local MODE_TO_UPDATE_FUNC = {
}
function ZO_GamepadStoreList : New ( control , mode , setupFunction , overrideTemplate , overrideHeaderTemplateSetupFunction )
return object
end
local function VendorEntryHeaderTemplateSetup ( control , data , selected , selectedDuringRebuild , enabled , activated )
end
function ZO_GamepadStoreList : SetMode ( mode , setupFunction , overrideTemplate , overrideHeaderTemplateSetupFunction )
self . storeMode = mode
self . sortFunc = MODE_TO_UPDATE_FUNC [ mode ] . sortFunc
self . template = overrideTemplate or "ZO_GamepadPricedVendorItemEntryTemplate"
local headerTemplateSetupFunction = overrideHeaderTemplateSetupFunction or VendorEntryHeaderTemplateSetup
self : AddDataTemplate ( self . template , setupFunction , ZO_GamepadMenuEntryTemplateParametricListFunction )
self : AddDataTemplateWithHeader ( self . template , setupFunction , ZO_GamepadMenuEntryTemplateParametricListFunction , nil , "ZO_GamepadMenuEntryHeaderTemplate" , headerTemplateSetupFunction )
end
local currentBestCategoryName = nil
local nextItemData = items [ i + 1 ]
local isNextEntryAHeader = nextItemData and nextItemData . bestGamepadItemCategoryName ~= itemData . bestGamepadItemCategoryName
local postPadding = postPaddingOverride or ( isNextEntryAHeader and STORE_ITEM_HEADER_DEFAULT_PADDING )
--This is only used by stables
if not itemData . ignoreStoreVisualInit then
end
if itemData . locked then
end
if itemData . bestGamepadItemCategoryName and itemData . bestGamepadItemCategoryName ~= currentBestCategoryName then
currentBestCategoryName = itemData . bestGamepadItemCategoryName
else
end
end
end
if self . sortFunc then
end
end |