It is currently April 30th, 2024, 11:18 am

Loading a Skin from a Skin

Get help with creating, editing & fixing problems with skins
User avatar
CyberTheWorm
Posts: 860
Joined: August 22nd, 2016, 11:32 pm
Location: Surrey, B.C., Canada

Loading a Skin from a Skin

Post by CyberTheWorm »

Got stuck with this one.

I creating several skins that I don't want to put into 1 skin as it will be very long.

So what I'm trying to do is load a skin by clicking on an image. (know how to do this)

That skin will do nothing except load other skins on start and close other skins on exit.

Can this be done?
Last edited by CyberTheWorm on March 29th, 2017, 11:46 pm, edited 1 time in total.
The only source of knowledge is experience. Albert Einstein
Deviant Art Page
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Loading a Skin from a Skin

Post by jsmorley »

CyberTheWorm wrote:Got stuck with this one.

I creating several skins that I don't want to put into 1 skin as it will be very long.

So what I'm trying to do is load a skin by clicking on an image. (know how to do this)

That skin will do nothing except load other skins on start and close other skins on exit.

Can this be done?
I would just put everything into OnRefreshAction and OnCloseAction in the skin.
User avatar
CyberTheWorm
Posts: 860
Joined: August 22nd, 2016, 11:32 pm
Location: Surrey, B.C., Canada

Re: Loading a Skin from a Skin

Post by CyberTheWorm »

jsmorley wrote:I would just put everything into OnRefreshAction and OnCloseAction in the skin.
Perfect, works like a charm :thumbup:
The only source of knowledge is experience. Albert Einstein
Deviant Art Page
User avatar
Mordasius
Posts: 1173
Joined: January 22nd, 2011, 4:23 pm
Location: GMT +8

Re: Loading a Skin from a Skin

Post by Mordasius »

CyberTheWorm wrote:Perfect, works like a charm :thumbup:
I've probably been away from the forum so long that I've lost track of what is possible with Rainmeter these days so come on Guys, help those of us who are more familiar with !ActivateConfig and !DeactivateConfig to use OnRefreshAction and OnCloseAction.

For example, how do we use OnRefreshAction and OnCloseAction to replicate or improve upon:

LeftMouseUpAction=[!ActivateConfig "#ROOTCONFIG#\MySkins" "SkinToShow.ini"] [!DeactivateConfig "#ROOTCONFIG#\MySkins" "SkinToHide.ini"]
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Loading a Skin from a Skin

Post by jsmorley »

Mordasius wrote:I've probably been away from the forum so long that I've lost track of what is possible with Rainmeter these days so come on Guys, help those of us who are more familiar with !ActivateConfig and !DeactivateConfig to use OnRefreshAction and OnCloseAction.

For example, how do we use OnRefreshAction and OnCloseAction to replicate or improve upon:

LeftMouseUpAction=[!ActivateConfig "#ROOTCONFIG#\MySkins" "SkinToShow.ini"] [!DeactivateConfig "#ROOTCONFIG#\MySkins" "SkinToHide.ini"]
The problem with that is that !DeactivateConfig doesn't require, and won't use, a skin .ini name. It simply closes whatever skin variant is currently "active" in the named config. So in your example, you are opening SkinToShow.ini in the config MySkins, and then instantly closing it.

The example we are talking about is only easy to get right if you put all the "open" commands in OnRefreshAction, and all the "close" commands in OnCloseAction.

OnRefreshAction=[!ActivateConfig "MySkins" "SkinToShow.ini"]
OnCloseAction=[!DeactivateConfig "MySkins"]

Make no mistake, I'm not a huge fan of "parent" skins that control other skins. That must be very carefully done in my view, or you open yourself up to problems if the "parent" is not running for some reason. It can be done, but I'd probably go to some lengths to avoid that kind of design. If the user closes the parent, which closes all the children, and then exits Rainmeter, what do they have when they start Rainmeter again? In my view, the best use of !ActivateConfig is for something like a "settings" skin, that you want to open when some meter is clicked on. Trying to somehow replicate Layouts using !ActivateConfig and !DeactivateConfig would take some careful thought.
User avatar
CyberTheWorm
Posts: 860
Joined: August 22nd, 2016, 11:32 pm
Location: Surrey, B.C., Canada

Re: Loading a Skin from a Skin

Post by CyberTheWorm »

jsmorley wrote:
The example we are talking about is only easy to get right if you put all the "open" commands in OnRefreshAction, and all the "close" commands in OnCloseAction.

OnRefreshAction=[!ActivateConfig "MySkins" "SkinToShow.ini"]
OnCloseAction=[!DeactivateConfig "MySkins"]
I did not put the skin ini file in that command and it still worked.

Code: Select all

OnRefreshAction=[!ActivateConfig "SystemInfo\Sensors\CPU"][!ActivateConfig "SystemInfo\Sensors\MB"]
OnCloseAction=[!DeactivateConfig "SystemInfo\Sensors\CPU"][!DeactivateConfig "SystemInfo\Sensors\MB"]
Is there a reason for having in there?
The only source of knowledge is experience. Albert Einstein
Deviant Art Page
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Loading a Skin from a Skin

Post by jsmorley »

CyberTheWorm wrote:I did not put the skin ini file in that command and it still worked.

Code: Select all

OnRefreshAction=[!ActivateConfig "SystemInfo\Sensors\CPU"][!ActivateConfig "SystemInfo\Sensors\MB"]
OnCloseAction=[!DeactivateConfig "SystemInfo\Sensors\CPU"][!DeactivateConfig "SystemInfo\Sensors\MB"]
Is there a reason for having in there?
https://docs.rainmeter.net/manual-beta/bangs/#ActivateConfig