Commit 5743003f authored by Benik's avatar Benik

Removed my own BfA Missions, OrderHall and Garrison datatexts. The new...

Removed my own BfA Missions, OrderHall and Garrison datatexts. The new Missions ElvUI one is superior
parent 411e5696
......@@ -1969,7 +1969,7 @@ local function SetupDataTexts(role)
E.db["datatexts"]["panels"]["BuiMiddleDTPanel"][3] = 'Crit Chance'
end
E.db["datatexts"]["panels"]["BuiLeftChatDTPanel"][2] = 'BfA Missions (BenikUI)'
E.db["datatexts"]["panels"]["BuiLeftChatDTPanel"][2] = 'Missions'
E.db["datatexts"]["panels"]["BuiLeftChatDTPanel"][3] = 'BuiMail'
E.db["datatexts"]["panels"]["BuiRightChatDTPanel"][1] = 'Spec Switch (BenikUI)'
......
......@@ -28,7 +28,7 @@ P['general']['minimap']['benikuiStyle'] = true
-- Datatexts
P['datatexts']['panels']['BuiLeftChatDTPanel'] = {
[1] = 'Spell/Heal Power',
[2] = 'BfA Missions (BenikUI)',
[2] = 'Missions',
[3] = 'BuiMail',
}
......@@ -223,7 +223,7 @@ P['benikui'] = {
-- Datatexts
P.datatexts.panels.BuiLeftChatDTPanel = {
[1] = 'Attack Power',
[2] = 'BfA Missions (BenikUI)',
[2] = 'Missions',
[3] = 'BuiMail',
}
......
local E, L, V, P, G = unpack(ElvUI);
local DT = E:GetModule('DataTexts')
local join = string.join
local format = string.format
local tsort = table.sort
local ipairs = ipairs
--WoW API / Variables
local C_Garrison_GetFollowerShipments = C_Garrison.GetFollowerShipments
local C_Garrison_GetInProgressMissions = C_Garrison.GetInProgressMissions
local C_Garrison_RequestLandingPageShipmentInfo = C_Garrison.RequestLandingPageShipmentInfo
local C_Garrison_GetLandingPageShipmentInfoByContainerID = C_Garrison.GetLandingPageShipmentInfoByContainerID
local C_Garrison_GetTalentTreeIDsByClassID = C_Garrison.GetTalentTreeIDsByClassID
local C_Garrison_GetTalentTreeInfoForID = C_Garrison.GetTalentTreeInfoForID
local C_Garrison_GetCompleteTalent = C_Garrison.GetCompleteTalent
local C_Garrison_GetAvailableMissions = C_Garrison.GetAvailableMissions
local C_IslandsQueue_GetIslandsWeeklyQuestID = C_IslandsQueue.GetIslandsWeeklyQuestID
local GetQuestObjectiveInfo = GetQuestObjectiveInfo
local IsQuestFlaggedCompleted = IsQuestFlaggedCompleted
local GetMaxLevelForExpansionLevel = GetMaxLevelForExpansionLevel
local GetRGB = GetRGB
local SecondsToTime = SecondsToTime
local GOAL_COMPLETED = GOAL_COMPLETED
local RESEARCH_TIME_LABEL = RESEARCH_TIME_LABEL
local GARRISON_LANDING_SHIPMENT_COUNT = GARRISON_LANDING_SHIPMENT_COUNT
local FOLLOWERLIST_LABEL_TROOPS = FOLLOWERLIST_LABEL_TROOPS
local LE_FOLLOWER_TYPE_GARRISON_8_0 = LE_FOLLOWER_TYPE_GARRISON_8_0
local LE_GARRISON_TYPE_8_0 = LE_GARRISON_TYPE_8_0
local LE_EXPANSION_BATTLE_FOR_AZEROTH = LE_EXPANSION_BATTLE_FOR_AZEROTH
local ISLANDS_QUEUE_WEEKLY_QUEST_PROGRESS = ISLANDS_QUEUE_WEEKLY_QUEST_PROGRESS
local ISLANDS_HEADER = ISLANDS_HEADER
local ISLANDS_QUEUE_FRAME_TITLE = ISLANDS_QUEUE_FRAME_TITLE
local GREEN_FONT_COLOR = GREEN_FONT_COLOR
--Global variables that we don't cache, list them here for mikk's FindGlobals script
-- GLOBALS: GarrisonLandingPage, selectioncolor
local displayModifierString = ''
local lastPanel;
local function sortFunction(a, b)
return a.missionEndTime < b.missionEndTime
end
local OnEvent = function(self)
local inProgressMissions = {};
C_Garrison_GetInProgressMissions(inProgressMissions, LE_FOLLOWER_TYPE_GARRISON_8_0)
local CountInProgress = 0
local CountCompleted = 0
for i = 1, #inProgressMissions do
if inProgressMissions[i].inProgress then
local TimeLeft = inProgressMissions[i].timeLeft:match("%d")
if (TimeLeft ~= "0") then
CountInProgress = CountInProgress + 1
else
CountCompleted = CountCompleted + 1
end
end
end
if (CountInProgress > 0) then
self.text:SetFormattedText(displayModifierString, GARRISON_MISSIONS, CountCompleted, #inProgressMissions)
elseif (CountInProgress == 0) and CountCompleted > 0 then
self.text:SetFormattedText("|cff00ff00%s|r", GARRISON_TYPE_8_0_LANDING_PAGE_TITLE) -- green text when there are completed missions
else
self.text:SetFormattedText(GARRISON_TYPE_8_0_LANDING_PAGE_TITLE)
end
lastPanel = self
end
local function OnClick()
if GarrisonLandingPageMinimapButton then
GarrisonLandingPageMinimapButton_OnClick()
end
end
local OnEnter = function(self)
DT:SetupTooltip(self)
C_Garrison_RequestLandingPageShipmentInfo()
local firstLine = true
--Missions
local inProgressMissions = {}
C_Garrison_GetInProgressMissions(inProgressMissions, LE_FOLLOWER_TYPE_GARRISON_8_0)
local numMissions = #inProgressMissions
local AvailableMissions = {};
C_Garrison_GetAvailableMissions(AvailableMissions, LE_FOLLOWER_TYPE_GARRISON_8_0);
DT.tooltip:AddLine(format(GARRISON_LANDING_AVAILABLE:gsub('-', ': '), #AvailableMissions), selectioncolor)
DT.tooltip:AddLine(" ")
if(numMissions > 0) then
tsort(inProgressMissions, sortFunction) --Sort by time left, lowest first
firstLine = false
DT.tooltip:AddLine(L["Mission(s) Report:"])
for i=1, numMissions do
local mission = inProgressMissions[i]
local timeLeft = mission.timeLeft:match("%d")
local r, g, b = 1, 1, 1
if(mission.isRare) then
r, g, b = 0.09, 0.51, 0.81
end
if(timeLeft and timeLeft == "0") then
DT.tooltip:AddDoubleLine(mission.name, GOAL_COMPLETED, r, g, b, GREEN_FONT_COLOR:GetRGB())
else
DT.tooltip:AddDoubleLine(mission.name, mission.timeLeft, r, g, b)
end
end
end
-- Troop Work Orders
local followerShipments = C_Garrison_GetFollowerShipments(LE_GARRISON_TYPE_8_0)
local hasFollowers = false
if(followerShipments) then
for i = 1, #followerShipments do
local name, _, _, shipmentsReady, shipmentsTotal, _, _, timeleftString = C_Garrison_GetLandingPageShipmentInfoByContainerID(followerShipments[i])
if(name and shipmentsReady and shipmentsTotal) then
if(hasFollowers == false) then
if not firstLine then
DT.tooltip:AddLine(" ")
end
firstLine = false
DT.tooltip:AddLine(FOLLOWERLIST_LABEL_TROOPS) -- "Troops"
hasFollowers = true
end
if timeleftString then
timeleftString = timeleftString.." "
else
timeleftString = ""
end
DT.tooltip:AddDoubleLine(name, timeleftString..format(GARRISON_LANDING_SHIPMENT_COUNT, shipmentsReady, shipmentsTotal), 1, 1, 1)
end
end
end
-- Talents
local talentTreeIDs = C_Garrison_GetTalentTreeIDsByClassID(LE_GARRISON_TYPE_8_0, E.myClassID)
local hasTalent = false
if(talentTreeIDs) then
-- this is a talent that has completed, but has not been seen in the talent UI yet.
local completeTalentID = C_Garrison_GetCompleteTalent(LE_GARRISON_TYPE_8_0)
for _, treeID in ipairs(talentTreeIDs) do
local _, _, tree = C_Garrison_GetTalentTreeInfoForID(treeID)
for _, talent in ipairs(tree) do
local showTalent = false
if(talent.isBeingResearched) then
showTalent = true
end
if(talent.id == completeTalentID) then
showTalent = true
end
if(showTalent) then
if not firstLine then
DT.tooltip:AddLine(" ")
end
firstLine = false
DT.tooltip:AddLine(RESEARCH_TIME_LABEL) -- "Research Time:"
if(talent.researchTimeRemaining and talent.researchTimeRemaining == 0) then
DT.tooltip:AddDoubleLine(talent.name, GOAL_COMPLETED, 1, 1, 1, GREEN_FONT_COLOR:GetRGB())
else
DT.tooltip:AddDoubleLine(talent.name, SecondsToTime(talent.researchTimeRemaining), 1, 1, 1)
end
hasTalent = true
end
end
end
end
-- Island Expeditions
local hasIsland = false
if(UnitLevel("player") >= GetMaxLevelForExpansionLevel(LE_EXPANSION_BATTLE_FOR_AZEROTH)) then
local questID = C_IslandsQueue_GetIslandsWeeklyQuestID()
if questID then
local _, _, finished, numFulfilled, numRequired = GetQuestObjectiveInfo(questID, 1, false);
local text = ""
local r1, g1 ,b1
if finished or IsQuestFlaggedCompleted(questID) then
text = GOAL_COMPLETED
r1, g1, b1 = GREEN_FONT_COLOR:GetRGB()
else
text = ISLANDS_QUEUE_WEEKLY_QUEST_PROGRESS:format(numFulfilled, numRequired)
r1, g1, b1 = selectioncolor
end
if not firstLine then
DT.tooltip:AddLine(" ")
end
firstLine = false
DT.tooltip:AddLine(ISLANDS_HEADER..":")
DT.tooltip:AddDoubleLine(ISLANDS_QUEUE_FRAME_TITLE, text, 1, 1, 1, r1, g1, b1)
hasIsland = true
end
end
if(numMissions > 0 or hasFollowers or hasTalent or hasIsland) then
DT.tooltip:AddLine(" ")
end
DT.tooltip:AddLine(GARRISON_TYPE_8_0_LANDING_PAGE_TOOLTIP, 0.7, 0.7, 1)
DT.tooltip:Show()
end
local function ValueColorUpdate(hex)
displayModifierString = join("", "%s: ", hex, "%d/%d|r")
if lastPanel ~= nil then
OnEvent(lastPanel)
end
end
E['valueColorUpdateFuncs'][ValueColorUpdate] = true
DT:RegisterDatatext('BfA Missions (BenikUI)', 'BenikUI', {'PLAYER_ENTERING_WORLD', 'GARRISON_MISSION_LIST_UPDATE', 'GARRISON_MISSION_STARTED', 'GARRISON_MISSION_FINISHED', 'ZONE_CHANGED_NEW_AREA', 'GARRISON_MISSION_COMPLETE_RESPONSE'}, OnEvent, nil, OnClick, OnEnter)
\ No newline at end of file
local E, L, V, P, G = unpack(ElvUI);
local DT = E:GetModule('DataTexts')
-- Missions are based on TukUI Garrison DataText. Credits: Hydra, Tukz
local join = string.join
local format = string.format
local tsort = table.sort
local GetCurrencyInfo = GetCurrencyInfo
local C_GarrisonRequestLandingPageShipmentInfo = C_Garrison.RequestLandingPageShipmentInfo
local C_GarrisonGetBuildings = C_Garrison.GetBuildings
local C_GarrisonGetInProgressMissions = C_Garrison.GetInProgressMissions
local C_GarrisonGetLandingPageShipmentInfo = C_Garrison.GetLandingPageShipmentInfo
local C_GarrisonGetAvailableMissions = C_Garrison.GetAvailableMissions
local C_Garrison_HasGarrison = C_Garrison.HasGarrison
local LoadAddOn = LoadAddOn
local GarrisonMissionFrame = GarrisonMissionFrame
local LE_FOLLOWER_TYPE_GARRISON_6_0, LE_FOLLOWER_TYPE_SHIPYARD_6_2 = LE_FOLLOWER_TYPE_GARRISON_6_0, LE_FOLLOWER_TYPE_SHIPYARD_6_2
local GARRISON_MISSIONS, GARRISON_LOCATION_TOOLTIP, GARRISON_SHIPMENT_EMPTY, GARRISON_MISSIONS_TITLE = GARRISON_MISSIONS, GARRISON_LOCATION_TOOLTIP, GARRISON_SHIPMENT_EMPTY, GARRISON_MISSIONS_TITLE
local AVAILABLE, GARRISON_MISSION_COMPLETE = AVAILABLE, GARRISON_MISSION_COMPLETE
local CAPACITANCE_WORK_ORDERS, SPLASH_NEW_6_2_FEATURE2_TITLE, MINIMAP_GARRISON_LANDING_PAGE_TOOLTIP = CAPACITANCE_WORK_ORDERS, SPLASH_NEW_6_2_FEATURE2_TITLE, MINIMAP_GARRISON_LANDING_PAGE_TOOLTIP
-- GLOBALS: selectioncolor
local displayModifierString = ''
local lastPanel;
local GARRISON_CURRENCY = 824
local GARRISON_CURRENCY_OIL = 1101
local OnEvent = function(self)
local inProgressMissions = {};
C_GarrisonGetInProgressMissions(inProgressMissions, LE_FOLLOWER_TYPE_GARRISON_6_0)
local CountInProgress = 0
local CountCompleted = 0
for i = 1, #inProgressMissions do
if inProgressMissions[i].inProgress then
local TimeLeft = inProgressMissions[i].timeLeft:match("%d")
if (TimeLeft ~= "0") then
CountInProgress = CountInProgress + 1
else
CountCompleted = CountCompleted + 1
end
end
end
if (CountInProgress > 0) then
self.text:SetFormattedText(displayModifierString, GARRISON_MISSIONS, CountCompleted, #inProgressMissions)
else
self.text:SetFormattedText(GARRISON_LOCATION_TOOLTIP..'+')
end
lastPanel = self
end
local garrisonType = LE_GARRISON_TYPE_6_0;
local function OnClick()
if not (C_Garrison_HasGarrison(garrisonType)) then
return;
end
local isShown = GarrisonLandingPage and GarrisonLandingPage:IsShown();
if (not isShown) then
ShowGarrisonLandingPage(garrisonType);
elseif (GarrisonLandingPage) then
local currentGarrType = GarrisonLandingPage.garrTypeID;
HideUIPanel(GarrisonLandingPage);
if (currentGarrType ~= garrisonType) then
ShowGarrisonLandingPage(garrisonType);
end
end
end
local function sortFunction(a, b)
return a.missionEndTime < b.missionEndTime
end
local OnEnter = function(self)
DT:SetupTooltip(self)
if (not GarrisonMissionFrame) then
LoadAddOn("Blizzard_GarrisonUI")
end
-- Work Orders
C_GarrisonRequestLandingPageShipmentInfo()
local buildings = C_GarrisonGetBuildings(LE_GARRISON_TYPE_6_0);
local NumBuildings = #buildings
local hasBuilding = false
if NumBuildings > 0 then
for i = 1, NumBuildings do
local buildingID = buildings[i].buildingID;
if (buildingID) then
local name, _, shipmentCapacity, shipmentsReady, shipmentsTotal, _, _, timeleftString = C_GarrisonGetLandingPageShipmentInfo(buildingID);
if (name) then
if(hasBuilding == false) then
DT.tooltip:AddLine(CAPACITANCE_WORK_ORDERS, selectioncolor)
hasBuilding = true
end
if shipmentsReady ~= shipmentsTotal then
DT.tooltip:AddDoubleLine(format('%s: |cffffff00%d/%d|r |cffffffff(%d)|r', name, shipmentsReady, shipmentsTotal, shipmentCapacity), timeleftString, 1, 1, 1, selectioncolor)
else
DT.tooltip:AddDoubleLine(format('%s: |cffff8000%d/%d|r |cffffffff(%d)|r', name, shipmentsReady, shipmentsTotal, shipmentCapacity), GARRISON_SHIPMENT_EMPTY, 1, 1, 1, 1, 0.5, 0)
end
end
end
end
DT.tooltip:AddLine(' ')
end
-- Follower Missions
local inProgressMissions = {};
C_GarrisonGetInProgressMissions(inProgressMissions, LE_FOLLOWER_TYPE_GARRISON_6_0)
local NumMissions = #inProgressMissions
local AvailableMissions = {};
C_GarrisonGetAvailableMissions(AvailableMissions, LE_FOLLOWER_TYPE_GARRISON_6_0);
if (NumMissions > 0) then
DT.tooltip:AddLine(format("%s (%s: %d)", GARRISON_MISSIONS_TITLE, AVAILABLE, #AvailableMissions), selectioncolor)
tsort(inProgressMissions, sortFunction)
for i = 1, NumMissions do
local Mission = inProgressMissions[i]
local TimeLeft = Mission.timeLeft:match("%d")
local r, g, b = 1, 1, 1
if (Mission.isRare) then r, g, b = 0.09, 0.51, 0.81 end
if (Mission.inProgress and (TimeLeft ~= "0")) then
if not (Mission.isRare) then r, g, b = 0.7, 0.7, 0.7 end
DT.tooltip:AddDoubleLine(format('%s |cffffffff(%s)|r', Mission.name, Mission.type), Mission.timeLeft, r, g, b, selectioncolor)
else
DT.tooltip:AddDoubleLine(Mission.name, GARRISON_MISSION_COMPLETE, r, g, b, 0, 1, 0)
end
end
DT.tooltip:AddLine(" ")
end
-- Ship Missions
local inProgressShipMissions = {};
C_GarrisonGetInProgressMissions(inProgressShipMissions, LE_FOLLOWER_TYPE_SHIPYARD_6_2)
local NumShipMissions = #inProgressShipMissions
local AvailableShipMissions = {};
C_GarrisonGetAvailableMissions(AvailableShipMissions, LE_FOLLOWER_TYPE_SHIPYARD_6_2);
if (NumShipMissions > 0) then
DT.tooltip:AddLine(format("%s (%s: %d)", SPLASH_NEW_6_2_FEATURE2_TITLE, AVAILABLE, #AvailableShipMissions), selectioncolor)
tsort(inProgressShipMissions, sortFunction)
for i = 1, NumShipMissions do
local shipMission = inProgressShipMissions[i]
local TimeLeft = shipMission.timeLeft:match("%d")
local r, g, b = 1, 1, 1
if (shipMission.isRare) then r, g, b = 0.09, 0.51, 0.81 end
if (shipMission.inProgress and (TimeLeft ~= "0")) then
if not (shipMission.isRare) then r, g, b = 0.7, 0.7, 0.7 end
DT.tooltip:AddDoubleLine(format('%s |cffffffff(%s)|r', shipMission.name, shipMission.type), shipMission.timeLeft, r, g, b, selectioncolor)
else
DT.tooltip:AddDoubleLine(shipMission.name, GARRISON_MISSION_COMPLETE, r, g, b, 0, 1, 0)
end
end
DT.tooltip:AddLine(" ")
end
local db = E.db.benikui.datatexts.garrison
if db.currency then
local name, amount, tex = GetCurrencyInfo(GARRISON_CURRENCY)
DT.tooltip:AddDoubleLine("\124T" .. tex .. ":12\124t " .. name, amount, 1, 1, 1, selectioncolor)
end
if db.oil then
local name, amount, tex = GetCurrencyInfo(GARRISON_CURRENCY_OIL)
DT.tooltip:AddDoubleLine("\124T" .. tex .. ":12\124t " .. name, amount, 1, 1, 1, selectioncolor)
DT.tooltip:AddLine(" ")
end
DT.tooltip:AddLine(MINIMAP_GARRISON_LANDING_PAGE_TOOLTIP, 0.7, 0.7, 1)
DT.tooltip:Show()
end
local function ValueColorUpdate(hex)
displayModifierString = join("", "%s: ", hex, "%d/%d|r")
if lastPanel ~= nil then
OnEvent(lastPanel)
end
end
E['valueColorUpdateFuncs'][ValueColorUpdate] = true
DT:RegisterDatatext('Garrison+ (BenikUI)', 'BenikUI', {'PLAYER_ENTERING_WORLD', 'GARRISON_MISSION_STARTED', 'GARRISON_MISSION_FINISHED', 'GARRISON_MISSION_COMPLETE_RESPONSE', 'ZONE_CHANGED_NEW_AREA'}, OnEvent, nil, OnClick, OnEnter)
\ No newline at end of file
......@@ -2,8 +2,5 @@
<script file="datatexts.lua"/>
<script file="options.lua"/>
<script file="mail.lua"/>
<script file="garrison.lua"/>
<script file="orderhall.lua"/>
<script file="bfamissions.lua"/>
<script file="specswitch.lua"/>
</Ui>
\ No newline at end of file
local E, L, V, P, G = unpack(ElvUI);
local DT = E:GetModule('DataTexts')
--Cache global variables
--Lua functions
local select, ipairs = select, ipairs
local format = string.format
local tsort = table.sort
local join = string.join
--WoW API / Variables
local C_Garrison_GetCompleteTalent = C_Garrison.GetCompleteTalent
local C_Garrison_GetFollowerShipments = C_Garrison.GetFollowerShipments
local C_Garrison_GetInProgressMissions = C_Garrison.GetInProgressMissions
local C_Garrison_GetLandingPageShipmentInfoByContainerID = C_Garrison.GetLandingPageShipmentInfoByContainerID
local C_GarrisonGetLooseShipments = C_Garrison.GetLooseShipments
local C_Garrison_GetTalentTreeIDsByClassID = C_Garrison.GetTalentTreeIDsByClassID
local C_Garrison_GetTalentTreeInfoForID = C_Garrison.GetTalentTreeInfoForID
local C_Garrison_RequestLandingPageShipmentInfo = C_Garrison.RequestLandingPageShipmentInfo
local C_Garrison_HasGarrison = C_Garrison.HasGarrison
local C_GarrisonGetAvailableMissions = C_Garrison.GetAvailableMissions
local HideUIPanel = HideUIPanel
local ShowGarrisonLandingPage = ShowGarrisonLandingPage
local UnitClass = UnitClass
local CAPACITANCE_WORK_ORDERS = CAPACITANCE_WORK_ORDERS
local COMPLETE = COMPLETE
local FOLLOWERLIST_LABEL_TROOPS = FOLLOWERLIST_LABEL_TROOPS
local GARRISON_LANDING_SHIPMENT_COUNT = GARRISON_LANDING_SHIPMENT_COUNT
local GARRISON_TALENT_ORDER_ADVANCEMENT = GARRISON_TALENT_ORDER_ADVANCEMENT
local LE_FOLLOWER_TYPE_GARRISON_7_0 = LE_FOLLOWER_TYPE_GARRISON_7_0
local LE_GARRISON_TYPE_7_0 = LE_GARRISON_TYPE_7_0
local ORDER_HALL_MISSIONS = ORDER_HALL_MISSIONS
--Global variables that we don't cache, list them here for mikk's FindGlobals script
-- GLOBALS: GarrisonLandingPage
local displayModifierString = ''
local lastPanel;
local function sortFunction(a, b)
return a.missionEndTime < b.missionEndTime
end
local function OnEnter(self)
DT:SetupTooltip(self)
C_Garrison_RequestLandingPageShipmentInfo()
local firstLine = true
--Missions
local inProgressMissions = C_Garrison_GetInProgressMissions(LE_FOLLOWER_TYPE_GARRISON_7_0)
local numMissions = (inProgressMissions and #inProgressMissions or 0)
local AvailableMissions = C_GarrisonGetAvailableMissions(LE_FOLLOWER_TYPE_GARRISON_7_0);
local numAvailableMissions = (AvailableMissions and #AvailableMissions or 0)
if (numAvailableMissions > 0 and numMissions == 0) then
DT.tooltip:AddLine(format(GARRISON_LANDING_AVAILABLE, numAvailableMissions))
elseif (numMissions > 0) then
tsort(inProgressMissions, sortFunction) --Sort by time left, lowest first
DT.tooltip:AddDoubleLine(format("%s", ORDER_HALL_MISSIONS), format("%s: %d", AVAILABLE, numAvailableMissions))
firstLine = false
for i=1, numMissions do
local mission = inProgressMissions[i]
local timeLeft = mission.timeLeft:match("%d")
local r, g, b = 1, 1, 1
if(mission.isRare) then
r, g, b = 0.09, 0.51, 0.81
end
if(timeLeft and timeLeft == "0") then
DT.tooltip:AddDoubleLine(mission.name, COMPLETE, r, g, b, 0, 1, 0)
else
DT.tooltip:AddDoubleLine(mission.name, mission.timeLeft, r, g, b)
end
end
end
-- Troop Work Orders
local followerShipments = C_Garrison_GetFollowerShipments(LE_GARRISON_TYPE_7_0)
local hasFollowers = false
if (followerShipments) then
for i = 1, #followerShipments do
local name, _, _, shipmentsReady, shipmentsTotal = C_Garrison_GetLandingPageShipmentInfoByContainerID(followerShipments[i])
if ( name and shipmentsReady and shipmentsTotal ) then
if(hasFollowers == false) then
if not firstLine then
DT.tooltip:AddLine(" ")
end
firstLine = false
DT.tooltip:AddLine(FOLLOWERLIST_LABEL_TROOPS) -- "Troops"
hasFollowers = true
end
DT.tooltip:AddDoubleLine(name, format(GARRISON_LANDING_SHIPMENT_COUNT, shipmentsReady, shipmentsTotal), 1, 1, 1)
end
end
end
-- "Loose Work Orders" (i.e. research, equipment)
local looseShipments = C_GarrisonGetLooseShipments(LE_GARRISON_TYPE_7_0)
local hasLoose = false
if (looseShipments) then
for i = 1, #looseShipments do
local name, _, _, shipmentsReady, shipmentsTotal = C_Garrison_GetLandingPageShipmentInfoByContainerID(looseShipments[i])
if ( name and shipmentsReady and shipmentsTotal ) then
if(hasLoose == false) then
if not firstLine then
DT.tooltip:AddLine(" ")
end
firstLine = false
DT.tooltip:AddLine(CAPACITANCE_WORK_ORDERS) -- "Work Orders"
hasLoose = true
end
DT.tooltip:AddDoubleLine(name, format(GARRISON_LANDING_SHIPMENT_COUNT, shipmentsReady, shipmentsTotal), 1, 1, 1)
end
end
end
-- Talents
local talentTreeIDs = C_Garrison_GetTalentTreeIDsByClassID(LE_GARRISON_TYPE_7_0, select(3, UnitClass("player")));
-- this is a talent that has completed, but has not been seen in the talent UI yet.
local hasTalent = false
if (talentTreeIDs) then
local completeTalentID = C_Garrison_GetCompleteTalent(LE_GARRISON_TYPE_7_0)
for _, treeID in ipairs(talentTreeIDs) do
local _, _, tree = C_Garrison_GetTalentTreeInfoForID(treeID)
for _, talent in ipairs(tree) do
local showTalent = false;
if (talent.isBeingResearched) then
showTalent = true;
end
if (talent.id == completeTalentID) then
showTalent = true;
end
if (showTalent) then
if not firstLine then
DT.tooltip:AddLine(" ")
end
firstLine = false
DT.tooltip:AddLine(GARRISON_TALENT_ORDER_ADVANCEMENT); -- "Order Advancement"
DT.tooltip:AddDoubleLine(talent.name, format(GARRISON_LANDING_SHIPMENT_COUNT, talent.isBeingResearched and 0 or 1, 1), 1, 1, 1);
hasTalent = true
end
end
end
end
if(numMissions > 0 or numAvailableMissions > 0 or hasFollowers or hasLoose or hasTalent) then
DT.tooltip:Show()
else
DT.tooltip:Hide()
end
end
local function OnClick()