View Single Post
02-19-24, 10:40 PM   #2
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,894
Blizz. will save the frame but if the user removes the addon for any reason, it will reset to the default location if they decide to install the addon again.
Lua Code:
  1. btn:SetPoint("CENTER")
  2. btn:SetSize(100, 40)
  3. btn:SetText("Click me")
  4. btn:SetScript("OnClick", function(self, button, ...)
  5. btn:SetMovable(true)
  6. btn:RegisterForDrag('LeftButton')
  7. btn:SetUserPlaced(true) -- Only works if the frame is created before the PLAYER_LOGIN event
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.
  Reply With Quote