It is currently May 17th, 2024, 2:05 am

Changing between layouts

Get help with creating, editing & fixing problems with skins
User avatar
Krainz
Posts: 186
Joined: May 27th, 2012, 5:16 am

Changing between layouts

Post by Krainz »

Hello!

I'm working on a skin that would make use of various layouts, and in order to switch between them, I need a code that would perform that on-demand. Is there any kind of code that does it?

Before 2.4 I used the following:

Code: Select all

LeftMouseUpAction=!Execute [!HideMeter b1] [!ShowMeter b1C] ["#ADDONSPATH#RainThemes\RainThemes.exe" "/load" "omnimodefinitive"] [!Redraw]
But now after updating Rainmeter I receive the following error message:
Image
(also, it takes a lot to 'load', whilst performing the layout switch through the menu has barely no wait time)

tl;dr: what is the bang to quickly switch between layouts?
User avatar
smurfier
Moderator
Posts: 1931
Joined: January 29th, 2010, 1:43 am
Location: Willmar, MN

Re: Changing between layouts

Post by smurfier »

RainThemes is an old outdated addon.

Rainmeter 2.4 introduces the !LoadLayout bang.
GitHub | DeviantArt | Tumblr
This is the song that never ends. It just goes on and on my friends. Some people started singing it not knowing what it was, and they'll continue singing it forever just because . . .
User avatar
Krainz
Posts: 186
Joined: May 27th, 2012, 5:16 am

Re: Changing between layouts

Post by Krainz »

Thank you!

So it would be something like

Code: Select all

LeftMouseUpAction=!Execute [!HideMeter b1] [!ShowMeter b1C] [!LoadLayout "omnimodefinitive"] [!Redraw]
But the layout loads without even showing meter b1C... Is there way I can put a wait time into it?

Like

Code: Select all

LeftMouseUpAction=!Execute [!HideMeter b1] [!ShowMeter b1C] [!Wait 500] [!LoadLayout "omnimodefinitive"] [!Redraw]
Where '500' is in milliseconds
User avatar
smurfier
Moderator
Posts: 1931
Joined: January 29th, 2010, 1:43 am
Location: Willmar, MN

Re: Changing between layouts

Post by smurfier »

Loading a layout unloads all skins then loads the skins listed in the selected layout.

!HideMeter and !ShowMeter are not preserved between layouts. You would need to use !WriteKeyValue for that.
GitHub | DeviantArt | Tumblr
This is the song that never ends. It just goes on and on my friends. Some people started singing it not knowing what it was, and they'll continue singing it forever just because . . .
User avatar
Krainz
Posts: 186
Joined: May 27th, 2012, 5:16 am

Re: Changing between layouts

Post by Krainz »

No, I want to show the meter (a clicked button) right before loading the next layout, not after.
User avatar
smurfier
Moderator
Posts: 1931
Joined: January 29th, 2010, 1:43 am
Location: Willmar, MN

Re: Changing between layouts

Post by smurfier »

Code: Select all

LeftMouseUpAction=[!HideMeter b1] [!ShowMeter b1C] [!EnableMeasure cCounter] [!Redraw]

[cCounter]
Measure=Calc
Formula=cCounter+1
IfAboveValue=500
IfAboveAction=!LoadLayout "omnimodefinitive"
Disabled=1
GitHub | DeviantArt | Tumblr
This is the song that never ends. It just goes on and on my friends. Some people started singing it not knowing what it was, and they'll continue singing it forever just because . . .
User avatar
Krainz
Posts: 186
Joined: May 27th, 2012, 5:16 am

Re: Changing between layouts

Post by Krainz »

I don't know if I'm doing something wrong, but with that code the meter b1C is shown but the Layout never changes
User avatar
smurfier
Moderator
Posts: 1931
Joined: January 29th, 2010, 1:43 am
Location: Willmar, MN

Re: Changing between layouts

Post by smurfier »

You'll have to change the IfAboveValue=500 to a smaller number. That is basically 500 updates after you click the button.

If you just want it to run on the following update:

Code: Select all

[cCounter]
Measure=Calc
Formula=1
IfAboveValue=0
IfAboveAction=!LoadLayout "omnimodefinitive"
Disabled=1
GitHub | DeviantArt | Tumblr
This is the song that never ends. It just goes on and on my friends. Some people started singing it not knowing what it was, and they'll continue singing it forever just because . . .