From 64f10e26ed0716e6445368aa9abc15fb8d6df732 Mon Sep 17 00:00:00 2001 From: Darthpred Date: Mon, 9 Mar 2015 05:21:44 +0400 Subject: [PATCH] For some asshole reason that was using x2 materials cost --- ElvUI_SLE/modules/garrison.lua | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/ElvUI_SLE/modules/garrison.lua b/ElvUI_SLE/modules/garrison.lua index e0c57a6..aebba06 100644 --- a/ElvUI_SLE/modules/garrison.lua +++ b/ElvUI_SLE/modules/garrison.lua @@ -12,24 +12,28 @@ local buildID = { } function G:SHIPMENT_CRAFTER_INFO(event, success, _, maxShipments, plotID) - if not GarrisonCapacitiveDisplayFrame then return end + if not GarrisonCapacitiveDisplayFrame then return end --Just in case local n = GarrisonCapacitiveDisplayFrame.available or 0 - - local enabled = GarrisonCapacitiveDisplayFrame.StartWorkOrderButton:IsEnabled() - - if not E.db.sle.garrison.autoOrder then return end - if not enabled then return end + if G.clicked or n == 0 or not E.db.sle.garrison.autoOrder then return end + G.clicked = true local ID = C_Garrison.GetOwnedBuildingInfo(plotID) local nope = buildID[ID] if nope then if E.db.sle.garrison['auto'..nope] then - C_Garrison.RequestShipmentCreation(n) + GarrisonCapacitiveDisplayFrame.CreateAllWorkOrdersButton:Click() end else - C_Garrison.RequestShipmentCreation(n) + GarrisonCapacitiveDisplayFrame.CreateAllWorkOrdersButton:Click() end end +function G:SHIPMENT_CRAFTER_CLOSED() + G.clicked = false +end + function G:Initialize() + G.clicked = false + self:RegisterEvent("SHIPMENT_CRAFTER_INFO"); + self:RegisterEvent("SHIPMENT_CRAFTER_CLOSED"); end \ No newline at end of file -- 1.7.9.5