It is currently April 25th, 2024, 6:00 am

Is There A Better Way Than Using !UpdateGroup In This Case?

Get help with creating, editing & fixing problems with skins
User avatar
CodeCode
Posts: 1366
Joined: September 7th, 2020, 2:24 pm
Location: QLD, Australia

Is There A Better Way Than Using !UpdateGroup In This Case?

Post by CodeCode »

Hello,
I have a click triggered meter that I am using to Toggle an Image Meter on or off.
I have tried a few ways of doing it and the best functionality causes the whole skin to blink, due to an
OnRefreshAction=[!HideMeterGroup #ToggleHide2#][!ShowMeterGroup #ToggleFreeze2#][!Update] (Yet another toggle here). The ToggleHide2 Variable and ToggleFreeze2 Variable manage a background Image to be one of 2 at any given time according to user choice.
Here is the Meter:

Code: Select all

[Lens]
Meter=Image
ImageName=#@#Lens.png 
ImageAlpha=190
X=61
Y=63
W=218
H=209
MouseScrollUpAction=[!WriteKeyValue Variables aState "((#aState#+1)%2)"][!SetVariable "aState" "((#aState#+1)%2)"][!SetOption ImageA Hidden "#aState#"][!UpdateMeter ImageA][!RefreshGroup Launcher][!Update]
MouseScrollDownAction=[!WriteKeyValue Variables aState "((#aState#=1)?1:(#aState#-1))"][!SetVariable "aState" "((#aState#=1)?1:(#aState#-1))"][!SetOption ImageA Hidden #aState#][!RefreshGroup Launcher][!Update]
The aState variable allows the end user to choose an overlay depending on what the last button clicked was.
I tried this:

Code: Select all

MouseScrollUpAction=[!ToggleMeter ImageA]!Update]
MouseScrollDownAction=[!ToggleMeter ImageA][!Update]
...but it still required a refresh to complete the desired intention of the overlay being on or off. Adding a !RefreshGroup causes the new overlay image to flash but not stay and the blinking was back in play as well so, no progress there.

Anything I am missing here or is the !RefreshGroup the only way?
Last edited by CodeCode on February 8th, 2021, 7:23 am, edited 1 time in total.
ƈǟռ'ȶ ʄɨӼ ɨȶ ɨʄ ɨȶ ǟɨռ'ȶ ɮʀօӄɛ - ʊռʟɛֆֆ ɨȶ ɨֆ ɨռ ƈօɖɛ.
User avatar
CodeCode
Posts: 1366
Joined: September 7th, 2020, 2:24 pm
Location: QLD, Australia

Re: Is There A Better Way Than Using !UpdateGroup In This Case?

Post by CodeCode »

I found a way to prevent the 'flicker', well, I reduced the 'visual anomaly' anyway.

I made all relevant image meters Hidden=1 as the default value. Now the skin flickers but not between the two image variations - which was the main concern.
Having no flicker at all would be best, but I do not think there is another way than what I am already using.

Please correct me if I am wrong.
ƈǟռ'ȶ ʄɨӼ ɨȶ ɨʄ ɨȶ ǟɨռ'ȶ ɮʀօӄɛ - ʊռʟɛֆֆ ɨȶ ɨֆ ɨռ ƈօɖɛ.