From e2340470d12dd59059f8c1930cb406b08108ff98 Mon Sep 17 00:00:00 2001
From: Alar of Daggerspine
Date: Fri, 26 Dec 2014 03:56:16 +0100
Subject: [PATCH] big screen made optional
Signed-off-by: Alar of Daggerspine
---
GarrisonCommander.lua | 415 ++++++++++++++++++++++++++++---------------------
GarrisonCommander.xml | 46 ++++--
2 files changed, 273 insertions(+), 188 deletions(-)
diff --git a/GarrisonCommander.lua b/GarrisonCommander.lua
index 64745af..16330d6 100644
--- a/GarrisonCommander.lua
+++ b/GarrisonCommander.lua
@@ -21,6 +21,7 @@ local wipe=wipe
local format=format
local tostring=tostring
local collectgarbage=collectgarbage
+local bigscreen=true
--@debug@
if (LibDebug) then LibDebug() end
@@ -483,7 +484,8 @@ function addon:OnInitialized()
Garrison_SortMissions_Followers=L["Number of followers"],
},
L["Sort missions by:"],L["Original sort restores original sorting method, whatever it was (If you have another addon sorting mission, it should kick in again)"])
---self:AddSlider("RESTIMER",5,1,10,"Enable res timer","Shows a timer for battlefield resser",1)
+ self:AddToggle("BIGSCREEN",true,L["Use big screen"],L["Disabling this will give you the interface from 1.1.8, given or taken. Need to reload interface"])
+ bigscreen=self:GetBoolean("BIGSCREEN")
self:AddSlider("MAXMISSIONS",5,1,8,L["Mission shown for follower"],nil,1)
self:AddSlider("MINPERC",50,0,100,L["Minimun chance success under which ignore missions"],nil,5)
self:Trigger("MSORT")
@@ -493,6 +495,19 @@ function addon:ApplyIGM(value)
self:BuildMissionsCache(false,true)
GarrisonMissionList_UpdateMissions()
end
+function addon:ApplyBIGSCREEN(value)
+ if (value ~= bigscreen) then
+ if (value) then
+ wipe(dbcache.ignored[missionID]) -- we no longer have an interface to change this settings
+ end
+ self:Popup(L["Must reload interface to apply"],0,
+ function(this)
+ addon:SetBoolean("BIGSCREEN",value)
+ ReloadUI()
+ end
+ )
+ end
+end
function addon:ApplyIGP(value)
self:BuildMissionsCache(false,true)
GarrisonMissionList_UpdateMissions()
@@ -953,8 +968,13 @@ function addon:HookedGarrisonMissionButton_AddThreatsToTooltip(missionID)
local button=GetMouseFocus()
--@debug@
GameTooltip:AddLine("ID:" .. tostring(missionID))
- if (not mission) then GameTooltip:AddLine("E dove minchia è finita??") return end
--@end-debug@
+ if (not mission) then
+--@debug@
+ GameTooltip:AddLine("E dove minchia è finita??")
+--@end-debug@
+ return
+ end
if (true) then
local f=GarrisonMissionListTooltipThreatsFrame
if (not f.Env) then
@@ -981,37 +1001,42 @@ function addon:HookedGarrisonMissionButton_AddThreatsToTooltip(missionID)
end
end
-- Adding All available followers
- GameTooltip:AddLine(L["Other useful followers"])
local fullnames=new()
+ local party=new()
local biascolors=new()
local partystring=strjoin("|",tostringall(unpack(parties[missionID].members)))
for followerID,refs in pairs(counterFollowerIndex[missionID]) do
+ local fullname= self:GetFollowerData(followerID,'fullname')
+ for i=1,#refs do
+ fullname=fullname .." |T" .. tostring(counters[missionID][refs[i]].icon) ..":16|t"
+ end
if (not partystring:find(followerID)) then
- local fullname= self:GetFollowerData(followerID,'fullname')
- for i=1,#refs do
- fullname=fullname .." |T" .. tostring(counters[missionID][refs[i]].icon) ..":16|t"
- end
tinsert(fullnames,fullname)
- biascolors[fullname]={self:GetBiasColor(followerID,missionID,"White"),self:GetFollowerStatus(followerID,true)}
+ else
+ tinsert(party,fullname)
end
+ biascolors[fullname]={self:GetBiasColor(followerID,missionID,"White"),self:GetFollowerStatus(followerID,true)}
end
table.sort(fullnames)
+ if (not bigscreen) then
+ GameTooltip:AddLine(PARTY)
+ for i=1,#party do
+ local fullname=party[i]
+ local info=biascolors[fullname]
+ self:AddLine(fullname,info[2],info[1])
+ end
+ if (#party < mission.numFollowers) then
+ GameTooltip:AddLine(GARRISON_PARTY_NOT_FULL_TOOLTIP,C.Red())
+ end
+ end
+ GameTooltip:AddLine(L["Other useful followers"])
for i=1,#fullnames do
local fullname=fullnames[i]
local info=biascolors[fullname]
self:AddLine(fullname,info[2],info[1])
end
--- for i=1,#mission.slots do
--- local slot=mission.slots[i]
--- local indexes=counterThreatIndex[missionID][cleanicon(slot.icon)]
--- local name=C(NONE,"Red")
--- if (indexes and #indexes > 0) then
--- local fid=counters[missionID][indexes[1]].followerID
--- name=fullnames[fid]
--- end
--- GameTooltip:AddDoubleLine(slot.name==TYPE and ENVIRONMENT_SUBHEADER or slot.name,name,nil,nil,nil,C.Green())
--- end
+ del(party)
del(fullnames)
del(biascolors)
local perc=parties[missionID].perc
@@ -1496,6 +1521,10 @@ function addon:ShowHelpWindow(button)
* Quick selection of which follower ignore for match making
* Quick mission list order selection
+Note
+
+If you dont use big screen and have Master Plan installed, you must hover on percentage to get Garrison Commander Tooltip
+