I ask this because I had already had !SetVariables in my skin that worked just fine and needed to be able to have settings saved when the skin was reset or turned off and then on again, so this brought me to !WriteKeyValue Variables.
So because I was learning as I went along I proceeded to set a !WriteKeyValue after all of my !SetVariable codes. This worked very well. Then as I proceeded to read the forums and Manual, I saw I had messed up and hadn't included a !Refresh to make it all work...
Well that's when it all stopped working! Actually it still worked just badly. very jumpy and slow to respond to the changes because the entire skin has to be refreshed for the change to happen rather then just the variable and the codes tied to it.
well nothing makes sense without examples so here goes. this is just a simple "Light Switch" On/Off code:
Code: Select all
[Rainmeter]
Update=1000
DynamicWindowSize=1
[Variables]
@Include=#@#Variables.inc
Settings=#@#Variables.inc
;-------------------Switches on and off------------------
[Switch]
Meter=Image
ImageName=#@#Images\switch#Num1#.png
LeftMouseUpAction=!Execute [!WriteKeyValue Variables Num1 (1-#Num1#) "#Settings#"][!WriteKeyValue Variables Core (1-#Core#) "#Settings#"][!Refresh #CURRENTCONFIG#]
DynamicVariables=1
X=0
Y=0
W=28
H=51
UpdateDivider=3600
Code: Select all
[Rainmeter]
Update=1000
DynamicWindowSize=1
[Variables]
@Include=#@#Variables.inc
Settings=#@#Variables.inc
;-------------------Switches on and off------------------
[Switch]
Meter=Image
ImageName=#@#Images\switch#Num1#.png
LeftMouseUpAction=!Execute [!SetVariable Num1 (1-#Num1#)][!WriteKeyValue Variables Num1 (1-#Num1#) "#Settings#"][!SetVariable Core (1-#Core#)][!WriteKeyValue Variables Core (1-#Core#) "#Settings#"][!UpdateMeter "Switch"]
DynamicVariables=1
X=0
Y=0
W=28
H=51
UpdateDivider=3600
Is there something here that I'm not understanding? Just because it seems to me that this is working doesn't mean I'm not seeing a possible problem down the road. Any input would be appreciated. Am I setting myself up for a problem later in my coding, or have I stumbled on a better way to have the Variable change to take effect in the skin?