Mercurial > wow > buffalo2
comparison Modules/OrderHall.lua @ 83:4ec4fd89fced
- order of operations regarding frame visibility checking
- interaction with WorldPlan OrderHall module
- fancy shmancy transition fades resulting from above
| author | Nenue |
|---|---|
| date | Tue, 18 Oct 2016 01:57:02 -0400 |
| parents | be813a9d99c0 |
| children |
comparison
equal
deleted
inserted
replaced
| 82:be813a9d99c0 | 83:4ec4fd89fced |
|---|---|
| 44 | 44 |
| 45 function frame.ShowPanel(frame) | 45 function frame.ShowPanel(frame) |
| 46 frame:SetShown(true) | 46 frame:SetShown(true) |
| 47 self:Show() | 47 self:Show() |
| 48 end | 48 end |
| 49 function frame.HidePanel(frame) | |
| 50 frame:SetShown(false) | |
| 51 self:UpdateSize() | |
| 52 end | |
| 49 end | 53 end |
| 50 self:SetOrderHallUIMods() | 54 self:SetOrderHallUIMods() |
| 51 end | 55 end |
| 52 | 56 |
| 53 function VeneerWorldStateMixin:SetOrderHallUIMods() | 57 function VeneerWorldStateMixin:SetOrderHallUIMods() |
| 97 self:SetOrderHallUIMods() | 101 self:SetOrderHallUIMods() |
| 98 end | 102 end |
| 99 elseif event == 'PLAYER_ENTERING_WORLD' then | 103 elseif event == 'PLAYER_ENTERING_WORLD' then |
| 100 self:Update() | 104 self:Update() |
| 101 elseif event == 'PLAYER_REGEN_ENABLED' then | 105 elseif event == 'PLAYER_REGEN_ENABLED' then |
| 102 self:Show() | 106 self:SetShown(true) |
| 103 elseif event == 'PLAYER_REGEN_DISABLED' then | 107 elseif event == 'PLAYER_REGEN_DISABLED' then |
| 104 self:Hide() | 108 self:SetShown(false) |
| 105 end | 109 end |
| 106 end | 110 end |
| 107 | 111 |
| 108 function VeneerWorldStateMixin:Update() | 112 function VeneerWorldStateMixin:Update() |
| 109 self.modules = {self:GetChildren()} | 113 self.modules = {self:GetChildren()} |
| 292 self.OverflowBar:Hide() | 296 self.OverflowBar:Hide() |
| 293 self.ProgressBar:SetColorTexture(0.5,0,1) | 297 self.ProgressBar:SetColorTexture(0.5,0,1) |
| 294 end | 298 end |
| 295 hasNewInfo = (self.progressAmount ~= xp) | 299 hasNewInfo = (self.progressAmount ~= xp) |
| 296 | 300 |
| 297 progressChange = (hasNewInfo and not self.modeChanged) and (xp - self.progressAmount) / self:GetWidth() | 301 progressChange = (hasNewInfo and not self.modeChanged) and ((xp - self.progressAmount) / xpMax) |
| 298 | 302 |
| 299 | 303 |
| 300 self.progressAmount = xp | 304 self.progressAmount = xp |
| 301 self.progressMax = xpMax | 305 self.progressMax = xpMax |
| 302 elseif self.mode == 'artifact' then | 306 elseif self.mode == 'artifact' then |
| 305 print(' C_AUI:', itemID, altItemID, name, icon, totalXP, pointsSpent) | 309 print(' C_AUI:', itemID, altItemID, name, icon, totalXP, pointsSpent) |
| 306 | 310 |
| 307 if itemID then | 311 if itemID then |
| 308 local nextRankCost = GetCostForPointAtRank(pointsSpent) or 0 | 312 local nextRankCost = GetCostForPointAtRank(pointsSpent) or 0 |
| 309 hasNewInfo = (self.progressAmount ~= totalXP) | 313 hasNewInfo = (self.progressAmount ~= totalXP) |
| 310 progressChange = (hasNewInfo and not self.modeChanged) and (totalXP - self.progressAmount) / self:GetWidth() | 314 progressChange = (hasNewInfo and not self.modeChanged) and (((totalXP - self.progressAmount) / nextRankCost)) |
| 311 | 315 |
| 312 if totalXP > nextRankCost then | 316 if totalXP > nextRankCost then |
| 313 self.progressPercent = 1 | 317 self.progressPercent = 1 |
| 314 self.progressOverflow = totalXP - nextRankCost | 318 self.progressOverflow = totalXP - nextRankCost |
| 315 else | 319 else |
| 368 self.Label:SetText(self.progressText) | 372 self.Label:SetText(self.progressText) |
| 369 else | 373 else |
| 370 self.ProgressBar:Hide() | 374 self.ProgressBar:Hide() |
| 371 end | 375 end |
| 372 else | 376 else |
| 373 self:Hide() | 377 self:HidePanel() |
| 374 end | 378 end |
| 375 | 379 |
| 376 self.modeChanged = nil | 380 self.modeChanged = nil |
| 377 end | 381 end |
