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
User avatar
balala
Rainmeter Sage
Posts: 13719
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: help to simplify a bunch of IfCondition

Post by balala »

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 :thumbup: ).
User avatar
carlitosbahia
Posts: 12
Joined: December 30th, 2021, 10:32 pm

Re: help to simplify a bunch of IfCondition

Post by carlitosbahia »

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

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

Re: help to simplify a bunch of IfCondition

Post by balala »

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).
User avatar
carlitosbahia
Posts: 12
Joined: December 30th, 2021, 10:32 pm

Re: help to simplify a bunch of IfCondition

Post by carlitosbahia »

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


gonna search for a new idea and leave this skin rest for now :D , just for future reference or whatever this is the final result ( black/white , eng/esp )
https://www.mediafire.com/file/vjq31zb0uyup6xq/YADTS_BeforeAfter_V2.7z/file
User avatar
death.crafter
Rainmeter Sage
Posts: 1293
Joined: April 24th, 2021, 8:13 pm

Re: help to simplify a bunch of IfCondition

Post by death.crafter »

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


gonna search for a new idea and leave this skin rest for now :D , just for future reference or whatever this is the final result ( black/white , eng/esp )
https://www.mediafire.com/file/vjq31zb0uyup6xq/YADTS_BeforeAfter_V2.7z/file
Congrats on your first skin...
P.S. Rainmeter is like a webpage, just meters instead of elements lol
from the Realm of Death
User avatar
balala
Rainmeter Sage
Posts: 13719
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: help to simplify a bunch of IfCondition

Post by balala »

carlitosbahia wrote: January 4th, 2022, 9:41 pm well, that part was easier than expected, went smooth :great:
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 :thumbup:
There is always something to learn...
User avatar
carlitosbahia
Posts: 12
Joined: December 30th, 2021, 10:32 pm

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

Post by carlitosbahia »

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 :D ) 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
Image


[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
Image

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 ?
:confused:
https://www.mediafire.com/file/borm5fmo1dk7ovo/YADTS_V2.7z/file
User avatar
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

Post by eclectic-tech »

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.
User avatar
carlitosbahia
Posts: 12
Joined: December 30th, 2021, 10:32 pm

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

Post by carlitosbahia »

oops , guess i forget those 2
:thumbup:
User avatar
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

Post by eclectic-tech »

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