View Single Post
05/08/17, 10:51 AM   #6
Letho
AddOn Author - Click to view addons
Join Date: Apr 2016
Posts: 238
Originally Posted by Baertram View Post
Simply specifying "self" is not returning the icon.
You need to let it return the SavedVariables data where the selected icon from the iconpicker is stored.

e.g.

function AuraMastery.EditAuraIcon(value)
AuraMastery.svars.auraData[activeAura].iconPath = value
end
It was d(self) and I dont have any idea how it got there^^

Originally Posted by Baertram View Post
getFunc = function() return AuraMastery.svars.auraData[activeAura].iconPath end,
setFunc = function(value) AuraMastery.EditAuraIcon(value) end,


default = AuraMastery.svars.DEFAULTS.auraData[activeAura].iconPath
Tried it that way and it didn't work for me.

Originally Posted by Baertram View Post
The default values just need to be an array/table with all your possible saved variables as default values, which you use at the SavedVariables creation as the default values/fallback values if the real saved variables are missing (new savedvars version, new addon, settings = nil ...)
Setting the default values at lam controls will let you use the "Set back to defaults" button fo all the LAM controls e.g.

The getfunc will try to read the savedvars and if nothing is found (= nil) it will use the default value.
If the default value is the same that you use for the SavedVars creation the settings probably won't be nil, as they got copied from the defaults. So the getfunc will just automatically use the default variable which is stored in the savedvars now.
Well, that's not exactly what I needed. Here is a screenshot that makes it easier understandable:



The controls on the right side of the menu are all precreated and hidden. As soon as the user "selects" an aura from the left menu it's name is saved to the addons "global" table (AuraMastery.activeAura = auraName), the editboxes will be filled with the appropriate text values and all menu controls will be displayed. If controls are not used, they are simply anchored to an invisible pool-control - the "control structure", meaning which control to display on what position is saved into an array containing the appropriate values.

Last edited by Letho : 05/08/17 at 10:55 AM.
  Reply With Quote