diff --git a/BuildingPage.lua b/BuildingPage.lua
index 199c52e..216ed14 100644
--- a/BuildingPage.lua
+++ b/BuildingPage.lua
@@ -8,22 +8,14 @@ followerTooltip="colore + nome del follower"
size= level
Plot=framde del piedistallino
Icon e IconRing contenuto e nordo dell'iconcina
-
-
--]]
local me,ns=...
-local addon=ns.addon
---@debug@
-if LibDebug then LibDebug() end
---@end-debug@
+ns.Configure()
+local addon=addon
local GBF=GarrisonBuildingFrame
local GBFMap=GBF.MapFrame
-local G=C_Garrison
local CreateFrame=CreateFrame
local GARRISON_FOLLOWER_MAX_LEVEL=GARRISON_FOLLOWER_MAX_LEVEL
-local L=ns.L
-local D=ns.D
-local C=ns.C
local new,del=ns.new,ns.del
local module=addon:NewSubClass("BuildingPage") --#module
function module:OnInitialize()
diff --git a/Debug.lua b/Debug.lua
index 09ffd19..d0b6270 100644
--- a/Debug.lua
+++ b/Debug.lua
@@ -298,10 +298,12 @@ local function traitGen()
end
local trackedEvents={}
local function eventTrace ( self, event, ... )
- if (event:find("GARRISON",1,true)) then
+ if (event=="VARIABLES_LOADED") then
+ trackedEvents=ATEINFO.trackedEvents or {}
+ elseif (event:find("GARRISON",1,true)) then
local signature="("..event
for i=1,select('#',...) do
- signature=','..signature..type(select(i,...))
+ signature=','..signature.." ".. tostring(select(i,...))
end
signature=signature..")"
trackedEvents[event]=signature
@@ -385,6 +387,7 @@ function addon:DumpSinks()
table.sort(sorted,function(a,b) return a>b end)
self:cutePrint(scroll,sorted)
end
+_G.GAC=addon
--[[
PlaySound("UI_Garrison_CommandTable_Open");
PlaySound("UI_Garrison_CommandTable_Close");
diff --git a/FollowerCache.lua b/FollowerCache.lua
index dcff76d..fd98eb3 100644
--- a/FollowerCache.lua
+++ b/FollowerCache.lua
@@ -1,35 +1,229 @@
local me,ns=...
-local addon=ns.addon --#addon
-local holdEvents,releaseEvents=addon.holdEvents,addon.releaseEvents
-local xdump=ns.xdump
+ns.Configure()
+print("loaded")
+local addon=addon --#addon
+--local holdEvents,releaseEvents=addon.holdEvents,addon.releaseEvents
--upvalue
-local C=ns.C
-local G=C_Garrison
-local GMF=GarrisonMissionFrame
local type=type
local select=select
local pairs=pairs
local tonumber=tonumber
local tinsert=tinsert
-local Mbase = GarrisonMissionFrameFollowers
+local tContains=tContains
+local wipe=wipe
+local Mbase = {}
local GARRISON_FOLLOWER_MAX_UPGRADE_QUALITY=GARRISON_FOLLOWER_MAX_UPGRADE_QUALITY
local GARRISON_FOLLOWER_MAX_LEVEL=GARRISON_FOLLOWER_MAX_LEVEL
local format=format
local tostring=tostring
local GetItemInfo=GetItemInfo
-local index={}
-local names={}
-local sorted={}
-local threats={}
-local traits={}
+local LE_FOLLOWER_TYPE_GARRISON_6_0=_G.LE_FOLLOWER_TYPE_GARRISON_6_0
+local LE_FOLLOWER_TYPE_SHIPYARD_6_2=_G.LE_FOLLOWER_TYPE_SHIPYARD_6_2
+local maxrank=GARRISON_FOLLOWER_MAX_UPGRADE_QUALITY*1000+GARRISON_FOLLOWER_MAX_LEVEL
+local module=addon:NewSubClass('FollowerCache')
+local cache={} --#cache
+local EMPTY={}
+function module:OnInitialized()
+ self:RegisterEvent("GARRISON_FOLLOWER_REMOVED","OnEvent")
+ self:RegisterEvent("GARRISON_FOLLOWER_ADDED","OnEvent")
+ self:RegisterEvent("GARRISON_FOLLOWER_LIST_UPDATE","OnEvent")
+ self:RegisterEvent("GARRISON_FOLLOWER_UPGRADED","OnEvent")
+ self:RegisterEvent("GARRISON_FOLLOWER_XP_CHANGED","OnEvent")
+ self.followerCache=cache:new(LE_FOLLOWER_TYPE_GARRISON_6_0)
+ self.shipCache=cache:new(LE_FOLLOWER_TYPE_SHIPYARD_6_2)
+end
+function module:OnEvent(event,...)
+ local followerID=...
+ if self.shipCache.cache[followerID].followerID then
+ self.shipCache:OnEvent(event,...)
+ elseif self.followerCache.cache[followerID].followerID then
+ self.followerCache:OnEvent(event,...)
+ else
+ self.followerCache:Wipe()
+ self.shipCache:Wipe()
+ end
+ print(event,...)
+end
+function cache:new(type)
+ local rc=setmetatable({type=type,names={},sorted={},threats={},traits={},cache={}},{__index=self})
+ setmetatable(rc.cache,{__index=function(t,k) return EMPTY end})
+ return rc
+end
+function cache:OnEvent(event,...)
+ print(event,...)
+ if event=="GARRISON_FOLLOWER_UPGRADED" or event=="GARRISON_FOLLOWER_XP_CHANGED" then
+ local followerID=...
+ if (self.cache[followerID]) then
+ self:AddExtraData(self.cache[followerID])
+ if event=="GARRISON_FOLLOWER_UPGRADED" then
+ self:AddAbilities(self.cache[followerID])
+ end
+ end
+ else
+ self:Wipe()
+ end
+end
+function cache:Wipe()
+ wipe(self.sorted)
+ wipe(self.names)
+ wipe(self.threats)
+ wipe(self.traits)
+ wipe(self.cache)
+end
+function cache:Refresh()
+ if next(self.cache) then return end
+ self:Wipe()
+ for _,follower in pairs(G.GetFollowers(self.type)) do
+ if follower.isCollected then
+ self:AddExtraData(follower)
+ self:AddAbilities(follower)
+ local i=follower.followerID
+ self.names[follower.name]=i
+ tinsert(self.sorted,i)
+ self.cache[i]=follower
+ end
+
+ end
+end
+function cache:AddAbilities(follower)
+ if (follower.abilities) then
+ local followerID=follower.followerID
+ for _,ability in pairs(follower.abilities) do
+ local t=self.traits[ability.id]
+ if t then
+ for i=1,#t do if t[i]==followerID then tremove(t,i) break end end
+ end
+ if (not ability.isTrait) then
+ for id,_ in pairs(ability.counters) do
+ local t=self.threats[id]
+ if t then
+ for i=1,#t do if t[i]==followerID then tremove(t,i) break end end
+ end
+ end
+ end
+ end
+ follower.abilities=nil
+ end
+ follower.abilities=G.GetFollowerAbilities(follower.followerID)
+ if (follower.abilities) then
+ local followerID=follower.followerID
+ for _,ability in pairs(follower.abilities) do
+ self.traits[ability.id]=self.traits[ability.id]or {}
+ tinsert(self.traits[ability.id],followerID)
+ if (not ability.isTrait) then
+ for id,_ in pairs(ability.counters) do
+ self.threats[id]=self.threats[id]or {}
+ tinsert(self.threats[id],followerID)
+ end
+ end
+ end
+ end
+
+end
+function cache:AddExtraData(follower)
+ follower.rank=follower.level < GARRISON_FOLLOWER_MAX_LEVEL and follower.level or follower.iLevel
+ follower.qLevel=follower.quality*1000+follower.level
+ follower.coloredname=C(follower.name,tostring(follower.quality))
+ follower.fullname=format("%3d %s",follower.rank,follower.coloredname)
+ follower.maxed=follower.qLevel>=maxrank
+ local weaponItemID, weaponItemLevel, armorItemID, armorItemLevel = G.GetFollowerItems(follower.followerID);
+ follower.weaponItemID=weaponItemID
+ follower.weaponItemLevel=weaponItemLevel
+ follower.armorItemID=armorItemID
+ follower.armorItemLevel=armorItemLevel
+ follower.weaponQuality=select(3,GetItemInfo(weaponItemID))
+ follower.armorQuality=select(3,GetItemInfo(armorItemID))
+end
+
+function cache:HasTrait(followerID,trait)
+ local list=self.traits[trait]
+ if list then return tContains(list,followerID) end
+end
+function cache:HasAbility(followerID,trait)
+ return self:HasTrait(followerID,trait)
+end
+function cache:CanCounter(followerID,threat)
+ local list=self.threats[threat]
+ if list then return tContains(list,followerID) end
+end
+function cache:GetFollowerData(followerID,key,default)
+ self:Refresh()
+ if type(followerID)~="string" then return self.cache end
+ if (followerID:sub(1,2)~="0x") then
+ followerID=self.names[followerID]
+ end
--@debug@
-if LibDebug then LibDebug() end
+ assert(followerID)
--@end-debug@
---[===[@non-debug@
-setfenv(1,setmetatable({print=function(...) print("x",...) end},{__index=_G}))
---@end-non-debug@]===]
-local LE_FOLLOWER_TYPE_GARRISON_6_0=LE_FOLLOWER_TYPE_GARRISON_6_0
-local LE_FOLLOWER_TYPE_SHIPYARD_6_2=LE_FOLLOWER_TYPE_SHIPYARD_6_2
+ if not followerID then
+ return key and default or EMPTY
+ end
+ if not key then
+ return self.cache[followerID]
+ else
+ return self.cache[followerID][key] or default
+ end
+end
+local sorters={}
+sorters.leveldesc = function(a,b)
+ return (Mbase.followers[a].iLevel * 10 + Mbase.followers[a].level) > (Mbase.followers[b].iLevel * 10 + Mbase.followers[b].level)
+end
+sorters.levelasc = function(a,b)
+ return (Mbase.followers[a].iLevel * 10 + Mbase.followers[a].level) < (Mbase.followers[b].iLevel * 10 + Mbase.followers[b].level)
+end
+
+
+---@function
+-- Iterator function
+-- @param func type of sorting (can be mitted if we dont care)
+--
+function cache:GetFollowersIterator(func)
+ self:Refresh()
+ if type(func)=="function" then
+ table.sort(self.sorted,sorters[func])
+ end
+ local f=self.cache
+ return function(sorted,i)
+ i=i+1
+ local x = sorted[i]
+ if x then
+ local v=f[x] and f[x].followerID or nil
+ if v then
+ return i,v
+ end
+ end
+ end,self.sorted,0
+end
+function cache:GetFollowersWithTrait(trait)
+ self:Refresh()
+ return self.traits[trait]
+end
+function cache:GetFollowersWithCounterFor(threat)
+ self:refresh()
+ return self.threats[threat]
+end
+
+-- Addon level proxies
+function addon:GetFollowerData(followerID,key,default)
+ return module.followerCache:GetFollowerData(followerID,key,default)
+end
+function addon:GetShipData(followerID,key,default)
+ return module.shipCache:GetFollowerData(followerID,key,default)
+end
+function addon:GetFollowersWithTrait(trait)
+ return module.followerCache:GetFollowersWithTrait(trait)
+end
+function addon:GetFollowersWithCounterFor(threat)
+ return module.followerCache:GetFollowersWithCounterFor(threat)
+end
+function addon:GetFollowersIterator(func)
+ return module.followerCache:GetFollowersIterator(func)
+end
+function addon:GetShipsIterator(func)
+ return module.shipCache:GetFollowersIterator(func)
+end
+
+--[=[
local function keyToIndex(key)
if (not Mbase.followers or not next(Mbase.followers)) then
Mbase.dirtyList=false
@@ -142,7 +336,7 @@ end
-- Iterator function
-- @param func type of sorting (can be mitted if we dont care)
--
-function addon:GetFollowerIterator(func,followerTypeID)
+function addon:GetFollowersIterator(func,followerTypeID)
keyToIndex()
if type(func)=="function" then
table.sort(sorted,sorters[func])
@@ -160,8 +354,11 @@ function addon:GetFollowerIterator(func,followerTypeID)
end,sorted,0
end
function addon:GetFollowersWithTrait(trait)
+ if not next(traits) then keyToIndex() end
return traits[trait]
end
function addon:GetFollowersWithCounterFor(threat)
+ if not next(traits) then keyToIndex() end
return threats[threat]
-end
\ No newline at end of file
+end
+--]=]
\ No newline at end of file
diff --git a/FollowerPage.lua b/FollowerPage.lua
index 9a1b862..c305683 100644
--- a/FollowerPage.lua
+++ b/FollowerPage.lua
@@ -1,25 +1,9 @@
local me, ns = ...
-local addon=ns.addon --#addon
-local L=ns.L
-local D=ns.D
-local C=ns.C
-local AceGUI=ns.AceGUI
+local pp=print
local _G=_G
-local new, del, copy =ns.new,ns.del,ns.copy
--- Courtesy of Motig
--- Concept and interface reused with permission
--- Mission building rewritten from scratch
---local GMC_G = {}
+ns.Configure()
+local addon=ns.addon --#addon
local factory=addon:GetFactory()
---GMC_G.frame = CreateFrame('FRAME')
-local aMissions={}
-local dbcache
-local cache
-local db
-local GMC
-local GMF=GarrisonMissionFrame
-local G=C_Garrison
-local GMCUsedFollowers={}
local wipe=wipe
local pairs=pairs
local tinsert=tinsert
@@ -35,11 +19,6 @@ local GameTooltip=GameTooltip
local StaticPopupDialogs=StaticPopupDialogs
local YES=YES
local NO=NO
---@debug@
-_G.GAC=addon
-if LibDebug then LibDebug() end
---@end-debug@
-local dbg
local GARRISON_FOLLOWER_MAX_ITEM_LEVEL=GARRISON_FOLLOWER_MAX_ITEM_LEVEL
function addon:ShowImprovements()
local scroller=self:GetScroller("Items")
@@ -211,4 +190,102 @@ end
function addon:FollowerPageStartUp()
self:RegisterEvent("GARRISON_FOLLOWER_UPGRADED","DelayedRefresh")
self:RegisterEvent("CHAT_MSG_LOOT","DelayedRefresh")
+ self:GarrisonTraitCountersFrame_OnLoad(GarrisonTraitCountersFrame, GARRISON_THREAT_COUNTER_TOOLTIP .. " %d")
+ self:HookScript(GarrisonTraitCountersFrame,"OnEvent","GarrisonTraitCountersFrame_OnEvent")
+ self:HookScript(GarrisonTraitCountersFrame,"OnShow","GarrisonTraitCountersFrame_OnShow")
+end
+--[[
+
+
+
+
+
+--]]
+
+function addon:GarrisonTraitCountersFrame_OnLoad(this, tooltipString)
+ print("Load")
+ this:ClearAllPoints()
+ this:SetParent(GarrisonThreatCountersFrame:GetParent())
+ this:SetPoint("BOTTOMLEFT",185,6)
+ this:Show()
+ this.tooltipString = tooltipString;
+ this.choice=CreateFrame('Frame',this:GetName()..tostring(GetTime()*1000),this,"UIDropDownMenuTemplate")
+ this.choice.button=_G[this.choice:GetName()..'Button']
+ this.choice:SetPoint("TOPLEFT",-192,0)
+ addon:FillCounters(this,1)
+ this.TraitsList[1]:SetScript("OnEnter",_G.GarrisonTraitCounter_OnEnter)
+ --this.TraitsList[1]:SetScript("OnEnter",pp)
+ do
+ local frame=this.choice
+ local list=G.GetRecruiterAbilityCategories()
+ local function sel(this,category,index)
+ UIDropDownMenu_SetSelectedID(frame,index)
+ self:FillCounters(frame:GetParent(),category)
+ end
+ UIDropDownMenu_Initialize(frame, function(...)
+ local i=0
+ for v,k in pairs(list) do
+ if ns.traitTable[v] then
+ i=i+1
+ local info=UIDropDownMenu_CreateInfo()
+ info.text=k
+ info.value=v
+ info.func=sel
+ info.arg1=v
+ info.arg2=i
+ UIDropDownMenu_AddButton(info,1)
+ end
+ end
+ end)
+ UIDropDownMenu_SetWidth(frame, 150);
+ UIDropDownMenu_SetButtonWidth(frame, 174)
+ UIDropDownMenu_SetSelectedID(frame, 1)
+ UIDropDownMenu_JustifyText(frame, "LEFT")
+ --EasyMenu(list,frame,frame,0,0,nil,5)
+ end
+ this:RegisterEvent("GARRISON_FOLLOWER_LIST_UPDATE");
+end
+
+function addon:GarrisonTraitCountersFrame_OnEvent(this, event, ...)
+ if ( this:IsVisible() ) then
+ self:GarrisonTraitCountersFrame_OnShow(this);
+ end
+end
+
+function addon:GarrisonTraitCountersFrame_OnShow(this)
+ for i = 1, #this.TraitsList do
+ local t=addon:GetFollowersWithTrait(this.TraitsList[i].id)
+ local n=t and #t or 0
+ this.TraitsList[i].Count:SetText(n);
+ end
+end
+
+---@function [parent=#addon] GarrisonTraitCounter_OnEnter
+-- Need to be a global
+function _G.GarrisonTraitCounter_OnEnter(this)
+ GameTooltip:SetOwner(this, "ANCHOR_RIGHT");
+ GameTooltip:SetText(this:GetParent().tooltipString:format(this.Count:GetText(), this.name,this.id), nil, nil, nil, nil, true);
+end
+function addon:FillCounters(this,category)
+ local i=0
+ for id,name in pairs(ns.traitTable[category]) do
+ i=i+1
+ local frame = this.TraitsList[i];
+ local offset=(ns.bigscreen and 22 or 17)
+
+ if ( not frame ) then
+ frame = CreateFrame("Button", nil, this, "GarrisonTraitCounterTemplate");
+ frame:SetPoint("LEFT", this.TraitsList[i-1], "RIGHT", 14, 0);
+ frame:SetScript("OnEnter",GarrisonTraitCounter_OnEnter)
+ this.TraitsList[i] = frame;
+ end
+ frame.Icon:SetTexture(G.GetFollowerAbilityIcon(id))
+ frame.name = name;
+ frame.id = id;
+ frame:Show()
+ end
+ for j=i+1,#this.TraitsList do
+ this.TraitsList[j]:Hide()
+ end
end
+
diff --git a/FollowerRecruiting.lua b/FollowerRecruiting.lua
index b980395..a62f333 100644
--- a/FollowerRecruiting.lua
+++ b/FollowerRecruiting.lua
@@ -1,17 +1,6 @@
local me,ns=...
-local addon=ns.addon
---@debug@
-if LibDebug then LibDebug() end
---@end-debug@
-local GBF=GarrisonBuildingFrame
-local GBFMap=GBF.MapFrame
-local G=C_Garrison
-local CreateFrame=CreateFrame
-local GARRISON_FOLLOWER_MAX_LEVEL=GARRISON_FOLLOWER_MAX_LEVEL
-local L=ns.L
-local D=ns.D
-local C=ns.C
-local new,del=ns.new,ns.del
+ns.Configure()
+local addon=addon
local GRF=GarrisonRecruiterFrame.Pick
local module=addon:NewSubClass("RecruitingPage") --#module
function module:OnInitialize()
@@ -20,11 +9,11 @@ local origGarrisonRecruiterFrame_AddEntryToDropdown=GarrisonRecruiterFrame_AddEn
function _G.GarrisonRecruiterFrame_AddEntryToDropdown(entry,info,level)
info.text = entry.name;
info.value = entry.id;
- info.checked = (GarrisonRecruiterFrame.Pick.dropDownValue == info.value);
+ info.checked = (GRF.dropDownValue == info.value);
if (entry.id) then
local list=GRF.Title2:GetText()==GARRISON_CHOOSE_THREAT and addon:GetFollowersWithCounterFor(entry.id) or addon:GetFollowersWithTrait(entry.id)
if list then
- info.text=format("%s (%d)",entry.name,#list)
+ info.text=("%s (%d)"):format(entry.name,#list)
info.tooltipText=entry.description.."\n"
for i=1,#list do
info.tooltipText=info.tooltipText.."\n"..addon:GetFollowerData(list[i],'fullname',L["Some follower"]) .. " " .. addon:GetFollowerStatus(list[i],false,true)
diff --git a/GarrisonCommander.lua b/GarrisonCommander.lua
index ac7fcb2..5f06435 100644
--- a/GarrisonCommander.lua
+++ b/GarrisonCommander.lua
@@ -1,11 +1,6 @@
local me, ns = ...
-local addon=ns.addon --#addon
-local L=ns.L
-local D=ns.D
-local C=ns.C
+ns.Configure()
local _G=_G
-local P=ns.party
-local AceGUI=ns.AceGUI
local HD=false
local tremove=tremove
local setmetatable=setmetatable
@@ -26,12 +21,7 @@ local trc=false
local pin=false
local baseHeight
local minHeight
---@debug@
-if LibDebug then LibDebug() end
---@end-debug@
---[===[@non-debug@
-setfenv(1,setmetatable({print=function(...) print("x",...) end},{__index=_G}))
---@end-non-debug@]===]
+local addon=addon --#addon
ns.bigscreen=true
-- Blizzard functions override support
local orig={} --#originals
@@ -437,98 +427,6 @@ function addon:showdata(fullargs,action,missionid)
end
end
end
-local function fillCounters(self,category)
- local i=0
- for id,name in pairs(ns.traitTable[category]) do
- i=i+1
- local frame = self.TraitsList[i];
- local offset=(ns.bigscreen and 22 or 17)
-
- if ( not frame ) then
- frame = CreateFrame("Button", nil, self, "GarrisonTraitCounterTemplate");
- frame:SetPoint("LEFT", self.TraitsList[i-1], "RIGHT", 14, 0);
- frame:SetScript("OnEnter",GarrisonTraitCounter_OnEnter)
- self.TraitsList[i] = frame;
- end
- frame.Icon:SetTexture(G.GetFollowerAbilityIcon(id))
- frame.name = name;
- frame.id = id;
- frame:Show()
- end
- for j=i+1,#self.TraitsList do
- self.TraitsList[j]:Hide()
- end
-end
-
----@function [parent=#GarrisonTraitCountersFrame] GarrisonTraitCountersFrame_OnLoad
---@param #enum followerType dalla 6.2, il tipo follower
---@param #string tooltipString Format per il tooltip
-function _G.GarrisonTraitCountersFrame_OnLoad(self, followerType, tooltipString)
- if (followerType == nil) then
- followerType = LE_FOLLOWER_TYPE_GARRISON_6_0;
- end
- if (tooltipString == nil) then
- tooltipString = GARRISON_THREAT_COUNTER_TOOLTIP .. " %d";
- end
- self.tooltipString = tooltipString;
- self.choice=CreateFrame('Frame',self:GetName()..tostring(GetTime()*1000),self,"UIDropDownMenuTemplate")
- self.choice.button=_G[self.choice:GetName()..'Button']
- self.choice:SetPoint("TOPLEFT")
- fillCounters(self,1)
- do
- local frame=self.choice
- local list=G.GetRecruiterAbilityCategories()
- local function sel(this,category,index)
- UIDropDownMenu_SetSelectedID(frame,index)
- fillCounters(frame:GetParent(),category)
- end
- UIDropDownMenu_Initialize(frame, function(...)
- local i=0
- for v,k in pairs(list) do
- if ns.traitTable[v] then
- i=i+1
- local info=UIDropDownMenu_CreateInfo()
- info.text=k
- info.value=v
- info.func=sel
- info.arg1=v
- info.arg2=i
- UIDropDownMenu_AddButton(info,1)
- end
- end
- end)
- UIDropDownMenu_SetWidth(frame, 150);
- UIDropDownMenu_SetButtonWidth(frame, 174)
- UIDropDownMenu_SetSelectedID(frame, 1)
- UIDropDownMenu_JustifyText(frame, "LEFT")
- --EasyMenu(list,frame,frame,0,0,nil,5)
- end
- self:RegisterEvent("GARRISON_FOLLOWER_LIST_UPDATE");
-end
-
----@function [parent=#GarrisonTraitCountersFrame] GarrisonTraitCountersFrame_OnEvent
-function _G.GarrisonTraitCountersFrame_OnEvent(self, event, ...)
- if ( self:IsVisible() ) then
- GarrisonTraitCountersFrame_Update(self);
- end
-end
-
----@function [parent=#GarrisonTraitCountersFrame] GarrisonTraitCountersFrame_Update
-function _G.GarrisonTraitCountersFrame_Update(self)
-
- for i = 1, #self.TraitsList do
- local t=addon:GetFollowersWithTrait(self.TraitsList[i].id)
- local n=t and #t or 0
- self.TraitsList[i].Count:SetText(n);
- end
-end
-
----@function [parent=#GarrisonTraitCountersFrame] GarrisonTraitCountersFrame_OnEnter
-function _G.GarrisonTraitCounter_OnEnter(self)
- GameTooltip:SetOwner(self, "ANCHOR_RIGHT");
- local text = string.format(self:GetParent().tooltipString, self.Count:GetText(), self.name,self.id);
- GameTooltip:SetText(text, nil, nil, nil, nil, true);
-end
function addon:CheckMP()
if (IsAddOnLoaded("MasterPlan")) then
@@ -1080,7 +978,7 @@ do
function addon:RefreshFollowerStatus()
wipe(s)
- for _,followerID in self:GetFollowerIterator() do
+ for _,followerID in self:GetFollowersIterator() do
local status=self:GetFollowerStatus(followerID)
s[status]=s[status]+1
end
@@ -1663,7 +1561,7 @@ do
local missionID=partyIndex[i]
local party=parties[missionID]
local mission=self:GetMissionData(missionID)
- if (mission) then
+ if mission and party and #party.members >= G.GetMissionMaxFollowers(missionID) then
local mb=AceGUI:Create("GMCMissionButton")
mb:SetScale(0.6)
ml:PushChild(mb,missionID)
@@ -1679,7 +1577,6 @@ end
--Initial one time setup
function addon:SetUp(...)
ns.CompletedMissions={}
- self:FollowerCacheInit()
--@alpha@
if (not db.alfa.v220) then
self:Popup(L["You are using an Alpha version of Garrison Commander. Please post bugs on Curse if you find them"],10)
@@ -1726,10 +1623,7 @@ function addon:SetUp(...)
bt:SetText(L["Garrison Comander Quick Mission Completion"])
bt:SetPoint("CENTER",0,-50)
addon:ActivateButton(bt,"MissionComplete",L["Complete all missions without confirmation"])
- GarrisonTraitCountersFrame:ClearAllPoints()
- GarrisonTraitCountersFrame:SetParent(GarrisonThreatCountersFrame:GetParent())
- GarrisonTraitCountersFrame:SetPoint("BOTTOMLEFT",200,0)
- GarrisonTraitCountersFrame:Show()
+
return self:StartUp()
--collectgarbage("step",10)
@@ -1938,6 +1832,9 @@ function addon:GetFollowerTexture(followerID)
end
function addon:CleanUp()
+--@debug@
+ print("Cleaning up")
+--@end-debug@
wipe(ns.CompletedMissions)
self:UnhookAll()
self:CancelAllTimers()
@@ -2035,7 +1932,7 @@ if not stage.missionid then
--@debug@
print("UpdateMissionPage for",missionID,missionInfo.name,missionInfo.numFollowers)
--@end-debug@
- self:holdEvents()
+ holdEvents()
if ns.toc < 60200 then
GarrisonMissionPage_ClearParty()
else
@@ -2062,7 +1959,7 @@ if not stage.missionid then
--self:Dump(GMF.MissionTab.MissionPage.Followers,"Selected followers")
--GarrisonMissionPage_UpdateEmptyString()
end
- self:releaseEvents()
+ releaseEvents()
end
local firstcall=true
diff --git a/GarrisonCommander.toc b/GarrisonCommander.toc
index 24f138b..e71d73e 100644
--- a/GarrisonCommander.toc
+++ b/GarrisonCommander.toc
@@ -5,7 +5,7 @@
## Notes-frFR: Vous aide au moment de choisir le droit utilisateur pour la bonne mission
## Author: Alar of Daggerspine
## Version: @project-version@ @project-abbreviated-hash@
-## X-Version: 2.4.8
+## X-Version: 2.5.0
## X-Revision: @project-abbreviated-hash@
## eMail: alar@aspide.it
## URL: http://wow.aspide.it
@@ -24,7 +24,7 @@
## X-Embeds:
embeds.xml
localization.lua
-wowhead.lua
+##wowhead.lua
Init.lua
Widgets.lua
GarrisonCommander.xml
diff --git a/GarrisonCommander.xml b/GarrisonCommander.xml
index c23b8cf..e463c26 100644
--- a/GarrisonCommander.xml
+++ b/GarrisonCommander.xml
@@ -421,11 +421,6 @@
-
-
-
-
-