From e6fa0ea54f917bad47434eed2d482c43d97a9efc Mon Sep 17 00:00:00 2001 From: Alar of Runetotem Date: Sun, 28 Jul 2019 18:47:04 +0200 Subject: [PATCH] Minimap icon button enhancement now is only in broker --- GarrisonCommander-Broker/ldb.lua | 15 +++++++++------ GarrisonCommander.lua | 28 ---------------------------- 2 files changed, 9 insertions(+), 34 deletions(-) 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)) -- 1.7.9.5