@@ -292,6 +292,7 @@ local labelRows = {
292292 type = ' currency' ,
293293 key = 3008 ,
294294 abbMax = true ,
295+ warband = true ,
295296 group = ' currency' ,
296297 version = WOW_PROJECT_MAINLINE
297298 },
@@ -372,6 +373,24 @@ local labelRows = {
372373 version = WOW_PROJECT_MAINLINE
373374 },
374375
376+ -- 11.1.5
377+ eye_of_nzoth = {
378+ label = ' Eye of N\' Zoth' ,
379+ type = ' treecurrency' ,
380+ passRow = true ,
381+ key = 3728 ,
382+ maxQuantity = 13 ,
383+ group = ' currency' ,
384+ version = WOW_PROJECT_MAINLINE
385+ },
386+ displaced_corrupted_mementos = {
387+ label = ' Corrupted Mementos' ,
388+ type = ' currency' ,
389+ key = 3149 ,
390+ group = ' currency' ,
391+ version = WOW_PROJECT_MAINLINE
392+ },
393+
375394 -- wotlk-classic
376395 honorBCC = {
377396 label = function ()
@@ -525,6 +544,27 @@ local function UpdateAllCurrencies(charInfo)
525544 end
526545end
527546
547+ local function UpdateAllTreeCurrencies (charInfo )
548+ local self = PermoksAccountManager
549+ charInfo .treeCurrencyInfo = charInfo .treeCurrencyInfo or {}
550+
551+ local currencyInfo = charInfo .treeCurrencyInfo
552+ for treeID , treeInfo in pairs (self .currencyTrees ) do
553+
554+ local configID = C_Traits .GetConfigIDBySystemID (treeInfo .systemID )
555+ local treeCurrencyInfos = configID and C_Traits .GetTreeCurrencyInfo (configID , treeID , true )
556+
557+ if treeCurrencyInfos then
558+ for _ , treeCurrencyInfo in ipairs (treeCurrencyInfos ) do
559+ currencyInfo [treeCurrencyInfo .traitCurrencyID ] = charInfo .currencyInfo [treeCurrencyInfo .traitCurrencyID ] or {}
560+ currencyInfo [treeCurrencyInfo .traitCurrencyID ].quantity = treeCurrencyInfo .quantity
561+ currencyInfo [treeCurrencyInfo .traitCurrencyID ].maxQuantity = treeCurrencyInfo .maxQuantity
562+ currencyInfo [treeCurrencyInfo .traitCurrencyID ].spent = treeCurrencyInfo .spent
563+ end
564+ end
565+ end
566+ end
567+
528568local function SumWarbandCurrencies (warbandCurrency )
529569 local currencySum = 0
530570 for _ , alt in pairs (warbandCurrency ) do
564604
565605local function Update (charInfo )
566606 UpdateAllCurrencies (charInfo )
607+ UpdateAllTreeCurrencies (charInfo )
567608
568609 -- requesting the warband data has a slight server-delay
569610 if PermoksAccountManager .isRetail then
@@ -607,6 +648,23 @@ local function UpdateCurrency(charInfo, currencyType, quantity, quantityChanged)
607648 end
608649end
609650
651+ local function UpdateTreeCurrency (charInfo , treeID )
652+ local self = PermoksAccountManager
653+ if not self .currencyTrees [treeID ] then
654+ return
655+ end
656+
657+ local treeInfo = self .currencyTrees [treeID ]
658+ local currencyInfo = charInfo .treeCurrencyInfo [treeInfo .currencyType ]
659+
660+ local configID = C_Traits .GetConfigIDBySystemID (treeInfo .systemID )
661+ local treeCurrencyInfo = configID and C_Traits .GetTreeCurrencyInfo (configID , treeID , true )
662+ if treeCurrencyInfo then
663+ currencyInfo .quantity = treeCurrencyInfo .quantity
664+ currencyInfo .maxQuantity = treeCurrencyInfo .maxQuantity
665+ end
666+ end
667+
610668local function CurrencyTransferUpdate (charInfo )
611669 local self = PermoksAccountManager
612670 local accountData = self .account .data
@@ -709,6 +767,13 @@ local function CreateCofferKeyString(labelRow, currencyInfo, itemCounts)
709767 return PermoksAccountManager :CreateCurrencyString (keyInfo , nil , nil , nil , nil , nil , total )
710768end
711769
770+ local function CreateTreeCurrencyString (labelRow , currencyInfo )
771+ local info = currencyInfo and currencyInfo [labelRow .key ]
772+ if info then
773+ return PermoksAccountManager :CreateFractionString ((info .quantity or 0 ) + (info .spent or 0 ), labelRow .maxQuantity or 0 )
774+ end
775+ end
776+
712777local payload = {
713778 update = Update ,
714779 labels = labelRows ,
@@ -717,6 +782,7 @@ local payload = {
717782 [' PERKS_ACTIVITIES_UDPATED' ] = UpdateCatalystCharges ,
718783 [' ACCOUNT_CHARACTER_CURRENCY_DATA_RECEIVED' ] = UpdateAllWarbandCurrencies ,
719784 [' CURRENCY_TRANSFER_LOG_UPDATE' ] = CurrencyTransferUpdate ,
785+ [' TRAIT_TREE_CURRENCY_INFO_UPDATED' ] = UpdateTreeCurrency ,
720786 },
721787 share = {
722788 [UpdateCurrency ] = ' currencyInfo'
@@ -727,6 +793,7 @@ module:AddCustomLabelType('catalystcharges', CreateCatalystChargeString, nil, 'c
727793module :AddCustomLabelType (' crestcurrency' , CreateCrestString , nil , ' currencyInfo' )
728794module :AddCustomLabelType (' valor' , CreateValorString , nil , ' currencyInfo' )
729795module :AddCustomLabelType (' cofferkey' , CreateCofferKeyString , nil , ' currencyInfo' , ' itemCounts' )
796+ module :AddCustomLabelType (' treecurrency' , CreateTreeCurrencyString , nil , ' treeCurrencyInfo' )
730797
731798-- TODO Create a CreateIconString function instead of two functions for items and currencies
732799function PermoksAccountManager :CreateCurrencyString (currencyInfo , abbreviateCurrent , abbreviateMaximum , hideMaximum ,
0 commit comments