/trunk
self.sortFuncs = { |
["name d"] = function(a, b) |
local _ |
_,a = GetAchievementInfo(a) |
_,b = GetAchievementInfo(b) |
return a < b |
end, |
["name a"] = function(a, b) |
local _, a1, b1 |
_,a1 = GetAchievementInfo(a) |
_,b1 = GetAchievementInfo(b) |
assert(a1, "a "..a) |
end, |
["points d"] = function(a, b) |
local _, a, b |
if self.isAchList[GetAchievementCategory(a)] or self.isGuildList[GetAchievementCategory(a)] then |
_,_,a = GetAchievementInfo(a) |
else |
end, |
["points a"] = function(a, b) |
local _, a, b |
if self.isAchList[GetAchievementCategory(a)] or self.isGuildList[GetAchievementCategory(a)] then |
_,_,a = GetAchievementInfo(a) |
else |
--self:PopulateAchievements("achievements") |
--self:PopulateAchievements("statistics") |
--self:CreateTracker() |
self:SetupFrames() |
UrbanAchiever:CreateOptions() |
end |
function self:PopulateAchieveList() |
--self.achieveList = {} |
for id = 1, MAX_ACHIEVEMENTS do |
category = GetAchievementCategory(id) |
local category = GetAchievementCategory(id) |
if category and category ~= nil then |
lastID = id |
_, _, _, completed = GetAchievementInfo(id) |
local lastID = id |
local _, _, _, completed = GetAchievementInfo(id) |
if not (UrbanAchiever.factionAchs[tostring(id)] and UrbanAchiever.factionAchs[tostring(id)] ~= playerFaction) then |
if(type(self.achieveList[category]) == "table") then |
table.insert(self.achieveList[category], id, completed) |
end |
end |
end |
--print(lastID) |
end |
function self:OnEnable() |
self:RegisterEvent("ADDON_LOADED", "Initialize") |
self:RegisterEvent("ACHIEVEMENT_EARNED", function(self1,arg1) |
self:SetDisplayAchievement() |
searchString = self:GetSearchString(arg1) |
local searchString = self:GetSearchString(arg1) |
self.masterList[arg1] = { |
["searchString"] = searchString:lower(), |
} |
--Use a different button so InspectAchievements() doesnt get called. Easier hooking. |
UnitPopupButtons["UA_ACHIEVEMENTS"] = { text = COMPARE_ACHIEVEMENTS, dist = 1 }; |
--Replace their Acheivement Button with mine. |
--Replace their Achievement Button with mine. |
for j = 1, #menuTypes do |
local t = menuTypes[j] |
for i = 1, #UnitPopupMenus[t] do |
------------------------------------------------------------- |
function self:UnitPopup_ShowMenu(dropdownMenu, which, unit, name, userData, ...) |
for i=1, UIDROPDOWNMENU_MAXBUTTONS do |
button = _G["DropDownList"..UIDROPDOWNMENU_MENU_LEVEL.."Button"..i]; |
local button = _G["DropDownList"..UIDROPDOWNMENU_MENU_LEVEL.."Button"..i]; |
if button.value == "UA_ACHIEVEMENTS" then |
button.func = function() |
self:SetComparisonUnit(unit) |
completed = ""; |
end |
--searchString will be used as a basis of the searching, instead of looping through all the sub-arrays |
searchStr = name .. "; " .. points .. "; " .. completed .. "; " .. description .. "; " .. reward .. "; " |
local searchStr = name .. "; " .. points .. "; " .. completed .. "; " .. description .. "; " .. reward .. "; " |
--Add the criteria info |
for a=1, GetAchievementNumCriteria(id) do |
_, criteriaName = pcall(GetAchievementCriteriaInfo, id, a) |
local _, criteriaName = pcall(GetAchievementCriteriaInfo, id, a) |
searchStr = searchStr .. (criteriaName or "") .. "; " |
end |
--Add all the info to the master list |
--Start with the frame and backdrop |
self.frame = CreateFrame("Frame", "UrbanAchieverFrame", UIParent) |
self.frame:SetBackdrop({ |
--bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", |
edgeFile = "Interface\\DialogFrame\\UI-DialogBox-Border", tile = true, tileSize = 32, edgeSize = 32, |
--edgeFile = "Interface\\AchievementFrame\\UI-Achievement-WoodBorder", tile = true, tileSize = 32, edgeSize = 64, |
insets = {left = 11, right = 12, top = 12, bottom = 11} |
}) |
self.frame.backdrop = self.frame:CreateTexture("$parentBG", "BACKGROUND") |
self.frame.backdrop:SetPoint("TOPLEFT", 6, -6) |
self.frame.backdrop:SetPoint("BOTTOMRIGHT", -6, 6) |
--self.frame.backdrop:SetTexture(0,0,0,1) |
self.frame.backdrop:SetTexture("Interface\\AchievementFrame\\UI-Achievement-StatsBackground") |
self.frame:SetWidth(632) |
self.compHeaderText:SetText(UAComparing .. " [Name here]") |
self.compHeaderText:SetPoint("RIGHT", self.compShield, "LEFT", -5, 2) |
--Comparison Button |
--[[ |
local compSetButton = CreateFrame("Button", "$parentComparisonSetButton", self.frame) |
compSetButton:SetNormalTexture("Interface\\Buttons\\UI-SpellbookIcon-NextPage-Up") |
compSetButton:SetPushedTexture("Interface\\Buttons\\UI-SpellbookIcon-NextPage-Down") |
compSetButton:SetHighlightTexture("Interface\\Buttons\\ButtonHilight-Round", "ADD") |
compSetButton:SetWidth(32) |
compSetButton:SetHeight(32) |
compSetButton:SetPoint("TOPRIGHT", self.frame, -8, -30) |
compSetButton:SetScript("OnClick", function() |
self:SetComparisonUnit("target") |
end) |
]]-- |
--Category Frame |
self.frame.category = CreateFrame("Frame", "$parentCategoryFrame", self.frame) |
self.frame.category:SetWidth(190) |
self.frame.category:SetHeight(470) |
self.frame.category:SetBackdrop({ |
--bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", |
edgeFile = "Interface\\DialogFrame\\UI-DialogBox-Border", tile = true, tileSize = 32, edgeSize = 32, |
insets = {left = 11, right = 12, top = 12, bottom = 11} |
}) |
self.frame.category.backdrop:SetPoint("BOTTOMRIGHT", -6, 6) |
self.frame.category.backdrop:SetTexture("Interface\\AchievementFrame\\UI-Achievement-Parchment") |
self.frame.category.backdrop:SetTexCoord(0,.5,0,1) |
--self.frame.category.backdrop:SetTexture(0,0,0,1) |
self.frame.category:SetPoint("RIGHT", self.frame, "LEFT", 12, 0) |
--Tab Buttons |
self.frame.tabButtons[3] = self:CreateTab("$parentTab1", self.frame, UAGuild, "guild") |
self.frame.tabButtons[3]:SetPoint("TOPLEFT", self.frame.tabButtons[2], "TOPRIGHT", 5, 0) |
--self.frame.tabButtons[3] = self:CreateTab("$parentTab1", self.frame, "Search", "search") |
--self.frame.tabButtons[3]:SetPoint("TOPLEFT", self.frame.tabButtons[2], "TOPRIGHT", 5, 0) |
--Category Buttons |
self.frame.catButtons[1] = self:CreateCategoryButton("$parentCatButton1", self.frame.category) |
self.frame.catButtons[1]:SetPoint("TOPLEFT", self.frame.category, 17, -17) |
self.frame.achButtons[1]:SetScript("OnLeave", function(self) |
GameTooltip:Hide(); |
guildMemberRequestFrame = nil; |
charOwnerRequestFrame = nil; |
end) |
for i=2, 27 do |
self.frame.achButtons[i] = self:CreateAchievementButton("$parentAchButton" .. i, self.frame) |
self.frame.achButtons[i]:SetScript("OnLeave", function(self) |
GameTooltip:Hide(); |
guildMemberRequestFrame = nil; |
charOwnerRequestFrame = nil; |
end) |
end |
self.frame.editbox:SetPoint("TOPLEFT", self.frame.catToggle, "TOPRIGHT", 10, 0) |
--Achievements Earned Progress Bar |
self.frame.summaryBar = CreateFrame("StatusBar", "$parentBar", self.frame, "AchievementProgressBarTemplate") |
self.frame.summaryBar:SetPoint("LEFT", self.frame.editbox, "RIGHT", 15, 9) |
self.frame.summaryBar:SetWidth(330) |
self.frame.summaryBar = CreateFrame("StatusBar", "$parentBar", self.frame, "AchievementFrameSummaryCategoryTemplate") |
self.frame.summaryBar:SetPoint("LEFT", self.frame.editbox, "RIGHT", 10, -5) |
self.frame.summaryBar:SetScript("OnShow", function(self) |
if self:GetID() ~= nil then |
local totalAchievements, totalCompleted |
local titleCategory = GetCategoryInfo(self:GetID()) |
if UrbanAchiever.isComparing or self:GetID() == -1 then |
if self:GetID() ~= -1 then |
totalAchievements, totalCompleted = GetCategoryNumAchievements(self:GetID()); |
else |
local inGuild |
if UrbanAchiever.currentTab == "guild" then |
inGuild = true |
else |
inGuild = false |
end |
titleCategory = UAAchievEarned |
totalAchievements, totalCompleted = GetNumCompletedAchievements(inGuild); |
end |
else |
totalAchievements, totalCompleted = AchievementFrame_GetCategoryTotalNumAchievements(self:GetID(), true); |
end |
self.text:SetText(string.format("%d/%d", totalCompleted, totalAchievements)); |
self:SetMinMaxValues(0, totalAchievements); |
self:SetValue(totalCompleted); |
self:RegisterEvent("ACHIEVEMENT_EARNED"); |
self.name:SetText(titleCategory) |
end |
end) |
self.frame.summaryBar:SetScript("OnHide", function(self) |
AchievementFrameSummaryCategory_OnHide(self) |
end) |
self.frame.summaryBar:SetWidth(200) |
self.frame.summaryBar:SetHeight(21) |
self.frame.summaryBar.text:ClearAllPoints() |
self.frame.summaryBar.text:SetPoint("RIGHT", -5, 0) |
self.frame.summaryBar.text:SetJustifyH("RIGHT") |
self.frame.summaryBar.name:SetJustifyH("LEFT") |
self.frame.summaryBar.name:SetWidth(300) |
--creatEachCategoryProgessBar |
--Create Each Category Progress Bar |
local lastFrame |
local idxCat = 0 |
for i,id in ipairs(GetCategoryList()) do |
tittleCat, parentCatID = GetCategoryInfo(id) |
local tittleCat, parentCatID = GetCategoryInfo(id) |
if ( parentCatID == -1 )then |
idxCat, lastFrame = self:createCategoryStatusBar(id, idxCat, lastFrame) |
idxCat, lastFrame = self:createCategoryStatusBar(id, idxCat, lastFrame, tittleCat) |
end |
end |
local lastFrame |
local idxCat = 0 |
for i,id in ipairs(GetGuildCategoryList()) do |
tittleCat, parentCatID = GetCategoryInfo(id) |
local tittleCat, parentCatID = GetCategoryInfo(id) |
if ( parentCatID == -1 or parentCatID == 15076 )then |
idxCat, lastFrame = self:createCategoryStatusBar(id, idxCat, lastFrame) |
idxCat, lastFrame = self:createCategoryStatusBar(id, idxCat, lastFrame, tittleCat) |
end |
end |
--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 = CreateFrame("StatusBar", "$parentComparisonBar", self.frame, "AchievementFrameSummaryCategoryTemplate") |
self.frame.comparisonSummaryBar:SetPoint("LEFT", self.frame.summaryBar, "RIGHT", 10, 0) |
self.frame.comparisonSummaryBar:SetScript("OnShow", function(self) |
if self:GetID() ~= nil then |
if UrbanAchiever.isComparing then |
local totalAchievements, totalCompleted |
if self:GetID() ~= -1 then |
totalAchievements = GetCategoryNumAchievements(self:GetID()); |
totalCompleted = GetComparisonCategoryNumAchievements(self:GetID()) |
else |
local inGuild |
if UrbanAchiever.currentTab == "guild" then |
inGuild = true |
else |
inGuild = false |
end |
totalAchievements, totalCompleted = GetNumComparisonCompletedAchievements(inGuild) |
end |
self.text:SetText(string.format("%d/%d", totalCompleted, totalAchievements)); |
self:SetMinMaxValues(0, totalAchievements); |
self:SetValue(totalCompleted); |
self:RegisterEvent("ACHIEVEMENT_EARNED"); |
end |
end |
end) |
self.frame.comparisonSummaryBar:SetScript("OnHide", function(self) |
AchievementFrameSummaryCategory_OnHide(self) |
end) |
self.frame.comparisonSummaryBar:SetWidth(200) |
self.frame.comparisonSummaryBar:SetHeight(21) |
self.frame.comparisonSummaryBar.text:ClearAllPoints() |
self.frame.comparisonSummaryBar.text:SetPoint("RIGHT", -5, 0) |
self.frame.comparisonSummaryBar.text:SetJustifyH("RIGHT") |
self.frame.comparisonSummaryBar.name:SetPoint("LEFT", 5, 0) |
self.frame.comparisonSummaryBar.name:SetJustifyH("LEFT") |
self.frame.comparisonSummaryBar.name:SetWidth(300) |
self.frame.comparisonSummaryBar:Hide() |
--Category Scroll Bar |
self.frame.catScroll = CreateFrame("Slider", "$parentCatSlider", self.frame.category, "UIPanelScrollBarTemplate") |
self.frame.display.criteriaButtons[1]:SetScript("OnLeave", function(self) |
GameTooltip:Hide(); |
guildMemberRequestFrame = nil; |
charOwnerRequestFrame = nil; |
end) |
for i=2, 9 do |
self.frame.display.criteriaButtons[i] = self:CreateCriteriaButton("$parentCriteriaButton" .. i, self.frame.display) |
self.frame.display.criteriaButtons[i]:SetScript("OnLeave", function(self) |
GameTooltip:Hide(); |
guildMemberRequestFrame = nil; |
charOwnerRequestFrame = nil; |
end) |
end |
self.frame:Hide() |
end |
function self:createCategoryStatusBar(id, idxCat, lastFrame) |
function self:createCategoryStatusBar(id, idxCat, lastFrame, tittleCat) |
idxCat = idxCat + 1 |
local categoryFrame = CreateFrame("StatusBar","categoryStatusBar"..id, self.frame, "AchievementFrameSummaryCategoryTemplate") |
if idxCat == 1 then |
button.bgframe:SetPoint("TOPLEFT") |
button.background = button:CreateTexture("$parentBackground", "BACKGROUND") |
--button.background:SetTexture("Interface\\AchievementFrame\\UI-Achievement-Parchment-Horizontal") |
button.background:SetTexture("Interface\\AchievementFrame\\UI-Achievement-Stat-Buttons") |
button.background:SetAlpha(0.5) |
button.background:SetPoint("TOPLEFT", button.offset, "TOPRIGHT") |
button.background:SetPoint("BOTTOMRIGHT", button.bgframe) |
--button.background:SetWidth(290) |
--button.background:SetHeight(16) |
button.name = button:CreateFontString("$parentNameText","BORDER", "GameFontNormal") |
button.name:SetPoint("TOPLEFT", button.background) |
--button.text:SetPoint("TOPRIGHT", button, "TOPRIGHT") |
button.name:SetWidth(200) |
button.name:SetHeight(16) |
button.name:SetJustifyH("LEFT") |
button.points = button:CreateFontString("$parentPointsText","BORDER", "GameFontNormal") |
button.points:SetPoint("TOPLEFT", button, "TOPLEFT", 217, 0) |
--button.text:SetPoint("TOPRIGHT", button, "TOPRIGHT") |
button.points:SetWidth(20) |
button.points:SetJustifyH("LEFT") |
button.points:SetJustifyV("TOP") |
button.completed = button:CreateFontString("$parentCompletedText","BORDER", "GameFontNormal") |
button.completed:SetPoint("TOPLEFT", button.points, "TOPRIGHT", 2, 0) |
--button.text:SetPoint("TOPRIGHT", button, "TOPRIGHT") |
button.completed:SetWidth(60) |
button.completed:SetHeight(16) |
button.completed:SetJustifyH("LEFT") |
button.stat = button:CreateFontString("$parentStatText","BORDER", "GameFontNormal") |
button.stat:SetPoint("TOPLEFT", button, "TOPLEFT", 217, 0) |
button.stat:SetPoint("TOPRIGHT", button.background, "TOPRIGHT") |
--button.stat:SetWidth(20) |
button.stat:SetJustifyH("LEFT") |
button.stat:SetJustifyV("TOP") |
button.stat:SetTextColor(1,1,1) |
button.comparison.background = button.comparison:CreateTexture("$parentBackground", "BACKGROUND") |
button.comparison.background:SetTexture("Interface\\AchievementFrame\\UI-Achievement-Parchment-Horizontal") |
--button.comparison.background:SetTexture("Interface\\AchievementFrame\\UI-Achievement-Stat-Buttons") |
button.comparison.background:SetAlpha(0.5) |
button.comparison.background:SetAllPoints(button.comparison) |
button.comparison:SetHeight(16) |
button.comparison:SetPoint("LEFT", button.offset) |
--button:SetNormalTexture("Interface/FriendsFrame/UI-FriendsFrame-HighlightBar") |
local highlightTexture = button:CreateTexture() |
highlightTexture:SetTexture("Interface\\AchievementFrame\\UI-Achievement-Stat-Buttons") |
highlightTexture:SetTexCoord(0, 1, 0.56, 0.73) |
--highlightTexture:SetAllPoints(button) |
button:SetHighlightTexture("Interface\\FriendsFrame\\UI-FriendsFrame-HighlightBar", "ADD") |
button:SetHeight(30) |
button:SetWidth(100) |
--button:SetNormalTexture("Interface\\DialogFrame\\UI-DialogBox-Header") |
button:SetHighlightTexture("Interface\\PaperDollInfoFrame\\UI-Character-Tab-Highlight", "ADD") |
button:SetBackdrop({ |
--bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", |
edgeFile = "Interface\\DialogFrame\\UI-DialogBox-Border", tile = true, edgeSize = 16, |
insets = {left = -5, right = -5, top = -5, bottom = -5} |
}) |
editboxFrame:SetScript("OnEscapePressed", function() editboxFrame:ClearFocus() end) |
editboxFrame:SetScript("OnEditFocusLost", function() editboxFrame:HighlightText(0, 0) end) |
editboxFrame:SetScript("OnEditFocusGained", function() editboxFrame:HighlightText() end) |
--editboxFrame:SetScript("OnTextChanged", Editbox_OnTextChanged) |
--editboxFrame:SetScript("OnEnter", Editbox_OnEnter) |
--editboxFrame:SetScript("OnLeave", Editbox_OnLeave) |
--editboxFrame:SetScript("OnTextChanged", function() self:Search(editboxFrame:GetText()) end) |
editboxFrame:SetScript("OnEnterPressed", function() self:Search(editboxFrame:GetText()) editboxFrame:ClearFocus() end) |
-- Left border. |
self:RefreshCategoryButtons() |
self:RefreshAchievementButtons(false) |
self:ComparisonUpdate() |
--self:TrackerUpdate() |
if self.currentTab == "guild" then |
inGuild = true; |
else |
inGuild = false; |
end |
self.pointsText:SetText(GetTotalAchievementPoints(inGuild)); |
end |
function self:PopulateMasterList() |
--Add child Categories |
for _,childId in next, list do |
childName, childParent = GetCategoryInfo(childId) |
local childName, childParent = GetCategoryInfo(childId) |
for parentKey, parentCat in next, self.categories[tab] do |
if childParent == parentCat.id then |
tinsert(parentCat.children,{ |
if completed == "" then |
self.frame.achButtons[button].background:SetTexture("Interface\\AchievementFrame\\UI-Achievement-Parchment-Horizontal-Desaturated") |
--else |
-- self.frame.achButtons[button].background:SetTexture("Interface\\AchievementFrame\\UI-Achievement-Parchment-Horizontal") |
end |
if IsTrackedAchievement(id) then |
if self.currentTab == "guild" then |
requiresRep, hasRep, repLevel = GetAchievementGuildRep(self.currentAch); |
local requiresRep, hasRep, repLevel = GetAchievementGuildRep(self.currentAch); |
if ( requiresRep ) then |
initialOffset = -ACHIEVEMENTBUTTON_CRITERIAROWHEIGHT; |
local gender = UnitSex("player"); |
local factionStandingtext = GetText("FACTION_STANDING_LABEL"..repLevel, gender); |
self.frame.display.repCriteria:SetFormattedText(ACHIEVEMENT_REQUIRES_GUILD_REPUTATION, factionStandingtext); |
if self.frame == nil then self:Initialize("","") end |
if self.frame == nil then return end |
if not self.frame:IsShown() then return end |
local criteriaName, criteriaType, criteriaCompleted, criteriaQuantity, criteriaReqQuantity,_ ,criteriaFlags, criteriaAssetID, icon, quantityStr |
local id, month, day, year, criteriaName, criteriaType, criteriaCompleted, criteriaQuantity, criteriaReqQuantity, _ ,criteriaFlags, criteriaAssetID, icon, quantityStr, charName |
local buttonNum = 1 |
local str = "" |
local offset = 1 |
if UASVPC.specificCriteria and criteriaReqQuantity > 1 then |
str = string.format("%s (%d/%d)", str, criteriaQuantity, criteriaReqQuantity) |
end |
--GetCriteriaComparisonInfo was remove a long time ago |
--[[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]] |
if criteriaType == CRITERIA_TYPE_ACHIEVEMENT and criteriaAssetID then |
--Its a meta achievement |
self.frame.display.criteriaButtons[buttonNum].icon:SetTexture(icon) |
if self.currentTab == "guild" then |
self.pointsText:SetTextColor(0,1,0); |
self.pointsText:SetText(GetTotalAchievementPoints(true)); |
total, completed = GetNumCompletedAchievements(true); |
if self.currentCat == -1 then |
self.frame.summaryBar:SetMinMaxValues(0, total) |
self.frame.summaryBar:SetValue(completed) |
self.frame.summaryBar.text:SetText(completed .. "/" .. total) |
end |
else |
self.pointsText:SetTextColor(1,1,1); |
self.pointsText:SetText(GetTotalAchievementPoints()); |
total, completed = GetNumCompletedAchievements(); |
if self.currentCat == -1 then |
self.frame.summaryBar:SetMinMaxValues(0, total) |
self.frame.summaryBar:SetValue(completed) |
self.frame.summaryBar.text:SetText(completed .. "/" .. total) |
end |
end |
self:RefreshSummaryBar() |
--Stuff for tab highlights |
--Not happy with this, but it works till I find some better textures. |
end |
function self:RefreshSummaryBar() |
local total, completed |
local name |
local compareCat = self.currentCat |
if self.currentCat < 0 then |
total, completed = GetNumCompletedAchievements() |
name = UATotal |
compareCat = -1 |
else |
total, completed = GetCategoryNumAchievements(self.currentCat) |
name = GetCategoryInfo(self.currentCat) |
end |
self.frame.summaryBar:Hide() |
self.frame.summaryBar:SetID(self.currentCat) |
self.frame.summaryBar:Show() |
self.frame.comparisonSummaryBar:Hide() |
if completed == 0 then |
self.frame.summaryBar:Hide() |
if self.isComparing then |
self.frame.summaryBar:SetWidth(200) |
self.frame.comparisonSummaryBar:Hide() |
self.frame.comparisonSummaryBar.name:SetText('('..self.comparisonUnitName..')') |
self.frame.comparisonSummaryBar:SetID(self.currentCat) |
self.frame.comparisonSummaryBar:Show() |
else |
self.frame.summaryBar:Show() |
self.frame.summaryBar:SetMinMaxValues(0, total) |
self.frame.summaryBar:SetValue(completed) |
self.frame.summaryBar.text:SetText(completed .. "/" .. total) |
if GetLocale() == 'deDE' then--It's crapy I know, I have to done something for this, I haven't the time now. |
self.frame.summaryBar.name:SetText(UAAchievEarned .. " " .. name) |
else |
self.frame.summaryBar.name:SetText(name .. " " .. UAAchievEarned) |
end |
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 |
self.frame.summaryBar:SetWidth(330) |
self.frame.comparisonSummaryBar:Hide() |
end |
end |
------------------------------------------------------------- |
ClearAchievementComparisonUnit() |
SetAchievementComparisonUnit(unit) |
end |
end |