WoWInterface SVN UrbanAchiever

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /trunk
    from Rev 120 to Rev 119
    Reverse comparison

Rev 120 → Rev 119

UrbanAchiever.toc
5,7 → 5,7
## Notes-frFR: Fenêtre de Hauts Faits améliorée
## Notes-zhTW:改進成就框架
## Notes-zhCN:改进成就框架
## Version 14.0.wowi:revision
## Version 13.5.wowi:revision
## OptionalDeps: Blizzard_AchievementUI
## SavedVariables: UASV
## SavedVariablesPerCharacter: UASVPC
Main.lua
8,7 → 8,7
--bindings
BINDING_HEADER_URBANACHIEVER = "Urban Achiever"
 
local MAX_ACHIEVEMENTS = 6186 --last 6185
local MAX_ACHIEVEMENTS = 5986 --last 5985
local menuTypes = {"PLAYER", "PARTY", "RAID_PLAYER"}
local playerFaction = UnitFactionGroup("player") == "Alliance" and 1 or 2
 
31,8 → 31,6
self.isAchList = {} --Used to see if id's are achievements or statistics or guild
self.isGuildList = {} --Used to see if id's are achievements or statistics or guild
 
self.achieveList = {}
 
self.currentTab = "achievements"
self.currentCat = -1
self.currentAch = 0
243,22 → 241,7
self:SetupFrames()
 
UrbanAchiever:CreateOptions()
self:PopulateAchieveList()
end
 
function self:PopulateAchieveList()
--self.achieveList = {}
for id = 1, MAX_ACHIEVEMENTS do
category = GetAchievementCategory(id)
if category and category ~= nil then
_, _, _, completed = GetAchievementInfo(id)
if(type(self.achieveList[category]) == "table") then
table.insert(self.achieveList[category], id, completed)
else
self.achieveList[category] = {[id] = completed}
end
end
end
end
 
function self:OnEnable()
413,15 → 396,15
-------------------------------------------------------------
function self:InsertIntoChat(id)
--Taken from Historian, thanks Ixchael!
if (GetCurrentKeyBoardFocus() == nil) then
if (ChatFrame1EditBox == nil) then
return;
end;
 
if not GetCurrentKeyBoardFocus():IsVisible() then
GetCurrentKeyBoardFocus():Show();
if not ChatFrame1EditBox:IsVisible() then
ChatFrame1EditBox:Show();
end;
 
GetCurrentKeyBoardFocus():Insert(GetAchievementLink(id));
ChatFrame1EditBox:Insert(GetAchievementLink(id));
end
 
function self:SortDisplayTable(sortStr)
1367,8 → 1350,7
button:SetScript("OnClick", function()
local id = button:GetID()
if self.masterList[id] then
SetFocusedAchievement(id)
if GetCurrentKeyBoardFocus() ~= nil and IsModifiedClick("CHATLINK") then
if ChatFrame1EditBox:HasFocus() and IsModifiedClick("CHATLINK") then
self:InsertIntoChat(id)
elseif IsShiftKeyDown() then
if IsTrackedAchievement(id) then
1589,6 → 1571,7
end
 
function self:PopulateMasterList()
debug("PML")
local id, name, points, completed, month, day, year, description, icon, reward, searchString
local criteriaName
local catList, numAchievements, nextId
2227,6 → 2210,32
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("")
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, {GetLatestUpdatedStats()} do
statId = GetAchievementInfoFromCriteria(id)
self:SetAchievementButton(buttonNum, statId)
buttonNum = buttonNum + 1
end]]
 
--new in sumarry
local numTotal, numDone
local catName
2236,17 → 2245,21
local numItems2, numCompleted2
 
for i,id in ipairs(GetCategoryList()) do
numTotal = 0
numDone = 0
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(id)
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)
2305,23 → 2318,6
end
end
 
function self:GetRealCategoryNumAchievements(id)
local numItems, numCompleted = 0, 0
if self.achieveList[id] ~= nil then
for k,v in pairs(self.achieveList[id]) do
if(id == 92)then
_, name = GetAchievementInfo(k)
print(name)
end
numItems = numItems+1
if v then
numCompleted = numCompleted+1
end
end
end
return numItems, numCompleted
end
 
function self:RefreshSummaryBar()
local total, completed
local name