You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
696 B
29 lines
696 B
|
3 years ago
|
local _, addon = ...
|
||
|
|
|
||
|
|
local OnEnterDelay = CreateFrame("Frame");
|
||
|
|
|
||
|
|
addon.TalentTreeOnEnterDelay = OnEnterDelay;
|
||
|
|
|
||
|
|
|
||
|
|
OnEnterDelay.onUpdate = function(self, elapsed)
|
||
|
|
self.t = self.t + elapsed;
|
||
|
|
if self.t > 0.1 then
|
||
|
|
self:SetScript("OnUpdate", nil);
|
||
|
|
self.t = 0;
|
||
|
|
if self.button and self.button.OnEnterCallback then
|
||
|
|
self.button:OnEnterCallback();
|
||
|
|
end
|
||
|
|
self.button = nil;
|
||
|
|
end
|
||
|
|
end
|
||
|
|
|
||
|
|
function OnEnterDelay:WatchButton(button)
|
||
|
|
self.button = button;
|
||
|
|
self.t = 0;
|
||
|
|
self:SetScript("OnUpdate", self.onUpdate);
|
||
|
|
end
|
||
|
|
|
||
|
|
function OnEnterDelay:ClearButton()
|
||
|
|
self.button = nil;
|
||
|
|
self:SetScript("OnUpdate", nil);
|
||
|
|
end
|