Originally Posted by ZOS_DanBatson
I've added a GetNextBackpackUpgradePrice to the API. It'll go out with the next major version.
|
Awesome! Thank you.
For any other potential addon authors/tweakers who may be wondering how i'm currently getting the next upgrade price, see below.
Store the bag sizes and costs in an object.
Code:
myObj.bagSizes = {
[70] = 400,
[80] = 2000,
[90] = 5900,
[100] = 11000,
[110] = 19200,
[120] = 30700,
[130] = 46000,
[140] = 64500,
}
Get data on Riding stats and Inventory slots, and work out inventory size.
Code:
local inventoryBonus, maxInventoryBonus, staminaBonus, maxStaminaBonus, speedBonus, maxSpeedBonus = GetRidingStats()
local usedSlots, maxSlots = PLAYER_INVENTORY:GetNumSlots(INVENTORY_BACKPACK)
myObj.inventorySize = maxSlots - inventoryBonus
Check if our bagSizes object has an index 10 above the current bag size.
Code:
if( myObj.bagSizes[myObj.inventorySize+10] ~= nil ) then
myObj.nextBagUpgrade = myObj.bagSizes[myObj.inventorySize+10]
else
-- do or set something else
end
Function is coming in next major, the above should do until then.