I have a little skin that I'm trying to dynamically show or hide depending on if there's a value. Right now, I manage to show both or none of them, but I want to show the first one if there's value. If not, hide it and show the other one if there's a value for it. It's based on a registry value. The key can exist but empty, not exist or exist with value.
This only work on hidding it if one of them is empty, but not on hidding the second one if the first one have value or showing only the second if the first one have value and first is empty.
Can you clarify a bit what behavior you are looking for?
I'm not sure I entirely follow these:
I want to show the first one if there's value. If not, hide it and show the other one if there's a value for it.
This only work on hiding it if one of them is empty, but not on hiding the second one if the first one have value or showing only the second if the first one have value and first is empty.
Remember that IfCondition / IfMatch tests are either "true" or "false". They are all evaluated, and there is no "if / then / elseif / else" construct. You need to be careful that the IfFalseAction of one doesn't conflict with or override the IfTrueAction of another.
The iftrue iffalse was a test, in the end it did the samething that I achieved from another way.
What I want is I have 2 meter, MeasureProfile and MeasureRole. Both of them read 2 different registry key value. This key can exist or not, and can be empty or not. When it's empty, it return 0 from my test.
Now, I want MeasureProfile to show if there's a value and I want to MeasureRole to show only if it has a value and MeasureProfile is hidden (in short, it's looking for a backup registry value in case the first one is not there. If there'S a way to do it with only one measure, I can use that too).
nodiaque wrote: ↑September 16th, 2019, 11:42 am
The iftrue iffalse was a test, in the end it did the samething that I achieved from another way.
What I want is I have 2 meter, MeasureProfile and MeasureRole. Both of them read 2 different registry key value. This key can exist or not, and can be empty or not. When it's empty, it return 0 from my test.
Now, I want MeasureProfile to show if there's a value and I want to MeasureRole to show only if it has a value and MeasureProfile is hidden (in short, it's looking for a backup registry value in case the first one is not there. If there'S a way to do it with only one measure, I can use that too).
So to be clear, you have two METERS, presumably called MeterProfile and MeterRole?
[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1
;Now, I want MeasureProfile to show if there's a value and I want to MeasureRole to show only if it has a value and MeasureProfile is hidden (in short, it's looking for a backup registry value in case the first one is not there. If there'S a way to do it with only one measure, I can use that too).
[MeasureProfile]
Measure=String
String=0
[MeasureRole]
Measure=String
String=1
IfCondition=MeasureProfile > 0
IfTrueAction=[!ShowMeterGroup "Profile"][!HideMeterGroup "Role"]
IfCondition2=(MeasureProfile = 0 ) && (MeasureRole > 0)
IfTrueAction2=[!ShowMeterGroup "Role"][!HideMeterGroup "Profile"]
IfCondition3=(MeasureProfile = 0 ) && (MeasureRole = 0)
IfTrueAction3=[!HideMeterGroup "Profile"][!HideMeterGroup "Role"]
[MeterProfile]
Meter=String
Group=Profile
FontSize=11
FontWeight=400
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1
Text=Profile
[MeterRole]
Meter=String
Group=Role
Y=0R
FontSize=11
FontWeight=400
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1
Text=Role
You will find that using IfFalseAction is generally going to cause logic complexity when you have a set of conditions that can have more than two "states". In this case you have three:
MeasureProfile is true
MeasureProfile is false and MeasureRole is true
Both MeasureProfile and MeasureRole are false
So the simplest logic is to have three "positive" tests for those three conditions. One and only one of those three "states" must be true. There is no way that all three can be false, and there is no way more than one can be true.
This assumes that both MeasureProfile and MeasureRole return numeric string values not equal to 0 if they are populated. If they return a textual string value and a number value of 0, then we would need to use IfMatch instead of IfCondition, (IfCondition ONLY acts on the number value of a measure) and the logic will be very different based on the behavior of IfMatch vs. IfCondition. The easiest way to know is to use About/Skins to look at the number and string values being returned:
1.jpg
You do not have the required permissions to view the files attached to this post.