It is currently December 12th, 2018, 4:07 am

RainRGB 4.0

Share your custom plugins and applications to enhance Rainmeter.
User avatar
jsmorley
Developer
Posts: 18476
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: RainRGB 4.0

jsmorley » September 24th, 2015, 2:57 pm

I have updated the RainRGB4.exe addon in the .rmskin in the first post of the thread.

Added the ability to tell the addon NOT to refresh any configs when the color is chosen:

From ReadMe.txt:
If the parameter is set to "-1", Example: "RefreshConfig=-1", then no configs will be refreshed. The variable will be written to the defined file, but you will have to have some other action to refresh the config to read the changed value.
This will allow you to have some "config" skin that allows setting multiple color variables, and then have some kind of "submit" button to refresh the desired / all configs instead of having them refresh on each color setting.

Be aware that the value is in fact "written" to the defined file on each call to RainRGB4.exe, so while you use this to defer any "refresh", that doesn't mean that you can allow the user to set some number of them and then say "never mind". That ability would require some extra coding on your part, and is not something the addon can help with.
User avatar
Kriust
Posts: 33
Joined: October 9th, 2014, 3:29 pm
Location: Europe

Re: RainRGB 4.0

Kriust » September 24th, 2015, 11:50 pm

I need help (I am a noob), I am trying to change multiple colors at once with an apply button but, I am having problems

(Someone is going to facepalm to my coding)

Code: Select all

[BoxColor]
Meter=Image
W=32
H=32
X=85
Y=165
SolidColor=#CPUColor#
Hidden=1
Group=Config
LeftMouseUpAction=["#@#Addons\RainRGB4.exe" "VarName=UniqueColor" "FileName=#@#Var.inc" "RefreshConfig=-1"]

[ApplyButton]
Meter=Image
W=66
H=22
X=30
Y=203
ImageName=#@#LouButton1.png
Hidden=1
ImageAlpha=200
Group=Config
leftmouseupaction=[!WriteKeyValue "Variables" "CPUColor" "#UniqueColor#" "#@#Variables.inc"][!WriteKeyValue "Variables" "CPUColorBg" "#UniqueColor#" "#@#Variables.inc"][!WriteKeyValue "Variables" "CPUColorTxt" "#UniqueColor#" "#@#Variables.inc"][!WriteKeyValue "Variables" "CPUColorTemp" "#UniqueColor#" "#@#Variables.inc"][!WriteKeyValue "Variables" "CPUColorNumb" "#UniqueColor#" "#@#Variables.inc"][!Refresh]
First Im telling to change the color value #UniqueColor# on "Var.inc", all the other colors are stored on another file "Variables.inc", so I made a long MouseAction that tells each part of the skin to change color to #UniqueSkin# and refresh, but works in a wierd way.

http://i.imgur.com/GDfK6x1.gifv (The problem)


Everytime I press the apply button first refresh the skin, and after changes the variables.
User avatar
jsmorley
Developer
Posts: 18476
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: RainRGB 4.0

jsmorley » September 24th, 2015, 11:59 pm

You have to understand that !WriteKeyValue writes to a file. That is all it does. It doesn't change the value of anything in memory, and any change won't be seen unless you refresh the skin that is reading the value that you are setting with !WriteKeyValue.

RainRGB gets the choice of color from the user, and uses !WriteKeyValue (more or less, it really doesn't, it just writes to the file directly, but the effect is the same) to change a Variable in a file to the newly selected color.

Normally what RainRGB does then is refresh the skin that is reading that value you just wrote to the file. If you set "RefreshConfig=-1", then no skins are refreshed, and nothing in Rainmeter has any idea that you changed anything at all. Again, no change made by "writing" to a file used by Rainmeter will be seen until you refresh the skin using it.

So while I don't exactly follow what you are doing, what you can never do is "write" a change to a variable in a file, and then "use" that new value somewhere in the skin without first refreshing the skin so it read the value.

I need the contents of all the files, the .ini and any .inc include files, to even begin to help any more than that.
User avatar
Kriust
Posts: 33
Joined: October 9th, 2014, 3:29 pm
Location: Europe

Re: RainRGB 4.0

Kriust » September 25th, 2015, 12:14 am

(Now this problem should go on another section)
I am trying to make the Apply button to write to a file and then refresh the skin.

CPU is the skin I use when I am chaning things, RAM and GPU are just modified copies.
Loutek_0.6.rmskin
You do not have the required permissions to view the files attached to this post.
User avatar
jsmorley
Developer
Posts: 18476
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: RainRGB 4.0

jsmorley » September 25th, 2015, 12:29 am

What I'm saying is that this:

Code: Select all

[BoxColor]
Meter=Image
W=32
H=32
X=85
Y=165
SolidColor=#CPUColor#
Hidden=1
Group=Config
LeftMouseUpAction=["#@#Addons\RainRGB4.exe" "VarName=UniqueColor" "FileName=#@#Var.inc" "RefreshConfig=-1"]

 [ApplyButton]
 Meter=Image
W=66
H=22
X=30
Y=203
ImageName=#@#LouButton1.png
Hidden=1
ImageAlpha=0
Group=Config
leftmouseupaction=[!WriteKeyValue "Variables" "CPUColor" "#UniqueColor#" "#@#Variables.inc"][!WriteKeyValue "Variables" "CPUColorBg" "#UniqueColor#" "#@#Variables.inc"][!WriteKeyValue "Variables" "CPUColorTxt" "#UniqueColor#" "#@#Variables.inc"][!WriteKeyValue "Variables" "CPUColorTemp" "#UniqueColor#" "#@#Variables.inc"][!WriteKeyValue "Variables" "CPUColorNumb" "#UniqueColor#" "#@#Variables.inc"][!Refresh]
Won't do what I think you expect it to do.

In [BoxColor] you have a mouse action that is letting the user select a color. It is "writing" the value of that color to the variable "UniqueColor" in the file "Var.inc".

So far so good. You now have that color value written to that variable in that file.

Then, without refreshing anything (RefreshConfig=-1) You are then trying to "use" that value in those !WriteKeyValue bangs in [ApplyButton]. You are writing the value of #UniqueColor# to the files and then refreshing the skin.

The problem of course is that #UniqueColor# has not changed. It was written to the Var.inc file by RainRGB, but it has not been read by the skin. So what is written to all those variables in "Variables.inc" is whatever the original value of #UniqueColor# was when the skin was last refreshed.

Do you see what I am getting at? You can't "write" a value to a file and then just expect to "use" it, without having Rainmeter "read" the file first. That will require a refresh after you set the color. You need to refresh before you try to "use" the new value in those !WriteKeyValue bangs.
User avatar
Kriust
Posts: 33
Joined: October 9th, 2014, 3:29 pm
Location: Europe

Re: RainRGB 4.0

Kriust » September 25th, 2015, 12:49 am

I see, that means if I want to change everything to #UniqueColor# i have to tell RainRGB to refresh Var.inc, and the apply button is going to change everything to #UniqueColor# and refresh the skin again?

Ok, is not working
User avatar
jsmorley
Developer
Posts: 18476
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: RainRGB 4.0

jsmorley » September 25th, 2015, 3:35 am

I'm not sure why you are going through all this, if the goal is to end up with a bunch of variables that have the same value. I'm not entirely sure why in that case you would use more than one variable at all, and even if you do, why not just have all the other color variables based on the #UniqueColor# variable?

[Variables]
UniqueColor=255,255,255,255
SecondColor=#UniqueColor#
ThirdColor=#UniqueColor#
ForthColor=#UniqueColor#

If you change UniqueColor with RainRGB and let it refresh the skin, all the variables will reflect the change.
User avatar
Kriust
Posts: 33
Joined: October 9th, 2014, 3:29 pm
Location: Europe

Re: RainRGB 4.0

Kriust » September 26th, 2015, 2:53 am

Better if I re-explain.

I want multiple option menus, the first one "Basic" changes the color of the whole skin, the second one "Advance" you can change each color individually, thats why i cant set every variables to #UniqueColor#.

Every color of the skin has is own variable on a file called Variable.inc, the #UniqueColor# color value is stored on a different file called Var.Inc.

Everytime i change #UniqueColor# the skin updates, but the Menu closes.

This is what I tried to do. I tell RainRGB to change #UniqueColor# and don't update with [RefreshConfig=-1], and works the skin is not updating, the menu not closing and UniqueColor on Var.inc is changing.
To change every variables on Variable.inc and update I made a separate MouseAction with all the !WriteKeyValue.... and a !Refresh at the end.
Here is the problem, the MouseAction updates the skin, that means rainmeter can read UniqueColor on Var.inc and changes the variables on Variables.inc, but at the end the skin doesnt change, I have to update a second time to make the Skin on my desktop change colors.

There is a way to change multiple valuables at once? maybe with RainRGB?

I am sorry if I am wasting your time and probably pretending something that is not possible.
User avatar
jsmorley
Developer
Posts: 18476
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: RainRGB 4.0

jsmorley » September 26th, 2015, 3:07 am

The direct answer to your question is "no". There is no way to have one execution of RainRGB4 set more than one variable. It's entire design is to set one variable in one file.

I'm not sure I entirely follow, but the only thing that comes to mind would be to use the RunCommand plugin to execute RainRGB4.exe, rather than just calling it directly with a LeftMouseUpAction or whatever. The advantage this might give in this case is that RunCommand can detect when RainRGB4.exe exits when done, and you can use a FinishAction on the RunCommand measure to take additional steps as needed after RainRGB4 is done. Maybe you can do an additional !Refresh on some particular skin or skins using that, after the user is finished with RainRGB4.
User avatar
jsmorley
Developer
Posts: 18476
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: RainRGB 4.0

jsmorley » September 26th, 2015, 3:21 am

Not sure this helps with your situation, but here at a high level is how you might use "FinishAction" with RainRGB4:

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1

[Variables]
CurrentColor=136,144,227,255

[MeasureRunRainRGB]
Measure=Plugin
Plugin=RunCommand
Program=""#@#Addons\RainRGB4.exe""
Parameter=""VarName=CurrentColor" "FileName=#CURRENTPATH##CURRENTFILE#" "RefreshConfig=-1""
FinishAction=[!Log "RainRGB4 is finished"][!Refresh "SomeOtherConfig"]

[MeterOne]
Meter=String
FontSize=17
FontColor=#CurrentColor#
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1
Text=Click me
LeftMouseUpAction=[!CommandMeasure MeasureRunRainRGB "Run"]
If you want to use this, be sure to get and install the example .rmskin in RunnCommadn Plugin so the RunCommand plugin is installed in your Rainmeter.