Quantcast

Removed improved logistiv and changed garrison cache icon

Alar of Daggerspine [07-12-15 - 10:28]
Removed improved logistiv and changed garrison cache icon

Signed-off-by: Alar of Daggerspine <alar@aspide.it>
Filename
CHANGELOG.txt
GarrisonCommander-Broker/ldb.lua
diff --git a/CHANGELOG.txt b/CHANGELOG.txt
index c20e6e9..83d9e2e 100644
--- a/CHANGELOG.txt
+++ b/CHANGELOG.txt
@@ -4,7 +4,9 @@
 Feature: Quick mission completion enabled for shipyard
 Feature: In Ship missions mission expire time added
 Fix: Sometimes interacting with shipyard raised a protection issue
-More shipyard feature incoming
+Change: I could not verify if "Improved logistic" actuall works so I removed that check from Broker. Cache size will be 500 or 1000
+More shipyard features incoming
+
 * *2.6.5*
 Feature: Garrison Broker is now aware of enhanced Garrison Cache sizes (750 and 1000)
 Feature: Ship list enhanced with "xp to go"
diff --git a/GarrisonCommander-Broker/ldb.lua b/GarrisonCommander-Broker/ldb.lua
index c919a06..68787ba 100644
--- a/GarrisonCommander-Broker/ldb.lua
+++ b/GarrisonCommander-Broker/ldb.lua
@@ -59,7 +59,7 @@ local GARRISON_SHIPMENT_IN_PROGRESS=GARRISON_SHIPMENT_IN_PROGRESS -- "Work Order
 local GARRISON_SHIPMENT_READY=GARRISON_SHIPMENT_READY -- "Work Order Ready";
 local QUEUED_STATUS_WAITING=QUEUED_STATUS_WAITING -- "Waiting"
 local CAPACITANCE_ALL_COMPLETE=format(CAPACITANCE_ALL_COMPLETE,'') -- "All work orders will be completed in: %s";
-local  GARRISON_NUM_COMPLETED_MISSIONS=format(GARRISON_NUM_COMPLETED_MISSIONS,'999'):gsub('999','') -- "%d Completed |4Mission:Missions;";
+local GARRISON_NUM_COMPLETED_MISSIONS=format(GARRISON_NUM_COMPLETED_MISSIONS,'999'):gsub('999','') -- "%d Completed |4Mission:Missions;";
 local KEY_BUTTON1="Shift " .. KEY_BUTTON1
 local KEY_BUTTON2="Shift " .. KEY_BUTTON2
 local EMPTY=EMPTY -- "Empty"
@@ -128,14 +128,17 @@ end
 function addon:QUEST_TURNED_IN(event,quest,item,gold)
 	if quest==37485 then
 		self.db.realm.cachesize[ns.me] = 1000
-		self:Print("Your garrison cache sise was increased to 1000")
+		self:Print(L["Your garrison cache size was increased to %d"],1000)
+--[[
 	elseif quest==38445 then
 		self.db.realm.cachesize[ns.me] = 750
-		self:Print("Your garrison cache sise was increased to 750")
+		self:Print(L["Your garrison cache size was increased to %d"],750)
 	elseif quest==37935 then
 		self.db.realm.cachesize[ns.me] = 750
-		self:Print("Your garrison cache sise was increased to 750")
+		self:Print(L["Your garrison cache size was increased to %d"],750)
+--]]
 	end
+
 end
 function addon:UNIT_SPELLCAST_START(event,unit,name,rank,lineID,spellID)
 	if (unit=='player') then
@@ -203,6 +206,7 @@ function addon:CountCaches()
 	local now=time()
 	local expired=400*600 -- 1 risorsa ogni 10 minuti, per fullare servono 500 * 600 secondi
 	for p,j in pairs(self.db.realm.caches) do
+		local expired=(addon.db.realm.cachesize[p] or 500)*0.9 /600
 		if j>0 then
 			tot=tot+1
 			if j+expired < now then
@@ -310,6 +314,13 @@ function addon:OnInitialized()
 			v[s]=tonumber(v[s]) or 0
 		end
 	end
+	-- I was not satisfied with logistic improved, now Ignore it
+	for k,v in pairs(addon.db.realm.cachesize) do
+		if v and v==750 then
+			addon.db.realm.cachesize[k]=500
+		end
+	end
+
 	ns.me=GetUnitName("player",false)
 	self:RegisterEvent("GARRISON_MISSION_STARTED")
 	self:RegisterEvent("GARRISON_MISSION_NPC_OPENED","ldbCleanup")
@@ -360,10 +371,12 @@ end
 function addon:GetImprovedCacheSize()
 	if IsQuestFlaggedCompleted(37485) then
 		return 1000 -- Arakkoa item
+--[[
 	elseif IsQuestFlaggedCompleted(38445) then
 		return 750 --Alliance improved logistic
 	elseif IsQuestFlaggedCompleted(37953) then
 		return 750 --Horde improved logistic
+--]]
 	else
 		return 500
 	end
@@ -420,7 +433,7 @@ cacheobj=LibStub:GetLibrary("LibDataBroker-1.1"):NewDataObject("GC-Cache", {
 	label = "GC " .. GARRISON_CACHE,
 	text=QUEUED_STATUS_WAITING,
 	category = "Interface",
-	icon = "Interface\\Icons\\Trade_Engineering"
+	icon = "Interface\\Icons\\inv_garrison_resource"
 })
 function farmobj:Update()
 	local n,t=addon:CountMissing()