Thread Tools Display Modes
10-31-22, 07:28 AM   #1
KingJulien
A Kobold Labourer
 
KingJulien's Avatar
Join Date: Oct 2022
Posts: 1
Trying to make my first addon to move stuff around, PetFrame resetting on reload

Like many people, with the new DF UI overhaul I was excited to try the game without ElvUI but was disappointed you couldn't move some elements. Motivated by that I searched for a solution and came across the following code for moving the pet frame:

Code:
PetFrame:SetMovable(true);    
PetFrame:EnableMouse(true);    
PetFrame:RegisterForDrag("LeftButton");    
PetFrame:SetScript("OnDragStart", function(self) self:StartMoving() end);      
PetFrame:SetScript("OnDragStop", function(self) self:StopMovingOrSizing() end);
Using a similar code I was able to make a very simple addon to move some other stuff around (XP bar, LFG eye and mini menu/bags bar) and mostly they stay I where I leave them, even after logging out, but the pet frame resets to its position under the player frame every reload. How do I make the pet frame stay as well?

I was also wondering how to make them moveable only in edit mode and/or save their positions in a edit mode layout. Ideally I'd like to incorporate these assets into edit mode.

I can code a little (C++ and python) but I'm not terribly familiar with lua. Don't be afraid to get a little technical if you need to, I'm always eager to learn new stuff!

Any help is appreciated!
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » Trying to make my first addon to move stuff around, PetFrame resetting on reload


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off