comparison Modules/Currency.lua @ 116:ddfe19d70a34

ArtifactPower: - Further 7.2 accommodations, relating to tokens that grant millions of AP. Currency: - Ancient Mana zones list expanded - Legionfall War Supplies, Nethershards, and Blood of Sargeras are tracked globally PaperDoll: - Should update more effectively when delayed artifact data loads in. WorldState: - Fixed hanging panels after OrderHallCommandBar is hidden.
author Nenue
date Wed, 26 Apr 2017 20:06:38 -0400
parents 8c94bee4fdfc
children b3c0258b419d
comparison
equal deleted inserted replaced
115:8c94bee4fdfc 116:ddfe19d70a34
20 } 20 }
21 21
22 local blocks = { 22 local blocks = {
23 ["Ancient Mana"] = { 23 ["Ancient Mana"] = {
24 currencyID = 1155, 24 currencyID = 1155,
25 showMax = true,
25 zones = { 26 zones = {
26 ['Suramar'] = true, 27 ['Suramar'] = true,
27 ["Sashj'tar Ruins"] = true, 28 ["Sashj'tar Ruins"] = true,
28 ["Faronaar Ruins"] = true 29 ["Faronaar Ruins"] = true,
29 } 30 ["Halls of the Eclipse"] = true,
31 ["Shal'aran"] = true,
32 ["The Fel Breach"] = true,
33 },
30 }, 34 },
31 ["Blood of Sargeras"] = { 35 ["Blood of Sargeras"] = {
32 itemID = 124124, 36 itemID = 124124,
37 },
38 ["Legionfall War Supplies"] = {
39 currencyID = 1342,
40 },
41 ["Nethershard"] = {
42 currencyID = 1226,
33 } 43 }
34 } 44 }
35 local items, currencies = {}, {} 45 local items, currencies = {}, {}
36 46
37 47
39 Blocks = {}, 49 Blocks = {},
40 HideCombat = true, 50 HideCombat = true,
41 EventList = {'PLAYER_ENTERING_WORLD'}, 51 EventList = {'PLAYER_ENTERING_WORLD'},
42 moduleName = 'Currency Watch', 52 moduleName = 'Currency Watch',
43 anchorPoint = 'TOP', 53 anchorPoint = 'TOP',
54 anchorPriority = 2,
44 } 55 }
45 VeneerCurrencyBlockMixin = {} 56 VeneerCurrencyBlockMixin = {}
46 local module = VeneerCurrencyMixin 57 local module = VeneerCurrencyMixin
47 local block = VeneerCurrencyBlockMixin 58 local block = VeneerCurrencyBlockMixin
48 59
90 frame.Update = function (block) 101 frame.Update = function (block)
91 debug('Update [Currency]') 102 debug('Update [Currency]')
92 local name, earned, texture, earnedThisWeek, weeklyMax, totalMax = GetCurrencyInfo(currencyID) 103 local name, earned, texture, earnedThisWeek, weeklyMax, totalMax = GetCurrencyInfo(currencyID)
93 104
94 block.Icon:SetTexture(texture) 105 block.Icon:SetTexture(texture)
95 block.Label:SetFormattedText("%d / %d", earned, totalMax) 106 if self.showMax then
107 block.Label:SetFormattedText("%d / %d", earned, totalMax)
108 else
109 block.Label:SetFormattedText("%d", earned)
110 end
111
96 block:SetWidth(block.Icon:GetWidth() + block.Label:GetStringWidth() + 6) 112 block:SetWidth(block.Icon:GetWidth() + block.Label:GetStringWidth() + 6)
97 return true 113 return true
98 end 114 end
99 115
100 RegisterEvents(frame, currencyEvents) 116 RegisterEvents(frame, currencyEvents)