It is currently April 18th, 2024, 2:31 am

RainRGB4.exe help and questions

Get help with creating, editing & fixing problems with skins
User avatar
Yincognito
Rainmeter Sage
Posts: 7120
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: RainRGB4.exe help and questions

Post by Yincognito »

Hackit wrote: March 21st, 2020, 9:45 pm i love the links, it points me in the right direction with out wondering if the info i'm reading is correct for what i'm trying to do.
Haha, well ... I love the feeling of being certain about something as well. ;-)
That being said, I've seen much more complicated manuals than the Rainmeter one. It's actually pretty easy to navigate it, once you know what the main elements of a skin do (e.g. measures measure things, meters show things, actions can be "attached" to both, bangs run things more or less "on demand", variables store values, and plugins ... well, you go there when the answer you're looking for isn't found in the other places I mentioned).
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
Hackit
Posts: 85
Joined: May 19th, 2010, 9:05 pm
Location: North of the Border

Re: RainRGB4.exe help and questions

Post by Hackit »

so i just came back had to get diner for the kids. i jumped the gun. it works but the oncloseaction is not saving it. so the alpha changes but on a manual refresh the image goes back to normal.

Code: Select all

ContextTitle2=Set Transparency 125
ContextAction2=[!SetOption MeterCurrentIcon ImageAlpha 125][!UpdateMeter MeterCurrentIcon][!Redraw][!SetVariable MeterCurrentIconAlphaVariable 125]
OnCloseAction2=[!WriteKeyValue Variables MeterCurrentIconAlphaVariable 125 "FileName=#@#WeatherComVariables.inc"]
ContextTitle3=Set Transparency 175
ContextAction3=[!SetOption MeterCurrentIcon ImageAlpha 175][!UpdateMeter MeterCurrentIcon][!Redraw][!SetVariable MeterCurrentIconAlphaVariable 175]
OnCloseAction3=[!WriteKeyValue Variables MeterCurrentIconAlphaVariable 175 "FileName=#@#WeatherComVariables.inc"]
“Whether you think you can, or you think you can't – you're right”

DeviantArt Profile
User avatar
Hackit
Posts: 85
Joined: May 19th, 2010, 9:05 pm
Location: North of the Border

Re: RainRGB4.exe help and questions

Post by Hackit »

ok so i'm getting somewhere but still it's not working. i can change the transparency ok, still if i refresh i loose the transparency. i did notice when i unload the skin the transparency value is then updated in WeatherComVaribles. but the transparency is not on the weather image, so it's like the WeatherComVaribles value that changes is not tied to the image.
does this make sense?
ini file

Code: Select all

ContextTitle2=Set Transparency 125
ContextAction2=[!SetOption MeterCurrentIcon ImageAlpha 125][!UpdateMeter MeterCurrentIcon][!Redraw][!SetVariable MeterCurrentIcon ImageAlpha Variable 125]
OnCloseAction=[!WriteKeyValue Variables ImageAlpha "125" "#@#WeatherComVariables.inc"]


weatherComVaribles file, image alpha is what changes after i unload the image.

Code: Select all

[Variables]

; Getting and setting your LocationCode can be done one of several ways.
; 
; Go to https://weather.com/
; Search for your city by name.
; Use the long number at the end of the resulting URL, for example:
; https://weather.com/weather/today/l/1665d9e3052c3448be48dafc1587318a27ee85516e97e0b5376043cd41a4f0e8
; The LocationCode would be 1665d9e3052c3448be48dafc1587318a27ee85516e97e0b5376043cd41a4f0e8
; Copy and enter that as the value for LocationCode below.
; LocationCode=1665d9e3052c3448be48dafc1587318a27ee85516e97e0b5376043cd41a4f0e8
;
; You can also use the location code used in earlier skins using wxdata as the source.
; LocationCode=USVA0944
;
; Alternatively, in the USA, you can simply use your ZipCode as the LocationCode.
; LocationCode=22308

LocationCode=USVA0944
ImageAlpha=125
; If another language or unit(s) of measures are desired, simply go to https://weather.com/
; Using the controls at the top of the page, set your country and units of measure as desired.
; Copy and enter the Language from the resulting URL.

; For example, French would be Language=fr-FR
; The unit(s) of measure are automatic, based on the language.
; For instance, you cannot have the language be French, but the units be F imperial.

; Note however, that simply changing from imperial F to metric C units of measure while keeping the 
; langage as English can be done by using en-GB as the Language.
 
Language=en-US

; How often to update the weather information. Default is 600 or 10 minutes.

UpdateRate=600

; Don't change these.

LanguagePath=/#Language#
URLcurrent=https://weather.com/#Language#/weather/today/l/#LocationCode#
URLforecast=https://weather.com/#Language#/weather/tenday/l/#LocationCode#
URLhourly=https://weather.com/#Language#/weather/hourbyhour/l/#LocationCode#
ImageAlpha=*
“Whether you think you can, or you think you can't – you're right”

DeviantArt Profile
User avatar
Hackit
Posts: 85
Joined: May 19th, 2010, 9:05 pm
Location: North of the Border

Re: RainRGB4.exe help and questions

Post by Hackit »

ok i think i figured it out. its not writing the new value in WeatherComVaribles.inc (couldnt figure it out) but i'm changing the value in the ini file. is this ok?
also would i need to copy all 3 lines of code to make 4 transparency options?

Code: Select all

ContextTitle2=Set Transparency 125
ContextAction2=[!SetOption MeterCurrentIcon ImageAlpha 125][!UpdateMeter MeterCurrentIcon][!Redraw][!SetVariable MeterCurrentIcon ImageAlpha Variable 125]
OnCloseAction=[!WriteKeyValue MeterCurrentIcon ImageAlpha "125"][!Refresh]
line that changes

Code: Select all

[MeterCurrentIcon]
Meter=Image
Group=AllMeters
MeasureName=@CurrentIcon
ImagePath=#@#TWCIcons\
ImageAlpha=125 ***
X=320
Y=-14
Hidden=1
“Whether you think you can, or you think you can't – you're right”

DeviantArt Profile
User avatar
Yincognito
Rainmeter Sage
Posts: 7120
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: RainRGB4.exe help and questions

Post by Yincognito »

Hackit wrote: March 21st, 2020, 9:56 pm so i just came back had to get diner for the kids. i jumped the gun. it works but the oncloseaction is not saving it. so the alpha changes but on a manual refresh the image goes back to normal.

Code: Select all

ContextTitle2=Set Transparency 125
ContextAction2=[!SetOption MeterCurrentIcon ImageAlpha 125][!UpdateMeter MeterCurrentIcon][!Redraw][!SetVariable MeterCurrentIconAlphaVariable 125]
OnCloseAction2=[!WriteKeyValue Variables MeterCurrentIconAlphaVariable 125 "FileName=#@#WeatherComVariables.inc"]
ContextTitle3=Set Transparency 175
ContextAction3=[!SetOption MeterCurrentIcon ImageAlpha 175][!UpdateMeter MeterCurrentIcon][!Redraw][!SetVariable MeterCurrentIconAlphaVariable 175]
OnCloseAction3=[!WriteKeyValue Variables MeterCurrentIconAlphaVariable 175 "FileName=#@#WeatherComVariables.inc"]
Ok, so first, some "rules":
- OnCloseAction isn't in the form of OnCloseActionN, meaning there is only one OnCloseAction you can have, not OnCloseAction2, OnCloseAction3, etc.
- I don't know if it's a typo or something else, but

Code: Select all

[!WriteKeyValue Variables MeterCurrentIconAlphaVariable 175 "FileName=#@#WeatherComVariables.inc"]
isn't correct - it should simply be

Code: Select all

[!WriteKeyValue Variables MeterCurrentIconAlphaVariable 175 "#@#WeatherComVariables.inc"]
(without the FileName= stuff)

That being said, when I advised you to do the OnCloseAction thing, I forgot that the [Rainmeter] section doesn't support dynamic variables (i.e. variables that change during a skin "session"), meaning that you can't do what you want from there. Sorry for misleading you, I was thinking at a single (static) value you'd write from there at the time, not a dynamic value.

But, there is a solution, of course - use what you wanted from the start, aka the InputText plugin:

Code: Select all

[Variables]
@Include1=#@#WeatherComVariables.inc

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1
BackgroundMode=2
SolidColor=47,47,47,255

---Measures---

[MeasureInputText]
Measure=Plugin
Plugin=InputText
X=0
Y=35
W=134
H=44
FontFace=Consolas
FontColor=255,255,255,255
SolidColor=47,47,247,255
Padding=5,5,5,5
FontSize=16
AntiAlias=1
ClipString=2
StringAlign=Center
DefaultValue="#MeterCurrentIconAlphaVariable#"
Command1=[!SetOption MeterCurrentIcon ImageAlpha "$UserInput$"][!UpdateMeter MeterCurrentIcon][!Redraw][!SetVariable MeterCurrentIconAlphaVariable [MeasureInputText]][!WriteKeyValue Variables MeterCurrentIconAlphaVariable [MeasureInputText] "#@#WeatherComVariables.inc"]
DynamicVariables=1

---Meters---

[MeterCurrentIcon]
Meter=Image
ImageName="#@#Battery.ico"
ImageAlpha=#MeterCurrentIconAlphaVariable#
X=0
Y=0
DynamicVariables=1

[MeterTest]
Meter=STRING
X=0R
Y=0r
FontFace=Consolas
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
FontSize=16
AntiAlias=1
Text="Test = #MeterCurrentIconAlphaVariable#"
DynamicVariables=1

[MeterInputText]
Meter=STRING
X=65
Y=35
W=130
H=35
FontFace=Consolas
FontColor=255,255,255,255
SolidColor=47,247,47,255
Padding=5,5,5,5
FontSize=16
AntiAlias=1
ClipString=2
StringAlign=Center
BevelType=2
Text="#MeterCurrentIconAlphaVariable#"
LeftMouseUpAction=[!CommandMeasure MeasureInputText "ExecuteBatch 1"]
DynamicVariables=1
Now, first, I suppose the WeatherComVariables.inc is already included in your skin - the @Include I have above might be different from yours (since I worked in a simplified test environment), so adapt it to match yours. Secondly, the rest of the things in the [Rainmeter] section are also specific to this simplified skin, so they might not be necessary in yours.

Naturally, the ImageName above and the position/dimensions/design of the [MeasureInputText] and [MeterInputText] are subject to modification to suit your needs (or to test how this sample works), but you should be aware that the latter two should be for the most part "synchronized", since the InputText plugin based on drawing an "interactive measure" ([MeasureInputText] in this case) over a static meter ([MeterInputText] in this case) to simulate the behavior of a "text box".

Hopefully, you'll understand how to integrate the above in your skin. It does what's expected to do:
- it draws a "text box" where you can input your desired value for the image alpha
- when you press Enter in the text box, the value is assigned to the variable and also written in the .inc
- when you load or refresh the skin, the value of the variable is taken from the (previously modified or not) .inc, without the need of a refresh to mess things up
- obviously, the value of the variable you set in the text box (or that you loaded from the .inc through the @Include) will stay in memory as long as the skin is active. When the skin is refreshed or unloaded then loaded again, the value is taken back from the .inc
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
Yincognito
Rainmeter Sage
Posts: 7120
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: RainRGB4.exe help and questions

Post by Yincognito »

Hackit wrote: March 22nd, 2020, 12:11 am

Code: Select all

ContextTitle2=Set Transparency 125
ContextAction2=[!SetOption MeterCurrentIcon ImageAlpha 125][!UpdateMeter MeterCurrentIcon][!Redraw][!SetVariable MeterCurrentIcon ImageAlpha Variable 125]
OnCloseAction=[!WriteKeyValue MeterCurrentIcon ImageAlpha "125"][!Refresh]
A refresh in an OnCloseAction doesn't make much sense. The skin will be unloaded, so reloading it again before closing isn't going to accomplish much. The whole point of me mentioning OnCloseAction was to avoid Refresh, since it will mess up other values the skin has in memory for the "current session". Bottom line, while it's very simple to write to a file connected to a skin and then refresh everything, this is going to cause additional issues, as things will start over from the beginning again (parsing the site, loading the measures, drawing the meters, etc).

I think the InputText code I wrote above is the best solution - and it's also looking more "user friendly", once you get the dimension/position/design for the measure and the meter properly.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
Hackit
Posts: 85
Joined: May 19th, 2010, 9:05 pm
Location: North of the Border

Re: RainRGB4.exe help and questions

Post by Hackit »

thanks for all your help, think i've had enough for tonight.
i'll come back to this next time i have time.
tnx
“Whether you think you can, or you think you can't – you're right”

DeviantArt Profile
User avatar
Yincognito
Rainmeter Sage
Posts: 7120
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: RainRGB4.exe help and questions

Post by Yincognito »

Hackit wrote: March 22nd, 2020, 12:45 am thanks for all your help, think i've had enough for tonight.
i'll come back to this next time i have time.
tnx
Ok then.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
Hackit
Posts: 85
Joined: May 19th, 2010, 9:05 pm
Location: North of the Border

Re: RainRGB4.exe help and questions

Post by Hackit »

Yincognito wrote: March 17th, 2020, 1:51 pm
For example, for a skin width increased by 200 pixels (not a dynamic width, just a larger one), the meter options that had to be modified were:
- X=(795*0.50)r in [MeterDate]
- X=(125*0.50) and StringAlign=left in [MeterTodayHighLow]
- X=(460*0.50) in [MeterDay3Icon]
- X=(780*0.50) in [MeterDay4Icon]
- W=(800*0.50) in [MeterLine1]
- W=(800*0.50) in [MeterSeconds]
what does the *0.50 do/mean?
trying to add more meters and now using just left and right align does not do the job.
“Whether you think you can, or you think you can't – you're right”

DeviantArt Profile
User avatar
Yincognito
Rainmeter Sage
Posts: 7120
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: RainRGB4.exe help and questions

Post by Yincognito »

Hackit wrote: March 23rd, 2020, 11:10 am what does the *0.50 do/mean?
trying to add more meters and now using just left and right align does not do the job.
I don't know what does *0.50 mean - maybe it's some early zoom attempt? I found them like that all over the code you posted, so I left them untouched.

So what doesn't do the job? Left align or right align? Or both? Bear in mind that my reply you mentioned was for an earlier version of your code, the changes you made since then have to be taken into account.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth