I have two tables: CC_Vars and CC_Defaults. Both have two tables in them: Data, and Options.
Then I have a button, that calls a function, that does this: CC_Vars.Options = CC_Defaults.Options; as well as a function that does: CC_Vars.Data = CC_Defaults.Data;
The problem is, this only works once. I've tested as much as I can think of, and no matter what I do, this only works the first time I click the button, then it won't work anymore. I've made it so the function posts a message in the chat log, so I know the function is firing.
This doesn't make any sense to me. The only thing I can think of is CC_Defaults.Options could be changing somewhere, but I've checked and checked and CC_Defaults is constant.
EDIT: I just discovered my using a /script to output the data in CC_Defaults, and it turns out it is changing. But there is nothing in my code could do that!?
EDIT2: I have a slider that changes the alpha of a frame:
Code:
<Scripts>
<OnLoad>
CC_SetupSlider(self, "Alpha", 0, 1, 0);
</OnLoad>
<OnValueChanged>
CC_Vars.Options.alpha = self:GetValue();
setAlpha(CC_Vars.Options.alpha);
</OnValueChanged>
</Scripts>
the setAlpha function isn't the problem, it doens't have the word Default in it at all.
Neither does SetupSilder.
But ingame, when I move the slider, it changes CC_Defaults.Options.alpha as well.