The hitch is that once an image is toggled hidden or not hidden, clicking another of the 12 buttons continues to toggle the same Variable aState, Hidden=1 or Hidden=0. The means even though separate images are being toggled, the same variable state persists between buttons, so if ButtonOne is Hidden then, ButtonTwo chooses to be not hidden, etc.
So I am trying to create a floating Toggle Variable that allows each button to start from a fixed state of Hidden = 0. So When Each button is clicked for the first time the image will be shown - toggled to Hidden=1 if clicked again, on and on for each of the 12 buttons.
Here is the code parts:
Code: Select all
[Variables]
ButtonOneImage=""swtor.png""
ButtonTwoImage=""skyrim.png""
aState=0
[ContainerA]
Meter=Shape
Shape=Rectangle 37,36,208,207,103
DynamicVariables=1
[ImageA]
Meter=Image
ImageName=#ImageNameA#
Container=ContainerA
AntiAlias=1
X=34
Y=34
W=213
H=211
UseExifOrientation=1
PreserveAspectRatio=1
DynamicVariables=1
Group=buttons
Hidden=#aState#
[Button1]
Meter=Image
ImageName=MyButtonFile.png
X=238
Y=144
W=36
H=35
Antialias=1
LeftMouseUpAction=[!WriteKeyValue Variables aState "(1-#aState#)"][!SetVariable "aState" "(1-#aState#)"][!SetOption ImageA Hidden "(1-#aState#)"][!UpdateMeter ImageA][!WriteKeyValue "Variables" "ImageNameA" #ButtonOneImage#][!SetOption "Variables" "ImageNameA" ""#ButtonOneImage#""][!Update]
[Button2]
Meter=Image
ImageName=MyButtonFile.png
X=219
Y=194
W=36
H=35
Antialias=1
LeftMouseUpAction=[!WriteKeyValue Variables aState "(1-#aState#)"][!SetVariable "aState" "(1-#aState#)"][!SetOption ImageA Hidden "(1-#aState#)"][!UpdateMeter ImageA][!WriteKeyValue "Variables" "ImageNameA" #ButtonTwoImage#][!SetOption "Variables" "ImageNameA" ""#ButtonTwoImage#""][!Update]
Thanks for any examples or suggestions.