Quantcast
WoWInterface - View Single Post - Error on Move Frame Addon
View Single Post
01-28-20, 11:39 PM   #1
BloodDragon
A Deviate Faerie Dragon
AddOn Author - Click to view addons
Join Date: Mar 2017
Posts: 19
Question Error on Move Frame Addon

Hey,
I want to make an addon to move different frames.
So far, it works quite well.
But with the frame AzeriteEssenceUI I always get the following error:

Code:
1x MoveAround\AzeriteEssenceUI.lua:3: attempt to index local 'MAEU' (a nil value)
[string "@MoveAround\AzeriteEssenceUI.lua"]:3: in main chunk

Locals:
MAEU = nil
(*temporary) = <function> defined @MoveAround\AzeriteEssenceUI.lua:3
(*temporary) = nil
(*temporary) = nil
(*temporary) = nil
(*temporary) = nil
(*temporary) = nil
(*temporary) = nil
(*temporary) = "attempt to index local 'MAEU' (a nil value)"
That is the lua file:
Lua Code:
  1. --AzeriteEssenceUI
  2. local MAEU = AzeriteEssenceUI
  3. MAEU.ClearAllPoints = function() end
  4. MAEU:SetPoint("TOPRIGHT", MinimapCluster, "BOTTOM", 45, -5)
  5. MAEU.SetPoint = function() end
  6. MAEU:SetMovable(true)
  7. MAEU:SetUserPlaced(true)
  8. MAEU:SetClampedToScreen(true)
  9.  
  10. local MoveAzeriteEssenceUI = CreateFrame("Frame", nil, MAEU)  
  11. MoveAzeriteEssenceUI:SetHeight(15)
  12. MoveAzeriteEssenceUI:ClearAllPoints()
  13. MoveAzeriteEssenceUI:SetPoint("TOPLEFT", MAEU)
  14. MoveAzeriteEssenceUI:SetPoint("TOPRIGHT", MAEU)
  15. MoveAzeriteEssenceUI:EnableMouse(true)
  16. MoveAzeriteEssenceUI:SetHitRectInsets(-5, -5, -5, -5)
  17. MoveAzeriteEssenceUI:RegisterForDrag("LeftButton")
  18. MoveAzeriteEssenceUI:SetScript("OnDragStart", function(self, button)
  19.     if button=="LeftButton" and IsModifiedClick()then
  20.         MAEU:StartMoving()
  21.     end
  22. end)
  23. MoveAzeriteEssenceUI:SetScript("OnDragStop", function(self, button)
  24.     MAEU:StopMovingOrSizing()
  25. end)
  26. --AzeriteEssenceUI

Can you tell me where the mistake is?
With the frames: ObjectiveTrackerFrame, VehicleSeatIndicator, SpellBookFrame it works without problems.
  Reply With Quote