It is currently January 22nd, 2022, 6:17 am

## [solved] help to simplify a bunch of IfCondition

Help with creating, editing & fixing problems with skins
balala
Rainmeter Sage
Posts: 13719
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

### Re: help to simplify a bunch of IfCondition

carlitosbahia wrote: January 4th, 2022, 7:49 pm i assume that is rainmeter way to say If [MeasureNumber]<5 then make that 1 , else then make it 0 ?
Right. In this case for instance, when day is less than 5 (so on 1st - 4th of month), you extract 31 days (31x86400 seconds) and add 10 days (10x86400 seconds). This means that for the first 4 days of month are extracted only 31-10 = 21 days, which ensures you that you get the previous month, not the one before. For dates after 5th of month, extracting 31 days is perfect, you get the previous month in every case.
In fact the above formula used in the TimeStamp option should have been TimeStamp=([MeasureNumber:TimeStamp]-31*86400+((([MeasureNumber]<5)?1:0)*10*86400)), I just simplified a little bit, omitting the not-needed part of the formula. But I suppose you got the essence (congratulations for this, good job ).
carlitosbahia
Posts: 12
Joined: December 30th, 2021, 10:32 pm

### Re: help to simplify a bunch of IfCondition

don't think that is in the manual, tip added to my tips file

now time to torture myself with the spanish version ( hope i don't have to add conditions again, lol )
balala
Rainmeter Sage
Posts: 13719
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

### Re: help to simplify a bunch of IfCondition

carlitosbahia wrote: January 4th, 2022, 8:46 pm now time to torture myself with the spanish version ( hope i don't have to add conditions again, lol )
Don't add them back. With the approach I posted above it'll work.
Just a side note: you don't have to translate the values returned by Time measures. These measures are able to return the string in any language (Spanish for instance). For this you only have to add a FormatLocale=es-ES option to the measures which you want too get the result in Spanish (or if you want another dialect find the proper language identifier here).
carlitosbahia
Posts: 12
Joined: December 30th, 2021, 10:32 pm

### Re: help to simplify a bunch of IfCondition

well, that part was easier than expected, went smooth
learned some useful things on the way so even better

gonna search for a new idea and leave this skin rest for now , just for future reference or whatever this is the final result ( black/white , eng/esp )
death.crafter
Rainmeter Sage
Posts: 1293
Joined: April 24th, 2021, 8:13 pm

### Re: help to simplify a bunch of IfCondition

carlitosbahia wrote: January 4th, 2022, 9:41 pm well, that part was easier than expected, went smooth
learned some useful things on the way so even better

gonna search for a new idea and leave this skin rest for now , just for future reference or whatever this is the final result ( black/white , eng/esp )
from the Realm of Death
balala
Rainmeter Sage
Posts: 13719
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

### Re: help to simplify a bunch of IfCondition

carlitosbahia wrote: January 4th, 2022, 9:41 pm well, that part was easier than expected, went smooth
Which part? Translating strings returned by Time measures or fixing the coloring problem of your skin?
In any case, I'm glad if you got it working as expected.
carlitosbahia wrote: January 4th, 2022, 9:41 pm learned some useful things on the way so even better
There is always something to learn...
carlitosbahia
Posts: 12
Joined: December 30th, 2021, 10:32 pm

### Re: [solved] help to simplify a bunch of IfCondition

well , i guess skin can not rest or let me rest, lol

looking at the skin last midnight ( then i had to wait 24 hours to reproduce it and get this screenshot ) i noticed something weird and i can't find the reason why it is happening

when the day changes , the 6 variables for the weekday ( name and number ) they do update like they should , i can see that in the skins tab of the about menu and also in the skin because the right day is located in the middle line of the meter

[MeterDayName]
MeasureName=MeasureYesterdayName
MeasureName2=MeasureTodayName
MeasureName3=MeasureTomorrowName
Text=%1#CRLF#%2#CRLF#%3

that is how i show them now

but, the weird thing is that the inline options are not updating right away for the day and number , for the month i can't say but my guess is not doing it either
waited a couple of minutes and nothing , had to manually refresh the skin from the manager for the color of the day to change

strange because the option is using the variables MeasureToday... that are updating
InlinePattern=[MeasureTodayname]
InlinePattern=[MeasureTodayNunmber]

the only update in the skin is the main one , no UpdateDivider anywhere in the code
[Rainmeter]
Update=1000

that should update everything including the inline option once a second, right ? strange bug or do i need to add something else to force to update that too ?

eclectic-tech
Rainmeter Sage
Posts: 4581
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

### Re: [solved] help to simplify a bunch of IfCondition

When you use Section Variables in a measure or meter, you need to add DynamicVariables=1 to those sections.

You use InlinePattern=[MeasureTodayName] and InlinePattern=[MeasureTodayNunmber] in [MeterDayName] and [MeterDayNumber], so adding DynamicVariables=1 to those 2 sections will make the meters update correctly when the measure values change.

carlitosbahia
Posts: 12
Joined: December 30th, 2021, 10:32 pm

### Re: [solved] help to simplify a bunch of IfCondition

oops , guess i forget those 2
eclectic-tech
Rainmeter Sage
Posts: 4581
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

### Re: [solved] help to simplify a bunch of IfCondition

carlitosbahia wrote: January 7th, 2022, 5:46 am oops , guess i forget those 2
ugh! that happens to me all the time
Happy to help