ms310 wrote: ↑June 11th, 2019, 4:34 am
Your skins are brilliant as always. Could you please explain a couple of things for me?
1. #CurrentSection# - this seems like a magic variable to me - where is it "set" and how does it drive the icon selection?
All the ms-Weather icon meters have a number for their section name; that number corresponds to the condition they represent. In my sample skin code for [measureW9], it will return a number for the current condition. I could have used that actual section name in the bang to show the icon, since it will never change, but I chose to use [#CurrentSection#] (this is the same as if I used [measureW9]). Then I hide all of the ms-weather icons by hiding the group "MSWeather", and show the meter that has the number returned by the measure.
#CurrentSection# is a very useful built-in variable in Rainmeter. It always references the section it is located in, but it's true usefulness is when it is used in a meter style, then it will reference the section that includes that style.
Here is a sample style that can be added to any meter and it will change the corresponding meter text to BOLD style when the the mouse hovers it and back to NORMAL when the mouse leaves; this same style can be added to multiple meters and each will translate #CurrentSection# to the name of the section it is in.
Code: Select all
[StringStyle]
MouseOverAction=[!SetOption #CURRENTSECTION# StringStyle Bold][!UpdateMeter #CURRENTSECTION#][!Redraw]
MouseLeaveAction=[!SetOption #CURRENTSECTION# StringStyle Normal[!UpdateMeter #CURRENTSECTION#][!Redraw]
[MeterString1]
Meter=String
MeterStyle=StringStyle
StringStyle=Normal
Text=Number 1
[MeterString2]
Meter=String
MeterStyle=StringStyle
StringStyle=Normal
Text=Number 2
ms310 wrote: ↑June 11th, 2019, 4:34 am2. @includeicons - this also seems like voodoo for me - how is the icon styled and placed (x,y)?
I realize these are basic questions - thank you for any explanation you are willing to provide. The method you described has me interested. Do you think you will update your other weather skins (I am thinking about the Win10 themed plugin you do) with this method or do you see this more as a proof of concept rather than a general shift in best practice?
@include... is used to add a separate file with code. It is generally used to include common items that can be used in multiple skins (Variables, styles, etc.). I used it to add the 47+ icon meters to the simple weather skin; without having to copy and paste them into the actual skin. The @include does not position the icons, it simply adds those meters to the skin. The positioning would have to be done in the included file if it is not 0,0.
These shape meters were provided as an alternative to icon images. They should scale to any size desired without distortion. I may use these in future weather skins, but don't plan on modifying any older ones at this time.
Thanks!
E.T.