Skip to content

Commit

Permalink
- the move handle button should fall in the same strata as the quest…
Browse files Browse the repository at this point in the history
… tracker now

 - the button is properly marked as UIParent child, so it will hide on AFK screens, such as the ELVUI afk screen
  • Loading branch information
Numynum committed May 8, 2021
1 parent ced015d commit 1a42abb
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions BlizzMovePlugin_QuestTracker.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,37 +5,39 @@ local ObjectiveTrackerFrame = _G.ObjectiveTrackerFrame;
local BlizzMoveAPI = _G.BlizzMoveAPI;
local print = _G.print;
local IsAddOnLoaded = _G.IsAddOnLoaded;
local UIParent = _G.UIParent;

local name = ...;
local name = ... or 'BlizzMovePlugin_QuestTracker';

_G.BlizzMovePlugin_QuestTracker = {};
local plugin = _G.BlizzMovePlugin_QuestTracker;
local Plugin = _G.BlizzMovePlugin_QuestTracker;

local frame = CreateFrame('Frame');
frame:HookScript('OnEvent', function(_, _, addonName) plugin:ADDON_LOADED(addonName); end);
frame:HookScript('OnEvent', function(_, _, addonName) Plugin:ADDON_LOADED(addonName); end);
frame:RegisterEvent('ADDON_LOADED');

plugin.frameTable = {
Plugin.frameTable = {
[name] = {
["ObjectiveTrackerFrame"] = {
MinVersion = 20000,
MinVersion = 30000, -- added when?
IgnoreMouse = true,
SubFrames = {
['BlizzMovePlugin_QuestTracker.MoveHandleFrame'] = {
MinVersion = 20000,
MinVersion = 30000, -- added when?
},
},
},
},
};

function plugin:CreateMoveHandleAtPoint(parentFrame, anchorPoint, relativePoint, offX, offY)
function Plugin:CreateMoveHandleAtPoint(parentFrame, anchorPoint, relativePoint, offX, offY)
if (not parentFrame) then return nil; end

local handleFrame = CreateFrame('Frame');
local handleFrame = CreateFrame('Frame', nil, UIParent);
handleFrame:SetPoint(anchorPoint, parentFrame, relativePoint, offX, offY);
handleFrame:SetHeight(16);
handleFrame:SetWidth(16);
handleFrame:SetFrameStrata(parentFrame:GetFrameStrata());

handleFrame.texture = handleFrame:CreateTexture();
handleFrame.texture:SetTexture('Interface/Buttons/UI-Panel-BiggerButton-Up');
Expand All @@ -45,7 +47,7 @@ function plugin:CreateMoveHandleAtPoint(parentFrame, anchorPoint, relativePoint,
return handleFrame;
end

function plugin:ADDON_LOADED(addonName)
function Plugin:ADDON_LOADED(addonName)
if (addonName == 'BlizzMove' or (addonName == name and IsAddOnLoaded('BlizzMove'))) then
if (not BlizzMoveAPI or not BlizzMoveAPI.RegisterAddOnFrames) then
print(name .. ' - Incompatible BlizzMove version is installed, please update BlizzMove!');
Expand Down

0 comments on commit 1a42abb

Please sign in to comment.