git
/
wowui.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
c23b2d1 - Move some standard blizzard frames
[wowui.git]
/
OmaAB
/
ActionBars.lua
diff --git
a/OmaAB/ActionBars.lua
b/OmaAB/ActionBars.lua
index
729ac4f
..
610dcf3
100644
(file)
--- a/
OmaAB/ActionBars.lua
+++ b/
OmaAB/ActionBars.lua
@@
-16,7
+16,8
@@
local CreateFrame = CreateFrame;
local RegisterStateDriver = RegisterStateDriver;
local CooldownFrame_Set, CooldownFrame_Clear = CooldownFrame_Set, CooldownFrame_Clear;
local CTimerAfter = C_Timer.After;
local RegisterStateDriver = RegisterStateDriver;
local CooldownFrame_Set, CooldownFrame_Clear = CooldownFrame_Set, CooldownFrame_Clear;
local CTimerAfter = C_Timer.After;
-local GameTooltip = nil;
+local GameTooltip = GameTooltip;
+local GameTooltip_SetDefaultAnchor = GameTooltip_SetDefaultAnchor;
local COOLDOWN_TYPE_LOSS_OF_CONTROL = COOLDOWN_TYPE_LOSS_OF_CONTROL;
local COOLDOWN_TYPE_NORMAL = COOLDOWN_TYPE_NORMAL;
local CDTexture = "Interface\\Cooldown\\edge";
local COOLDOWN_TYPE_LOSS_OF_CONTROL = COOLDOWN_TYPE_LOSS_OF_CONTROL;
local COOLDOWN_TYPE_NORMAL = COOLDOWN_TYPE_NORMAL;
local CDTexture = "Interface\\Cooldown\\edge";
@@
-130,6
+131,15
@@
local ActionBars = CreateFrame("Frame", "OmaActionBars", UIParent);
local inheritedFrames =
"SecureActionButtonTemplate,SecureHandlerDragTemplate,SecureHandlerStateTemplate";
local inheritedFrames =
"SecureActionButtonTemplate,SecureHandlerDragTemplate,SecureHandlerStateTemplate";
+local function showTooltip(secure)
+ GameTooltip_SetDefaultAnchor(GameTooltip, secure);
+ GameTooltip:SetAction(secure:GetAttribute("action"));
+end
+
+local function hideTooltip()
+ GameTooltip:Hide();
+end
+
local numChargeCDs = 0;
local function createChargeCD(parent)
numChargeCDs = numChargeCDs + 1;
local numChargeCDs = 0;
local function createChargeCD(parent)
numChargeCDs = numChargeCDs + 1;
@@
-452,6
+462,10
@@
local function createActionBar(parent, config)
end
if config.nomouse then
secure:EnableMouse(false);
end
if config.nomouse then
secure:EnableMouse(false);
+ else
+ -- only show tooltips for bars with mouse interaction
+ secure:SetScript("OnEnter", showTooltip);
+ secure:SetScript("OnLeave", hideTooltip);
end
secure:SetWidth(config.size or 32);
secure:SetHeight(config.size or 32);
end
secure:SetWidth(config.size or 32);
secure:SetHeight(config.size or 32);
@@
-643,7
+657,7
@@
local events = {
end
end,
["PLAYER_LOGIN"] = function()
end
end,
["PLAYER_LOGIN"] = function()
- GameTooltip = _G["GameTooltip"];
-- TODO use PLAYER_ENTERING_WORLD with MoveAnything
+ GameTooltip = _G["GameTooltip"];
initialize();
end,
["ADDON_LOADED"] = function(addon)
initialize();
end,
["ADDON_LOADED"] = function(addon)
@@
-670,7
+684,6
@@
events["UNIT_ENTERED_VEHICLE"] = function(unit)
if unit == "player" then events["ACTIONBAR_UPDATE_STATE"]() end
end
events["UNIT_EXITED_VEHICLE"] = events["UNIT_ENTERED_VEHICLE"];
if unit == "player" then events["ACTIONBAR_UPDATE_STATE"]() end
end
events["UNIT_EXITED_VEHICLE"] = events["UNIT_ENTERED_VEHICLE"];
--- tooltips
ActionBars:RegisterEvent("ADDON_LOADED");
ActionBars:RegisterEvent("PLAYER_LOGIN");
ActionBars:RegisterEvent("ADDON_LOADED");
ActionBars:RegisterEvent("PLAYER_LOGIN");