Hey, folks. I have this following macro that I click when I log in to the game to relocate my frame/target frame to specific places so that it’s uniform across all characters.
It slightly annoys me that I have to click this thing manually, so I wanted to move this to a tiny addon instead, but I can’t get it to work.
This is the macro I’m using, per some documentation that I found:
/run PlayerFrame:ClearAllPoints()PlayerFrame:SetPoint("RIGHT",UIParent,"CENTER",-375,300)PlayerFrame.SetPoint=function()end
/run TargetFrame:ClearAllPoints()TargetFrame:SetPoint("RIGHT",UIParent,"CENTER",-150,300)TargetFrame.SetPoint=function()end
The last attempt I made at converting this into an addon is as follows:
local function MFPosition(self, event)
PlayerFrame.ClearAllPoints()
PlayerFrame.SetPoint("RIGHT", UIParent, "CENTER", -375, 300)
PlayerFrame.SetUserPlaced(true);
TargetFrame.ClearAllPoints()
TargetFrame.SetPoint("RIGHT", UIParent, "CENTER", -150, 300)
TargetFrame.SetUserPlaced(true);
end
local events = CreateFrame('Frame');
events:RegisterEvent('PLAYER_LOGIN');
event:SetScript('OnEvent', MFPosition)
Not sure what I’m doing wrong, though I have found that the API really isn’t documented very well at all, and what docs DO exist are community-made and scattered all over the place.
Can anyone help me out? I’d really appreciate it.