WoWInterface SVN UrbanAchiever

Compare Revisions

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

Rev 119 → Rev 120

UrbanAchiever.toc
5,7 → 5,7
## Notes-frFR: Fenêtre de Hauts Faits améliorée
## Notes-zhTW:改進成就框架
## Notes-zhCN:改进成就框架
## Version 13.5.wowi:revision
## Version 14.0.wowi:revision
## OptionalDeps: Blizzard_AchievementUI
## SavedVariables: UASV
## SavedVariablesPerCharacter: UASVPC
Main.lua
8,7 → 8,7
--bindings
BINDING_HEADER_URBANACHIEVER = "Urban Achiever"
 
local MAX_ACHIEVEMENTS = 5986 --last 5985
local MAX_ACHIEVEMENTS = 6186 --last 6185
local menuTypes = {"PLAYER", "PARTY", "RAID_PLAYER"}
local playerFaction = UnitFactionGroup("player") == "Alliance" and 1 or 2
 
31,6 → 31,8
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
241,7 → 243,22
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()
396,15 → 413,15
-------------------------------------------------------------
function self:InsertIntoChat(id)
--Taken from Historian, thanks Ixchael!
if (ChatFrame1EditBox == nil) then
if (GetCurrentKeyBoardFocus() == nil) then
return;
end;
 
if not ChatFrame1EditBox:IsVisible() then
ChatFrame1EditBox:Show();
if not GetCurrentKeyBoardFocus():IsVisible() then
GetCurrentKeyBoardFocus():Show();
end;
 
ChatFrame1EditBox:Insert(GetAchievementLink(id));
GetCurrentKeyBoardFocus():Insert(GetAchievementLink(id));
end
 
function self:SortDisplayTable(sortStr)
1350,7 → 1367,8
button:SetScript("OnClick", function()
local id = button:GetID()
if self.masterList[id] then
if ChatFrame1EditBox:HasFocus() and IsModifiedClick("CHATLINK") then
SetFocusedAchievement(id)
if GetCurrentKeyBoardFocus() ~= nil and IsModifiedClick("CHATLINK") then
self:InsertIntoChat(id)
elseif IsShiftKeyDown() then
if IsTrackedAchievement(id) then
1571,7 → 1589,6
end
 
function self:PopulateMasterList()
debug("PML")
local id, name, points, completed, month, day, year, description, icon, reward, searchString
local criteriaName
local catList, numAchievements, nextId
2210,32 → 2227,6
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
2245,21 → 2236,17
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 = GetCategoryNumAchievements(id)
numItems, numCompleted = self:GetRealCategoryNumAchievements(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)
2318,6 → 2305,23
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