It is currently April 19th, 2024, 9:16 pm

Help: Switching wallpapers with a button

Get help with creating, editing & fixing problems with skins
Mino_el_Nukenin
Posts: 231
Joined: April 24th, 2020, 7:39 pm
Location: France

Re: Help: Switching wallpapers with a button

Post by Mino_el_Nukenin »

I'm now trying to add some more to this ButtonCommand.

I want the 2 skins linked to the [!ToggleGroup] to appear after a delay.
I found how to do it with [!FadeDurationGroup] but I don't want them to fade.

I'm not sure of what bang to use.
This is what i have for now for the delay, and it's not working.

Code: Select all

...
[Variables]
@include=#@#\Config.inc
Seconds=5

[MeterButton]
Meter=Button
ButtonImage=#@#\Images\Shield Central Launcher Button\Shield Central Launcher Button Orange.png
ButtonCommand=[!ToggleGroup "Frame+Logo"][!DelayGroup "Frame+Logo" "(1000*#Seconds#)"]
Antialias=1
User avatar
balala
Rainmeter Sage
Posts: 16147
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Help: Switching wallpapers with a button

Post by balala »

Mino_el_Nukenin wrote: April 25th, 2020, 9:10 pm I'm now trying to add some more to this ButtonCommand.

I want the 2 skins linked to the [!ToggleGroup] to appear after a delay.
I found how to do it with [!FadeDurationGroup] but I don't want them to fade.

I'm not sure of what bang to use.
Not sure I entirely follow. There are two skins belonging to a group? What's the name of that group? Frame+Logo?
Now what do you mean by 2 skins linked to the [!ToggleGroup] to appear after a delay.? You wanna one of the skins to show up and the other after a delay, or want to get both skins to be shown a little bit delayed then when you clicked the button? Because both are possible, I'm just not sure what you want.
Note that the !Delay bang creates a delay between the bangs posted before it and those posted after it. This means that the bangs posted before the !Delay bang are executed, then the skin waits a number of milliseconds equal with the value used into the !Delay bang and only then the bangs existing after the !Delay bang, are executed. However take care that a !DelayGroup bang doesn't exist. The only parameter of a !Delay bang is the wait time (important: expressed in milliseconds, not in seconds).
So please come back with a few details.
Mino_el_Nukenin
Posts: 231
Joined: April 24th, 2020, 7:39 pm
Location: France

Re: Help: Switching wallpapers with a button

Post by Mino_el_Nukenin »

Yes sorry I wasn't very clear.
So, I have 2 skins, both belonging to the same

Code: Select all

Group=Frame+Logo
.
Currently, the button toggles both skins together when clicking it.

I want a delay before both skins appear after clicking the button (as if it were like a "booting of the system"). Later I'll add a image or gif during this delay to make it look even more like a real "booting".
But for now, just a delay before both skin appear.

I've just read about plugin : ActionTimer but not sure if it's the one, cause it needs an action before and after teh delay, and I don't have any action after.
User avatar
Yincognito
Rainmeter Sage
Posts: 7128
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Help: Switching wallpapers with a button

Post by Yincognito »

Mino_el_Nukenin wrote: April 25th, 2020, 9:10 pm I'm now trying to add some more to this ButtonCommand.

I want the 2 skins linked to the [!ToggleGroup] to appear after a delay.
I found how to do it with [!FadeDurationGroup] but I don't want them to fade.

I'm not sure of what bang to use.
This is what i have for now for the delay, and it's not working.

Code: Select all

...
[Variables]
@include=#@#\Config.inc
Seconds=5

[MeterButton]
Meter=Button
ButtonImage=#@#\Images\Shield Central Launcher Button\Shield Central Launcher Button Orange.png
ButtonCommand=[!ToggleGroup "Frame+Logo"][!DelayGroup "Frame+Logo" "(1000*#Seconds#)"]
Antialias=1
Mino_el_Nukenin wrote: April 25th, 2020, 9:41 pm Yes sorry I wasn't very clear.
So, I have 2 skins, both belonging to the same

Code: Select all

Group=Frame+Logo
.
Currently, the button toggles both skins together when clicking it.

I want a delay before both skins appear after clicking the button (as if it were like a "booting of the system"). Later I'll add a image or gif during this delay to make it look even more like a real "booting".
But for now, just a delay before both skin appear.

I've just read about plugin : ActionTimer but not sure if it's the one, cause it needs an action before and after teh delay, and I don't have any action after.
I believe that simply doing:

Code: Select all

...
[Variables]
@include=#@#\Config.inc
Seconds=5

[MeterButton]
Meter=Button
ButtonImage=#@#\Images\Shield Central Launcher Button\Shield Central Launcher Button Orange.png
ButtonCommand=[!Delay (1000*#Seconds#)][!ToggleGroup "Frame+Logo"]
Antialias=1
will do just fine. As pointed out by balala, there is no !DelayGroup bang, only a !Delay bang, which takes only the duration as a "parameter". So you want that bang before the group toggling (so that things will stay "idle" for the desired duration, until the group toggling is triggered), and not after it. Putting the delay after the group toggling doesn't make any sense, since the "idle duration" needs to happen before the group toggling.

P.S. If it doesn't work in this form, adding a DynamicVariables=1 line to [MeterButton] (e.g. right after the Antialias=1 line) will most likely fix the issue - although from the looks of it, it won't be needed.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
Mino_el_Nukenin
Posts: 231
Joined: April 24th, 2020, 7:39 pm
Location: France

Re: Help: Switching wallpapers with a button

Post by Mino_el_Nukenin »

Thanks for the help and explanation. I understand the way it works now.
It's working fine.
User avatar
balala
Rainmeter Sage
Posts: 16147
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Help: Switching wallpapers with a button

Post by balala »

Mino_el_Nukenin wrote: April 26th, 2020, 4:09 pm Thanks for the help and explanation. I understand the way it works now.
It's working fine.
Ok, glad if you got it working.

Just one more detail you have to take into account, related to the following:
Mino_el_Nukenin wrote: April 25th, 2020, 9:41 pm Later I'll add a image or gif during this delay to make it look even more like a real "booting".
I'm not sure it is the case, but if it is, note that although Rainmeter supports the .gif images, it doesn't support animated gifs, which means that even if the .gif image is animated, Rainmeter will show only the first frame, not-animated. Here is a description on how can you show the animation.
Mino_el_Nukenin
Posts: 231
Joined: April 24th, 2020, 7:39 pm
Location: France

Re: Help: Switching wallpapers with a button

Post by Mino_el_Nukenin »

balala wrote: April 26th, 2020, 4:17 pm I'm not sure it is the case, but if it is, note that although Rainmeter supports the .gif images, it doesn't support animated gifs, which means that even if the .gif image is animated, Rainmeter will show only the first frame, not-animated. Here is a description on how can you show the animation.
Yes, it will be an animated gif (I always though gif were only animated btw.. Just found out it's an image format first).
I found the info in the link yesterday going trough the manual, thanks anyway :thumbup:
User avatar
balala
Rainmeter Sage
Posts: 16147
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Help: Switching wallpapers with a button

Post by balala »

Mino_el_Nukenin wrote: April 26th, 2020, 6:08 pm (I always though gif were only animated btw.. Just found out it's an image format first).
Common mistake, I think.
Mino_el_Nukenin wrote: April 26th, 2020, 6:08 pm I found the info in the link yesterday going trough the manual, thanks anyway :thumbup:
Please let me know if you need help.
Mino_el_Nukenin
Posts: 231
Joined: April 24th, 2020, 7:39 pm
Location: France

Re: Help: Switching wallpapers with a button

Post by Mino_el_Nukenin »

balala wrote: April 26th, 2020, 6:23 pm Please let me know if you need help.
So I've been combining different thing to my main button, and almost everything works.

So to resume : When I turn on my PC, I have only the button and a wallpaper (Wallpaper - Lockscreen) [has to be default wallpaper of PC]
When I click on the button :
- Wallpaper switches to "Wallpaper - Inactive" Not Working (weird because I just reused the previous you helped me with)
- a delay then the group "Frame+Logo" appears Working
- another delay then group "Module" appears Working
When I click again I want both group to dissapear with no delay and wallpaper to switch back to default.

Code: Select all

[Variables]
@include=#@#\Config.inc
MyVar=1
Seconds1=3
Seconds2=2

[MeterButton]
Meter=Button
ButtonImage=#@#\Images\Shield Central Launcher Button\Shield Central Launcher Button Orange.png
LeftMouseupAction=[!SetVariable MyVar "(0-#MyVar#)"][!UpdateMeasure "MeasureMyVar"][!UpdateMeter "#CURRENTSECTION#"][!Delay (1000*#Seconds1#)][!ToggleGroup "Frame+Logo"][!Delay (1000*#Seconds2#)][!ToggleGroup "Module"]
Antialias=1

[MeasureMyVar]
Measure=Calc
Formula=#MyVar#
IfCondition=(#CURRENTSECTION#=1)
IfTrueAction=[!SetWallpaper "#@#\Wallpapers\Wallpaper - inactive.png" Fill]
IfFalseAction=[!SetWallpaper "#@#\Wallpapers\Wallpaper - Lockscreen.png" Fill]
DynamicVariables=1
User avatar
balala
Rainmeter Sage
Posts: 16147
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Help: Switching wallpapers with a button

Post by balala »

Mino_el_Nukenin wrote: April 26th, 2020, 8:41 pm So I've been combining different thing to my main button, and almost everything works.

So to resume : When I turn on my PC, I have only the button and a wallpaper (Wallpaper - Lockscreen) [has to be default wallpaper of PC]
When I click on the button :
- Wallpaper switches to "Wallpaper - Inactive" Not Working (weird because I just reused the previous you helped me with)
- a delay then the group "Frame+Logo" appears Working
- another delay then group "Module" appears Working
When I click again I want both group to dissapear with no delay and wallpaper to switch back to default.
When you click the meter, the value of the variable changes, but the meter doesn't see it, so it doesn't set the new value which should be on click, so accordingly the [MeasureMyVar] measure doesn1t change the wallpaper. The toggling operation doesn't use the MyVar variable, so those bangs are working.
The solution is pretty simple: add a DynamicVariables=1 option to the [MeterButton] meter.