/trunk
function UrbanAchiever:CreateOptions() |
local panel = CreateFrame("Frame") |
panel.name = "Urban Achiever" |
local title = panel:CreateFontString(nil, "ARTWORK", "GameFontNormalLarge") |
title:SetPoint("TOPLEFT", 15, -16) |
title:SetText("Urban Achiever") |
title:SetJustifyH("LEFT") |
title:SetJustifyV("TOP") |
local subText = panel:CreateFontString(nil, "ARTWORK", "GameFontHighlightSmall") |
subText:SetPoint("TOPLEFT", title, "BOTTOMLEFT", 0, -8) |
subText:SetText("Replacement Achievement Frame") |
subText:SetNonSpaceWrap(true) |
subText:SetJustifyH("LEFT") |
subText:SetJustifyV("TOP") |
local trackerTitle = panel:CreateFontString(nil, "ARTWORK", "GameFontNormal") |
trackerTitle:SetText("Tracker") |
trackerTitle:SetPoint("TOPLEFT", subText, "BOTTOMLEFT", 0, -10) |
local reset = CreateFrame("Button", nil, panel, "UIPanelButtonTemplate") |
reset:SetPoint("TOPLEFT", trackerTitle, "BOTTOMLEFT", 0, -10) |
reset:SetWidth(120) |
reset:SetHeight(24) |
reset.text = reset:GetRegions() |
reset.text:SetText("Reset Tracker") |
reset:SetScript("OnClick", function() |
UASVPC.tracker.x = UIParent:GetWidth()/2 |
UASVPC.tracker.y = UIParent:GetHeight()/2 |
UrbanAchiever.tracker:SetPoint("TOPLEFT", UIParent, "BOTTOMLEFT", UASVPC.tracker.x, UASVPC.tracker.y) |
UrbanAchiever.tracker.header:Show() |
end) |
local move = CreateFrame("Button", nil, panel, "UIPanelButtonTemplate") |
move:SetPoint("TOPLEFT", reset, "TOPRIGHT", 5, 0) |
move:SetWidth(120) |
move:SetHeight(24) |
move.text = move:GetRegions() |
move.text:SetText("Move Tracker") |
move:SetScript("OnClick", function() |
UrbanAchiever.tracker.header:Show() |
end) |
InterfaceOptions_AddCategory(panel) |
end |
["horde"] = { |
["1173"] = 1172, |
["873"] = 220, --"Frostwolf Perfection", |
["1006"] = 388, |
["1252"] = 206, |
["700"] = 701, --"Freedom of the Horde", |
["1356"] = 34, |
["708"] = 709, --"Hero of the Frostwolf Clan", |
["1360"] = 41, |
["1682"] = 1681, |
["1657"] = 1656, |
["2017"] = 2016, |
["712"] = 713, --"Warsong Outrider", |
["1026"] = 1023, --"Flame Keeper of Kalimdor", |
["1170"] = 1169, |
["2192"] = 1762, |
["714"] = 907, --"The Conqueror", |
["1031"] = 1028, |
["943"] = 942, |
["710"] = 711, --"The Defiler", |
["1039"] = 1038, --"The Flame Keeper", |
["1041"] = 1040, |
["1011"] = 1012, |
["1203"] = 1184, |
["965"] = 963, |
["1357"] = 37, |
["224"] = 1151, |
["968"] = 969, |
["1358"] = 33, |
["1272"] = 1191, |
["971"] = 970, |
["1164"] = 225, |
["1359"] = 35, |
["1693"] = 1707, |
["1691"] = 1692, |
["1033"] = 1030, |
["1036"] = 1034, |
["1677"] = 1676, |
["763"] = 764, |
["1273"] = 1192, |
["967"] = 966, |
["1680"] = 1678, |
["1274"] = 1262, |
["1271"] = 1189, |
["1783"] = 1782, |
["1698"] = 1697, |
["1005"] = 246, |
["1685"] = 1686, |
["2145"] = 2144, |
["1168"] = 1167, |
["1280"] = 1279, |
["909"] = 908, |
["2195"] = 2194, |
["1175"] = 230, |
["259"] = 1255, |
["1784"] = 1563, |
["1032"] = 1029, |
["1502"] = 202, |
["1251"] = 203, |
["1683"] = 1684, |
["1025"] = 1022, --"Flame Keeper of Eastern Kingdoms", |
["1027"] = 1024, --"Flame Keeper of Outland", |
["619"] = 612, --"For The Horde!", |
["443"] = "High Warlord", |
["445"] = "Warlord", |
["446"] = "General", |
["444"] = "Lieutenant General", |
["447"] = "Champion", |
["448"] = "Centurion", |
["469"] = "Legionnaire", |
["449"] = "Blood Guard", |
["451"] = "Stone Guard", |
["452"] = "First Sergeant", |
["450"] = "Senior Sergeant", |
["453"] = 471, --"Sergeant", |
["468"] = "Grunt", |
["454"] = "Scout", |
["618"] = 613, --"Putting Out the Light", |
["617"] = "Immortal No More", |
["706"] = 707, --"Frostwolf Howler", |
["762"] = 948, --"Ambassador of the Horde", |
["616"] = "Death to the King!", |
["615"] = "Storming Stormwind", |
["1037"] = 1035, --"Desecration of the Alliance", |
["603"] = 604, --"Wrath of the Horde", |
["901"] = 899, --"Mag'har of Draenor", |
}, |
["alliance"] = { |
["948"] = 764, --"Ambassador of the Alliance", |
["612"] = "Downing the Dark Lady", |
["611"] = "Bleeding Bloodhoof", |
["899"] = 901, --"Oh My, Kurenai", |
["1035"] = 1037, --"Desecration of the Horde", |
["613"] = 611, --"Killed in Quel'Thalas", |
["701"] = 700, --"Freedom of the Alliance", |
["604"] = 603, --"Wrath of the Alliance", |
["610"] = "Death to the Warchief!", |
["707"] = 706, --"Stormpike Battle Charger", |
["433"] = "Grand Marshal", |
["434"] = "Field Marshal", |
["473"] = "Marshal", |
["435"] = "Commander", |
["436"] = "Lieutenant Commander", |
["437"] = "Knight-Champion", |
["438"] = "Knight-Captain", |
["472"] = "Knight-Lieutenant", |
["439"] = "Knight", |
["440"] = "Sergeant Major", |
["441"] = "Master Sergeant", |
["471"] = 453, --"Sergeant", |
["470"] = "Corporal", |
["442"] = "Private", |
["1189"] = 1271, |
["1012"] = 1011, |
["37"] = 1357, |
["908"] = 909, |
["1028"] = 1031, |
["1022"] = 1025, --"Flame Warden of Eastern Kingdoms", |
["764"] = 763, |
["1678"] = 1680, |
["33"] = 1358, |
["711"] = 710, --"Knight of Arathor", |
["246"] = 1005, |
["1681"] = 1682, |
["1686"] = 1685, |
["203"] = 1251, |
["907"] = 714, --"The Justicar", |
["1656"] = 1657, |
["206"] = 1252, |
["1172"] = 1173, |
["1782"] = 1783, |
["1040"] = 1041, |
["1151"] = 224, |
["1563"] = 1784, |
["1191"] = 1272, |
["388"] = 1006, |
["1262"] = 1274, |
["1184"] = 1203, |
["2144"] = 2145, |
["41"] = 1360, |
["35"] = 1359, |
["2016"] = 2017, |
["713"] = 712, --"Silverwing Sentinel", |
["1169"] = 1170, |
["1038"] = 1039, --"The Flame Warden", |
["969"] = 968, |
["1757"] = 2200, |
["1697"] = 1698, |
["1692"] = 1691, |
["1030"] = 1033, |
["966"] = 967, |
["1192"] = 1273, |
["1707"] = 1693, |
["1279"] = 1280, |
["963"] = 965, |
["1684"] = 1683, |
["225"] = 1164, |
["34"] = 1356, |
["1023"] = 1026, --"Flame Warden of Kalimdor", |
["1034"] = 1036, |
["970"] = 971, |
["1167"] = 1168, |
["202"] = 1502, |
["1029"] = 1032, |
["220"] = 873, --"Stormpike Perfection", |
["709"] = 708, --"Hero of the Stormpike Guard", |
["614"] = 619, --"For The Alliance!", |
["1024"] = 1027, --"Flame Warden of Outland", |
["1762"] = 2192, |
["942"] = 943, |
["1676"] = 1677, |
["1255"] = 259, |
["2194"] = 2195, |
["230"] = 1175, |
}, |
## Title: Urban Achiever |
## Author: Syzgyn |
## Notes: Improved Achievement Frame |
## Version 0.6.wowi:revision |
## Version 0.7.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"] = 955, |
["y"] = 815, |
["x"] = UIParent:GetWidth()/2, |
["y"] = UIParent:GetHeight()/2, |
} |
} |
------------------------------------------------------------- |
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:SetPoint("BOTTOMRIGHT") |
button.bg:SetWidth(140) |
button.bg:SetHeight(16) |
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, "TOPLEFT", 217, 0) |
button.points:SetPoint("TOPLEFT", button.name, "TOPRIGHT", 3, 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", 3, 0) |
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.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 |
tinsert(self.displayTable, id) |
--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 |
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() |