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:
--AzeriteEssenceUI
local MAEU = AzeriteEssenceUI
MAEU.ClearAllPoints = function() end
MAEU:SetPoint("TOPRIGHT", MinimapCluster, "BOTTOM", 45, -5)
MAEU.SetPoint = function() end
MAEU:SetMovable(true)
MAEU:SetUserPlaced(true)
MAEU:SetClampedToScreen(true)
local MoveAzeriteEssenceUI = CreateFrame("Frame", nil, MAEU)
MoveAzeriteEssenceUI:SetHeight(15)
MoveAzeriteEssenceUI:ClearAllPoints()
MoveAzeriteEssenceUI:SetPoint("TOPLEFT", MAEU)
MoveAzeriteEssenceUI:SetPoint("TOPRIGHT", MAEU)
MoveAzeriteEssenceUI:EnableMouse(true)
MoveAzeriteEssenceUI:SetHitRectInsets(-5, -5, -5, -5)
MoveAzeriteEssenceUI:RegisterForDrag("LeftButton")
MoveAzeriteEssenceUI:SetScript("OnDragStart", function(self, button)
if button=="LeftButton" and IsModifiedClick()then
MAEU:StartMoving()
end
end)
MoveAzeriteEssenceUI:SetScript("OnDragStop", function(self, button)
MAEU:StopMovingOrSizing()
end)
--AzeriteEssenceUI
Can you tell me where the mistake is?
With the frames: ObjectiveTrackerFrame, VehicleSeatIndicator, SpellBookFrame it works without problems.