It is currently April 25th, 2024, 4:06 am

How to detect whether a value has changed?

Get help with creating, editing & fixing problems with skins
skipperhi
Posts: 5
Joined: August 20th, 2019, 4:06 pm

How to detect whether a value has changed?

Post by skipperhi »

I'm trying to make a skin that will switch between my main layout and an empty one while fullscreen to save some resources, but the code I have so far will constantly keep reloading the main layout whenever i'm not fullscreen.

Is there a way for rainmeter to only evaluate the IfCondition when the fullscreen value has changed?

Code: Select all

[Rainmeter]
Update=1000

[MeasureIsFullScreen]
Measure=Plugin
Plugin=IsFullScreen
IfCondition=MeasureIsFullScreen=1
IfTrueAction=[!LoadLayout "Empty"]
IfFalseAction=[!LoadLayout "Main"]
Last edited by skipperhi on August 23rd, 2019, 5:27 pm, edited 1 time in total.
User avatar
ikarus1969
Posts: 571
Joined: February 28th, 2011, 3:20 pm
Location: Vienna, Austria

Re: How to detect whether a value has changed?

Post by ikarus1969 »

skipperhi wrote: August 23rd, 2019, 12:47 pm I'm trying to make a skin that will switch between my main layout and an empty one while fullscreen to save some resources, but the code I have so far will constantly keep reloading the main layout whenever i'm not fullscreen.

Is there a way for rainmeter to only evaluate the IfCondition when the fullscreen value has changed?

Code: Select all

[Rainmeter]
Update=1000

[MeasureIsFullScreen]
Measure=Plugin
Plugin=IsFullScreen
IfCondition=MeasureIsFullScreen=1
IfTrueAction=[!LoadLayout "Empty"]
IfFalseAction=[!LoadLayout "Main"]
I admit i don't fully understand. You want Layout "Empty" when fullscreen, Layout "Main" when not fullscreen, right? That would be covered by the code you've posted.
Could you please explain again what you want to achieve?

btw. if that is your fulll code, then a code for a meter is missing. A meter is needed by any skin, even if it's invisible. So you would need to add a

Code: Select all

[Meter_DUMMY]
Meter=STRING
skipperhi wrote: August 23rd, 2019, 12:47 pm Is there a way for rainmeter to only evaluate the IfCondition when the fullscreen value has changed?
so switch from from "Main" to "Empty and vice-versa the value of the plugin changes, right?
skipperhi
Posts: 5
Joined: August 20th, 2019, 4:06 pm

Re: How to detect whether a value has changed?

Post by skipperhi »

The problem is that my skin continually updates, meaning that the same layout is constantly being reloaded, ex. when I'm on the desktop my main layout is constantly being reloaded over and over.

I realized that I could've just broken up the code into 2 skins, 1 in each layout to load the other layout when an app was/wasn't in fullscreen, thanks for your help though!
User avatar
ikarus1969
Posts: 571
Joined: February 28th, 2011, 3:20 pm
Location: Vienna, Austria

Re: How to detect whether a value has changed?

Post by ikarus1969 »

My problem was, that i can't think of "constantly reloading" unless there is a "IfConditionMode=1" coded on the measure.
Can you do me a favour and check that just a last time in your code (unless your code is identical to that you've posted)