View Single Post
08-26-08, 12:23 PM   #5
BDelacroix
An Aku'mai Servant
AddOn Author - Click to view addons
Join Date: Jan 2006
Posts: 33
Ok, Its a new day....

Since I couldn't get the spells to actually work on states, I went with a different approach. I also needed to change the icon depending on state and I couldn't find a way to do that in combat.

I went with a different approach using "hidestate"/"showstate".

In this scheme I create up to 5 buttons and put them all in the same space. All but one is hidden per state.

That works. Except then I found out that whenever I click the button it changes the state automatically to the next one in line. I'd rather that didn't happen except by some other method. For testing that is clicking in the bordering frame.

Now, I can make the state change up and down. I do the math myself and all. I have stopped the secureheader from moving the state on the button with every click with:

SetAttribute("newstate","1-5:=")

I read that notation somewhere, it works.

I change the state programatically with SetAttribute("state",x)

that changes the state BUT introduces a new problem I've not been able to work around. It doesn't seem to actually update all the buttons.

In my research I tried ActionButton_Update(). This is no good because my button isn't actually an action bar button. It therefore bashes out when trying to use a function ActionGetTexture(action) internally.

Again, I don't want to make it an action button as that defeats the purpose of what I'm doing with this.

I seem to be so close with this. In fact, if I can find a way to update the secureheader and its children I'd be good to go.

Now I am torturing myself looking through the securexxxxtemplate.lua codes to see how those are updated.
  Reply With Quote