It is currently March 28th, 2024, 3:37 pm

How to hide a skin outside of set times?

Get help with creating, editing & fixing problems with skins
Post Reply
Jughead
Posts: 2
Joined: May 24th, 2017, 7:15 am

How to hide a skin outside of set times?

Post by Jughead »

Hi all,

I've made a skin which draws a bar that extends throughout the course of my school day over my timetable (to show which period it is/how long until my next class) and it works fine. However, I want to automatically hide the skin outside of school hours, and on weekends, and I was wondering how to do that? I'm sorry if this is a stupid question, and thanks.
User avatar
balala
Rainmeter Sage
Posts: 16109
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: How to hide a skin outside of set times?

Post by balala »

Jughead wrote:Hi all,

I've made a skin which draws a bar that extends throughout the course of my school day over my timetable (to show which period it is/how long until my next class) and it works fine. However, I want to automatically hide the skin outside of school hours, and on weekends, and I was wondering how to do that? I'm sorry if this is a stupid question, and thanks.
No, it's not.
You probably have a time measure in your code (that one which has a Measure=Time option). You have to add an IfCondition to that measure.
One example of how this could be done: this is a Time measure, which can be easily used for a such task:

Code: Select all

[MeasureTime]
Measure=Time
Format=%#H%M
This measure will return the time as a three or four digits (eg. for me right now it would return 1250). This value being a number, you can add an IfCondition:

Code: Select all

IfCondition=((#CURRENTSECTION#>=800)&&(#CURRENTSECTION#<=1400))
IfTrueAction=[!ShowFade "#CURRENTCONFIG#"]
IfFalseAction=[!HideFade "#CURRENTCONFIG#"]
Note that the [MeasureTime] measure returns the time in 24 hour format. It's much easier to work in this format, as in a 12 hours format.

If you can't implement, this, for specific help, please post the code of your skin.
Jughead
Posts: 2
Joined: May 24th, 2017, 7:15 am

Re: How to hide a skin outside of set times?

Post by Jughead »

Thank you! I've got it working now, thanks to your help, and I probably would have spent ages trying to figure it out on my own. :oops:
User avatar
balala
Rainmeter Sage
Posts: 16109
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: How to hide a skin outside of set times?

Post by balala »

Glad to help.
Post Reply