View Single Post
08-13-19, 06:31 PM   #6
myrroddin
A Pyroguard Emberseer
 
myrroddin's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 1,240
The other idea is that each time the user changes the anchor, run the function that sets or gets the x and y offsets immediately after, within the options to change the anchor.

This means you will need to rewrite slightly:
Lua Code:
  1. -- this is the get for the anchor option code
  2. get = function()
  3.     local x, y = MyAddOn:GetXYOffsets()
  4.     -- or return GetXYOffsets() if the function is local to file scope
  5.     -- update your anchor
  6.     -- followed by updating your x, y offsets
  7. end
  8.  
  9. function:MyAddOn:GetXYOffsets()
  10.     return self.db.profile.x, self.db.profile.y -- or whatever your DB is actually
  11. end
You get the idea, I hope.
  Reply With Quote