It is currently March 29th, 2024, 1:15 pm

Animated GIF issue

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

Re: Animated GIF issue

Post by Yincognito »

JamX wrote: June 24th, 2020, 2:58 pm BTW, is there a possibility to add a custon menu when right click on the skin where 2 or more locations are listed which you can select.
After the selection the latitude and longitude should be used for the weather_twc skin

I think you can use something like:

Code: Select all

ContextTitle="--Locations--"
ContextAction=[]
ContextTitle2="Landgraaf"
ContextAction2=[!Setvariable Latitude 50.8871][!Setvariable Longitude 6.0116]
ContextTitle3="Brouwersdam"
ContextAction3=[!Setvariable Latitude 51.7563][!Setvariable Longitude 3.8402]
Is this the way to accomplish this?
And what do I miss?

I see the variables Latitude and Longitude change when I select one or the other.
The variable URLSite does not change it's sting to the new Latitude and Longitude set variables

The I used this:

Code: Select all

ContextTitle="--Locations--"
ContextAction=[]
ContextTitle2="Landgraaf"
ContextAction2=[!Setvariable Latitude 50.8871][!Setvariable Longitude 6.0116][!Setvariable URLSite "https://weather.com/#Language#/weather/today/l/#Latitude#,#Longitude#"][!UpdateMeasure @EntireSiteSuperParent][!Redraw]
ContextTitle3="Brouwersdam"
ContextAction3=[!Setvariable Latitude 51.7563][!Setvariable Longitude 3.8402][!Setvariable URLSite "https://weather.com/#Language#/weather/today/l/#Latitude#,#Longitude#"][!UpdateMeasure @EntireSiteSuperParent][!Redraw]
But still the variable URLSite does not change
WebParser measures need to be "commanded" to update (which unfortunately means polling the site again in some cases) in order to use dynamic variables in their options, like mentioned here. In the case you are talking about it's not a big issue, however, since I suppose you don't change the latitude and longitude every second. So, in order to do what you want, you'd have to probably use something like [!CommandMeasure @EntireSiteSuperParent "Update"] instead of [!UpdateMeasure @EntireSiteSuperParent] after setting the latitude and longitude variables to the new values.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
JamX
Posts: 207
Joined: October 4th, 2019, 2:46 pm

Re: Animated GIF issue

Post by JamX »

Do you also have an idea why the variable :

URLSite = "https://weather.com/#Language#/weather/today/l/#Latitude#,#Longitude#"

is not updated while the Latitude and Longitude variables are updated?

This does not work:
ContextAction2=[!Setvariable Latitude 50.8871][!Setvariable Longitude 6.0116][!Setvariable URLSite "https://weather.com/#Language#/weather/today/l/#Latitude#,#Longitude#"][!Commandmeasure @EntireSiteSuperParent "Update"]

This does work:
ContextAction2=[!Setvariable URLSite "https://weather.com/#Language#/weather/today/l/50.8871,6.0116"][!Commandmeasure @EntireSiteSuperParent "Update"]
User avatar
Yincognito
Rainmeter Sage
Posts: 7029
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Animated GIF issue

Post by Yincognito »

JamX wrote: June 24th, 2020, 5:20 pm Do you also have an idea why the variable :

URLSite = "https://weather.com/#Language#/weather/today/l/#Latitude#,#Longitude#"

is not updated while the Latitude and Longitude variables are updated?
That's a quirk in how Rainmeter operates (probably logical from a programing point of view, but obviously not that nice for a skin developer) where the variables are updated to the new values only after "exiting" the option where they were set to those values. So:

Code: Select all

[!Setvariable Latitude 51.7563][!Setvariable Longitude 3.8402][!Setvariable URLSite "https://weather.com/#Language#/weather/today/l/#Latitude#,#Longitude#"]
won't "update" URLSite simply because the bang where this is supposed to happen belongs to the same option where the latitude and longitude variables (which the URLSite variable depends on) have also been set.

Possible solutions:
- move the latter bang to another place/option/measure in the code
- create a measure doing the URLSite variable change in a basic IfCondition and update it (this will work in the same option, by the way)
- decide on whether the URLsite variable update is really necessary, because if you don't do anything else with it and just use it in the WebParser parent's URL option, simply setting the latitude and longitude followed by command updating the WebParser parent will be enough from a functional point of view
- use measures instead of variables, as those can be updated "on demand" within the same option
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
JamX
Posts: 207
Joined: October 4th, 2019, 2:46 pm

Re: Animated GIF issue

Post by JamX »

Yincognito wrote: June 24th, 2020, 5:40 pm
Possible solutions:
- move the latter bang to another place/option/measure in the code
- create a measure doing the URLSite variable change in a basic IfCondition and update it (this will work in the same option, by the way)
- decide on whether the URLsite variable update is really necessary, because if you don't do anything else with it and just use it in the WebParser parent's URL option, simply setting the latitude and longitude followed by command updating the WebParser parent will be enough from a functional point of view
- use measures instead of variables, as those can be updated "on demand" within the same option
This does not work
ContextAction3=[!Setvariable Latitude 50.8871][!Setvariable Longitude 6.0116][!Commandmeasure @EntireSiteSuperParent "Update"]
because the URLSite is not updated.

What i have used and works is:
ContextAction2=[!Setvariable URLSite "https://weather.com/#Language#/weather/today/l/50.8871,6.0116"][!Commandmeasure @EntireSiteSuperParent "Update"]
Directly added the Lat and Long into the URLSite variable
User avatar
JamX
Posts: 207
Joined: October 4th, 2019, 2:46 pm

Re: Animated GIF issue

Post by JamX »

menu.mp4
Is there the possibility to change the text you see when you right click the skin for these action.
Now you see " custom skin actions"
I would like to change that into "Select Location"
You do not have the required permissions to view the files attached to this post.
User avatar
Yincognito
Rainmeter Sage
Posts: 7029
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Animated GIF issue

Post by Yincognito »

JamX wrote: June 24th, 2020, 5:46 pm This does not work
ContextAction3=[!Setvariable Latitude 50.8871][!Setvariable Longitude 6.0116][!Commandmeasure @EntireSiteSuperParent "Update"]
Yeah, that's probably because the @EntireSiteSuperParent measure is using the #URLSite# variable, without a direct reference to latitude and longitude. That explains why setting the URLSite variable instead works.

Sorry, not an expert in jsmorley's .inc files, as I use a different approach, where, among other differences, I directly reference the "location code" (aka the latitude and longitude, in the current format) in the URL option instead:

Code: Select all

Url=https://#WeatherSite#/#WeatherLanguage#/weather/#WeatherForecastDays#/l/#WeatherLocationCode#?units=#WeatherUnits#
The above is only for reference only. You should continue to use the .inc files as they were built.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Animated GIF issue

Post by jsmorley »

JamX wrote: June 24th, 2020, 5:56 pm menu.mp4

Is there the possibility to change the text you see when you right click the skin for these action.
Now you see " custom skin actions"
I would like to change that into "Select Location"
You can do something like this:

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1
RightMouseUpAction=[!SkinCustomMenu]
ContextTitle=Select Location
ContextAction=[!Log "Put action here"]
ContextTitle2=---
ContextAction2=[]
ContextTitle3=Main Context Menu
ContextAction3=[!SkinMenu]


1.jpg
You do not have the required permissions to view the files attached to this post.
User avatar
JamX
Posts: 207
Joined: October 4th, 2019, 2:46 pm

Re: Animated GIF issue

Post by JamX »

Perfect.

I used MiddleMouseUpAction for it.

Thanks.

It looks now like this:
skin.mp4
You do not have the required permissions to view the files attached to this post.
Last edited by JamX on June 24th, 2020, 6:16 pm, edited 1 time in total.
User avatar
Yincognito
Rainmeter Sage
Posts: 7029
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Animated GIF issue

Post by Yincognito »

Yep, jsmorley was faster on this one. I was going to say just about the same thing. :D
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Animated GIF issue

Post by jsmorley »

Yincognito wrote: June 24th, 2020, 6:15 pm Yep, jsmorley was faster on this one. I was going to say just about the same thing. :D
Yeah, I'm that guy that sticks his nose in a thread to pick off some low hanging fruit, then disappears again when it's a tough question... ;-)