It is currently April 19th, 2024, 12:49 pm

Check if a skin is ClickThrough

Get help with creating, editing & fixing problems with skins
GingerGuy118
Posts: 7
Joined: April 26th, 2022, 3:15 pm

Check if a skin is ClickThrough

Post by GingerGuy118 »

So this should be a fairly quick question.
I have a skin that I want to show a certain meter when the skin is clickthrough. I'm trying to use the IfCondition Action and want to know if it's even possible and if so, what's the command I am supposed to be using?
NOTE: I know it can be done by parsing the rainmeter.ini file but my attempt was a failure, I wanted to know if there's a simpler way.
User avatar
tass_co
Posts: 513
Joined: May 4th, 2020, 3:01 pm
Location: Ankara, TURKEY

Re: Check if a skin is ClickThrough

Post by tass_co »

GingerGuy118 wrote: April 26th, 2022, 3:19 pm So this should be a fairly quick question.
I have a skin that I want to show a certain meter when the skin is clickthrough. I'm trying to use the IfCondition Action and want to know if it's even possible and if so, what's the command I am supposed to be using?
NOTE: I know it can be done by parsing the rainmeter.ini file but my attempt was a failure, I wanted to know if there's a simpler way.
You can look Skin Bangs or Meter Bangs https://docs.rainmeter.net/manual/bangs/

If you want to show/hide a meter;

Code: Select all

[ShowHideMeter]
Meter=IMAGE
ImageName="IMAGE"
x=....
y=...
W=...
H=...
LeftMouseUpAction=[!ToogleMeter ABCD] ; or [!ShowMeter ABCD]

[ABCD]
Meter=IMAGE
ImageName="IMAGE"
x=....
y=...
W=...
H=...
Hidden=1 ; Important
If you want to Show/hide A skin;

Code: Select all

;Main Skin
[Rainmeter]
Update=1000
OnRefreshAction=[!DeactivateConfig "ABCD" "ABCD.ini"] ; or [!ToogleConfig "ABCD" "ABCD.ini"]

[ShowSkin]
Meter=IMAGE
ImageName="IMAGE"
x=....
y=...
W=...
H=...
LeftMouseUpAction=[!ActivateConfig "ABCD" "ABCD.ini"]
I don't know where i going from here, but i promise it won't be boring... :great:
GingerGuy118
Posts: 7
Joined: April 26th, 2022, 3:15 pm

Re: Check if a skin is ClickThrough

Post by GingerGuy118 »

I guess I didn't fully clarify myself. I don't have a problem of hiding the meter. My problem is hiding it only when the skin becomes clickthrough, I am trying to use it is as a condition but I don't know what the condition needs to be for that to work or if there's even a condition
User avatar
tass_co
Posts: 513
Joined: May 4th, 2020, 3:01 pm
Location: Ankara, TURKEY

Re: Check if a skin is ClickThrough

Post by tass_co »

GingerGuy118 wrote: April 26th, 2022, 10:07 pm I guess I didn't fully clarify myself. I don't have a problem of hiding the meter. My problem is hiding it only when the skin becomes clickthrough, I am trying to use it is as a condition but I don't know what the condition needs to be for that to work or if there's even a condition
Sorry i misunderstood.

EDIT:
You should read the skin clickthrough value from the Rainmeter.ini file. (C:\Users\username\AppData\Roaming\Rainmeter)
Then you can use it by assigning it to the variable.
I don't know where i going from here, but i promise it won't be boring... :great:
User avatar
balala
Rainmeter Sage
Posts: 16144
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Check if a skin is ClickThrough

Post by balala »

GingerGuy118 wrote: April 26th, 2022, 3:19 pm I have a skin that I want to show a certain meter when the skin is clickthrough. I'm trying to use the IfCondition Action and want to know if it's even possible and if so, what's the command I am supposed to be using?
NOTE: I know it can be done by parsing the rainmeter.ini file but my attempt was a failure, I wanted to know if there's a simpler way.
There is no other way than using a WebParser measure to get the needed information. I don't see a way to get the ClickThrough setting, not even of the current skin, other than parsing the Rainmeter.ini, as said. But it doesn't hurt and can easily be done.
Here is an example: add the following measure to your code:

Code: Select all

[MeasureRainmeter]
Measure=WebParser
UpdateRate=5
Url=file://#SETTINGSPATH#Rainmeter.ini
DecodeCharacterReference=1
CodePage=1200
RegExp=(?siU)^.*\[#CURRENTCONFIG#].*ClickThrough=(\d{1,}).*$
StringIndex=1
IfCondition=(#CURRENTSECTION#>=1)
IfTrueAction=[!ShowMeter "MyMeter"][!Redraw]
IfFalseAction=[!HideMeter "MyMeter"][!Redraw]
The skin having this measure checks the ClickThrough setting of itself, due to the #CURRENTCONFIG# variable used in the RegExp option. If you want to get the setting of another skin / config, replace the #CURRENTCONFIG# variable with the name of the appropriate config.
Note the UpdateRate=5 option, which makes the measure to be updated every 5 seconds. This means that when you set the ClikcThrough, the skin will react in up to 5 seconds. If needed you can modify this even to UpdateRate=1, however I'm not sure if it worth.
See the IfCondition and the appropriate IfTrueAction and IfFalseAction options. When the ClickThrough is set, the IfTrueAction option shows the meter, otherwise the IfFalseAction hides it. Make sure to use the correct meter name in the !ShowMeter and !HideMeter bangs.
Is this what was needed?
GingerGuy118
Posts: 7
Joined: April 26th, 2022, 3:15 pm

Re: Check if a skin is ClickThrough

Post by GingerGuy118 »

That was a very helpful code and explanation. It works now. I wish to thank you and hope that you have a fantastic day!
User avatar
balala
Rainmeter Sage
Posts: 16144
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Check if a skin is ClickThrough

Post by balala »

GingerGuy118 wrote: April 29th, 2022, 12:16 pm That was a very helpful code and explanation. It works now. I wish to thank you and hope that you have a fantastic day!
Glad you got it working and you're welcome. Wish a fantastic day to you too. :thumbup: