From 24a9da55a223987f27d45a94e5fc767de33399a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robin=20H=C3=BCskes?= Date: Tue, 25 Oct 2022 16:12:21 +0200 Subject: [PATCH] Fix OnClick for Dragonflight --- broker.lua | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/broker.lua b/broker.lua index 5905940..c5b3340 100755 --- a/broker.lua +++ b/broker.lua @@ -8,13 +8,23 @@ local folder = addonName ~= childName and format("Interface\\AddOns\\%s\\%s", a local function OnClick(self, button) if(button == 'RightButton') then if(IsShiftKeyDown()) then - zzCoords_MinimapToggle() +-- zzCoords_MinimapToggle() else - if(InterfaceOptionsFrame:IsVisible() and not InCombatLockdown()) then - InterfaceOptionsFrame:Hide() - else - InterfaceOptionsFrame_OpenToCategory(childName) - InterfaceOptionsFrame_OpenToCategory(childName) -- Twice because of a bug in InterfaceOptionsFrame_OpenToCategory + if(not InCombatLockdown()) then + if(SettingsPanel) then + if(SettingsPanel:IsVisible()) then + SettingsPanel:Hide() + else + Settings.OpenToCategory(childName) + end + elseif(InterfaceOptionsFrame) then + if(InterfaceOptionsFrame:IsVisible()) then + InterfaceOptionsFrame:Hide() + else + InterfaceOptionsFrame_OpenToCategory(childName) + InterfaceOptionsFrame_OpenToCategory(childName) -- Twice because of a bug in InterfaceOptionsFrame_OpenToCategory + end + end end end elseif(button == "LeftButton") then @@ -40,8 +50,8 @@ local function OnTooltipShow(tip) tip:AddLine(format("%s: %s",childName, child['playerCoords'])) tip:AddLine(L['HINT']) tip:AddLine(L['HINT2']) - tip:AddLine(L['HINT3']) - tip:AddLine(L['HINT4']) +-- tip:AddLine(L['HINT3']) +-- tip:AddLine(L['HINT4']) end child['ldb'] = { -- https://github.com/tekkub/libdatabroker-1-1/wiki/Data-Specifications ['type'] = 'data source', -- required: 'data source' or 'launcher'