View Single Post
06-09-05, 07:50 AM   #6
Beladona
A Molten Giant
 
Beladona's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2005
Posts: 539
You need to do the following:

Setup your slider to change the savedVariable, and then call your textureUpdate function. You already have that so you are almost there...

Setup your textureUpdate function to check for the existence of the variable it needs. if the variable isn't there, then it needs to be created, which I assume you have elsewhere in your script, so we don't need to go over that. Once it has the varaible it needs, then change the texture. You have that, although the syntax is badly written, so you may want to fix that. I can assist if you need.

The final thing that needs to be done, which is your primary problem, is that you need to add a script section to your DiivSkins_Hbar1 frame. You see, the slider will NOT do anything until it gets shown. That means the config options have to be opened EVERY session in order for your texture to get updated. So you need to add the texture update to something that will be on screen every session. Since the frame mentioned above is the one with the texture you plan to change, it should have the update script in its OnEvent section. Do it like this:

<OnLoad>this:RegisterEvent("VARIABLES_LOADED");</OnLoad>
<OnEvent>if (event == "VARIABLES_LOADED") then TextureUpdateFunction(); end</OnEvent>

Basically that means that whenever someone loads the game, and after the varaibles get loaded, the texture update function will get run, which checks to see what they have set for that variable (if at all, else it creates a default value) and then udpates the texture accordingly.

Hopefully this gets you where you are trying to go. As always, let me know if you need any assistance. Especially with that texture Update function, as it looks like you didn't format the if, else, and elseif's correctly...

Last edited by Beladona : 06-09-05 at 08:01 AM.
  Reply With Quote