/trunk
--Achievements Earned Progress Bar |
self.frame.summaryBar = CreateFrame("StatusBar", "$parentBar", self.frame, "AchievementProgressBarTemplate") |
self.frame.summaryBar:SetPoint("LEFT", self.frame.editbox, "RIGHT", 15, -5) |
self.frame.summaryBar:SetPoint("LEFT", self.frame.editbox, "RIGHT", 15, 9) |
self.frame.summaryBar:SetWidth(330) |
--self.frame.summaryBar.text:SetFontObject("GameFontNormal") |
--self.frame.summaryBar.text:SetWidth(320) |
self.frame.summaryBar.name:SetJustifyH("LEFT") |
self.frame.summaryBar.name:SetWidth(300) |
--Achievements Earned Comparison Progress Bar |
self.frame.comparisonSummaryBar = CreateFrame("StatusBar", "$parentComparisonBar", self.frame, "AchievementProgressBarTemplate") |
self.frame.comparisonSummaryBar:SetPoint("LEFT", self.frame.editbox, "RIGHT", 15, -8) |
self.frame.comparisonSummaryBar:SetWidth(330) |
--self.frame.comparisonSummaryBar.text:SetFontObject("GameFontNormal") |
--self.frame.comparisonSummaryBar.text:SetWidth(320) |
self.frame.comparisonSummaryBar.text:ClearAllPoints() |
self.frame.comparisonSummaryBar.text:SetPoint("RIGHT", -5, 0) |
self.frame.comparisonSummaryBar.text:SetJustifyH("RIGHT") |
self.frame.comparisonSummaryBar.name = self.frame.comparisonSummaryBar:CreateFontString("$parentName", "OVERLAY", "GameFontHighlightSmall") |
self.frame.comparisonSummaryBar.name:SetPoint("LEFT", 5, 0) |
self.frame.comparisonSummaryBar.name:SetJustifyH("LEFT") |
self.frame.comparisonSummaryBar.name:SetWidth(300) |
--Category Scroll Bar |
self.frame.catScroll = CreateFrame("Slider", "$parentCatSlider", self.frame, "UIPanelScrollBarTemplate") |
self.frame.catScroll:SetPoint("TOPLEFT", self.frame.catButtons[2], "TOPRIGHT") |
function self:RefreshSummaryBar() |
local total, completed |
local name |
local compareCat = self.currentCat |
if self.currentCat < 0 then |
total, completed = GetNumCompletedAchievements() |
name = "Total" |
compareCat = -1 |
else |
total, completed = GetCategoryNumAchievements(self.currentCat) |
name = GetCategoryInfo(self.currentCat) |
end |
self.frame.comparisonSummaryBar:Hide() |
if completed == 0 then |
self.frame.summaryBar:Hide() |
else |
self.frame.summaryBar:SetValue(completed) |
self.frame.summaryBar.text:SetText(completed .. "/" .. total) |
self.frame.summaryBar.name:SetText(name .. " Achievements Earned") |
if self.isComparing then |
local comparisonCompleted = GetComparisonCategoryNumAchievements(compareCat) |
self.frame.comparisonSummaryBar:Show() |
self.frame.comparisonSummaryBar:SetMinMaxValues(0, total) |
self.frame.comparisonSummaryBar:SetValue(comparisonCompleted) |
self.frame.comparisonSummaryBar.text:SetText(comparisonCompleted .. "/" .. total) |
self.frame.comparisonSummaryBar.name:SetText(self.comparisonUnitName) |
end |
end |
end |
------------------------------------------------------------- |
self.frame.achSort.comparison:Hide() |
self.comparisonUnit = "" |
end |
self:RefreshSummaryBar() |
end |
function self:SetComparisonUnit(unit) |