Quantcast

TitanUtils : Do not allow the tooltip to show if right click menu is shown

urnati [12-30-18 - 15:39]
TitanUtils : Do not allow the tooltip to show if right click menu is shown
Filename
Titan/TitanUtils.lua
diff --git a/Titan/TitanUtils.lua b/Titan/TitanUtils.lua
index 0728e97..3a96dc5 100644
--- a/Titan/TitanUtils.lua
+++ b/Titan/TitanUtils.lua
@@ -16,6 +16,8 @@ local _G = getfenv(0);
 local L = LibStub("AceLocale-3.0"):GetLocale(TITAN_ID, true)
 local media = LibStub("LibSharedMedia-3.0")

+-- The LibUIDropDownMenu lib is used over the Blizzard frame
+local drop_down_1 = "L_DropDownList1"
 --
 -- The routines labeled API are useable by addon developers
 --
@@ -1459,8 +1461,8 @@ VAR:  None
 OUT:  None
 --]]
 function TitanUtils_CloseRightClickMenu()
-	if (DropDownList1:IsVisible()) then
-		DropDownList1:Hide();
+	if (_G["DropDownList1"]:IsVisible()) then
+		_G["DropDownList1"]:Hide();
 	end
 end

@@ -1476,7 +1478,7 @@ OUT:
 --]]
 local function TitanRightClick_UIScale()
 	-- take UI Scale into consideration
-	local listFrame = _G["DropDownList1"];
+	local listFrame = _G[drop_down_1];
 	local listframeScale = listFrame:GetScale();

 	local uiScale;
@@ -1666,7 +1668,7 @@ OUT:
 - true (IsVisible) or false
 --]]
 function TitanPanelRightClickMenu_IsVisible()
-	return _G["DropDownList1"]:IsVisible();
+	return _G[drop_down_1]:IsVisible();
 end

 --[[ Titan
@@ -1676,8 +1678,8 @@ VAR:  None
 OUT:  None
 --]]
 function TitanPanelRightClickMenu_Close()
-	if _G["DropDownList1"]:IsVisible() then
-		_G["DropDownList1"]:Hide()
+	if _G[drop_down_1]:IsVisible() then
+		_G[drop_down_1]:Hide()
 	end
 end