|
criteriaName, criteriaType, criteriaCompleted, criteriaQuantity, criteriaReqQuantity,icon ,criteriaFlags, criteriaAssetID, quantityStr = |
GetAchievementCriteriaInfo(self.currentAch, a) |
if criteriaCompleted then |
str = "|CFF00FF00" |
else |
str = "|CFF808080" |
end |
str = str .. (criteriaName or "no name") |
|
if self.isComparing and not compDone then |
--compDone = GetAchievementComparisonInfo(self.currentAch,1) |
compCriteriaText,comparisonComplete = GetCriteriaComparisonInfo(self.currentAch, a, 1) |
|
self.frame.display.criteriaButtons[buttonNum].comparison:Show() |
|
offset = offset + 16 |
|
if comparisonComplete then |
self.frame.display.criteriaButtons[buttonNum].comparison:SetTexture("Interface\\RaidFrame\\ReadyCheck-Ready") |
if criteriaType then --Some Achievements seem to throw out the wrong number of criteria, causing errors. |
if criteriaCompleted then |
str = "|CFF00FF00" |
else |
self.frame.display.criteriaButtons[buttonNum].comparison:SetTexture("Interface\\RaidFrame\\ReadyCheck-NotReady") |
str = "|CFF808080" |
end |
end |
|
if criteriaType == 8 then |
--Its a meta achievement |
_,_,_,_,_,_,_,_,_,icon = GetAchievementInfo(criteriaAssetID) |
self.frame.display.criteriaButtons[buttonNum].icon:SetTexture(icon) |
self.frame.display.criteriaButtons[buttonNum].icon:Show() |
offset = offset + 16 |
self.frame.display.criteriaButtons[buttonNum]:SetID(criteriaAssetID) |
elseif (bit.band(criteriaFlags, ACHIEVEMENT_CRITERIA_PROGRESS_BAR) == ACHIEVEMENT_CRITERIA_PROGRESS_BAR) then |
--Its a progress bar |
offset = 1 |
self.frame.display.criteriaButtons[buttonNum].comparison:Hide() |
str = "" |
--self.frame.display.criteriaButtons[buttonNum]:Hide() |
str = str .. criteriaName -- .. "= " .. criteriaQuantity .. " (" .. criteriaAssetID .. ")" |
|
self.frame.display.criteriaButtons[buttonNum].bar:Show() |
self.frame.display.criteriaButtons[buttonNum].bar:SetMinMaxValues(0,criteriaReqQuantity) |
self.frame.display.criteriaButtons[buttonNum].bar:SetValue(criteriaQuantity) |
self.frame.display.criteriaButtons[buttonNum].bar.text:SetText(quantityStr) |
|
if self.isComparing and compCriteriaText then |
self.frame.display.criteriaButtons[buttonNum].compareBar:Show() |
self.frame.display.criteriaButtons[buttonNum].compareBar:SetMinMaxValues(0, criteriaReqQuantity) |
if compDone then |
self.frame.display.criteriaButtons[buttonNum].compareBar:SetValue(criteriaReqQuantity) |
self.frame.display.criteriaButtons[buttonNum].compareBar.text:SetText(criteriaReqQuantity .. " / " .. criteriaReqQuantity) |
if self.isComparing and not compDone then |
--compDone = GetAchievementComparisonInfo(self.currentAch,1) |
compCriteriaText,comparisonComplete = GetCriteriaComparisonInfo(self.currentAch, a, 1) |
|
self.frame.display.criteriaButtons[buttonNum].comparison:Show() |
|
offset = offset + 16 |
|
if comparisonComplete then |
self.frame.display.criteriaButtons[buttonNum].comparison:SetTexture("Interface\\RaidFrame\\ReadyCheck-Ready") |
else |
local _,_,min, max = string.find(compCriteriaText, "(%d+)/(%d+)") |
self.frame.display.criteriaButtons[buttonNum].compareBar:SetValue(min) |
self.frame.display.criteriaButtons[buttonNum].compareBar.text:SetText(min .. " / " .. criteriaReqQuantity) |
self.frame.display.criteriaButtons[buttonNum].comparison:SetTexture("Interface\\RaidFrame\\ReadyCheck-NotReady") |
end |
end |
|
if criteriaType == CRITERIA_TYPE_ACHIEVEMENT then |
--Its a meta achievement |
_,_,_,_,_,_,_,_,_,icon = GetAchievementInfo(criteriaAssetID) |
self.frame.display.criteriaButtons[buttonNum].icon:SetTexture(icon) |
self.frame.display.criteriaButtons[buttonNum].icon:Show() |
offset = offset + 16 |
self.frame.display.criteriaButtons[buttonNum]:SetID(criteriaAssetID) |
elseif (bit.band(criteriaFlags, ACHIEVEMENT_CRITERIA_PROGRESS_BAR) == ACHIEVEMENT_CRITERIA_PROGRESS_BAR) then |
--Its a progress bar |
offset = 1 |
self.frame.display.criteriaButtons[buttonNum].comparison:Hide() |
str = "" |
--self.frame.display.criteriaButtons[buttonNum]:Hide() |
|
self.frame.display.criteriaButtons[buttonNum].bar:Show() |
self.frame.display.criteriaButtons[buttonNum].bar:SetMinMaxValues(0,criteriaReqQuantity) |
self.frame.display.criteriaButtons[buttonNum].bar:SetValue(criteriaQuantity) |
self.frame.display.criteriaButtons[buttonNum].bar.text:SetText(quantityStr) |
|
if self.isComparing and compCriteriaText then |
self.frame.display.criteriaButtons[buttonNum].compareBar:Show() |
self.frame.display.criteriaButtons[buttonNum].compareBar:SetMinMaxValues(0, criteriaReqQuantity) |
if compDone then |
self.frame.display.criteriaButtons[buttonNum].compareBar:SetValue(criteriaReqQuantity) |
self.frame.display.criteriaButtons[buttonNum].compareBar.text:SetText(criteriaReqQuantity .. " / " .. criteriaReqQuantity) |
else |
local _,_,min, max = string.find(compCriteriaText, "(%d+)/(%d+)") |
self.frame.display.criteriaButtons[buttonNum].compareBar:SetValue(min) |
self.frame.display.criteriaButtons[buttonNum].compareBar.text:SetText(min .. " / " .. criteriaReqQuantity) |
end |
|
end |
end |
|
self.frame.display.criteriaButtons[buttonNum].text:SetText(str) |
self.frame.display.criteriaButtons[buttonNum].offset:SetWidth(offset) |
buttonNum = buttonNum + 1 |
end |
|
self.frame.display.criteriaButtons[buttonNum].text:SetText(str) |
self.frame.display.criteriaButtons[buttonNum].offset:SetWidth(offset) |
buttonNum = buttonNum + 1 |
end |
end |
|