It is currently October 18th, 2024, 3:42 am

Syncing skins using a common ini file?

Get help with creating, editing & fixing problems with skins
An_Hell
Posts: 12
Joined: July 16th, 2012, 11:27 pm

Syncing skins using a common ini file?

Post by An_Hell »

Hello, I have a couple of skins in this suite I'm making, and one of the gimmicks is switching information due to space, for example: In my network skin I have a graph showing the download and after 3 seconds it shows the upload, hiding the download one, and so on. The issue is when loading all the skins they load at different pace and end up not in sync when switching the information.

They all have the switching "contraption" in each skin, this thing right here:
(This might not be (probably isn't) the best way, but it is doing the job)

Code: Select all

[ColumnShow]
Measure=Calc
Formula=(ColumnShow+1)%2
UpdateDivider=3
IfCondition=(ColumnShow = 0)
IfTrueAction=[!EnableMeasureGroup "Info"][!UpdateMeterGroup "Info"][!ShowMeterGroup "Info"][!RedrawGroup "Info"][!DisableMeasureGroup "Cast"][!HideMeterGroup "Cast"][!RedrawGroup "Cast"]
IfFalseAction=[!EnableMeasureGroup "Cast"][!UpdateMeterGroup "Cast"][!ShowMeterGroup "Cast"][!RedrawGroup "Cast"][!DisableMeasureGroup "Info"][!HideMeterGroup "Info"][!RedrawGroup "Info"]
Disabled=0
So I got thinking if it was possible to have some part of it in a common file from where the skins would read when they should switch, maybe one of the skins could keep writing like a metronome and the other skins would read from it and switch at the same time?

Or instead of that, if it was possible to add a startup time before the first update, a delay of sorts, like: the skins are loaded and they all get ready at different times, 10 seconds delay for them to get ready, skins start updating, that might work also.
User avatar
sl23
Posts: 1835
Joined: February 17th, 2011, 7:45 pm
Location: a Galaxy S7 far far away

Re: Syncing skins using a common ini file?

Post by sl23 »

So I got thinking if it was possible to have some part of it in a common file from where the skins would read when they should switch,
You can create a file, name it anything, eg syncfile.inc then copy that code to it and save.

Then, in the skins ini file, add the line:
@include=syncfile.inc

See here.

Add this to each skin you want to use it with.
Hope that helps. :)
Last edited by sl23 on July 18th, 2024, 12:06 pm, edited 2 times in total.
57686174 77696C6C 6265 77696C6C 6265
User avatar
balala
Rainmeter Sage
Posts: 16669
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Syncing skins using a common ini file?

Post by balala »

An_Hell wrote: July 17th, 2024, 7:24 pm Hello, I have a couple of skins in this suite I'm making, and one of the gimmicks is switching information due to space, for example: In my network skin I have a graph showing the download and after 3 seconds it shows the upload, hiding the download one, and so on. The issue is when loading all the skins they load at different pace and end up not in sync when switching the information.

They all have the switching "contraption" in each skin, this thing right here:
Move the [ColumnShow] measure into a .inc file and include this file into the @Resources folder of your config (let's name this file ColumnShow.inc - finally doesn't really matter how do you name it, just make sure it is a .inc, not a .ini file). Add this file to each skin you want to use it in, by adding a @Include=#@#ColumnShow.inc option to the end of the [Variables] section of each such .ini file (use the proper file name, as you named the file).
By this you ensure to have one single [ColumnShow] measure, returning the same value for each skin, and executing the appropriate operations at the same time.
User avatar
Yincognito
Rainmeter Sage
Posts: 8485
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Syncing skins using a common ini file?

Post by Yincognito »

In addition to the advice from sl23 and balala, all that assumes that you already grouped your relevant measures / meters in those skins into 'Info' and 'Cast' groups.

Also, since the measure would be @included in all those skins, redrawing the similar skin groups would happen multiple times, i.e. from each and every skin, which, although it would guarantee same time redrawing of the skins in the group, could be a performance concern. If so, you might want to replace the [!RedrawGroup ...] parts with simple [!Redraw] bangs, to redraw each skin in those groups only once.

That being said, besides !RedrawGroup, the above will NOT redraw the skins (or even do the rest in those skins) at the exact same time anyway. So, if you're bothered by the few ms difference in that regard, having this measure in a single, 'central' skin that's always loaded with the others and using the Config (or even * for all loaded skins) parameter in those bangs to control stuff in the other skins would be an alternative, see the Note in the 2nd paragraph here:
https://docs.rainmeter.net/manual/bangs/
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth