Was adding 2 lines in report icon tooltip
ggargani [10-06-16 - 20:27]
Was adding 2 lines in report icon tooltip
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