comparison Modules/Currency.lua @ 114:6748c98a6c6c

- Reworked OrderHallHandler triggers - OrderHallHandler minimializes hud info - WorldState currency headers have a unified font
author Nick@Zahhak
date Mon, 27 Mar 2017 00:39:29 -0400
parents 2105b6e5095f
children 8c94bee4fdfc
comparison
equal deleted inserted replaced
113:2105b6e5095f 114:6748c98a6c6c
83 elseif info.currencyID then 83 elseif info.currencyID then
84 local currencyID = info.currencyID 84 local currencyID = info.currencyID
85 frame.Update = function (block) 85 frame.Update = function (block)
86 debug('Update [Currency]') 86 debug('Update [Currency]')
87 local name, earned, texture, earnedThisWeek, weeklyMax, totalMax = GetCurrencyInfo(currencyID) 87 local name, earned, texture, earnedThisWeek, weeklyMax, totalMax = GetCurrencyInfo(currencyID)
88
88 block.Icon:SetTexture(texture) 89 block.Icon:SetTexture(texture)
89 block.Label:SetFormattedText("%d / %d", earned, totalMax) 90 block.Label:SetFormattedText("%d / %d", earned, totalMax)
90 block:SetWidth(block.Icon:GetWidth() + block.Label:GetStringWidth() + 6) 91 block:SetWidth(block.Icon:GetWidth() + block.Label:GetStringWidth() + 6)
91 return true 92 return true
92 end 93 end
184 if self.needsUpdate then 185 if self.needsUpdate then
185 self:Update() 186 self:Update()
186 end 187 end
187 end 188 end
188 189
190 function block:OnEnter()
191 if not InCombatLockdown() then
192 GameTooltip:SetOwner(self, "ANCHOR_BOTTOMRIGHT");
193 if self.currencyID then
194 GameTooltip:SetCurrencyTokenByID(self.currencyID);
195 else
196 GameTooltip:SetItemByID(self.itemID);
197 end
198 GameTooltip:Show();
199 end
200 end
201 function block:OnLeave()
202 if GameTooltip:IsOwned(self) then
203 GameTooltip_Hide()
204 end
205 end
206
189 function block:OnEvent(event, ...) 207 function block:OnEvent(event, ...)
190 print('|cFF0088FF<'..self.name..'>|r', 'OnEvent', event, ...) 208 print('|cFF0088FF<'..self.name..'>|r', 'OnEvent', event, ...)
191 self:Update() 209 self:Update()
192 end 210 end
193 211