Hackit wrote: ↑
March 21st, 2020, 6:36 pm
ok thanks for the links.
because i'm trying to add this to the context menu and have the value stored in variables.
does this warning mean it wont work?
No. It will work. You are not using !SetOption
to modify the context menu, but the image meter
. The context menu is where you'll use !SetOption from
. Something like this, at the beggining of your skin:
Code: Select all
ContextTitle=Modify the image alpha
ContextAction=[!SetOption SomeImageMeter ImageAlpha 128][!UpdateMeter SomeImageMeter][!Redraw][!SetVariable SomeImageAlphaVariable 128]
As far as I know, variables in the context options are always dynamic, so you shouldn't have any paticular issues doing something along the lines of the above. I'm not sure what you mean by having the value stored in variables though:
- if SomeImageAlphaVariable already exists in [Variables], then it will get the value of 128 in the code above
- if you want that variable to be "persistent" (e.g. remain in the [Variables]
section after, say, skin unloading or such), then you'd need to take a look at the !WriteKeyValue
bang (it's just a !SetOption that writes on the disk instead of in the memory, basically), that writes a Key=Value
piece in an .ini or .inc file (that's going to be a little problematic though, as using the value you just written - in this case the image alpha variable - requires that you !Refresh
Sorry if there are too many links. Just take things easy, one at a time, and you'll eventually get things right. If you still don't after trying, there is always the forum where you can ask for further "guidance".
EDIT: If you want the value to remain in the [Variables] section even after unloading the skin, and you want to avoid refreshing the skin (and losing other values from the memory in the process), there is a "workaround": just use !SetVariable like above to assign the value to the variable in the memory, and then, when the skin or Rainmeter close, use this in the [Rainmeter] section of your skin:
Code: Select all
OnCloseAction=[!WriteKeyValue Variables SomeImageAlphaVariable 128]
Since the skin (or Rainmeter) will unload/close after the action above, you won't need to use the variable in the "current session" or refresh the skin anymore, but it will be there with the value you want on subsequent skin load or Rainmeter start.