ID:148050
 
/.......i'm konphuzified
*I can get the icons to work great but i cant unselect them after i have clicked them once, they are staying in their highlighted icon_states..... :(
heres the coding(cpy and pste for ease of revising)
thank you!
*/

var
active
obj
var
regicon
highlighticon
hovericon
obj
buttons
icon = 'Buttons.dmi'

attack
icon_state = "attack"
highlighticon = "attack highlight"
hovericon = "attack hover"
regicon = "attack"
guard
icon_state = "guard"
highlighticon = "guard highlight"
hovericon = "guard hover"
regicon = "guard"
range
icon_state = "range"
highlighticon = "range highlight"
hovericon = "range hover"
regicon = "range"
magic
icon_state = "magic"
highlighticon = "magic highlight"
hovericon = "magic hover"
regicon = "magic"
flee
icon_state = "flee"
highlighticon = "flee highlight"
hovericon = "flee hover"
regicon = "flee"

MouseEntered()
if(active == src)
icon_state = highlighticon
else
icon_state = hovericon
MouseExited()
if(active == src)
icon_state = highlighticon
else
icon_state = regicon
MouseDown()
if(active == src)
icon_state = regicon
active = null
if(active == null)
icon_state = highlighticon
active = src