It is currently December 1st, 2020, 5:59 pm

Update a measure in a skin group

Help with creating, editing & fixing problems with skins
User avatar
StArL0rd84
Posts: 358
Joined: February 8th, 2015, 10:07 pm
Location: EU, Denmark.

Update a measure in a skin group

Post by StArL0rd84 »

My suite has three different color sources and they depend on a variable and a measure to switch between them.
I want to switch color sources from the settings skin.
HUD.png

SharedMeasures.inc

Code: Select all

[Rainmeter]
Group=HUD

[mColorSource]
Measure=Calc
Formula=#ColorSource#
DynamicVariables=1
UpdateDivider=-1
IfCondition=#CURRENTSECTION#=1
IfTrueAction=[!EnableMeasureGroup ColorSource1][!UpdateMeasureGroup ColorSource1]
IfFalseAction=[!DisableMeasureGroup ColorSource1]
IfCondition2=#CURRENTSECTION#=2
IfTrueAction2=[!EnableMeasureGroup ColorSource2][!UpdateMeasureGroup ColorSource2]
IfFalseAction2=[!DisableMeasureGroup ColorSource2]
IfCondition3=#CURRENTSECTION#=3
IfTrueAction3=[!EnableMeasureGroup ColorSource3][!UpdateMeasureGroup ColorSource3]
IfFalseAction3=[!DisableMeasureGroup ColorSource3]
OnChangeAction=[!UpdateMeter *][!Redraw][!Update]
I am able to set the variable #ColorSource# to 1, 2 and 3 across all skins using: [!SetVariableGroup "ColorSource" "1" "HUD"].
But i cannot update the measure [mColorSource] using this method, [!UpdateMeasureGroup "mColorSource" "HUD"].

I am therefore forced to do: [!UpdateMeasure "mColorSource" "HUD\Launcher1"][!UpdateMeasure "mColorSource" "HUD\Launcher2"][!UpdateMeasure "mColorSource" "HUD\Launcher3"] so on and so forth...

Just seems a bit inefficient that only some bangs would be skin group friendly.
EDIT: Maybe this should be moved to 'Bugs & Feature Suggestions'
You do not have the required permissions to view the files attached to this post.
([mWorkTime] = 1 ? #Work# : ([mEnergyLoss:%] >= 70% ? #Chillmode# : </>))
User avatar
Yincognito
Posts: 2933
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Update a measure in a skin group

Post by Yincognito »

StArL0rd84 wrote: October 15th, 2020, 4:46 pmI am able to set the variable #ColorSource# to 1, 2 and 3 across all skins using: [!SetVariableGroup "ColorSource" "1" "HUD"].
But i cannot update the measure [mColorSource] using this method, [!UpdateMeasureGroup "mColorSource" "HUD"].

I am therefore forced to do: [!UpdateMeasure "mColorSource" "HUD\Launcher1"][!UpdateMeasure "mColorSource" "HUD\Launcher2"][!UpdateMeasure "mColorSource" "HUD\Launcher3"] so on and so forth...

Just seems a bit inefficient that only some bangs would be skin group friendly.
EDIT: Maybe this should be moved to 'Bugs & Feature Suggestions'
As far as I know, the Group parameter in the !UpdateMeasureGroup refers to a group of measures, and not a group of skins, which is why your attempt doesn't work. My guess is that the absence of the ability to specify a skin group that the update would be applied on has something to do with Rainmeter not having a "built-in" way of knowing which skins (and from which skin groups) are active at a specific moment of time. Variables, on the other hand, might be stored in a more "central" Rainmeter area (e.g. memory?) so setting them on a more global basis is easier.

That being said, have you tried using the * (i.e. "all") parameter in those bangs, when it comes to skins? For example, [!UpdateMeasureGroup SomeMeasureGroup *], or even [!UpdateMeasure mColorSource *], in order to act on all active skins. Assuming unique measure or measure group names (i.e. that don't exist in other active skins), this might work... :???:
User avatar
balala
Rainmeter Sage
Posts: 11837
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Update a measure in a skin group

Post by balala »

EDIT: Sorry, Yincognito beat me again. As usually...
StArL0rd84 wrote: October 15th, 2020, 4:46 pm I am able to set the variable #ColorSource# to 1, 2 and 3 across all skins using: [!SetVariableGroup "ColorSource" "1" "HUD"].
But i cannot update the measure [mColorSource] using this method, [!UpdateMeasureGroup "mColorSource" "HUD"].

I am therefore forced to do: [!UpdateMeasure "mColorSource" "HUD\Launcher1"][!UpdateMeasure "mColorSource" "HUD\Launcher2"][!UpdateMeasure "mColorSource" "HUD\Launcher3"] so on and so forth...

Just seems a bit inefficient that only some bangs would be skin group friendly.
The purpose of the !UpdateMeasureGroup is to update all measures belonging to a group of measures in the current skin or in a skin specified through the Config (second) parameter of the !UpdateMeasureGroup bang (if the bangs has such a parameter), but not to update a group of measures in all loaded skins belonging to a group of configs. There is no bang for this, the method you've described is the only way to achieve what you want.
Sorry...
StArL0rd84 wrote: October 15th, 2020, 4:46 pm EDIT: Maybe this should be moved to 'Bugs & Feature Suggestions'
Yeah, you might post this there as well, but to be honest I doubt this will be added.
User avatar
Yincognito
Posts: 2933
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Update a measure in a skin group

Post by Yincognito »

balala wrote: October 15th, 2020, 6:23 pmEDIT: Sorry, Yincognito beat me again. As usually...
Well, you beat me in the thread about "Growing and shrinking bar based on time", so... 8-)
User avatar
balala
Rainmeter Sage
Posts: 11837
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Update a measure in a skin group

Post by balala »

Yincognito wrote: October 15th, 2020, 8:04 pm Well, you beat me in the thread about "Growing and shrinking bar based on time", so... 8-)
No I didn't. There you was the first who replied as well, so...
User avatar
Yincognito
Posts: 2933
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Update a measure in a skin group

Post by Yincognito »

balala wrote: October 15th, 2020, 8:05 pm No I didn't. There you was the first who replied as well, so...
Yeah, but that was just a couple of words reply, and not even a proper answer, more like a pre-answer. :)
User avatar
StArL0rd84
Posts: 358
Joined: February 8th, 2015, 10:07 pm
Location: EU, Denmark.

Re: Update a measure in a skin group

Post by StArL0rd84 »

:D :D :D
62b8dc5b56845e6435b5d6ebdb1da44a.png
You do not have the required permissions to view the files attached to this post.
([mWorkTime] = 1 ? #Work# : ([mEnergyLoss:%] >= 70% ? #Chillmode# : </>))
User avatar
Yincognito
Posts: 2933
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Update a measure in a skin group

Post by Yincognito »

StArL0rd84 wrote: October 15th, 2020, 8:51 pm :D :D :D 62b8dc5b56845e6435b5d6ebdb1da44a.png
Image
:twisted:
User avatar
balala
Rainmeter Sage
Posts: 11837
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Update a measure in a skin group

Post by balala »

StArL0rd84 wrote: October 15th, 2020, 8:51 pm :D :D :D 62b8dc5b56845e6435b5d6ebdb1da44a.png
Ok, I don't, but finally have you got a proper answer to your question?
User avatar
StArL0rd84
Posts: 358
Joined: February 8th, 2015, 10:07 pm
Location: EU, Denmark.

Re: Update a measure in a skin group

Post by StArL0rd84 »

balala wrote: October 16th, 2020, 10:49 am Ok, I don't, but finally have you got a proper answer to your question?
Yep thank you.
([mWorkTime] = 1 ? #Work# : ([mEnergyLoss:%] >= 70% ? #Chillmode# : </>))