self.frame.display.bar:Hide() |
self.frame.display.compareBar:Hide() |
|
for a = 1, GetAchievementNumCriteria(self.currentAch) do |
if buttonNum <= #self.frame.display.criteriaButtons and a > self.criteriaOffset then |
|
self.frame.display.criteriaButtons[buttonNum]:Show() |
self.frame.display.criteriaButtons[buttonNum].icon:Hide() |
self.frame.display.criteriaButtons[buttonNum].comparison:Hide() |
offset = 1 |
|
criteriaName, criteriaType, criteriaCompleted, criteriaQuantity, criteriaReqQuantity,icon ,criteriaFlags, criteriaAssetID, quantityStr = |
GetAchievementCriteriaInfo(self.currentAch, a) |
if criteriaType then --Some Achievements seem to throw out the wrong number of criteria, causing errors. |
if criteriaCompleted then |
str = "|CFF00FF00" |
--for a = 1, GetAchievementNumCriteria(self.currentAch) do |
-- if buttonNum <= #self.frame.display.criteriaButtons and a > self.criteriaOffset then |
for a = self.criteriaOffset + 1, min(#self.frame.display.criteriaButtons + self.criteriaOffset, GetAchievementNumCriteria(self.currentAch)) do |
self.frame.display.criteriaButtons[buttonNum]:Show() |
self.frame.display.criteriaButtons[buttonNum].icon:Hide() |
self.frame.display.criteriaButtons[buttonNum].comparison:Hide() |
offset = 1 |
|
criteriaName, criteriaType, criteriaCompleted, criteriaQuantity, criteriaReqQuantity,icon ,criteriaFlags, criteriaAssetID, quantityStr = |
GetAchievementCriteriaInfo(self.currentAch, a) |
if criteriaType then --Some Achievements seem to throw out the wrong number of criteria, causing errors. |
if criteriaCompleted then |
str = "|CFF00FF00" |
else |
str = "|CFF808080" |
end |
str = str .. criteriaName -- .. "= " .. criteriaQuantity .. " (" .. criteriaAssetID .. ")" |
if UASVPC.specificCriteria and criteriaReqQuantity > 1 then |
str = string.format("%s (%d/%d)", str, criteriaQuantity, criteriaReqQuantity) |
end |
if self.isComparing and not compDone and UASVPC.statCriteria then |
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 |
str = "|CFF808080" |
self.frame.display.criteriaButtons[buttonNum].comparison:SetTexture("Interface\\RaidFrame\\ReadyCheck-NotReady") |
end |
str = str .. criteriaName -- .. "= " .. criteriaQuantity .. " (" .. criteriaAssetID .. ")" |
if UASVPC.specificCriteria and criteriaReqQuantity > 1 then |
str = string.format("%s (%d/%d)", str, criteriaQuantity, criteriaReqQuantity) |
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]:Hide() |
str = "" |
|
self.frame.display.bar:Show() |
self.frame.display.bar:SetMinMaxValues(0,criteriaReqQuantity) |
self.frame.display.bar:SetValue(criteriaQuantity) |
local cQ, cRQ = criteriaQuantity, criteriaReqQuantity |
if quantityStr:find("|T") then |
cQ, cRQ = self:FormatMoney(criteriaQuantity, criteriaReqQuantity) |
end |
if self.isComparing and not compDone and UASVPC.statCriteria then |
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 |
self.frame.display.criteriaButtons[buttonNum].comparison:SetTexture("Interface\\RaidFrame\\ReadyCheck-NotReady") |
end |
end |
self.frame.display.bar.text:SetText(cQ .. " / " .. cRQ) |
|
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]:Hide() |
str = "" |
|
self.frame.display.bar:Show() |
self.frame.display.bar:SetMinMaxValues(0,criteriaReqQuantity) |
self.frame.display.bar:SetValue(criteriaQuantity) |
local cQ, cRQ = criteriaQuantity, criteriaReqQuantity |
if self.isComparing and compCriteriaText then |
self.frame.display.compareBar:Show() |
self.frame.display.compareBar:SetMinMaxValues(0, criteriaReqQuantity) |
local _,_,min, max = string.find(compCriteriaText, "(%d+)/(%d+)") |
self.frame.display.compareBar:SetValue(min) |
--If theres money textures in the string, we're gonna need to format it. |
if quantityStr:find("|T") then |
cQ, cRQ = self:FormatMoney(criteriaQuantity, criteriaReqQuantity) |
min, criteriaReqQuantity = self:FormatMoney(min, criteriaReqQuantity) |
end |
self.frame.display.bar.text:SetText(cQ .. " / " .. cRQ) |
self.frame.display.compareBar.text:SetText(min .. " / " .. criteriaReqQuantity) |
self.frame.display.compareBar.nameText:SetText(self.comparisonUnitName .. ":") |
|
if self.isComparing and compCriteriaText then |
self.frame.display.compareBar:Show() |
self.frame.display.compareBar:SetMinMaxValues(0, criteriaReqQuantity) |
local _,_,min, max = string.find(compCriteriaText, "(%d+)/(%d+)") |
self.frame.display.compareBar:SetValue(min) |
--If theres money textures in the string, we're gonna need to format it. |
if quantityStr:find("|T") then |
min, criteriaReqQuantity = self:FormatMoney(min, criteriaReqQuantity) |
end |
self.frame.display.compareBar.text:SetText(min .. " / " .. criteriaReqQuantity) |
self.frame.display.compareBar.nameText:SetText(self.comparisonUnitName .. ":") |
|
end |
--If theres a progress bar, theres no other achievements |
break |
end |
|
self.frame.display.criteriaButtons[buttonNum].text:SetText(str) |
self.frame.display.criteriaButtons[buttonNum].offset:SetWidth(offset) |
buttonNum = buttonNum + 1 |
--If theres a progress bar, theres no other achievements |
break |
end |
|
self.frame.display.criteriaButtons[buttonNum].text:SetText(str) |
self.frame.display.criteriaButtons[buttonNum].offset:SetWidth(offset) |
buttonNum = buttonNum + 1 |
end |
end |
|