Quantcast

Minimap icon button enhancement now is only in broker

Alar of Runetotem [07-28-19 - 16:47]
Minimap icon button enhancement now is only in broker
Filename
GarrisonCommander-Broker/ldb.lua
GarrisonCommander.lua
diff --git a/GarrisonCommander-Broker/ldb.lua b/GarrisonCommander-Broker/ldb.lua
index 54d639f..7319a34 100644
--- a/GarrisonCommander-Broker/ldb.lua
+++ b/GarrisonCommander-Broker/ldb.lua
@@ -381,24 +381,27 @@ function addon:OnInitialized()
 	self:ScheduleTimer("DelayedInit",1)
 	-- Avoid double adding
 	if not IsAddOnLoaded("GarrisonCommander") then
-    self:SecureHookScript(GarrisonLandingPageMinimapButton,"OnEnter",function(this)
+     self:SecureHookScript(GarrisonLandingPageMinimapButton,"OnEnter",function(this)
         if this.description==MINIMAP_ORDER_HALL_LANDING_PAGE_TOOLTIP or
            this.description == GARRISON_TYPE_8_0_LANDING_PAGE_TOOLTIP then
-          GameTooltip:AddLine(WARDROBE_NEXT_VISUAL_KEY .. " " .. MINIMAP_GARRISON_LANDING_PAGE_TOOLTIP)
-          GameTooltip:AddLine(SHIFT_KEY_TEXT .." ".. WARDROBE_NEXT_VISUAL_KEY .. " " .. MINIMAP_ORDER_HALL_LANDING_PAGE_TOOLTIP)
+          GameTooltip:AddLine(CTRL_KEY_TEXT .. " " .. MINIMAP_GARRISON_LANDING_PAGE_TOOLTIP)
+          GameTooltip:AddLine(SHIFT_KEY_TEXT  .. " " .. MINIMAP_ORDER_HALL_LANDING_PAGE_TOOLTIP)
         end
         GameTooltip:Show()
     end
     )
-    GarrisonLandingPageMinimapButton:RegisterForClicks("LEFTBUTTONUP","RIGHTBUTTONUP")
+    --GarrisonLandingPageMinimapButton:RegisterForClicks("LEFTBUTTONUP","RIGHTBUTTONUP")
     self:SecureHookScript(GarrisonLandingPageMinimapButton,"OnClick",
       function (this,button)
+     --@debug@
+     self:Print("minimap click")
+     --@end-debug@
          local shown=GarrisonLandingPage:IsShown()
          local actual=GarrisonLandingPage.garrTypeID
          local requested=C_Garrison.GetLandingPageGarrisonType()
-         if button=="RightButton" and IsShiftKeyDown() then
+         if IsShiftKeyDown() then
             requested=LE_GARRISON_TYPE_7_0
-         elseif button=="RightButton" then
+         elseif IsControlKeyDown() then
             requested=LE_GARRISON_TYPE_6_0
          end
          if InCombatLockdown() then return end
diff --git a/GarrisonCommander.lua b/GarrisonCommander.lua
index f56d039..03e608f 100644
--- a/GarrisonCommander.lua
+++ b/GarrisonCommander.lua
@@ -461,34 +461,6 @@ function addon:OnInitialized()
 	self:AddOpenCmd("show","showdata","Prints a mission score")
 --@end-debug@
 	self:Trigger("MSORT")
-	if not IsAddOnLoaded("GarrisonCommander-Broker") then
-    self:SecureHookScript(GarrisonLandingPageMinimapButton,"OnEnter",function(this)
-        if this.description==MINIMAP_ORDER_HALL_LANDING_PAGE_TOOLTIP or
-           this.description == GARRISON_TYPE_8_0_LANDING_PAGE_TOOLTIP then
-          GameTooltip:AddLine(WARDROBE_NEXT_VISUAL_KEY .. " " .. MINIMAP_GARRISON_LANDING_PAGE_TOOLTIP)
-          GameTooltip:AddLine(SHIFT_KEY_TEXT .." ".. WARDROBE_NEXT_VISUAL_KEY .. " " .. MINIMAP_ORDER_HALL_LANDING_PAGE_TOOLTIP)
-        end
-        GameTooltip:Show()
-    end
-    )
-    GarrisonLandingPageMinimapButton:RegisterForClicks("LEFTBUTTONUP","RIGHTBUTTONUP")
-    self:SecureHookScript(GarrisonLandingPageMinimapButton,"OnClick",
-      function (this,button)
-         local shown=GarrisonLandingPage:IsShown()
-         local actual=GarrisonLandingPage.garrTypeID
-         local requested=C_Garrison.GetLandingPageGarrisonType()
-         if button=="RightButton" and IsShiftKeyDown() then
-            requested=LE_GARRISON_TYPE_7_0
-         elseif button=="RightButton" then
-            requested=LE_GARRISON_TYPE_6_0
-         end
-         if InCombatLockdown() then return end
-         if shown and actual ~= requested then
-           ShowGarrisonLandingPage(requested);
-         end
-      end
-    )
-	end
 --@debug@
 --	assert(self:GetAgeColor(1/0))
 --	assert(self:GetAgeColor(0/0))