WoWInterface SVN UrbanAchiever

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /trunk
    from Rev 108 to Rev 109
    Reverse comparison

Rev 108 → Rev 109

Localization.ruRU.lua
36,4 → 36,5
UAOptions = "Настройки";
UAAchievementDone = "Вы уже получили это достижение, отслеживание невозможно.";
UAGuild = "Guild"
UARecentGuildAchiev = "Recent Guild Achievements"
end
\ No newline at end of file
Main.lua
58,7 → 58,7
_,b = GetAchievementInfo(b)
return a < b
end,
 
 
["name a"] = function(a, b)
_,a1 = GetAchievementInfo(a)
_,b1 = GetAchievementInfo(b)
66,7 → 66,7
assert(b1, "b "..b)
return a1 > b1
end,
 
 
["points d"] = function(a, b)
if self.isAchList[GetAchievementCategory(a)] or self.isGuildList[GetAchievementCategory(a)] then
_,_,a = GetAchievementInfo(a)
80,7 → 80,7
end
return a < b
end,
 
 
["points a"] = function(a, b)
if self.isAchList[GetAchievementCategory(a)] or self.isGuildList[GetAchievementCategory(a)] then
_,_,a = GetAchievementInfo(a)
94,7 → 94,7
end
return a > b
end,
 
 
["completed d"] = function(a, b)
local _,_,_,_,a1,a2,a3 = GetAchievementInfo(a)
a1, a2, a3 = a1 or 0, a2 or 0, a3 or 0
105,7 → 105,7
if a2 ~= b2 then return a2 < b2 end --Finally Days
return false --They're exactly the same, return false
end,
 
 
["completed a"] = function(a, b)
local _,_,_,_,a1,a2,a3 = GetAchievementInfo(a)
a1, a2, a3 = a1 or 0, a2 or 0, a3 or 0
116,7 → 116,7
if a2 ~= b2 then return a2 > b2 end --Finally Days
return false --They're exactly the same, return false
end,
 
 
["compare d"] = function(a, b)
if not self.isComparing then return false end
--They're both achievements, go by date
136,21 → 136,21
else
a = GetStatistic(a)
end
 
 
if self.isAchList[GetAchievementCategory(b)] or self.isGuildList[GetAchievementCategory(b)] then
local _,b1, b2, b3 = GetAchievementComparisonInfo(b,1)
b = (b1 or "") .. "/" .. (b2 or "") .. "/" .. (b3 or "")
else
b = GetStatistic(b)
end
 
 
return a < b
end
end,
 
 
["compare a"] = function(a, b)
if not self.isComparing then return false end
 
 
if (self.isAchList[GetAchievementCategory(a)] and self.isAchList[GetAchievementCategory(b)]) or (self.isGuildList[GetAchievementCategory(a)] and self.isGuildList[GetAchievementCategory(b)]) then
local _,a1,a2,a3 = GetAchievementComparisonInfo(a,1)
a1, a2, a3 = a1 or 0, a2 or 0, a3 or 0
161,21 → 161,21
if a2 ~= b2 then return a2 > b2 end --Finally Days
return false --They're exactly the same, return false
end
 
 
if self.isAchList[GetAchievementCategory(a)] or self.isGuildList[GetAchievementCategory(a)] then
local _,a1, a2, a3 = GetAchievementComparisonInfo(a,1)
a = (a1 or "") .. "/" .. (a2 or "") .. "/" .. (a3 or "")
else
a = GetStatistic(a)
end
 
 
if self.isAchList[GetAchievementCategory(b)] or self.isGuildList[GetAchievementCategory(b)] then
local _,b1, b2, b3 = GetAchievementComparisonInfo(b,1)
b = (b1 or "") .. "/" .. (b2 or "") .. "/" .. (b3 or "")
else
b = GetStatistic(b)
end
 
 
return a > b
end
}
211,7 → 211,7
["trackTimed"] = true,
}
-------------------------------------------------------------
--Local functions
--Local functions
-------------------------------------------------------------
local function debug(...)
if DBG then print(...) end
223,25 → 223,25
return GANC(...) or 0
end
-------------------------------------------------------------
--Startup Stuff
--Startup Stuff
-------------------------------------------------------------
function self:Initialize(event, name)
self:UnregisterEvent("ADDON_LOADED")
debug("Initializing")
self:PopulateMasterList()
 
 
self:PopulateCategories("achievements")
self:PopulateCategories("statistics")
self:PopulateCategories("guild")
 
 
--self:PopulateAchievements("achievements")
--self:PopulateAchievements("statistics")
 
 
--self:CreateTracker()
self:SetupFrames()
 
 
UrbanAchiever:CreateOptions()
 
 
end
 
function self:OnEnable()
256,9 → 256,8
end)
self:RegisterEvent("CRITERIA_UPDATE", function()
self:RefreshCriteriaButtons()
--self:TrackerUpdate()
end)
 
 
self:RegisterEvent("INSPECT_ACHIEVEMENT_READY", function()
if self.isComparing then
self:ComparisonUpdate()
266,19 → 265,18
self.frame:Show()
end
end)
 
 
--I loooooove that this event gets called for any achievement, not just when you're tracking it.
self:RegisterEvent("TRACKED_ACHIEVEMENT_UPDATE", function(event, ...)
local id, criteriaID, elapsed, duration = ...
--print("TAU", id, criteriaID, elapsed, duration)
if not elapsed or not duration or not UASVPC.trackTimed then return end
if elapsed < duration then
AddTrackedAchievement(id)
AddTrackedAchievement(id)
elseif IsTrackedAchievement(id) and elapsed >= duration then
RemoveTrackedAchievement(id)
end
end)
 
 
--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.
291,16 → 289,15
end
end
end
 
 
SlashCmdList["ACHIEVEMENTUI"] = function(msg)
self:ToggleFrame()
end
 
 
self:HookAlertFrames()
self:HookMicroMenu()
self:HookWatchFrame()
 
--self:Hook("AchievementAlertFrame_OnClick")
 
self:SecureHook("UnitPopup_ShowMenu")
end
 
308,7 → 305,7
self:UnregisterEvent("ADDON_LOADED")
self:UnregisterEvent("ACHIEVEMENT_EARNED")
self:UnregisterEvent("CRITERIA_UPDATE")
 
 
--Go back to the original button.
for j = 1, #menuTypes do
local t = menuTypes[j]
332,25 → 329,25
end
end
end
end
end
 
function self:HookAlertFrames()
if not AchievementFrame then
AchievementFrame_LoadUI()
end
 
 
CreateFrame("Button", "AchievementAlertFrame1", UIParent, "AchievementAlertFrameTemplate")
AchievementAlertFrame1:SetPoint("BOTTOM", UIParent, "BOTTOM", 0, 128)
CreateFrame("Button", "AchievementAlertFrame2", UIParent, "AchievementAlertFrameTemplate")
AchievementAlertFrame2:SetPoint("BOTTOM", AchievementAlertFrame1, "TOP", 0, -10)
 
 
AchievementAlertFrame1:SetScript("OnClick", function(button)
local id = button.id
self.frame:Show()
self:SetDisplayAchievement(id, true)
self:SetCategory(id)
end)
 
 
AchievementAlertFrame2:SetScript("OnClick", function(button)
local id = button.id
self.frame:Show()
363,7 → 360,7
AchievementMicroButton:SetScript("OnClick", function()
self:ToggleFrame()
end)
 
 
AchievementMicroButton:SetScript("OnEnter", function(frame)
frame.tooltipText = MicroButtonTooltipText(ACHIEVEMENT_BUTTON, "URBANACHIEVER_TOGGLE")
GameTooltip_AddNewbieTip(frame, frame.tooltipText, 1.0, 1.0, 1.0, NEWBIE_TOOLTIP_ACHIEVEMENT);
395,18 → 392,18
end
end
-------------------------------------------------------------
--Utilities
--Utilities
-------------------------------------------------------------
function self:InsertIntoChat(id)
--Taken from Historian, thanks Ixchael!
if (ChatFrame1EditBox == nil) then
return;
if (ChatFrame1EditBox == nil) then
return;
end;
 
if not ChatFrame1EditBox:IsVisible() then
 
if not ChatFrame1EditBox:IsVisible() then
ChatFrame1EditBox:Show();
end;
 
 
ChatFrame1EditBox:Insert(GetAchievementLink(id));
end
 
451,7 → 448,7
end
end
end
 
 
self.currentCat = -2
self:RefreshAchievementButtons("name a")
end
463,7 → 460,7
if not id then return nil end
if completed then
if year < 10 then
year = "0" .. year;
year = "0" .. year;
end
if (GetLocale() == "frFR" or GetLocale() == "ruRU") then
completed = day .. "/" .. month .. "/" .. year;
526,7 → 523,7
function self:SetCategory(id)
if id == nil then id = self.currentAch end
if not self.masterList[id] then return end
 
 
local category = GetAchievementCategory(id)
if self.isAchList[category] then
self.currentTab = "achievements"
537,7 → 534,7
self.currentTab = "statistics"
end
end
 
 
self.currentCat = category
local _, catParent = GetCategoryInfo(category)
if catParent ~= -1 then --It's a child category, expand the parent
563,7 → 560,7
local gold, silver, copper = "","",""
if length <= 2 then -- 1-2
copper = compMin
elseif length <= 4 then -- 3-4
elseif length <= 4 then -- 3-4
silver = compMin:sub(1, length - 2)
copper = compMin:sub(length-1)
else -- 5+
574,16 → 571,16
gold = tonumber(gold) or 0
silver = tonumber(silver) or 0
copper = tonumber(copper) or 0
 
 
if gold > 0 then gold = format(self.moneyFormats.gold[fIndex], gold) else gold = "" end
if silver > 0 then silver = format(self.moneyFormats.silver[fIndex], silver) else silver = "" end
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 "") ..
 
compMin = gold .. (gold:len() > 0 and silver:len() > 0 and fSpace or "") ..
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))
 
 
return compMin, compMax
end
 
610,8 → 607,51
end
end
-------------------------------------------------------------
--Frame Stuff
--Frame Stuff
-------------------------------------------------------------
 
function self:HideCategorySum()
categoryStatusBar92:Hide();
categoryStatusBar96:Hide();
categoryStatusBar97:Hide();
categoryStatusBar95:Hide();
categoryStatusBar168:Hide();
categoryStatusBar169:Hide();
categoryStatusBar201:Hide();
categoryStatusBar155:Hide();
categoryStatusBar81:Hide();
end
function self:ShowCategorySum()
categoryStatusBar92:Show();
categoryStatusBar96:Show();
categoryStatusBar97:Show();
categoryStatusBar95:Show();
categoryStatusBar168:Show();
categoryStatusBar169:Show();
categoryStatusBar201:Show();
categoryStatusBar155:Show();
categoryStatusBar81:Hide();
end
function self:HideCategorySumGuild()
categoryStatusBar15088:Hide();
categoryStatusBar15077:Hide();
categoryStatusBar15078:Hide();
categoryStatusBar15079:Hide();
categoryStatusBar15080:Hide();
categoryStatusBar15089:Hide();
categoryStatusBar15093:Hide();
end
function self:ShowCategorySumGuild()
categoryStatusBar15088:Show();
categoryStatusBar15077:Show();
categoryStatusBar15078:Show();
categoryStatusBar15079:Show();
categoryStatusBar15080:Show();
categoryStatusBar15089:Show();
categoryStatusBar15093:Hide();
 
end
 
function self:SetupFrames()
if self.frame then self.frame:Show() return end
--Start with the frame and backdrop
634,7 → 674,7
self.frame:SetFrameStrata("DIALOG")
self.frame:EnableMouse(true)
self.frame:SetMovable(true)
 
 
self.frame:SetScript("OnMouseDown",function(self1,arg1)
if ( arg1 == "LeftButton" ) then
self.frame:StartMoving()
645,20 → 685,20
self.frame:StopMovingOrSizing()
end
end)
 
 
--Initialize arrays
self.frame.catButtons = {}
self.frame.achButtons = {}
self.frame.tabButtons = {}
self.frame.achSort = {}
 
 
--Header
local header = self.frame:CreateTexture("$parentHeader", "ARTWORK")
header:SetTexture("Interface\\DialogFrame\\UI-DialogBox-Header")
header:SetWidth(256)
header:SetHeight(64)
header:SetPoint("TOP")
 
 
--Points Display Shield
local shield = self.frame:CreateTexture("$parentPointShield", "ARTWORK")
shield:SetTexture("Interface\\AchievementFrame\\UI-Achievement-TinyShield")
666,25 → 706,24
shield:SetHeight(20)
shield:SetPoint("TOP", 76, -14)
shield:SetTexCoord(0, 0.6, 0, 0.6)
 
 
--Header Text
local headerText = self.frame:CreateFontString("$parentHeaderText", "ARTWORK", "GameFontNormal")
headerText:SetText("Urban Achiever")
headerText:SetPoint("CENTER", header, 0, 12)
 
 
--Points Text
self.pointsText = self.frame:CreateFontString("$parentPointText", "ARTWORK", "GameFontNormal")
self.pointsText:SetText("12345")
self.pointsText:SetPoint("LEFT", shield, "RIGHT", 0, 2)
 
 
--Comparison parent frame
self.comparison = CreateFrame("Frame", nil, self.frame)
 
 
--Comparison Points Text
self.compPointsText = self.comparison:CreateFontString("$parentCompPointText", "ARTWORK", "GameFontNormal")
self.compPointsText:SetText("12345")
self.compPointsText:SetPoint("TOPRIGHT", self.frame, "TOP", -67, -14)
 
 
--Comparison Points Display Shield
self.compShield = self.comparison:CreateTexture("$parentCompPointShield", "ARTWORK")
self.compShield:SetTexture("Interface\\AchievementFrame\\UI-Achievement-TinyShield")
692,12 → 731,12
self.compShield:SetHeight(20)
self.compShield:SetPoint("RIGHT", self.compPointsText, "LEFT", 0, -2)
self.compShield:SetTexCoord(0, 0.6, 0, 0.6)
 
 
--Comparison Header Text
self.compHeaderText = self.comparison:CreateFontString("$parentCompHeaderText", "ARTWORK", "GameFontNormal")
self.compHeaderText:SetText(UAComparing .. " [Name here]")
self.compHeaderText:SetPoint("RIGHT", self.compShield, "LEFT", -5, 2)
 
 
--Comparison Button
--[[
local compSetButton = CreateFrame("Button", "$parentComparisonSetButton", self.frame)
711,7 → 750,7
self:SetComparisonUnit("target")
end)
]]--
 
 
--Category Frame
self.frame.category = CreateFrame("Frame", "$parentCategoryFrame", self.frame)
self.frame.category:SetWidth(190)
728,20 → 767,20
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[1] = self:CreateTab("$parentTab1", self.frame, UAAchievement, "achievements")
self.frame.tabButtons[1]:SetPoint("TOPLEFT", self.frame, "BOTTOMLEFT", 20, 6)
 
 
self.frame.tabButtons[2] = self:CreateTab("$parentTab1", self.frame, UAStatistic, "statistics")
self.frame.tabButtons[2]:SetPoint("TOPLEFT", self.frame.tabButtons[1], "TOPRIGHT", 5, 0)
 
 
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, 12, -12)
749,7 → 788,7
self.frame.catButtons[i] = self:CreateCategoryButton("$parentCatButton"..i, self.frame.category)
self.frame.catButtons[i]:SetPoint("TOPLEFT", self.frame.catButtons[i-1], "BOTTOMLEFT")
end
 
 
--Achievement Buttons
self.frame.achButtons[1] = self:CreateAchievementButton("$parentAchButton1", self.frame, 1)
self.frame.achButtons[1]:SetPoint("TOPLEFT", 12, -90)
757,25 → 796,25
self.frame.achButtons[i] = self:CreateAchievementButton("$parentAchButton" .. i, self.frame)
self.frame.achButtons[i]:SetPoint("TOPLEFT", self.frame.achButtons[i-1], "BOTTOMLEFT")
end
 
 
--Achievement Sort Buttons
self.frame.achSort.name = self:CreateAchievementSortButton("$parentSortNameButton", 190, self.frame, UASORT_Name, "name")
self.frame.achSort.name:SetPoint("BOTTOMLEFT", self.frame.achButtons[1], "TOPLEFT", 10, 1)
 
 
self.frame.achSort.points = self:CreateAchievementSortButton("$parentSortPointsButton", 48, self.frame, UASORT_Points, "points")
self.frame.achSort.points:SetPoint("LEFT", self.frame.achSort.name, "RIGHT", 1, 0)
 
 
self.frame.achSort.completed = self:CreateAchievementSortButton("$parentSortCompletedButton", 50, self.frame, UASORT_Date, "completed")
self.frame.achSort.completed:SetPoint("LEFT", self.frame.achSort.points, "RIGHT", 1, 0)
 
 
self.frame.achSort.comparison = self:CreateAchievementSortButton("$parentSortComparisonButton", 70, self.frame, UASORT_Compare, "compare")
self.frame.achSort.comparison:SetPoint("LEFT", self.frame.achSort.completed, "RIGHT", 1, 0)
self.frame.achSort.comparison:Hide()
 
 
--Close Button
self.frame.close = CreateFrame("Button", "$parentCloseButton", self.frame, "UIPanelCloseButton")
self.frame.close:SetPoint("TOPRIGHT", self.frame, "TOPRIGHT", -4, -5)
 
 
--Category Toggle Button
self.frame.catToggle = CreateFrame("Button", "$parentCategoryToggleButton", self.frame)
self.frame.catToggle:SetNormalTexture("Interface\\Buttons\\UI-SpellbookIcon-PrevPage-Up")
791,12 → 830,12
self.frame.category:Show()
end
end)
 
 
--Search Editbox
self.frame.editbox = self:CreateEditbox(self.frame)
self.frame.editbox:SetWidth(200)
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)
808,7 → 847,7
self.frame.summaryBar.name:SetPoint("LEFT", 5, 0)
self.frame.summaryBar.name:SetJustifyH("LEFT")
self.frame.summaryBar.name:SetWidth(300)
 
 
--creatEachCategoryProgessBar
local lastFrameID
local idxCat = 0
819,7 → 858,7
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)
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)
840,8 → 879,39
self.frame.category[id]:Hide()
end
end
 
 
 
local lastFrameID
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()
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)
855,7 → 925,7
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.category, "UIPanelScrollBarTemplate")
self.frame.catScroll:SetPoint("TOPLEFT", self.frame.catButtons[2], "TOPRIGHT")
865,7 → 935,7
self.frame.catScroll:SetValueStep(1)
self.frame.catScroll:SetScript("OnValueChanged", UrbanAchiever_OnCatScroll)
self.frame.catScroll:SetValue(1)
 
 
--Achievement Button Scroll Bar
self.frame.achScroll = CreateFrame("Slider", "$parentAchSlider", self.frame, "UIPanelScrollBarTemplate")
self.frame.achScroll:SetPoint("TOPLEFT", self.frame.achButtons[2], "TOPRIGHT")
875,20 → 945,20
self.frame.achScroll:SetValueStep(1)
self.frame.achScroll:SetScript("OnValueChanged",UrbanAchiever_OnAchScroll)
self.frame.achScroll:SetValue(1)
 
 
--Achievement Display Frame
self.frame.display = CreateFrame("Frame", "$parentDisplayFrame", self.frame)
self.frame.display.backdrop = self.frame.display:CreateTexture("$parentBG", "BACKGROUND")
self.frame.display.backdrop:SetPoint("TOPLEFT")
self.frame.display.backdrop:SetPoint("BOTTOMRIGHT")
--self.frame.display.backdrop:SetTexture(1,0,0,1)
 
 
 
 
self.frame.display:SetWidth(290)
self.frame.display:SetHeight(463)
self.frame.display:SetPoint("TOPRIGHT", -13, -75) -- , self.frame.achButtons[1], "TOPRIGHT", 19, 0)
self.frame.display:Hide()
 
 
--Display Icon
self.frame.display.icon = self.frame.display:CreateTexture(nil, "ARTWORK")
self.frame.display.icon:SetWidth(64)
898,7 → 968,7
--self.frame.display.icon:SetScript("OnClick", function()
-- self:InsertIntoChat(self.currentAch)
--end)
 
 
--Display Name
self.frame.display.name = self.frame.display:CreateFontString("$parentName", "ARTWORK", "AchievementPointsFont")
self.frame.display.name:SetPoint("TOPLEFT", self.frame.display.icon, "TOPRIGHT", 5, 0)
907,7 → 977,7
self.frame.display.name:SetHeight(70)
self.frame.display.name:SetJustifyH("CENTER")
self.frame.display.name:SetJustifyV("TOP")
 
 
--Display Shield Icon
self.frame.display.shield = self.frame.display:CreateTexture("$parentShield", "ARTWORK")
self.frame.display.shield:SetPoint("TOPLEFT", self.frame.display.icon, "BOTTOMLEFT", 0, -5)
915,11 → 985,11
self.frame.display.shield:SetTexCoord(0, 0.5, 0.5, 1);
self.frame.display.shield:SetWidth(64)
self.frame.display.shield:SetHeight(64)
 
 
--Display Points
self.frame.display.points = self.frame.display:CreateFontString("$parentPoints", "ARTWORK", "AchievementPointsFont")
self.frame.display.points:SetPoint("CENTER", self.frame.display.shield, "CENTER", 0, 3)
 
 
--Display Description
self.frame.display.desc = self.frame.display:CreateFontString("$parentDescription", "ARTWORK", "GameFontNormal")
self.frame.display.desc:SetPoint("TOPLEFT", self.frame.display.shield, "TOPRIGHT", 5, 0)
927,39 → 997,39
self.frame.display.desc:SetWidth(220)
self.frame.display.desc:SetHeight(65)
self.frame.display.desc:SetTextColor(1,1,1)
 
 
--Display Reward
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 Compare Completed
self.frame.display.compareDate = self.frame.display:CreateFontString("$parentReward", "ARTWORK", "GameFontNormal")
self.frame.display.compareDate:SetPoint("TOP", self.frame.display.reward, "BOTTOM", 0, -1)
self.frame.display.compareDate:SetTextColor(0,1,0)
self.frame.display.compareDate:SetText("Tomate " .. UACompleted .. ": 12/12/12")
self.frame.display.compareDate:Hide()
 
 
--Display Bar
self.frame.display.bar = CreateFrame("StatusBar", "$parentBar", self.frame.display, "AchievementProgressBarTemplate")
--self.frame.display.bar.text:SetFontObject("GameFontHighlight")
self.frame.display.bar.text:SetWidth(200)
self.frame.display.bar:SetPoint("CENTER", self.frame.display, 0, 60)
 
 
--Display Comparison Bar
self.frame.display.compareBar = CreateFrame("StatusBar", "$parentCompareBar", self.frame.display, "AchievementProgressBarTemplate")
--self.frame.display.compareBar.text:SetFontObject("GameFontHighlight")
self.frame.display.compareBar.text:SetWidth(200)
self.frame.display.compareBar:ClearAllPoints()
self.frame.display.compareBar:SetPoint("TOP", self.frame.display.bar, "BOTTOM", 0, -25)
 
 
--Display Comparison Bar Name Text
self.frame.display.compareBar.nameText = self.frame.display.compareBar:CreateFontString("$parentNameText", "ARTWORK", "GameFontNormal")
self.frame.display.compareBar.nameText:SetTextColor(1,1,1)
self.frame.display.compareBar.nameText:SetPoint("BOTTOM", self.frame.display.compareBar, "TOP", 0, 5)
 
 
self.frame.display.criteriaButtons = {}
 
 
--Criteria Buttons
self.frame.display.criteriaButtons[1] = self:CreateCriteriaButton("$parentCriteriaButton1", self.frame.display)
self.frame.display.criteriaButtons[1]:SetPoint("TOPLEFT", 0, -160)
967,7 → 1037,7
self.frame.display.criteriaButtons[i] = self:CreateCriteriaButton("$parentCriteriaButton" .. i, self.frame.display)
self.frame.display.criteriaButtons[i]:SetPoint("TOPLEFT", self.frame.display.criteriaButtons[i-1], "BOTTOMLEFT")
end
 
 
--Display Scroll Bar
self.frame.criteriaScroll = CreateFrame("Slider", "$parentSlider", self.frame.display, "UIPanelScrollBarTemplate")
self.frame.criteriaScroll:SetPoint("TOPLEFT", self.frame.display.criteriaButtons[2], "TOPRIGHT", 1,0)
978,16 → 1048,16
self.frame.criteriaScroll:SetScript("OnValueChanged", UrbanAchiever_OnCriteriaScroll)
self.frame.criteriaScroll:SetValue(1)
self.frame.criteriaScroll:Show()
 
 
self.frame.display.criteria = self.frame.display:CreateFontString("$parentCriteria", "ARTWORK", "GameFontNormal")
self.frame.display.criteria:SetPoint("TOPLEFT", 0, -135)
self.frame.display.criteria:SetJustifyH("LEFT")
self.frame.display.criteria:SetJustifyV("TOP")
 
 
tinsert(UISpecialFrames,self.frame:GetName())
self.frame:SetScript("OnShow", function()
self:UpdateFunction()
 
 
if self.masterList[self.currentAch] then
self:SetDisplayAchievement(self.currentAch)
end
999,7 → 1069,7
end)
 
self:UpdateFunction()
 
 
self.frame:Hide()
end
 
1008,12 → 1078,12
button:EnableMouseWheel(true)
button:SetWidth(150)
button:SetHeight(16)
 
 
button.offset = CreateFrame("Frame","$parentOffset", button)
button.offset:SetPoint("TOPLEFT")
button.offset:SetWidth(1)
button.offset:SetHeight(16)
 
 
button.text = button:CreateFontString("$parentText", "BORDER", "GameFontNormal")
button.text:SetJustifyH("LEFT")
button.text:SetFont(GameFontNormal:GetFont(), 12)
1021,7 → 1091,7
button.text:SetPoint("RIGHT")
--button.text:SetWidth(150)
--button.text:SetTextColor(1,1,1)
 
 
button.bg = button:CreateTexture(nil, "BACKGROUND")
--button.bg:SetTexture("Interface\\AuctionFrame\\UI-AuctionFrame-FilterBg")
button.bg:SetTexture("Interface\\AchievementFrame\\UI-Achievement-Category-Background")
1030,16 → 1100,16
--button.bg:SetPoint("BOTTOMRIGHT")
button.bg:SetWidth(140)
button.bg:SetHeight(16)
 
 
local highlightTexture = button:CreateTexture()
highlightTexture:SetTexture("Interface\\AchievementFrame\\UI-Achievement-Category-Highlight")
highlightTexture:SetTexCoord(0.02, 0.65, 0, 0.91)
highlightTexture:SetPoint("TOPLEFT", button.bg, -1, 0)
highlightTexture:SetPoint("BOTTOMRIGHT", button.bg, 1, -2)
 
 
--button:SetHighlightTexture("Interface\\FriendsFrame\\UI-FriendsFrame-HighlightBar", "ADD")
button:SetHighlightTexture(highlightTexture, "ADD")
 
 
button:SetScript("OnClick", function()
local id = button:GetID()
self.currentCat = id
1054,7 → 1124,7
self:RefreshAchievementButtons()
end)
button:SetScript("OnMouseWheel",UrbanAchiever_CatButtonScroll)
 
 
return button
end
 
1063,7 → 1133,7
button:EnableMouseWheel(true)
button:SetWidth(300)
button:SetHeight(16)
 
 
button.expand = button:CreateFontString("$parentExpand", "BORDER", "GameFontNormal")
button.expand:SetText("+")
button.expand:SetWidth(10)
1074,12 → 1144,12
button.offset:SetWidth(10)
button.offset:SetHeight(1)
button.offset:SetPoint("TOPLEFT", 9, 0)
 
 
button.bgframe = CreateFrame("Frame", nil, button)
button.bgframe:SetWidth(300)
button.bgframe:SetHeight(16)
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")
1089,7 → 1159,7
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")
1098,7 → 1168,7
button.name:SetJustifyH("LEFT")
button.name:SetJustifyV("TOP")
button.name:SetTextColor(1,1,1)
 
 
button.points = button:CreateFontString("$parentPointsText","BORDER", "GameFontNormal")
button.points:SetPoint("TOPLEFT", button, "TOPLEFT", 217, 0)
--button.text:SetPoint("TOPRIGHT", button, "TOPRIGHT")
1106,7 → 1176,7
button.points:SetJustifyH("LEFT")
button.points:SetJustifyV("TOP")
button.points:SetTextColor(1,1,1)
 
 
button.completed = button:CreateFontString("$parentCompletedText","BORDER", "GameFontNormal")
button.completed:SetPoint("TOPLEFT", button.points, "TOPRIGHT", 2, 0)
--button.text:SetPoint("TOPRIGHT", button, "TOPRIGHT")
1115,7 → 1185,7
button.completed:SetJustifyH("LEFT")
button.completed:SetJustifyV("TOP")
button.completed:SetTextColor(1,1,1)
 
 
button.stat = button:CreateFontString("$parentStatText","BORDER", "GameFontNormal")
button.stat:SetPoint("TOPLEFT", button, "TOPLEFT", 217, 0)
button.stat:SetPoint("TOPRIGHT", button.background, "TOPRIGHT")
1123,47 → 1193,47
button.stat:SetJustifyH("LEFT")
button.stat:SetJustifyV("TOP")
button.stat:SetTextColor(1,1,1)
 
 
button.comparison = CreateFrame("Frame", "$parentComparison", button)
button.comparison:SetPoint("RIGHT")
button.comparison:SetWidth(70)
button.comparison:SetHeight(16)
button.comparison:Hide()
button.comparison:SetFrameLevel(button.comparison:GetFrameLevel() - 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.compare = button.comparison:CreateFontString("$parentText", "BORDER", "GameFontNormal")
button.compare:SetPoint("LEFT", button.comparison, 5, 0)
button.compare:SetPoint("RIGHT", button.comparison)
button.compare:SetTextColor(1,1,1)
 
 
button.comparison:SetScript("OnShow", function()
if self.isComparing then
button:SetWidth(370)
self.frame:SetWidth(702)
end
end)
 
 
button.comparison:SetScript("OnHide", function()
if not self.isComparing then
button:SetWidth(300)
self.frame:SetWidth(632)
end
end)
 
 
local highlightTexture = button:CreateTexture()
highlightTexture:SetTexture("Interface\\AchievementFrame\\UI-Achievement-Stat-Buttons")
highlightTexture:SetTexCoord(0, 1, 0.56, 0.73)
highlightTexture:SetPoint("TOPLEFT", button.background)
highlightTexture:SetPoint("BOTTOMRIGHT", button)
 
 
button:SetHighlightTexture(highlightTexture, "ADD")
 
 
button:SetScript("OnClick", function()
local id = button:GetID()
if self.masterList[id] then
1185,16 → 1255,16
else
self.currentAch = id
if GetPreviousAchievement(id) and (not GetNextAchievement(id)) then
self.expandList[id] = not self.expandList[id]
self.expandList[id] = not self.expandList[id]
end
 
 
self:RefreshAchievementButtons(false)
self:SetDisplayAchievement(id)
end
end
end)
button:SetScript("OnMouseWheel", UrbanAchiever_AchButtonScroll)
 
 
return button
end
 
1203,47 → 1273,47
button:EnableMouseWheel(true)
button:SetWidth(273)
button:SetHeight(16)
 
 
--Offset used to move text when an icon is present
button.offset = CreateFrame("Frame", nil, button)
button.offset:SetWidth(1)
button.offset:SetHeight(16)
button.offset:SetPoint("LEFT")
 
 
button.text = button:CreateFontString("$parentText", "BORDER", "GameFontHighlight")
button.text:SetPoint("LEFT", button.offset, "RIGHT")
button.text:SetPoint("RIGHT", button)
button.text:SetJustifyH("LEFT")
button.text:SetTextColor(1,1,1)
 
 
button.icon = button:CreateTexture(nil, "ARTWORK")
button.icon:SetWidth(16)
button.icon:SetHeight(16)
button.icon:SetPoint("RIGHT", button.text, "LEFT")
 
 
button.comparison = button:CreateTexture(nil, "ARTWORK")
button.comparison:SetWidth(16)
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:SetScript("OnMouseWheel", UrbanAchiever_CriteriaButtonScroll)
 
 
button:SetScript("OnClick", function()
local id = button:GetID()
if button.icon:IsShown() then
self:SetDisplayAchievement(id)
end
end)
 
 
return button
end
 
1253,14 → 1323,14
button:SetWidth(width)
button:SetNormalTexture("Interface\\AchievementFrame\\UI-Achievement-Parchment-Horizontal-Desaturated")
button:SetHighlightTexture("Interface/FriendsFrame/UI-FriendsFrame-HighlightBar", "ADD")
 
 
button.text = button:CreateFontString("$parentText", "ARTWORK", "GameFontNormal")
button.text:SetPoint("CENTER", 0, 2)
button.text:SetTextColor(1,1,1)
button.text:SetText(text)
 
 
button:SetScript("OnClick", function() self:SortDisplayTable(sortStr) end)
 
 
return button
end
 
1280,18 → 1350,18
button.backdrop = button:CreateTexture("$parentBG", "BACKGROUND")
button.backdrop:SetPoint("TOPLEFT", 2, -2)
button.backdrop:SetPoint("BOTTOMRIGHT", -2, 2)
button.backdrop:SetTexture(0,0,0,1)
 
button.backdrop:SetTexture(0,0,0,1)
 
button.text = button:CreateFontString("$parentText", "ARTWORK", "GameFontNormal")
button.text:SetPoint("CENTER")
button.text:SetTextColor(1,1,1)
button.text:SetText(text)
 
 
button:SetScript("OnClick", function()
self.currentTab = tab
self:RefreshCategoryButtons()
end)
 
 
return button
end
 
1325,7 → 1395,7
left:SetPoint("LEFT", editboxFrame, "LEFT", -5, 0)
left:SetTexCoord(0, 0.0625, 0, 0.625)
 
-- Right border.
-- Right border.
local right = editboxFrame:CreateTexture(nil, "BACKGROUND")
right:SetTexture("Interface\\Common\\Common-Input-Border")
right:SetWidth(8)
1333,7 → 1403,7
right:SetPoint("RIGHT")
right:SetTexCoord(0.9375, 1, 0, 0.625)
 
-- Middle border.
-- Middle border.
local middle = editboxFrame:CreateTexture(nil, "BACKGROUND")
middle:SetTexture("Interface\\Common\\Common-Input-Border")
middle:SetWidth(10)
1353,7 → 1423,7
end
 
-------------------------------------------------------------
--Scroll Stuff
--Scroll Stuff
-------------------------------------------------------------
function UrbanAchiever_OnCatScroll(self1)
self.catOffset = self1:GetValue()
1371,7 → 1441,7
end
 
-------------------------------------------------------------
--Core Stuff
--Core Stuff
-------------------------------------------------------------
function self:UpdateFunction()
if (not self.frame) or (not self.frame:IsShown()) then return end
1379,7 → 1449,12
self:RefreshAchievementButtons(false)
self:ComparisonUpdate()
--self:TrackerUpdate()
self.pointsText:SetText(GetTotalAchievementPoints())
if self.currentTab == "guild" then
inGuild = true;
else
inGuild = false;
end
self.pointsText:SetText(GetTotalAchievementPoints(inGuild));
end
 
function self:PopulateMasterList()
1389,7 → 1464,7
local catList, numAchievements, nextId
local tempTable = {}
local category
 
 
--Get Every achievement
for i=1, MAX_ACHIEVEMENTS do
searchString = self:GetSearchString(i)
1397,14 → 1472,14
self.masterList[i] = {
["searchString"] = searchString:lower(),
}
 
 
if not GetNextAchievement(i) then
--If this isnt in the middle of a chain, add it to the category listing
category = GetAchievementCategory(i)
if not self.seriesList[category] then
if not self.seriesList[category] then
self.seriesList[category] = {}
end
 
 
tinsert(self.seriesList[category], i)
end
end
1427,34 → 1502,33
list = GetStatisticsCategoryList()
end
end
 
 
--Insert summary Category
tinsert(self.categories[tab], {
["id"] = "-1",
["id"] = "-1",
["name"] = UASummary,
["collapsed"] = true,
["children"] = {}
})
 
 
--Add top level Categories
for _,id in next, list do
name, parent = GetCategoryInfo(id)
self.isAchList[id] = isAch
self.isGuildList[id] = isGuild
DEFAULT_CHAT_FRAME:AddMessage(parent);
if parent == 15076 then
parent = -1
end
if parent == -1 then
tinsert(self.categories[tab], {
["id"] = id,
["id"] = id,
["name"] = name,
["collapsed"] = true,
["children"] = {}
})
end
end
 
 
--Add child Categories
for _,childId in next, list do
childName, childParent = GetCategoryInfo(childId)
1472,10 → 1546,10
function self:SetAchievementButton(button, id, offset)
local retok, id, name, points, completed, month, day, year, description, _,icon, reward = pcall (GetAchievementInfo,id)
if not retok then return nil end
 
 
if completed then
if year < 10 then
year = "0" .. year;
year = "0" .. year;
end
if (GetLocale() == "frFR" or GetLocale() == "ruRU") then
completed = day .. "/" .. month .. "/" .. year;
1490,7 → 1564,7
completed = "";
end
if not offset then offset = 1 end
 
 
self.frame.achButtons[button]:SetWidth(300)
self.frame.achButtons[button].name:SetText(name)
self.frame.achButtons[button].completed:SetText(completed)
1498,15 → 1572,15
self.frame.achButtons[button].expand:Hide()
self.frame.achButtons[button].compare:SetText("")
self.frame.achButtons[button].comparison:Hide()
 
 
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
self.frame.achButtons[button].stat:SetText(self:FormatString(GetStatistic(id)))
self.frame.achButtons[button].points:SetText("")
 
 
if self.isComparing then
self.frame.achButtons[button].comparison:Show()
self.frame.achButtons[button].compare:SetText(self:FormatString(GetComparisonStatistic(id)))
1515,12 → 1589,12
self.frame.achButtons[button].points:SetText(points)
self.frame.achButtons[button].stat:SetText("")
 
if completed == "" then
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
self.frame.achButtons[button].expand:SetTextColor(0,1,0)
self.frame.achButtons[button].expand:SetText("T")
1540,25 → 1614,25
end
end
end
 
 
if self.isComparing then
self.frame.achButtons[button].comparison:Show()
local compDone, compM, compD, compY = GetAchievementComparisonInfo(id, 1)
 
if compDone then
 
if compDone then
self.frame.achButtons[button].compare:SetText(string.format("%d/%d/0%d", compM, compD, compY))
else
self.frame.achButtons[button].comparison.background:SetTexture("Interface\\AchievementFrame\\UI-Achievement-Parchment-Horizontal-Desaturated")
end
end
end
 
 
if self.currentAch == id then
self.frame.achButtons[button]:LockHighlight()
else
self.frame.achButtons[button]:UnlockHighlight()
end
 
 
self.frame.achButtons[button].offset:SetWidth(offset)
self.frame.achButtons[button]:Show()
end
1566,27 → 1640,27
function self:SetDisplayAchievement(id, forceCat)
if id == nil then id = self.currentAch end
if not self.masterList[id] then return end
 
 
self.currentAch = id
 
 
--Update the category list
--On second thought, I dont want it doing this.
--On third thought, I only want to do it if we're coming from the summary frame.
if self.currentCat == -1 or forceCat then
self:SetCategory(self.currentAch)
end
 
 
--Update this achievement
self.masterList[id].searchString = self:GetSearchString(id)
 
 
local retok, id, name, points, completed, month, day, year, description, _,icon, reward = pcall (GetAchievementInfo,id)
 
 
self.frame.display:Show()
self.frame.display.icon:SetTexture(icon)
self.frame.display.name:SetText(name)
self.frame.display.desc:SetText(description)
self.frame.display.compareDate:Hide()
 
 
if self.isAchList[GetAchievementCategory(id)] == false and self.isGuildList[GetAchievementCategory(id)] == false then
--Statistic
self.frame.display.icon:Hide()
1597,12 → 1671,12
self.frame.display.desc:SetText("")
self.frame.display.name:SetJustifyH("MIDDLE")
self.frame.display.name:SetWidth(280)
 
 
for a = 1, #self.frame.display.criteriaButtons do
self.frame.display.criteriaButtons[a]:Hide()
self.frame.display.criteriaButtons[a].icon:Hide()
end
 
 
self.frame.display.reward:SetText("|cffffffff" .. self:FormatString(GetStatistic(id)))
if self.isComparing then
self.frame.display.compareDate:Show()
1626,7 → 1700,7
self.frame.display.name:SetWidth(220)
if completed then
if year < 10 then
year = "0" .. year;
year = "0" .. year;
end
if (GetLocale() == "frFR" or GetLocale() == "ruRU") then
completed = day .. "/" .. month .. "/" .. year;
1640,8 → 1714,8
else
completed = "";
end
 
if points == 0 then
 
if points == 0 then
self.frame.display.shield:SetTexture("Interface\\AchievementFrame\\UI-Achievement-Shields-NoPoints")
self.frame.display.points:SetText("")
else
1659,11 → 1733,11
self.frame.display.reward:SetTextColor(0,1,0)
self.frame.display.reward:SetText(UACompleted .. ": " .. completed)
end
 
 
if self.isComparing then
local compDone, m, d, y = GetAchievementComparisonInfo(id,1)
if compDone then
self.frame.display.compareDate:Show()
self.frame.display.compareDate:Show()
self.frame.display.compareDate:SetText(string.format("%s " .. UACompleted .. ":" .." %d/%d/0%d", self.comparisonUnitName, m or -1, d or -1, y or -1))
end
end
1671,7 → 1745,7
end
end
-------------------------------------------------------------
--Refresh Stuff
--Refresh Stuff
-------------------------------------------------------------
function self:RefreshCriteriaButtons()
if self.frame == nil then self:Initialize("","") end
1682,15 → 1756,15
local str = ""
local offset = 1
local compDone, comparisonComplete, compCriteriaText
 
 
if self.isComparing then
compDone = GetAchievementComparisonInfo(self.currentAch,1)
end
 
 
 
 
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
for a = self.criteriaOffset + 1, min(#self.frame.display.criteriaButtons + self.criteriaOffset, GetAchievementNumCriteria(self.currentAch)) do
1698,8 → 1772,8
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 =
 
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
1713,19 → 1787,19
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
 
if criteriaType == CRITERIA_TYPE_ACHIEVEMENT then
 
if criteriaType == CRITERIA_TYPE_ACHIEVEMENT then
--Its a meta achievement
retok,_,_,_,_,_,_,_,_,_,icon = pcall (GetAchievementInfo,criteriaAssetID)
if retok then
1733,13 → 1807,13
self.frame.display.criteriaButtons[buttonNum].icon:Show()
offset = offset + 16
self.frame.display.criteriaButtons[buttonNum]:SetID(criteriaAssetID)
end
end
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)
1748,7 → 1822,7
cQ, cRQ = self:FormatMoney(criteriaQuantity, criteriaReqQuantity)
end
self.frame.display.bar.text:SetText(cQ .. " / " .. cRQ)
 
 
if self.isComparing and compCriteriaText then
self.frame.display.compareBar:Show()
self.frame.display.compareBar:SetMinMaxValues(0, criteriaReqQuantity)
1760,25 → 1834,25
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
end
end
self.frame.criteriaScroll:SetMinMaxValues(0,math.max(GetAchievementNumCriteria(self.currentAch)-#self.frame.display.criteriaButtons, 0))
 
 
if GetAchievementNumCriteria(self.currentAch)-#self.frame.display.criteriaButtons > 0 then
self.frame.criteriaScroll:Show()
else
self.frame.criteriaScroll:Hide()
end
 
 
for a = GetAchievementNumCriteria(self.currentAch) + 1, #self.frame.display.criteriaButtons do
self.frame.display.criteriaButtons[a]:Hide()
end
1801,7 → 1875,7
self.frame.catButtons[buttonNum]:Show()
buttonNum = buttonNum + 1
end
 
 
if v.collapsed == false then
for subK, subV in next, v.children do
count = count + 1
1820,19 → 1894,35
end
end
end
 
 
self.frame.catScroll:SetMinMaxValues(0,math.max(count-#self.frame.catButtons, 0))
if count-#self.frame.catButtons > 0 then
self.frame.catScroll:Show()
else
self.frame.catScroll:Hide()
end
 
end
 
for i = buttonNum, #self.frame.catButtons do
self.frame.catButtons[i]:Hide()
end
self:RefreshSummaryBar()
 
 
if self.currentTab == "guild" then
self.pointsText:SetTextColor(0,1,0);
total, completed = GetNumCompletedAchievements(true);
self.frame.summaryBar:SetMinMaxValues(0, total)
self.frame.summaryBar:SetValue(completed)
self.frame.summaryBar.text:SetText(completed .. "/" .. total)
self.pointsText:SetText(GetTotalAchievementPoints(true));
else
total, completed = GetNumCompletedAchievements();
self.frame.summaryBar:SetMinMaxValues(0, total)
self.frame.summaryBar:SetValue(completed)
self.frame.summaryBar.text:SetText(completed .. "/" .. total)
self.pointsText:SetTextColor(1,1,1);
self.pointsText:SetText(GetTotalAchievementPoints());
end
 
--Stuff for tab highlights
--Not happy with this, but it works till I find some better textures.
if self.currentTab == "achievements" then
1872,7 → 1962,7
preserveSort(self.displayTable, self.sortFuncs["name a"])
preserveSort(self.displayTable, self.sortFuncs["completed d"])
end
 
 
--Used to move the achievement scroll to show the ID we want.
if shownID then
--Make sure we're looking for the top achievement of the series.
1895,7 → 1985,7
end
end
end
 
 
for _, id in next, self.displayTable do
count = count + 1
if buttonNum <= #self.frame.achButtons and count > self.achOffset then
1916,10 → 2006,10
end
end
end
 
 
--Start summary category stuff. We assume all the above stuff has done nothing.
if self.currentCat == -1 then --Summary category
--Incredibly hackish on my part :\
--Incredibly hackish on my part :\
self.frame.achButtons[buttonNum]:SetWidth(300)
self.frame.achButtons[buttonNum].name:SetText(UARecentAchiev .. ":")
self.frame.achButtons[buttonNum].completed:SetText("")
1933,19 → 2023,44
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()
if self.isComparing then
if self.isComparing then
self.frame.achButtons[buttonNum]:SetWidth(370)
self.frame.achButtons[buttonNum].comparison:Show()
end
self.frame.achButtons[buttonNum]:Show()
buttonNum = buttonNum + 1
 
 
for k,id in next, {GetLatestCompletedAchievements()} do
self:SetAchievementButton(buttonNum, id)
buttonNum = buttonNum + 1
end
 
 
self.frame.achButtons[buttonNum]:SetWidth(300)
self.frame.achButtons[buttonNum].name:SetText(UARecentGuildAchiev .. ":")
self.frame.achButtons[buttonNum].completed:SetText("")
self.frame.achButtons[buttonNum].compare:SetText("")
self.frame.achButtons[buttonNum].points:SetText("")
self.frame.achButtons[buttonNum].stat:SetText("")
self.frame.achButtons[buttonNum]:SetID(-1)
self.frame.achButtons[buttonNum].expand:Hide()
self.frame.achButtons[buttonNum].comparison:Hide()
self.frame.achButtons[buttonNum].background:SetTexture("Interface\\AchievementFrame\\UI-Achievement-Parchment-Horizontal-Desaturated")
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()
if self.isComparing then
self.frame.achButtons[buttonNum]:SetWidth(370)
self.frame.achButtons[buttonNum].comparison:Show()
end
self.frame.achButtons[buttonNum]:Show()
buttonNum = buttonNum + 1
 
for k,id in next, {GetLatestCompletedAchievements(true)} do
self:SetAchievementButton(buttonNum, id)
buttonNum = buttonNum + 1
end
 
self.frame.achButtons[buttonNum]:SetWidth(300)
self.frame.achButtons[buttonNum].name:SetText(UARecentStat .. ":")
self.frame.achButtons[buttonNum].completed:SetText("")
self.frame.achButtons[buttonNum].compare:SetText("")
1958,19 → 2073,19
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()
if self.isComparing then
if self.isComparing then
self.frame.achButtons[buttonNum]:SetWidth(370)
self.frame.achButtons[buttonNum].comparison:Show()
end
self.frame.achButtons[buttonNum]:Show()
buttonNum = buttonNum + 1
 
 
for k,id in next, {GetLatestUpdatedStats()} do
statId = GetAchievementInfoFromCriteria(id)
statId = GetAchievementInfoFromCriteria(id)
self:SetAchievementButton(buttonNum, statId)
buttonNum = buttonNum + 1
end
 
 
--new in sumarry
local numTotal, numDone
local catName
1978,7 → 2093,7
local id
local numItems, numCompleted
local numItems2, numCompleted2
 
 
for i,id in ipairs(GetCategoryList()) do
numTotal = 0
numDone = 0
1995,24 → 2110,51
numItems2, numCompleted2 = GetCategoryNumAchievements(id)
numTotal = (numTotal + numItems2)
numDone = (numDone + numCompleted2)
self.frame.category[id]:Show()
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
categoryStatusBar81:Hide();
else
for i,id in ipairs(GetCategoryList()) do
_, parentCatID = GetCategoryInfo(id)
if parentCatID == -1 then
 
for i,id in ipairs(GetGuildCategoryList()) do
numTotal = 0
numDone = 0
catName, parentCatID = GetCategoryInfo(id)
if parentCatID == -1 or parentCatID == 15076 then
for i2,id2 in ipairs(GetGuildCategoryList()) do
_, parentCatID2 = GetCategoryInfo(id2)
if parentCatID2 == id then
numItems, numCompleted = GetCategoryNumAchievements(id)
numTotal = (numTotal + numItems)
numDone = (numDone + numCompleted)
end
end
numItems2, numCompleted2 = GetCategoryNumAchievements(id)
numTotal = (numTotal + numItems2)
numDone = (numDone + numCompleted2)
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
end
 
if self.currentTab == "guild" then
self:HideCategorySum()
self:ShowCategorySumGuild()
else
self:HideCategorySumGuild()
self:ShowCategorySum()
end
else
self:HideCategorySumGuild()
self:HideCategorySum()
end
--End summary category stuff.
 
 
--Scroll bar Stuff
self.frame.achScroll:SetMinMaxValues(0,math.max(count-#self.frame.achButtons, 0))
if count-#self.frame.achButtons > 0 then
2038,9 → 2180,9
total, completed = GetCategoryNumAchievements(self.currentCat)
name = GetCategoryInfo(self.currentCat)
end
 
 
self.frame.comparisonSummaryBar:Hide()
 
 
if completed == 0 then
self.frame.summaryBar:Hide()
else
2053,7 → 2195,7
else
self.frame.summaryBar.name:SetText(name .. " " .. UAAchievEarned)
end
 
 
if self.isComparing then
local comparisonCompleted = GetComparisonCategoryNumAchievements(compareCat)
self.frame.comparisonSummaryBar:Show()
2065,7 → 2207,7
end
end
-------------------------------------------------------------
--Comparison Stuff
--Comparison Stuff
-------------------------------------------------------------
function self:ComparisonUpdate()
if self.isComparing and (self.comparisonUnit ~= "") then
2085,15 → 2227,15
 
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)
self.comparisonFaction = UnitFactionGroup(unit) == "Alliance" and 1 or 2
 
 
ClearAchievementComparisonUnit()
SetAchievementComparisonUnit(unit)
end
Localization.frFR.lua
36,4 → 36,5
UAOptions = "Options";
UAAchievementDone = "Vous avez d\195\169j\195\160 accomplis ce Haut-Fait, vous ne pouvez donc plus le suivre.";
UAGuild = "Guilde"
UARecentGuildAchiev = "Hauts Faits de guilde r\195\169cents"
end
\ No newline at end of file
Localization.deDE.lua
4,7 → 4,7
UACompleted = "Errungen";
UARecentAchiev = "Neueste Erfolge";
UARecentStat = "Neueste Statistiken";
UAAchievEarned = "errungene Erfolge";
UAAchievEarned = "Errungene Erfolge -";
UASummary = "\195\156bersicht";
UAAchievement = "Erfolge";
UAStatistic = "Statistiken";
35,5 → 35,6
UAReplacementFrame = "Ersetzt das Erfolge-Fenster";
UAOptions = "Einstellungen";
UAAchievementDone = "Du hast diesen Erfolg schon errungen; er kann nicht mehr verfolgt werden.";
UAGuild = "Guild"
UAGuild = "Gilde"
UARecentGuildAchiev = "Recent Guild Achievements"
end
\ No newline at end of file
Localization.zhCN.lua
36,4 → 36,5
UAOptions = "选项";
UAAchievementDone = "你已取得这项成就,无法继续追踪。";
UAGuild = "公会"
UARecentGuildAchiev = "Recent Guild Achievements"
end
\ No newline at end of file
Localization.koKR.lua
36,4 → 36,5
UAOptions = "설정";
UAAchievementDone = "You already earned this achievement, you can't track it anymore";
UAGuild = "Guild"
UARecentGuildAchiev = "Recent Guild Achievements"
end
\ No newline at end of file
Localization.enUS.lua
37,4 → 37,5
UAOptions = "Options";
UAAchievementDone = "You already earned this achievement, you can't track it anymore";
UAGuild = "Guild"
UARecentGuildAchiev = "Recent Guild Achievements"
end
\ No newline at end of file
Localization.zhTW.lua
36,4 → 36,5
UAOptions = "選項";
UAAchievementDone = "你已取得這項成就,無法繼續追蹤。";
UAGuild = "公會"
UARecentGuildAchiev = "Recent Guild Achievements"
end
\ No newline at end of file