Mercurial > wow > buffalo2
comparison Modules/WorldState.lua @ 85:1196b8175674
missing "else" control
| author | Nenue |
|---|---|
| date | Tue, 18 Oct 2016 13:16:57 -0400 |
| parents | 16b300d96724 |
| children | 27db212af783 |
comparison
equal
deleted
inserted
replaced
| 84:16b300d96724 | 85:1196b8175674 |
|---|---|
| 294 local xpMax = UnitXPMax('player') | 294 local xpMax = UnitXPMax('player') |
| 295 local bonusXP = GetXPExhaustion() | 295 local bonusXP = GetXPExhaustion() |
| 296 if xp then | 296 if xp then |
| 297 self.progressPercent = xp / xpMax | 297 self.progressPercent = xp / xpMax |
| 298 end | 298 end |
| 299 | |
| 300 self.progressText = '|cFFFFCC00' .. UnitLevel('player') .. '|r ' .. xp .. '/' .. xpMax | 299 self.progressText = '|cFFFFCC00' .. UnitLevel('player') .. '|r ' .. xp .. '/' .. xpMax |
| 301 | |
| 302 if bonusXP then | 300 if bonusXP then |
| 303 self.ProgressBar:SetColorTexture(0, 0.5,1) | 301 self.ProgressBar:SetColorTexture(0, 0.5,1) |
| 304 self.OverflowBar:Show() | 302 self.OverflowBar:Show() |
| 305 self.OverflowBar:ClearAllPoints() | 303 self.OverflowBar:ClearAllPoints() |
| 306 self.OverflowBar:SetPoint('BOTTOMLEFT', self.ProgressBar, 'BOTTOMRIGHT', 0, 0) | 304 self.OverflowBar:SetPoint('BOTTOMLEFT', self.ProgressBar, 'BOTTOMRIGHT', 0, 0) |
| 307 | |
| 308 else | 305 else |
| 309 self.ProgressBar:SetColorTexture(0.5,0,1) | 306 self.ProgressBar:SetColorTexture(0.5,0,1) |
| 310 end | 307 end |
| 311 hasNewInfo = (self.progressAmount ~= xp) | 308 hasNewInfo = (self.progressAmount ~= xp) |
| 312 | |
| 313 progressChange = (hasNewInfo and not self.modeChanged) and ((xp - self.progressAmount) / xpMax) | 309 progressChange = (hasNewInfo and not self.modeChanged) and ((xp - self.progressAmount) / xpMax) |
| 314 | 310 self.progressOverflow = bonusXP |
| 315 self.progressOverFlow = bonusXP | |
| 316 self.progressAmount = xp | 311 self.progressAmount = xp |
| 317 self.progressMax = xpMax | 312 self.progressMax = xpMax |
| 313 | |
| 318 elseif self.mode == 'artifact' then | 314 elseif self.mode == 'artifact' then |
| 319 | |
| 320 local itemID, altItemID, name, icon, totalXP, pointsSpent = GetEquippedArtifactInfo() | 315 local itemID, altItemID, name, icon, totalXP, pointsSpent = GetEquippedArtifactInfo() |
| 321 print(' C_AUI:', itemID, altItemID, name, icon, totalXP, pointsSpent) | |
| 322 | 316 |
| 323 if itemID then | 317 if itemID then |
| 324 local nextRankCost = GetCostForPointAtRank(pointsSpent) or 0 | 318 local nextRankCost = GetCostForPointAtRank(pointsSpent) or 0 |
| 319 print(' C_AUI:', itemID, name, 'XP:', totalXP, 'Points:', pointsSpent, 'Next:', nextRankCost) | |
| 325 hasNewInfo = (self.progressAmount ~= totalXP) | 320 hasNewInfo = (self.progressAmount ~= totalXP) |
| 326 progressChange = (hasNewInfo and not self.modeChanged) and (((totalXP - self.progressAmount) / nextRankCost)) | 321 progressChange = (hasNewInfo and not self.modeChanged) and (((totalXP - self.progressAmount) / nextRankCost)) |
| 327 | 322 |
| 328 if totalXP > nextRankCost then | 323 if totalXP > nextRankCost then |
| 329 self.progressPercent = 1 | 324 self.progressPercent = 1 |
| 325 else | |
| 330 self.progressPercent = totalXP / nextRankCost | 326 self.progressPercent = totalXP / nextRankCost |
| 331 end | 327 end |
| 332 | 328 |
| 333 self.progressText = name .. ' ('..pointsSpent .. '): '.. totalXP .. ' / ' .. nextRankCost | 329 self.progressText = name .. ' ('..pointsSpent .. '): '.. totalXP .. ' / ' .. nextRankCost |
| 334 | 330 |
| 335 self.ProgressBar:SetColorTexture(1,0.5,0,1) | 331 self.ProgressBar:SetColorTexture(1,0.5,0,1) |
| 336 self.OverflowBar:Hide() | 332 self.OverflowBar:Hide() |
| 337 | 333 |
| 338 self.progressOverFlow = 0 | 334 self.progressOverflow = 0 |
| 339 self.progressAmount = totalXP | 335 self.progressAmount = totalXP |
| 340 self.progressMax = nextRankCost | 336 self.progressMax = nextRankCost |
| 341 else | 337 else |
| 342 self.progressAmount = 0 | 338 self.progressAmount = 0 |
| 343 self.progressMax = 1 | 339 self.progressMax = 1 |
| 360 self:ShowPanel() | 356 self:ShowPanel() |
| 361 end | 357 end |
| 362 | 358 |
| 363 end | 359 end |
| 364 | 360 |
| 365 --print(self.ProgressBG:GetWidth()) | 361 print(self:IsVisible()) |
| 362 print(self:GetWidth()) | |
| 363 print(self.ProgressBG:GetWidth()) | |
| 366 print(' Percent:', floor(self.progressPercent*100)/100, 'BarLength:', floor(self:GetWidth()* self.progressPercent), 'NewInfo:', hasNewInfo, 'IsShown:', self:IsShown()) | 364 print(' Percent:', floor(self.progressPercent*100)/100, 'BarLength:', floor(self:GetWidth()* self.progressPercent), 'NewInfo:', hasNewInfo, 'IsShown:', self:IsShown()) |
| 367 | 365 |
| 368 | 366 |
| 369 if progressChange then | 367 if progressChange then |
| 370 print(' Render change:', progressChange) | 368 print(' Render change:', progressChange) |
| 390 | 388 |
| 391 else | 389 else |
| 392 self.ProgressBar:Hide() | 390 self.ProgressBar:Hide() |
| 393 end | 391 end |
| 394 else | 392 else |
| 395 --self:HidePanel() | 393 self:HidePanel() |
| 396 end | 394 end |
| 397 | 395 |
| 398 self.modeChanged = nil | 396 self.modeChanged = nil |
| 399 end | 397 end |
| 400 | 398 |
| 408 print('keepOpen =', self.keepOpen) | 406 print('keepOpen =', self.keepOpen) |
| 409 else | 407 else |
| 410 if self.mode == 'xp' then | 408 if self.mode == 'xp' then |
| 411 self.mode = 'artifact' | 409 self.mode = 'artifact' |
| 412 else | 410 else |
| 411 if not self.canGainXP then | |
| 412 return | |
| 413 end | |
| 413 self.mode = 'xp' | 414 self.mode = 'xp' |
| 414 end | 415 end |
| 415 self:AnimateMode() | 416 self:AnimateMode() |
| 416 end | 417 end |
| 417 | 418 |
