It is currently April 23rd, 2024, 11:57 am

!ActivateConfigGroup ?

Get help with creating, editing & fixing problems with skins
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: !ActivateConfigGroup ?

Post by jsmorley »

balala wrote: April 16th, 2021, 5:14 pm No. The following code does perfectly work, it activates / deactivates all four skins (note that there are single quotes):

Code: Select all

[Variables]
Skin1="Config1" "Skin1.ini"
Skin2="Config2" "Skin2.ini"
Skin3="Config3" "Skin3.ini"
Skin4="Config4" "Skin4.ini"

[SectionName]
LeftMouseUpAction=[!ToggleConfig #Skin1#][!ToggleConfig #Skin2#][!ToggleConfig #Skin3#][!ToggleConfig #Skin4#]
The String meter indeed throw away the quotes, showing the string as you described, but the above LeftMouseUpAction does perfectly work, even with single quotes.
Try it with config or skin names that have spaces in them.
User avatar
balala
Rainmeter Sage
Posts: 16162
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: !ActivateConfigGroup ?

Post by balala »

jsmorley wrote: April 16th, 2021, 5:18 pm Try it with config or skin names that have spaces in them.
To be honest, it works even if there are spaces. Am I mistaken somewhere?
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: !ActivateConfigGroup ?

Post by jsmorley »

Hm.. It does seem to work. Rainmeter must be seeing the problem and dealing with it. I don't particularly recommend this though, as this is going to lead to wrong conclusions about how quotes work.
User avatar
balala
Rainmeter Sage
Posts: 16162
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: !ActivateConfigGroup ?

Post by balala »

jsmorley wrote: April 16th, 2021, 5:28 pm Hm.. It does seem to work. Rainmeter must be seeing the problem and dealing with it. I don't particularly recommend this though, as this is going to lead to wrong conclusions about how quotes work.
Alright, same here. But strictly speaking, it does work. However I agree it doesn't seem to be a good practice.
Mino_el_Nukenin
Posts: 231
Joined: April 24th, 2020, 7:39 pm
Location: France

Re: !ActivateConfigGroup ?

Post by Mino_el_Nukenin »

Actually my only concern was to avoid ressources consuming by having the skins loaded but hidden until I toggle them to appear.
That's why I ask if there was a possibility to activate various skins of the same group at the same time.

Here is the code so far, which works perfectly but I need to have all the skins as start hidden

Code: Select all

[Variables]
@include=#@#\Config.inc
MyVar=0
Seconds1=8
Seconds2=9
MouseAction0=[!DeactivateConfig "SHIELD Agent Module\Main Shutdown" "Main Shutdown.ini"][!ActivateConfig "SHIELD Agent Module\Mainframe Boot"][!Delay "13000"][!DeactivateConfig "SHIELD Agent Module\Mainframe Boot"][!Delay "500"][Play "#@#\Audio\Greetings AI 0.wav"][!Delay "1500"][!ActivateConfig "SHIELD Agent Module\Clock" "Clock.ini"]
MouseAction1=[!DeactivateConfig "SHIELD Agent Module\Clock" "Clock.ini"][!ActivateConfig "SHIELD Agent Module\Main Shutdown" "Main Shutdown.ini"]

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

[MeasureMyVar]
Measure=Calc
Formula=#MyVar#
IfCondition=(#CURRENTSECTION#=1)
IfTrueAction=[!SetWallpaper "#@#\Wallpapers\Wallpaper - active.png" Fill]
IfFalseAction=[!SetWallpaper "#@#\Wallpapers\Wallpaper - inactive.png" Fill]
UpdateDivider=-1
DynamicVariables=1
So the only way to modify that is to change the LeftMouseupAction as you all mention with each skins.
I have about 17 or 18 skins in the Module group, that's why I asked in the first place.
User avatar
balala
Rainmeter Sage
Posts: 16162
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: !ActivateConfigGroup ?

Post by balala »

Mino_el_Nukenin wrote: April 18th, 2021, 2:24 pm Actually my only concern was to avoid ressources consuming by having the skins loaded but hidden until I toggle them to appear.
The activated skins are consuming almost the same amount of resources, no matter if they are hidden or shown. A small difference might exist (probably depends on the skins as well), but not too great.
Mino_el_Nukenin wrote: April 18th, 2021, 2:24 pm Actually my only concern was to avoid ressources consuming by having the skins loaded but hidden until I toggle them to appear.
That's why I ask if there was a possibility to activate various skins of the same group at the same time.
Sorry, these two doesn't match each other. If the skins are activated, you don't have to activate them, just have to show them (supposing they were hidden).
Please pay attention to the fact that there are two different operations: activating / deactivating skins versus showing / hiding them. Don't mix these two, they are different operations.
Mino_el_Nukenin wrote: April 18th, 2021, 2:24 pm Here is the code so far, which works perfectly but I need to have all the skins as start hidden
More possibilities:
  • Add an OnRefreshAction=[!Hide] option to the [Rainmeter] section of each skin you'd like to get hidden when loading.
  • If those skins you'd like to hide, belong to a group of skins (they are, right?) add the following option to the same [Rainmeter] section of one or more activated skins: OnRefreshAction=[!HideGroup "Module"] (obviously you have to use the appropriate group name in this !HideGroup bang, but based on your post, I supposed the group name is Module - replace it if it's not). Note that to get the skins hidden, you have to have loaded the skin(s) to which you've added the above OnRefreshAction option.
Mino_el_Nukenin wrote: April 18th, 2021, 2:24 pm

Code: Select all

[Variables]
@include=#@#\Config.inc
MyVar=0
Seconds1=8
Seconds2=9
MouseAction0=[!DeactivateConfig "SHIELD Agent Module\Main Shutdown" "Main Shutdown.ini"][!ActivateConfig "SHIELD Agent Module\Mainframe Boot"][!Delay "13000"][!DeactivateConfig "SHIELD Agent Module\Mainframe Boot"][!Delay "500"][Play "#@#\Audio\Greetings AI 0.wav"][!Delay "1500"][!ActivateConfig "SHIELD Agent Module\Clock" "Clock.ini"]
MouseAction1=[!DeactivateConfig "SHIELD Agent Module\Clock" "Clock.ini"][!ActivateConfig "SHIELD Agent Module\Main Shutdown" "Main Shutdown.ini"]

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

[MeasureMyVar]
Measure=Calc
Formula=#MyVar#
IfCondition=(#CURRENTSECTION#=1)
IfTrueAction=[!SetWallpaper "#@#\Wallpapers\Wallpaper - active.png" Fill]
IfFalseAction=[!SetWallpaper "#@#\Wallpapers\Wallpaper - inactive.png" Fill]
UpdateDivider=-1
DynamicVariables=1
As said here a few times, the !DeactivateConfig bang, unlike !ActivateConfig, needs one single parameter: the name of the config. The name of skin's file is not needed. Rainmeter doesn't care too much which skin of a config is loaded. When you deactivate it, Rainmeter deactivates the loaded skin.
So for instance the first bang of the MouseAction0 variable (within the [Variables] section) is [!DeactivateConfig "SHIELD Agent Module\Main Shutdown" "Main Shutdown.ini"]. The red part is not needed (even if the bang works even with it). Correctly it is: [!DeactivateConfig "SHIELD Agent Module\Main Shutdown"].
Since as explaind, there might be more (unlimited number) skins into a config, to activate certain skin, you have to add the name of the skin, beside the name of config into the !ActivateConfig bang. But in fact even !ActivateConfig does work with one single parameter, the name of the config.
Mino_el_Nukenin wrote: April 18th, 2021, 2:24 pm So the only way to modify that is to change the LeftMouseupAction as you all mention with each skins.
I have about 17 or 18 skins in the Module group, that's why I asked in the first place.
Right, have to add all skins, one by one, to get them activated.
Mino_el_Nukenin
Posts: 231
Joined: April 24th, 2020, 7:39 pm
Location: France

Re: !ActivateConfigGroup ?

Post by Mino_el_Nukenin »

I might have explained badly...

So far the only way to have what I wanted visually with my config was to have various skins of the same group activated, but hidden when Rainmeter starts (with start hidden) and a button to toggle them to appear when needed.

So my only question was if it exists another way to do the same thing ( > activate "visually speaking" various skins of the same group at the same time and deactivate them when clicking the button), so it would avoid ressources consuming of having the skins activated and hidden, when I don't use them.

Maybe the only way, if I understood well is to create aonther config with the skins, and toggle this particular config when needed ?
User avatar
balala
Rainmeter Sage
Posts: 16162
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: !ActivateConfigGroup ?

Post by balala »

Mino_el_Nukenin wrote: April 18th, 2021, 9:21 pm So my only question was if it exists another way to do the same thing ( > activate "visually speaking" various skins of the same group at the same time and deactivate them when clicking the button), so it would avoid ressources consuming of having the skins activated and hidden, when I don't use them.

Maybe the only way, if I understood well is to create aonther config with the skins, and toggle this particular config when needed ?
As said, you have to activate them one by one. A group activating bang doesn't exist. But at least if you know which skins would you like to activate, this is not a problem, it can easily be done.
Another way is to create a layout, containg all required skins, then when needed, load the created layout. If you're not sure how or what to do, but are interested, please let me know.