arcanosa84 wrote: ↑September 27th, 2023, 12:21 am
My friend, I think that is not the case, at least from my point of view, I will explain how I have done it and tell me if there is any error.
First in the LeftMouseDownAction options of the [SelectPlanetTierra], [SelectPlanetLuna] (and so on) meters, you have bangs only to write the appropriate values to the [Variables] section of the
@Resources\Config\Variables.inc file. A skin never can use a just-written value of a variable unless you're refreshing the skin, or (and usually this is a much better approach) besides the !WriteKeyValue bang you add a !SetVariable bang as well. This way you do two things: you write the value to the appropriate file, to can reuse it in case of a refresh and you get the same value dynamically, for immediate use in the skin.
So, for instance, add the following, red-marked bangs to the LeftMouseDownAction option of the [SelectPlanetLuna] meter:
LeftMouseDownAction = [!DisableMeasureGroup Planet][!WriteKeyValue Variables PlanetSelect Luna "#@#\Config\Variables.inc"][!SetVariable PlanetSelect "Luna"][!SetVariable Planet "[#PlanetSelect]"][!SetVariable Size "[#Size[#Planet]]"][!SetVariable Speed "[#Speed[#Planet]]"][!SetVariable Angle "[#InclinationAngle[#Planet]]"][!UpdateMeasureGroup Planet][!EnableMeasureGroup Planet][!ShowMeterGroup Planet].
Note that besides setting the new value for the PlanetSelect variable, I updated with additional !SetVariable bangs the values of the Planet, Size, Speed and Angle variables as well. We have to do this because otherwise you don't get updated the appropriate values of these variables.
Didn't check, but you have to check, to have a
DynamicVariables=1 option in every measure and meter, in which you want to use the values of the set variables (Planet, Size, Speed and Angle).
With this addition you still won't see an update of the variables when you click another planet, but this is happening only because the values of the #SizeLuna# and #SizeSol#, #SpeedLuna# and #SpeedSol# (and so on) variables are coinciding, in the
@Resources\Config\Variables.inc file. If you set different values for these variables, you'll get the values updated, by adding the above bangs. Obviously I described here what you have to add only to the LeftMouseDownAction option of the [SelectPlanetLuna] meter. You have to add similar bangs to all LeftMouseDownAction options of all similar meters ([SelectPlanetTierra], [SelectPlanetVenus], [SelectPlanetMercurio] and so on).
Additional notes (recommend to take this into account):
- Make sure (absolutely sure) you've added the DynamicVariables=1 option to all meters and measure in which you are using the variables, as described above. On meters and measure on which this option is missing, you don't get updated the variable(s).
- Recommend not to use the LeftMouseDownAction option, unless it has to be used (use it only when you have both, a LeftMouseDownAction and a LeftMouseUpAction options on a meter). Use instead LeftMouseUpAction. You find out why in the Note here.
- The #@# variable contains the backslash, no need to manually add one more. For instance this character is not needed right after the #@# variable, in the ImageName option of the [SelectPlanetMercurio] meter. There the ImageName you've used is this: ImageName = #@#\Images\Mercurio\Mercurio\Mercurio0.png (obviously once again this is just an example, you have such characters in all places where you did use the #@# variable). This option should look this way: ImageName=#@#Images\Mercurio\Mercurio\Mercurio0.png. Finally this is not a mistake, because Rainmeter simply ignores the not-needed characters (you can add even more than one single), however, strictly speaking, it is not needed. You can find out why, in the PS of this post.
Please let me know if the above things helped.