Quantcast
WoWInterface - View Single Post - Error on Move Frame Addon
View Single Post
01-30-20, 11:26 AM   #16
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,230
Something like:

Lua Code:
  1. local EventFrame = CreateFrame("Frame", "BloodDragonAzMover", UIParent)
  2. EventFrame:Hide()
  3. EventFrame:SetSize(50, 15)
  4. EventFrame:SetFrameStrata("HIGH")
  5. EventFrame:SetPoint("TOPLEFT", 20, -100)
  6. EventFrame:SetMovable(true)
  7. EventFrame:SetClampedToScreen(true)
  8. EventFrame:EnableMouse(true)
  9. EventFrame:SetHitRectInsets(-5, -5, -5, -5)
  10. EventFrame:RegisterForDrag("LeftButton")
  11. EventFrame:SetUserPlaced(true)
  12. EventFrame:SetScript("OnDragStart", function(self, button)
  13.     if button=="LeftButton" and IsModifiedClick()then
  14.         self:StartMoving()
  15.     end
  16. end)
  17. EventFrame:SetScript("OnDragStop", function(self, button)
  18.     self:StopMovingOrSizing()
  19. end)
  20. EventFrame:SetScript('OnEvent', function(self, event, name)
  21.     if name == 'Blizzard_AzeriteEssenceUI' then
  22.         self:UnregisterAllEvents()
  23.         local MAEU = AzeriteEssenceUI
  24.         self:SetParent(MAEU)
  25.         self:SetSize(MAEU:GetWidth()-50, 15) -- -50 to not block the close button
  26.         MAEU:ClearAllPoints()
  27.         MAEU:SetPoint("TOP", self)
  28.         MAEU.ClearAllPoints = function() end
  29.         MAEU.SetPoint = function() end
  30.         self:Show()
  31.     end
  32. end)
  33. EventFrame:RegisterEvent('ADDON_LOADED')
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.

Last edited by Fizzlemizz : 01-30-20 at 11:37 AM.
  Reply With Quote