Quantcast

Naval mission in broker are now cyan (only for missions started after

Alar of Daggerspine [07-12-15 - 16:09]
Naval mission in broker are now cyan (only for missions started after
update)

Signed-off-by: Alar of Daggerspine <alar@aspide.it>
Filename
GarrisonCommander-Broker/ldb.lua
GarrisonCommander.lua
diff --git a/GarrisonCommander-Broker/ldb.lua b/GarrisonCommander-Broker/ldb.lua
index 31c90e6..52a33fe 100644
--- a/GarrisonCommander-Broker/ldb.lua
+++ b/GarrisonCommander-Broker/ldb.lua
@@ -64,6 +64,8 @@ local KEY_BUTTON1="Shift " .. KEY_BUTTON1
 local KEY_BUTTON2="Shift " .. KEY_BUTTON2
 local EMPTY=EMPTY -- "Empty"
 local GARRISON_CACHE=GARRISON_CACHE
+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 dbversion=1
 local frequency=5
@@ -106,7 +108,13 @@ function addon:ldbUpdate()
 end
 function addon:GARRISON_MISSION_STARTED(event,missionID)
 	local duration=select(2,G.GetPartyMissionInfo(missionID)) or 0
-	local k=format("%015d.%4d.%s",time() + duration,missionID,ns.me)
+	local followerType=self.db.global.missionType[missionID]
+	if not followerType then
+		local t=G.GetBasicMissionInfo(missionID)
+		followerType=t.followerTypeID
+		self.db.global.missionType[missionID]=followerType
+	end
+	local k=format("%015d.%4d.%s.%d",time() + duration,missionID,ns.me,followerType)
 	tinsert(self.db.realm.missions,k)
 	table.sort(self.db.realm.missions)
 	self:ldbUpdate()
@@ -292,6 +300,7 @@ function addon:SetDbDefaults(default)
 		cachesize={["*"]=false},
 		dbversion=1
 	}
+	default.global.missionType={}
 	default.profile['allowedWorkOrders']={["*"]=true}
 end
 function addon:OnInitialized()
@@ -487,9 +496,10 @@ function dataobj:OnTooltipShow()
 	local now=time()
 	for i=1,#db do
 		if db[i] then
-			local t,missionID,pc=strsplit('.',db[i])
+			local t,missionID,pc,followerType=strsplit('.',db[i])
 			t=tonumber(t) or 0
-			local name=G.GetMissionName(missionID)
+
+			local name=(followerType and followerType==LE_FOLLOWER_TYPE_SHIPYARD_6_2) and C(G.GetMissionName(missionID),"cyan") or G.GetMissionName(missionID)
 			if (name) then
 				local msg=format("|cff%s%s|r: %s",pc==ns.me and C.Green.c or C.Orange.c,pc,name)
 				if t > now then
diff --git a/GarrisonCommander.lua b/GarrisonCommander.lua
index 7397c4d..5d3808d 100644
--- a/GarrisonCommander.lua
+++ b/GarrisonCommander.lua
@@ -22,6 +22,8 @@ local pin=false
 local baseHeight
 local minHeight
 local addon=addon --#self
+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
 ns.bigscreen=true
 -- Blizzard functions override support
 local orig=orig --#originals
@@ -2745,7 +2747,9 @@ function addon:AddStandardDataToButton(page,button,mission,missionID,bigscreen)
 	button.Title:SetText(mission.name)
 --@end-non-debug@]===]
 	--@debug@
-	button.Title:SetText(mission.name:sub(1,15).."  " .. (mission.class or ""))
+	if mission.followerTypeID==LE_FOLLOWER_TYPE_GARRISON_6_0 then
+		button.Title:SetText(mission.name:sub(1,15).."  " .. (mission.class or ""))
+	end
 	--@end-debug@
 	button.Level:SetText(mission.level);
 	local seconds=self:GetMissionData(missionID,'improvedDurationSeconds')
@@ -2949,6 +2953,10 @@ function addon:AddIndicatorToButton(button,mission,missionID,bigscreen)
 	end
 end
 function addon:AddShipsToButton(button,mission,missionID,bigscreen)
+	for i=1,3 do
+		local frame=button.gcPANEL.Party[i]
+		frame:Hide()
+	end
 end
 function addon:AddFollowersToButton(button,mission,missionID,bigscreen)
 	if (not button.gcPANEL) then