Quantcast WoWInterface - View Single Post - Ace3 Options: Refresh specific option after another option changes. How?
View Single Post
08-12-19, 03:38 AM   #4
Lybrial
A Black Drake
AddOn Compiler - Click to view compilations
Join Date: Jan 2010
Posts: 86
Turned out that NotifyChange will have no effect when called from within a setter since
setting a value already leads to a GUI refresh automatically. The thing is that min and max
is only initialized once at creation. Currently there is no way to add a function here. So I need
to set the min max values manually:

Lua Code:
  1. anchor = {
  2.     type = "select",
  3.     order = 1,
  4.     name = LOCALE["ANCHOR"],
  5.     desc = LOCALE["ANCHOR_MINI_MAP"],
  6.     values = CORE.Values.Anchors,
  7.     get = function()
  8.         return LybrialMiniMap.db.profile.position.anchor;
  9.     end,
  10.     set = function(_, value)
  11.         LybrialMiniMap.db.profile.position.anchor = value;
  12.         LybrialMiniMap:OnUpdatePosition();
  13.  
  14.         LybrialUI.options.args.miniMap.args.position.args.offset.args.x.min = Minimap:GetMinOffsetX(value);
  15.         LybrialUI.options.args.miniMap.args.position.args.offset.args.x.max = Minimap:GetMaxOffsetX(value);
  16.     end,
  17. },
  Reply With Quote