From 5fcf68d902cc8c994283878f71a1ce22523cec04 Mon Sep 17 00:00:00 2001 From: ggargani Date: Thu, 6 Oct 2016 22:27:49 +0200 Subject: [PATCH] Was adding 2 lines in report icon tooltip --- GarrisonCommander-Broker/ldb.lua | 41 ++++++++++++++++++++------------------ GarrisonCommander.lua | 1 - Init.lua | 3 --- OrderHall.lua | 21 ------------------- 4 files changed, 22 insertions(+), 44 deletions(-) diff --git a/GarrisonCommander-Broker/ldb.lua b/GarrisonCommander-Broker/ldb.lua index ffe5d78..ab87bda 100644 --- a/GarrisonCommander-Broker/ldb.lua +++ b/GarrisonCommander-Broker/ldb.lua @@ -377,27 +377,30 @@ function addon:OnInitialized() self:AddSlider("FREQUENCY",5,1,60,L["Update frequency"]) frequency=self:GetNumber("FREQUENCY",5) self:ScheduleTimer("DelayedInit",1) - GarrisonLandingPageMinimapButton:HookScript("OnEnter",function(this) - if this.description==MINIMAP_ORDER_HALL_LANDING_PAGE_TOOLTIP then - GameTooltip:AddLine(WARDROBE_NEXT_VISUAL_KEY .. " " .. MINIMAP_GARRISON_LANDING_PAGE_TOOLTIP) - end - GameTooltip:Show() - end - ) - GarrisonLandingPageMinimapButton:RegisterForClicks("LEFTBUTTONUP","RIGHTBUTTONUP") - GarrisonLandingPageMinimapButton:SetScript("OnClick", - function (this,button) - if (GarrisonLandingPage and GarrisonLandingPage:IsShown()) then - HideUIPanel(GarrisonLandingPage); - else - if button=="RightButton" then - ShowGarrisonLandingPage(2) - else - ShowGarrisonLandingPage(C_Garrison.GetLandingPageGarrisonType()); - end + -- Avoid double adding + if not IsAddOnLoaded("GarrisonCommander") then + GarrisonLandingPageMinimapButton:HookScript("OnEnter",function(this) + if this.description==MINIMAP_ORDER_HALL_LANDING_PAGE_TOOLTIP then + GameTooltip:AddLine(WARDROBE_NEXT_VISUAL_KEY .. " " .. MINIMAP_GARRISON_LANDING_PAGE_TOOLTIP) end + GameTooltip:Show() end - ) + ) + GarrisonLandingPageMinimapButton:RegisterForClicks("LEFTBUTTONUP","RIGHTBUTTONUP") + GarrisonLandingPageMinimapButton:SetScript("OnClick", + function (this,button) + if (GarrisonLandingPage and GarrisonLandingPage:IsShown()) then + HideUIPanel(GarrisonLandingPage); + else + if button=="RightButton" then + ShowGarrisonLandingPage(2) + else + ShowGarrisonLandingPage(C_Garrison.GetLandingPageGarrisonType()); + end + end + end + ) + end end function addon:ApplyFREQUENCY(value) frequency=value diff --git a/GarrisonCommander.lua b/GarrisonCommander.lua index d4419fa..c204072 100644 --- a/GarrisonCommander.lua +++ b/GarrisonCommander.lua @@ -503,7 +503,6 @@ function addon:OnInitialized() self:AddOpenCmd("show","showdata","Prints a mission score") --@end-debug@ self:Trigger("MSORT") - LoadAddOn("GarrisonCommander-Broker") if (not IsAddOnLoaded("GarrisonCommander-Broker")) then GarrisonLandingPageMinimapButton:HookScript("OnEnter",function(this) if this.description==MINIMAP_ORDER_HALL_LANDING_PAGE_TOOLTIP then diff --git a/Init.lua b/Init.lua index 9632f75..fda14c5 100644 --- a/Init.lua +++ b/Init.lua @@ -430,9 +430,6 @@ function ns.Configure() setfenv(2, ENV) end function addon:EventADDON_LOADED(event,AddOn) ---@debug@ - print(event,AddOn) ---@end-debug@ if AddOn~="Blizzard_OrderHallUI" then return end self:UnregisterEvent("ADDON_LOADED") ns.GHF=_G.OrderHallMissionFrame diff --git a/OrderHall.lua b/OrderHall.lua index e7d6fd2..dd8045e 100644 --- a/OrderHall.lua +++ b/OrderHall.lua @@ -26,27 +26,6 @@ local GHF local GHFMissions function module:OnInitialize(...) if not ns.GHF then return end -- Waiting to be late initialized by init routine - GarrisonLandingPageMinimapButton:HookScript("OnEnter",function(this) - if this.description==MINIMAP_ORDER_HALL_LANDING_PAGE_TOOLTIP then - GameTooltip:AddLine(WARDROBE_NEXT_VISUAL_KEY .. " " .. MINIMAP_GARRISON_LANDING_PAGE_TOOLTIP) - end - GameTooltip:Show() - end - ) - GarrisonLandingPageMinimapButton:RegisterForClicks("LEFTBUTTONUP","RIGHTBUTTONUP") - GarrisonLandingPageMinimapButton:SetScript("OnClick", - function (this,button) - if (GarrisonLandingPage and GarrisonLandingPage:IsShown()) then - HideUIPanel(GarrisonLandingPage); - else - if button=="RightButton" then - ShowGarrisonLandingPage(2) - else - ShowGarrisonLandingPage(C_Garrison.GetLandingPageGarrisonType()); - end - end - end - ) GHF=ns.GHF GHFMissions=ns.GHFMissions --GARRISON_SHIPYARD_NPC_OPEN -- 1.7.9.5