/trunk
## Title: Urban Achiever |
## Author: Syzgyn |
## Notes: Improved Achievement Frame |
## Version 0.7.wowi:revision |
## Version 0.6.wowi:revision |
## SavedVariables: UASV |
## SavedVariablesPerCharacter: UASVPC |
bindings.xml |
Main.lua |
FactionSpecificAchievements.lua |
Options.lua |
local MAX_ACHIEVEMENTS = 2500 |
local menuTypes= {"PLAYER", "PARTY", "RAID_PLAYER"} |
local playerFaction = UnitFactionGroup("player") == "Alliance" and 1 or 2 |
self.categories = { |
["achievements"] = {}, |
self.isComparing = false |
self.comparisonUnit = "" |
self.comparisonFaction = "" |
self.sortFuncs = { |
["name d"] = function(a, b) |
UASVPC = { |
["tracker"] = { |
["x"] = UIParent:GetWidth()/2, |
["y"] = UIParent:GetHeight()/2, |
["x"] = 955, |
["y"] = 815, |
} |
} |
------------------------------------------------------------- |
self:CreateTracker() |
self:SetupFrames() |
UrbanAchiever:CreateOptions() |
--AchievementFrame:SetScript("OnShow", function() |
-- AchievementFrame:Hide() |
-- self.frame:Show() |
self:RefreshCriteriaButtons() |
self:TrackerUpdate() |
end) |
self:RegisterEvent("INSPECT_ACHIEVEMENT_READY", function() |
if self.isComparing then |
self:ComparisonUpdate() |
self:RefreshAchievementButtons(false) |
self:RefreshAchievementButtons(false) |
self.frame:Show() |
end |
end) |
button.bg:SetTexture("Interface\\AchievementFrame\\UI-Achievement-Category-Background") |
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:SetHeight(16) |
button.bg:SetPoint("BOTTOMRIGHT") |
local highlightTexture = button:CreateTexture() |
highlightTexture:SetTexture("Interface\\AchievementFrame\\UI-Achievement-Category-Highlight") |
button.name:SetTextColor(1,1,1) |
button.points = button:CreateFontString("$parentPointsText","BORDER", "GameFontNormal") |
button.points:SetPoint("TOPLEFT", button.name, "TOPRIGHT", 3, 0) |
button.points:SetPoint("TOPLEFT", button, "TOPLEFT", 217, 0) |
--button.text:SetPoint("TOPRIGHT", button, "TOPRIGHT") |
button.points:SetWidth(20) |
button.points:SetJustifyH("LEFT") |
button.points:SetTextColor(1,1,1) |
button.completed = button:CreateFontString("$parentCompletedText","BORDER", "GameFontNormal") |
button.completed:SetPoint("TOPLEFT", button.points, "TOPRIGHT", 2, 0) |
button.completed:SetPoint("TOPLEFT", button.points, "TOPRIGHT", 3, 0) |
--button.text:SetPoint("TOPRIGHT", button, "TOPRIGHT") |
button.completed:SetWidth(60) |
button.completed:SetHeight(16) |
button.completed:SetJustifyH("LEFT") |
button.completed:SetJustifyV("TOP") |
button.completed:SetTextColor(1,1,1) |
elseif sortStr == nil then |
self.displayTable = {} |
for _, id in next, (self.seriesList[self.currentCat] or {}) do |
--If we're searching, or comparing with the opposite faction, or its not in the list, or its the right faction, show |
if self.currentCat == -2 or (self.isComparing and self.comparisonFaction ~= playerFaction) or (not UrbanAchiever.factionAchs[tostring(id)]) or UrbanAchiever.factionAchs[tostring(id)] == playerFaction then |
tinsert(self.displayTable, id) |
end |
tinsert(self.displayTable, id) |
end |
preserveSort(self.displayTable, self.sortFuncs["name a"]) |
preserveSort(self.displayTable, self.sortFuncs["completed d"]) |
function self:SetComparisonUnit(unit) |
if not UnitExists(unit) then return end |
--Called to prevent errors from being thrown by the default UI |
achievementFunctions.selectedCategory = 96 |
self.isComparing = true |
self.comparisonUnit = unit |
self.comparisonUnitName = UnitName(unit) |
self.comparisonFaction = UnitFactionGroup(unit) == "Alliance" and 1 or 2 |
ClearAchievementComparisonUnit() |
SetAchievementComparisonUnit(unit) |
self.comparisonUnit = unit |
self.isComparing = true |
self.comparisonUnitName = GetAchievementComparisonUnitInfo() |
--Called on INSPECT_ACHIEVEMENT_READY now |
--self:ComparisonUpdate() |
--self:RefreshAchievementButtons(false) |
end |
------------------------------------------------------------- |
self.tracker.header:SetBackdropColor(0,0,0) |
self.tracker.header:SetWidth(200) |
self.tracker.header:SetHeight(25) |
self.tracker.header:SetClampedToScreen(true) |
self.tracker.header:EnableMouse(true) |
self.tracker.header:SetPoint("BOTTOM", self.tracker, "TOP") |
self.tracker.header:SetScript("OnMouseDown",function() |