It is currently April 3rd, 2020, 11:46 am

Communication between skins

Help with creating, editing & fixing problems with skins
GREHNINATOR
Posts: 5
Joined: March 14th, 2020, 11:30 pm

Communication between skins

Post by GREHNINATOR »

I have 2 skins, let's call them A and B. B is not visible until I hover over A(which is always visible). Then when I stop hovering over A, I use the actiontimer plugin to make B fade away after 5000ms, though this action is reseted when I hover over A again, and then restarted when the cursor leave A again.
My question is whether there's any way to reset this action by hovering over B aswell, so that it doesn't disappear when I'm hovering over it, without putting the two skins in the same ini-file?
User avatar
Mor3bane
Posts: 774
Joined: May 7th, 2016, 7:32 am

Re: Communication between skins

Post by Mor3bane »

Once an action timer has been started there is no way to pause it or similar.

However, you might consider utilising some creative !Bang sequences. Like !ActivateMeasure / !DeactivateMeasure with the B skin or both.

There is also the option to use Group setting and associated !ShowMeterGroup / !HideMeterGroup !Toggle... etc.

If your code is very long. perhaps create a rmskin with the Rainmeter Manager and upload it to the forum, in this or a new thread if necessary.
My DevArt Gallery

There are many ways to be different - there is only one way to be yourself - be amazing at it
User avatar
balala
Rainmeter Sage
Posts: 10034
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Communication between skins

Post by balala »

GREHNINATOR wrote:
March 14th, 2020, 11:48 pm
I have 2 skins, let's call them A and B. B is not visible until I hover over A(which is always visible). Then when I stop hovering over A, I use the actiontimer plugin to make B fade away after 5000ms, though this action is reseted when I hover over A again, and then restarted when the cursor leave A again.
My question is whether there's any way to reset this action by hovering over B aswell, so that it doesn't disappear when I'm hovering over it, without putting the two skins in the same ini-file?
Not clear at all. Some details would be needed.
When you're leaving skin A, skin B fades out in 5 seconds or it fades out after 5 seconds? Because there is a huge difference between these two. Another question is that probably the ActionTimer plugin measure is in the code of skin A, right?
As Mor3bane said, the code of the two skins would be needed, or even better a package containing the two .ini files (with all needed additional resources).
Mor3bane wrote:
March 15th, 2020, 4:53 am
Once an action timer has been started there is no way to pause it or similar.
Sorry, but this is wrong. What can't be stopped is the !Delay bang. an ActionTimer plugin measure can easily be stopped, with the a bang like [!CommandMeasure "MeasureSlide" "Stop 1"].
User avatar
Yincognito
Posts: 1077
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Communication between skins

Post by Yincognito »

GREHNINATOR wrote:
March 14th, 2020, 11:48 pm
I have 2 skins, let's call them A and B. B is not visible until I hover over A(which is always visible). Then when I stop hovering over A, I use the actiontimer plugin to make B fade away after 5000ms, though this action is reseted when I hover over A again, and then restarted when the cursor leave A again.
My question is whether there's any way to reset this action by hovering over B aswell, so that it doesn't disappear when I'm hovering over it, without putting the two skins in the same ini-file?
In theory, this is possible. As long as the !Delay bang isn't involved, like balala mentioned, and the fade out is done exclusively through ActionTimer, you could set a "control variable" that is accessible to both A and B and based on its value in both A in B stop the ActionTimer process like balala recommended.

That being said, there is another problem with the setup you described, and this is that you need to hover over B before the fade out is completed by A. I posted a sample on a similar setup to yours in a different thread (not involving ActionTimer though), but I need a bit of time to find it...and here it is. As you can see, the "submenu" (aka B skin, in your setup) skin is not hidden immediately after the "menu" skin (aka A, in your case) is un-hovered: there is a delay involved, of course, but also a #SubmenuWasHovered# variable (a way to have a "control variable" that acts on data from both A and B skin) that checks whether the "B skin" was not hovered on before proceeding with hiding the skin. Don't bother with the method used to do it (since, as I said, it's not done using ActionTimer), just check the preview and compare it to your needs. If they are similar, it means it can for sure be done, with some tweaks to make it work in your ActionTimer case, obviously.
GREHNINATOR
Posts: 5
Joined: March 14th, 2020, 11:30 pm

Re: Communication between skins

Post by GREHNINATOR »

Thank you for your answers!
balala wrote:
March 15th, 2020, 1:17 pm
Not clear at all. Some details would be needed.
When you're leaving skin A, skin B fades out in 5 seconds or it fades out after 5 seconds? Because there is a huge difference between these two. Another question is that probably the ActionTimer plugin measure is in the code of skin A, right?
As Mor3bane said, the code of the two skins would be needed, or even better a package containing the two .ini files (with all needed additional resources).
As you'll see in the code below, it fades out AFTER 5 seconds, and you're correct that the ActionTimer plugin measure is in skin A. My question is basically if it's possible to make the code in skin B stop the ActionTimer that's started in skin A. I know I could put them into the same skin, though that would make it less customize friendly, and also there's no fade option for the meter group-bangs if I'm not mistaken. The alternative I'm leaning towards right now is making a second, invisible meter in skin A, that I place behind skin B, that stops the ActionTimer in skin A from making skin B disappear, even though I'm not totally pleased with that solution, that's the best I can think of with my very limited knowledge of Rainmeter and coding in general. Is this a possible solution or will skin B block the invisible meter from registering that it's being hovered above, or vice versa, can I put the invisible meter above skin B without blocking it from being clicked.

Also I should maybe mention that even though in this example skin B is only one skin. But the when I use the skins there will be multiple duplicates of skin B, each having its own .ini-file, leading to different applications and URLs when clicked. They will all be in the group GAMES, and appear when I hover over skin A.

SKIN A

Code: Select all

[Rainmeter]
Update=1000

[Metadata]
Name=
Author=
Information=
Version=
License=Creative Commons Attribution - Non - Commercial - Share Alike 3.0

[Variables]

[MeasureHide]
Measure=Plugin
Plugin=ActionTimer
HideGroup=[!hidefadegroup "GAMES"]
ActionList1=Wait 5000 | HideGroup

[MeterImage]
Meter=Image
ImageName=#@#Images\GAMES.png 
;Icon made by Good Ware from www.flaticon.com
W=90
H=90
MouseOverAction=[!CommandMeasure MeasureHide "Stop 1"][!showfadegroup "GAMES"]
MouseLeaveAction=[!CommandMeasure MeasureHide "Execute 1"]
SKIN B

Code: Select all

[Rainmeter]
Update=1000
Group=GAMES

[Metadata]
Name=
Author=
Information=
Version=
License=

[MeterImage]
Meter=Image
ImageName=#@#Images\minecraft.png
W=90
H=90
LeftMouseUpAction=["C:\Program Files (x86)\Minecraft Launcher\MinecraftLauncher.exe"]
GREHNINATOR
Posts: 5
Joined: March 14th, 2020, 11:30 pm

Re: Communication between skins

Post by GREHNINATOR »

Yincognito wrote:
March 15th, 2020, 5:23 pm
In theory, this is possible. As long as the !Delay bang isn't involved, like balala mentioned, and the fade out is done exclusively through ActionTimer, you could set a "control variable" that is accessible to both A and B and based on its value in both A in B stop the ActionTimer process like balala recommended.

That being said, there is another problem with the setup you described, and this is that you need to hover over B before the fade out is completed by A. I posted a sample on a similar setup to yours in a different thread (not involving ActionTimer though), but I need a bit of time to find it...and here it is. As you can see, the "submenu" (aka B skin, in your setup) skin is not hidden immediately after the "menu" skin (aka A, in your case) is un-hovered: there is a delay involved, of course, but also a #SubmenuWasHovered# variable (a way to have a "control variable" that acts on data from both A and B skin) that checks whether the "B skin" was not hovered on before proceeding with hiding the skin. Don't bother with the method used to do it (since, as I said, it's not done using ActionTimer), just check the preview and compare it to your needs. If they are similar, it means it can for sure be done, with some tweaks to make it work in your ActionTimer case, obviously.
Yeah, no !Delay is used, only ActionTimer. My head is tired and slow after a hectic day at work, so that's not really helping, but it seems like I need to start by figuring out how these control variables work. As I mentioned in my earlier reply, I'm more or less a complete noob in programming, so I'll need some time, but I really appreciate your time and help! :bow:
User avatar
Yincognito
Posts: 1077
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Communication between skins

Post by Yincognito »

GREHNINATOR wrote:
March 15th, 2020, 6:08 pm
Yeah, no !Delay is used, only ActionTimer. My head is tired and slow after a hectic day at work, so it's not really helping, but it seems like I need to start by figuring out how these control variables work. As I mentioned in my earlier reply, I'm more or less a complete noob in programming, so I'll need some time, but I really appreciate your time and help :bow:
Yeah, well, "control variables" is just a fancy way of saying "a variable whose value is accessible from both skins". That being said, your code above has more "problems" than the fading one. For starters, you don't activate (i.e. "load") the B skin. The !ShowFadeGroup bang works on previously activated/loaded skins. One other thing is that you cannot activate a group of skins, you have to do it one skin at a time (you can deactivate a group of skins though).
User avatar
balala
Rainmeter Sage
Posts: 10034
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Communication between skins

Post by balala »

GREHNINATOR wrote:
March 15th, 2020, 5:50 pm
As you'll see in the code below, it fades out AFTER 5 seconds, and you're correct that the ActionTimer plugin measure is in skin A. My question is basically if it's possible to make the code in skin B stop the ActionTimer that's started in skin A.
Yes, it is.Add the following two options to the [MeterImage] meter of skin B:

Code: Select all

[MeterImage]
...
MouseOverAction=[!CommandMeasure MeasureHide "Stop 1" "A"][!showfadegroup "GAMES"]
MouseLeaveAction=[!CommandMeasure MeasureHide "Execute 1" "A"]
Replace the "A" parameter of the above !CommandMeasure bangs with the config name of skin A. This is the path os the folder containing the A.ini file (having the first code posted by you above), starting from Skins folder. For instance if the path of A.ini file is C:\Users\YourName\Documents\Rainmeter\Skins\MyConfig\A\A.ini, the config name you should replace the A with in the above !CommandMeasure bangs is MyConfig\A.
Details about the Config parameter: https://docs.rainmeter.net/manual/skins/#Config
User avatar
balala
Rainmeter Sage
Posts: 10034
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Communication between skins

Post by balala »

Yincognito wrote:
March 15th, 2020, 6:37 pm
For starters, you don't activate (i.e. "load") the B skin. The !ShowFadeGroup bang works on previously activated/loaded skins. One other thing is that you cannot activate a group of skins, you have to do it one skin at a time (you can deactivate a group of skins though).
Both skins, A and B have to be loaded manually. The code doesn't have bangs for loading (activating) skins, they are supposed to be already loaded.
Or instead of the B skin I should say "all desired skins, belonging to group GAMES".
User avatar
Yincognito
Posts: 1077
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Communication between skins

Post by Yincognito »

balala wrote:
March 15th, 2020, 7:06 pm
Both skins, A and B have to be loaded manually. The code doesn't have bangs for loading (activating) skins, they are supposed to be already loaded.
Or instead of the B skin I should say "all desired skins, belonging to group GAMES".
Huh. I was under the impression that the "GAMES" skins would be loaded when hovering on A, but maybe I was wrong. If they are already loaded, then yeah, your solution should work. ;-)