WoWInterface SVN UrbanAchiever

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /trunk
    from Rev 132 to Rev 133
    Reverse comparison

Rev 132 → Rev 133

Main.lua
1,4 → 1,4
--SKINNER ADD
--SKINNER ADD
--categoryStatusBar15165
--categoryStatusBar15117
 
11,7 → 11,7
--bindings
BINDING_HEADER_URBANACHIEVER = "Urban Achiever"
 
local MAX_ACHIEVEMENTS = 7502 --last 7501
local MAX_ACHIEVEMENTS = 7503 --last 7502
local menuTypes = {"PLAYER", "PARTY", "RAID_PLAYER"}
local playerFaction = UnitFactionGroup("player") == "Alliance" and 1 or 2
 
74,12 → 74,12
 
["points d"] = function(a, b)
if self.isAchList[GetAchievementCategory(a)] or self.isGuildList[GetAchievementCategory(a)] then
_,_,a = GetAchievementInfo(a)
_,_,a = GetAchievementInfo(a)
else
a = GetStatistic(a)
end
if self.isAchList[GetAchievementCategory(b)] or self.isGuildList[GetAchievementCategory(b)] then
_,_,b = GetAchievementInfo(b)
_,_,b = GetAchievementInfo(b)
else
b = GetStatistic(b)
end
88,12 → 88,12
 
["points a"] = function(a, b)
if self.isAchList[GetAchievementCategory(a)] or self.isGuildList[GetAchievementCategory(a)] then
_,_,a = GetAchievementInfo(a)
_,_,a = GetAchievementInfo(a)
else
a = GetStatistic(a)
end
if self.isAchList[GetAchievementCategory(b)] or self.isGuildList[GetAchievementCategory(b)] then
_,_,b = GetAchievementInfo(b)
_,_,b = GetAchievementInfo(b)
else
b = GetStatistic(b)
end
256,7 → 256,7
if category and category ~= nil then
lastID = id
_, _, _, completed = GetAchievementInfo(id)
if not (UrbanAchiever.factionAchs[tostring(id)] and UrbanAchiever.factionAchs[tostring(id)] ~= playerFaction) then
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)
else
326,7 → 326,7
end
 
function self:OnDisable()
self:UnregisterEvent("ADDON_LOADED")
self:UnregisterEvent("ADDON_LOADED")
self:UnregisterEvent("ACHIEVEMENT_EARNED")
self:UnregisterEvent("CRITERIA_UPDATE")
 
348,7 → 348,7
for i=1, UIDROPDOWNMENU_MAXBUTTONS do
button = _G["DropDownList"..UIDROPDOWNMENU_MENU_LEVEL.."Button"..i];
if button.value == "UA_ACHIEVEMENTS" then
button.func = function()
button.func = function()
self:SetComparisonUnit(unit)
end
end
480,7 → 480,7
function self:GetSearchString(id)
if not type(id) == "number" then return end
local retok, id, name, points, completed, month, day, year, description, _,_, reward = pcall (GetAchievementInfo,id)
if not retok or not id then return nil end
if not retok or not id then return nil end
if not id then return nil end
if completed then
if year < 10 then
532,7 → 532,7
local sMin, sMax = self.frame.criteriaScroll:GetMinMaxValues()
self.criteriaOffset = math.min(sMax, math.max(sMin, self.criteriaOffset+ (arg1 * -1)))
self.frame.criteriaScroll:SetValue(self.criteriaOffset)
end
end
 
function self:ToggleFrame()
if self.frame == nil then self:Initialize("","") end
601,7 → 601,7
if copper > 0 then copper = format(self.moneyFormats.copper[fIndex], copper) else copper = "" end
 
compMin = gold .. (gold:len() > 0 and silver:len() > 0 and fSpace or "") ..
silver .. (silver:len() > 0 and copper:len() > 0 and fSpace or "") .. copper
silver .. (silver:len() > 0 and copper:len() > 0 and fSpace or "") .. copper
if compMin == "" then compMin = format(self.moneyFormats.copper[fIndex], 0) end
compMax = format(self.moneyFormats.gold[fIndex], compMax:sub(1, compMax:len() - 4))
 
704,15 → 704,15
self.frame:SetMovable(true)
 
self.frame:SetScript("OnMouseDown",function(self1,arg1)
if ( arg1 == "LeftButton" ) then
if ( arg1 == "LeftButton" ) then
self.frame:StartMoving()
end
end)
self.frame:SetScript("OnMouseUp",function(self1,arg1)
if ( arg1 == "LeftButton" ) then
end)
self.frame:SetScript("OnMouseUp",function(self1,arg1)
if ( arg1 == "LeftButton" ) then
self.frame:StopMovingOrSizing()
end
end)
end)
 
--Initialize arrays
self.frame.catButtons = {}
811,39 → 811,53
 
--Category Buttons
self.frame.catButtons[1] = self:CreateCategoryButton("$parentCatButton1", self.frame.category)
self.frame.catButtons[1]:SetPoint("TOPLEFT", self.frame.category, 12, -12)
for i=2, 28 do
self.frame.catButtons[1]:SetPoint("TOPLEFT", self.frame.category, 17, -17)
for i=2, 21 do
self.frame.catButtons[i] = self:CreateCategoryButton("$parentCatButton"..i, self.frame.category)
self.frame.catButtons[i]:SetPoint("TOPLEFT", self.frame.catButtons[i-1], "BOTTOMLEFT")
self.frame.catButtons[i]:SetPoint("TOPLEFT", self.frame.catButtons[i-1], "BOTTOMLEFT", 0, -5)
end
 
--Achievement Buttons
self.frame.achButtons[1] = self:CreateAchievementButton("$parentAchButton1", self.frame, 1)
self.frame.achButtons[1]:SetPoint("TOPLEFT", 12, -90)
self.frame.achButtons[1]:SetScript("OnEnter", function(self)
if ( UrbanAchiever.currentTab == "guild" ) then
if UrbanAchiever.currentTab == "guild" then
GameTooltip:SetOwner(self, "ANCHOR_RIGHT");
UrbanAchiever:CheckGuildMembersTooltip(self);
GameTooltip:Show();
else
if UrbanAchiever.currentTab == "achievements" then
GameTooltip:SetOwner(self, "ANCHOR_RIGHT");
UrbanAchiever:CheckCharOwnerTooltip(self);
GameTooltip:Show();
end
end
end)
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]:SetPoint("TOPLEFT", self.frame.achButtons[i-1], "BOTTOMLEFT")
self.frame.achButtons[i]:SetScript("OnEnter", function(self)
if ( UrbanAchiever.currentTab == "guild" ) then
if UrbanAchiever.currentTab == "guild" then
GameTooltip:SetOwner(self, "ANCHOR_RIGHT");
UrbanAchiever:CheckGuildMembersTooltip(self);
GameTooltip:Show();
else
if UrbanAchiever.currentTab == "achievements" then
GameTooltip:SetOwner(self, "ANCHOR_RIGHT");
UrbanAchiever:CheckCharOwnerTooltip(self);
GameTooltip:Show();
end
end
end)
self.frame.achButtons[i]:SetScript("OnLeave", function(self)
GameTooltip:Hide();
guildMemberRequestFrame = nil;
charOwnerRequestFrame = nil;
end)
end
 
899,65 → 913,21
self.frame.summaryBar.name:SetWidth(300)
 
--creatEachCategoryProgessBar
local lastFrameID
local lastFrame
local idxCat = 0
for i,id in ipairs(GetCategoryList()) do
tittleCat, parentCatID = GetCategoryInfo(id)
if ( parentCatID == -1 )then
idxCat = idxCat + 1
self.frame.category[id] = CreateFrame("StatusBar","categoryStatusBar"..id, self.frame, "AchievementProgressBarTemplate")
if idxCat == 1 then
lastFrameID = id
self.frame.category[id]:SetPoint("BOTTOMLEFT", self.frame, "BOTTOMLEFT", 15, 155)
else
if (idxCat%2) == 0 then
self.frame.category[id]:SetPoint("LEFT", self.frame.category[lastFrameID], "RIGHT", 20, 0)
else
self.frame.category[id]:SetPoint("TOPLEFT", self.frame.category[lastFrameID], "BOTTOMLEFT", 0, -5)
lastFrameID = id
end
end
self.frame.category[id]:SetWidth(290)
self.frame.category[id]:SetHeight(30)
self.frame.category[id].text:ClearAllPoints()
self.frame.category[id].text:SetPoint("RIGHT", -5, 0)
self.frame.category[id].text:SetJustifyH("RIGHT")
self.frame.category[id].name = self.frame.category[id]:CreateFontString("$parentName", "OVERLAY", "GameFontHighlightSmall")
self.frame.category[id].name:SetPoint("LEFT", 5, 0)
self.frame.category[id].name:SetJustifyH("LEFT")
self.frame.category[id].name:SetWidth(300)
self.frame.category[id]:Hide()
idxCat, lastFrame = self:createCategoryStatusBar(id, idxCat, lastFrame)
end
end
 
local lastFrameID
local lastFrame
local idxCat = 0
for i,id in ipairs(GetGuildCategoryList()) do
tittleCat, parentCatID = GetCategoryInfo(id)
if ( parentCatID == -1 or parentCatID == 15076 )then
idxCat = idxCat + 1
self.frame.category[id] = CreateFrame("StatusBar","categoryStatusBar"..id, self.frame, "AchievementProgressBarTemplate")
if idxCat == 1 then
lastFrameID = id
self.frame.category[id]:SetPoint("BOTTOMLEFT", self.frame, "BOTTOMLEFT", 15, 120)
else
if (idxCat%2) == 0 then
self.frame.category[id]:SetPoint("LEFT", self.frame.category[lastFrameID], "RIGHT", 20, 0)
else
self.frame.category[id]:SetPoint("TOPLEFT", self.frame.category[lastFrameID], "BOTTOMLEFT", 0, -5)
lastFrameID = id
end
end
self.frame.category[id]:SetWidth(290)
self.frame.category[id]:SetHeight(30)
self.frame.category[id].text:ClearAllPoints()
self.frame.category[id].text:SetPoint("RIGHT", -5, 0)
self.frame.category[id].text:SetJustifyH("RIGHT")
self.frame.category[id].name = self.frame.category[id]:CreateFontString("$parentName", "OVERLAY", "GameFontHighlightSmall")
self.frame.category[id].name:SetPoint("LEFT", 5, 0)
self.frame.category[id].name:SetJustifyH("LEFT")
self.frame.category[id].name:SetWidth(300)
self.frame.category[id]:Hide()
idxCat, lastFrame = self:createCategoryStatusBar(id, idxCat, lastFrame)
end
end
 
1052,12 → 1022,12
self.frame.display.reward = self.frame.display:CreateFontString("$parentReward", "ARTWORK", "GameFontNormal")
self.frame.display.reward:SetPoint("TOP", self.frame.display, "TOP", 0, -127)
self.frame.display.reward:SetTextColor(1,1,1)
 
 
--Display completed
self.frame.display.completed = self.frame.display:CreateFontString("$parentReward", "ARTWORK", "GameFontNormal")
self.frame.display.completed:SetPoint("TOP", self.frame.display, "TOP", 0, -60)
self.frame.display.completed:SetTextColor(0,1,0)
 
 
--Display repCriteria
self.frame.display.repCriteria = self.frame.display:CreateFontString("$parentReward", "ARTWORK", "GameFontNormal")
self.frame.display.repCriteria:SetPoint("BOTTOM", self.frame.display, "TOP", 0, 3)
1097,12 → 1067,14
GameTooltip:SetOwner(self, "ANCHOR_RIGHT",-50,0);
GameTooltip:AddLine(self.date, 1, 1, 1);
UrbanAchiever:CheckGuildMembersTooltip(self);
UrbanAchiever:CheckCharOwnerTooltip(self);
GameTooltip:Show();
end
end)
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)
1112,12 → 1084,14
GameTooltip:SetOwner(self, "ANCHOR_RIGHT",-50,0);
GameTooltip:AddLine(self.date, 1, 1, 1);
UrbanAchiever:CheckGuildMembersTooltip(self);
UrbanAchiever:CheckCharOwnerTooltip(self);
GameTooltip:Show();
end
end)
self.frame.display.criteriaButtons[i]:SetScript("OnLeave", function(self)
GameTooltip:Hide();
guildMemberRequestFrame = nil;
charOwnerRequestFrame = nil;
end)
end
 
1156,6 → 1130,44
self.frame:Hide()
end
 
function self:createCategoryStatusBar(id, idxCat, lastFrame)
idxCat = idxCat + 1
local categoryFrame = CreateFrame("StatusBar","categoryStatusBar"..id, self.frame, "AchievementFrameSummaryCategoryTemplate")
if idxCat == 1 then
lastFrame = "categoryStatusBar"..id
categoryFrame:SetPoint("BOTTOMLEFT", self.frame, "BOTTOMLEFT", 30, 150)
else
if (idxCat%2) == 0 then
categoryFrame:SetPoint("LEFT", lastFrame, "RIGHT", 30, 0)
else
categoryFrame:SetPoint("TOPLEFT", lastFrame, "BOTTOMLEFT", 0, -12)
lastFrame = "categoryStatusBar"..id
end
end
categoryFrame:SetID(id)
categoryFrame:SetScript("OnShow", function(self)
if self:GetID() ~= nil then
AchievementFrameSummaryCategory_OnShow (self)
end
end)
categoryFrame:SetScript("OnHide", function(self)
AchievementFrameSummaryCategory_OnHide(self)
end)
categoryFrame:SetWidth(270)
categoryFrame:SetHeight(21)
categoryFrame.text:ClearAllPoints()
categoryFrame.text:SetPoint("RIGHT", -5, 0)
categoryFrame.text:SetJustifyH("RIGHT")
categoryFrame.name = categoryFrame:CreateFontString("$parentName", "OVERLAY", "GameFontHighlightSmall")
categoryFrame.name:SetPoint("LEFT", 5, 0)
categoryFrame.name:SetJustifyH("LEFT")
categoryFrame.name:SetWidth(300)
categoryFrame.name:SetText(tittleCat)
categoryFrame:Hide()
 
return idxCat, lastFrame
end
 
function self:CheckGuildMembersTooltip(requestFrame)
if ( self.currentTab == "guild" ) then
local achievementId = requestFrame.id;
1174,7 → 1186,7
-- add a line break if the tooltip shows completed date (meta tooltip)
if ( GameTooltip:NumLines() > 0 ) then
GameTooltip:AddLine(" ");
end
end
GameTooltip:AddLine(GUILD_ACHIEVEMENT_EARNED_BY, 1, 1, 1);
local leftMemberName;
for i = 1, numMembers do
1183,14 → 1195,14
leftMemberName = nil;
else
leftMemberName = GetGuildAchievementMemberInfo(achievementId, i);
end
end
end
-- check for leftover name
if ( leftMemberName ) then
GameTooltip:AddLine(leftMemberName);
end
end
-- otherwise check if criteria has names
-- otherwise check if criteria has names
elseif ( flags ~= nil ) then
if ( bit.band(flags, ACHIEVEMENT_FLAGS_SHOW_CRITERIA_MEMBERS) == ACHIEVEMENT_FLAGS_SHOW_CRITERIA_MEMBERS ) then
local numCriteria = GetAchievementNumCriteria(achievementId);
1214,10 → 1226,47
end
end
 
function self:CheckCharOwnerTooltip(requestFrame)
if ( self.currentTab == "achievements" ) then
local accountWide = false
local achievementId = requestFrame.id;
if achievementId == nil then
achievementId = requestFrame:GetID();
end
local _, _, _, achievementCompleted, _, _, _, _, flags, _, _, isGuild, wasEarnedByMe, earnedBy = GetAchievementInfo(achievementId);
if isGuild then
return;
end
if flags ~= nil then
if ( bit.band(flags, ACHIEVEMENT_FLAGS_ACCOUNT) == ACHIEVEMENT_FLAGS_ACCOUNT ) then
accountWide = true
end
end
if accountWide then
if achievementCompleted then
GameTooltip:AddLine(ACCOUNT_WIDE_ACHIEVEMENT_COMPLETED);
else
GameTooltip:AddLine(ACCOUNT_WIDE_ACHIEVEMENT);
end
return;
end
if earnedBy then
GameTooltip:AddLine(format(ACHIEVEMENT_EARNED_BY,earnedBy));
local me = UnitName("player")
if ( not wasEarnedByMe ) then
GameTooltip:AddLine(format(ACHIEVEMENT_NOT_COMPLETED_BY, me));
elseif ( me ~= earnedBy ) then
GameTooltip:AddLine(format(ACHIEVEMENT_COMPLETED_BY, me));
end
return;
end
end
end
 
function self:CreateCategoryButton(name, parent)
local button = CreateFrame("Button", name, parent)
button:EnableMouseWheel(true)
button:SetWidth(150)
button:SetWidth(160)
button:SetHeight(16)
 
button.offset = CreateFrame("Frame","$parentOffset", button)
1239,7 → 1288,7
button.bg:SetTexCoord(0.025, 0.64, 0.1, 0.75)
button.bg:SetPoint("TOPLEFT", button.offset, "TOPRIGHT")
--button.bg:SetPoint("BOTTOMRIGHT")
button.bg:SetWidth(140)
button.bg:SetWidth(150)
button.bg:SetHeight(16)
 
local highlightTexture = button:CreateTexture()
1615,7 → 1664,7
}
 
if not GetNextAchievement(i) then
--If this isnt in the middle of a chain, add it to the category listing
--If this isnt in the middle of a chain, add it to the category listing
category = GetAchievementCategory(i)
if not self.seriesList[category] then
self.seriesList[category] = {}
1676,8 → 1725,8
for parentKey, parentCat in next, self.categories[tab] do
if childParent == parentCat.id then
tinsert(parentCat.children,{
["id"] = childId,
["name"] = childName
["id"] = childId,
["name"] = childName
})
end
end
1685,7 → 1734,7
end
 
function self:SetAchievementButton(button, id, offset)
local retok, id, name, points, completed, month, day, year, description, _,icon, reward = pcall (GetAchievementInfo,id)
local retok, id, name, points, completed, month, day, year, description, flags,icon, reward = pcall(GetAchievementInfo,id)
if not retok then return nil end
 
if completed then
1714,11 → 1763,19
self.frame.achButtons[button].compare:SetText("")
self.frame.achButtons[button].comparison:Hide()
 
self.frame.achButtons[button].background:SetVertexColor(1, 1, 1)
if flags ~= nil then
if ( bit.band(flags, ACHIEVEMENT_FLAGS_ACCOUNT) == ACHIEVEMENT_FLAGS_ACCOUNT ) then
self.frame.achButtons[button].background:SetVertexColor(1, 0, 1)
end
end
 
 
self.frame.achButtons[button].background:SetTexture("Interface\\AchievementFrame\\UI-Achievement-Parchment-Horizontal")
self.frame.achButtons[button].comparison.background:SetTexture("Interface\\AchievementFrame\\UI-Achievement-Parchment-Horizontal")
 
if self.isAchList[GetAchievementCategory(id)] == false and self.isGuildList[GetAchievementCategory(id)] == false then
--Its a statistic, no date, no points
--Its a statistic, no date, no points
self.frame.achButtons[button].stat:SetText(self:FormatString(GetStatistic(id)))
self.frame.achButtons[button].points:SetText("")
 
1732,8 → 1789,8
 
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")
--else
-- self.frame.achButtons[button].background:SetTexture("Interface\\AchievementFrame\\UI-Achievement-Parchment-Horizontal")
end
 
if IsTrackedAchievement(id) then
1863,8 → 1920,8
self.frame.display.points:SetText(points)
self.frame.display.shield:SetTexture("Interface\\AchievementFrame\\UI-Achievement-Shields")
end
 
 
 
 
if self.currentTab == "guild" then
requiresRep, hasRep, repLevel = GetAchievementGuildRep(self.currentAch);
if ( requiresRep ) then
1884,7 → 1941,7
else
self.frame.display.repCriteria:Hide();
end
 
 
if completed == "" then
self.frame.display.shield:SetTexCoord(.5, 1, 0, .5)
self.frame.display.points:SetVertexColor(.65, .65, .65)
1933,14 → 1990,14
self.frame.display.criteriaButtons[buttonNum].icon:Hide()
self.frame.display.criteriaButtons[buttonNum].comparison:Hide()
offset = 1
 
 
criteriaName, criteriaType, criteriaCompleted, criteriaQuantity, criteriaReqQuantity, charName, criteriaFlags, criteriaAssetID, quantityStr =
GetAchievementCriteriaInfo(self.currentAch, a)
GetAchievementCriteriaInfo(self.currentAch, a)
if criteriaType then --Some Achievements seem to throw out the wrong number of criteria, causing errors.
if criteriaType == CRITERIA_TYPE_ACHIEVEMENT and criteriaAssetID then
id, criteriaName, _, criteriaCompleted, month, day, year, _, _, icon = GetAchievementInfo(criteriaAssetID);
end
 
 
if criteriaCompleted then
str = "|CFF00FF00"
else
1950,7 → 2007,8
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
--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()
1962,7 → 2020,7
else
self.frame.display.criteriaButtons[buttonNum].comparison:SetTexture("Interface\\RaidFrame\\ReadyCheck-NotReady")
end
end
end]]
 
if criteriaType == CRITERIA_TYPE_ACHIEVEMENT and criteriaAssetID then
--Its a meta achievement
2198,6 → 2256,7
self.frame.achButtons[buttonNum].comparison.background:SetTexture("Interface\\AchievementFrame\\UI-Achievement-Parchment-Horizontal-Desaturated")
self.frame.achButtons[buttonNum].offset:SetWidth(1)
self.frame.achButtons[buttonNum]:UnlockHighlight()
self.frame.achButtons[buttonNum].background:SetVertexColor(1, 1, 1)
if self.isComparing then
self.frame.achButtons[buttonNum]:SetWidth(370)
self.frame.achButtons[buttonNum].comparison:Show()
2212,7 → 2271,7
 
self.frame.achButtons[buttonNum]:Hide()
buttonNum = buttonNum + 1
 
 
self.frame.achButtons[buttonNum]:SetWidth(300)
self.frame.achButtons[buttonNum].name:SetText(UARecentGuildAchiev .. ":")
self.frame.achButtons[buttonNum].completed:SetText("")
2226,6 → 2285,7
self.frame.achButtons[buttonNum].comparison.background:SetTexture("Interface\\AchievementFrame\\UI-Achievement-Parchment-Horizontal-Desaturated")
self.frame.achButtons[buttonNum].offset:SetWidth(1)
self.frame.achButtons[buttonNum]:UnlockHighlight()
self.frame.achButtons[buttonNum].background:SetVertexColor(1, 1, 1)
if self.isComparing then
self.frame.achButtons[buttonNum]:SetWidth(370)
self.frame.achButtons[buttonNum].comparison:Show()
2238,54 → 2298,6
buttonNum = buttonNum + 1
end
 
--new in sumarry
local numTotal, numDone
local catName
local parentCatID
local id
local numItems, numCompleted
local numItems2, numCompleted2
 
for i,id in ipairs(GetCategoryList()) do
catName, parentCatID = GetCategoryInfo(id)
if parentCatID == -1 then
numTotal, numDone = self:GetRealCategoryNumAchievements(id)
for i2,id2 in ipairs(GetCategoryList()) do
_, parentCatID2 = GetCategoryInfo(id2)
if parentCatID2 == id then
numItems, numCompleted = self:GetRealCategoryNumAchievements(id2)
numTotal = (numTotal + numItems)
numDone = (numDone + numCompleted)
end
end
self.frame.category[id]:Hide()
self.frame.category[id]:SetMinMaxValues(0, numTotal)
self.frame.category[id]:SetValue(numDone)
self.frame.category[id].text:SetText(numDone .. "/" .. numTotal)
self.frame.category[id].name:SetText(catName)
end
end
 
for i,id in ipairs(GetGuildCategoryList()) do
catName, parentCatID = GetCategoryInfo(id)
if parentCatID == -1 or parentCatID == 15076 then
numTotal, numDone = self:GetRealCategoryNumAchievements(id)
for i2,id2 in ipairs(GetGuildCategoryList()) do
_, parentCatID2 = GetCategoryInfo(id2)
if parentCatID2 == id then
numItems, numCompleted = self:GetRealCategoryNumAchievements(id2)
numTotal = (numTotal + numItems)
numDone = (numDone + numCompleted)
end
end
self.frame.category[id]:Hide()
self.frame.category[id]:SetMinMaxValues(0, numTotal)
self.frame.category[id]:SetValue(numDone)
self.frame.category[id].text:SetText(numDone .. "/" .. numTotal)
self.frame.category[id].name:SetText(catName)
end
end
 
if self.currentTab == "guild" then
self:HideCategorySum()
self:ShowCategorySumGuild()
2334,6 → 2346,7
name = UATotal
compareCat = -1
else
print('=='..self.currentCat)
total, completed = GetCategoryNumAchievements(self.currentCat)
name = GetCategoryInfo(self.currentCat)
end
2385,9 → 2398,6
function self:SetComparisonUnit(unit)
if not UnitExists(unit) then return end
 
--Called to prevent errors from being thrown by the default UI
achievementFunctions.selectedCategory = achievementFunctions.selectedCategory or 96
 
self.isComparing = true
self.comparisonUnit = unit
self.comparisonUnitName = UnitName(unit)