• Welcome to TodayPlus Boards v2.
 

News:

No news is good news.

Main Menu

On the wishlist

Started by Daan, March 17, 2005, 04:34:18 AM

Previous topic - Next topic

Daan

I have a wish for the Hammerskin. I want to make it possible to start radar pictures other then starting with the top-left corner. Sometimes the relevant part of the picture is the bottom-right part or some other part. This makes that var3 and var23 in the skin should be calculated according to wich city your loading and which x,y postion is relevant with that city.

This implies that you need (at the beginning of the skin; someplace else?) a list of starting positions (x,y) per picture. Are there vars free in the skin?

@Witchel or UKSkinner: can you give me a help?

Broesel

Quote from: DaanI have a wish for the Hammerskin. I want to make it possible to start radar pictures other then starting with the top-left corner. Sometimes the relevant part of the picture is the bottom-right part or some other part. This makes that var3 and var23 in the skin should be calculated according to wich city your loading and which x,y postion is relevant with that city.

This implies that you need (at the beginning of the skin; someplace else?) a list of starting positions (x,y) per picture. Are there vars free in the skin?

Could be simple, if I understand that right:

in the Skin (Radar-Section) you will find the lines:
load,city,%var9%

image,%var3%,%var23%,%var9%.png
image,%var3%,%var23%,%var9%.jpg
image,%var3%,%var23%,%var9%.gif


after the load,city,...
you could insert:

if,var,var9,,=,1
initvar,var3,x
initvar,var23,y
else
if,var,var9,,=,2
initvar,var3,x2
initvar,var23,y2
.
.
.
endif
endif


where x,x2 y,y2 .... has to be defined for the x-y-position of the pics.

Regards Broesel

Daan

Exactly what I had in mind.

I was more for code like:
Quote
initvar,var3,x%var9% where var9 is the city number
Can this be done?

Its a little bit more complicated with the button to reset the image position.

Quote
imagebutton,226,472,refresh.png,t,-1,6,var3=-16,7  //Reset Image Position
   button,226,472,26,26,-1,6,var23=36,7  //Reset Image Position

should be something like

Quote
imagebutton,226,472,refresh.png,t,-1,6,?var3=x%var9%,7  //Reset Image Position
   button,226,472,26,26,-1,6,var23=y%var9%,7  //Reset Image Position

Can you use variables called x1 etc. or only var1 till varxx?

Broesel

Quote from: DaanExactly what I had in mind.

I was more for code like:
Quote
initvar,var3,x%var9% where var9 is the city number
Can this be done?

Its a little bit more complicated with the button to reset the image position.

Quote
imagebutton,226,472,refresh.png,t,-1,6,var3=-16,7  //Reset Image Position
   button,226,472,26,26,-1,6,var23=36,7  //Reset Image Position

should be something like

Quote
imagebutton,226,472,refresh.png,t,-1,6,?var3=x%var9%,7  //Reset Image Position
   button,226,472,26,26,-1,6,var23=y%var9%,7  //Reset Image Position

Can you use variables called x1 etc. or only var1 till varxx?

No sorry, all the things you have in mind, are not possible. The only thing
you could do, is to create registry-keys under ..... TodayPlus/var/

f.ex. xpos1, xpos2, ... for each city and ypos1, ypos2, ...
and then call it in the skin before displaying the picture like:

calcvar,var3,fromconfig,xpos%var9%
calcvar,var23,fromconfig,ypos%var9%

then display the image with:

image,%var3%,%var23%,%var9%.jpg

To reset the images to the right positon you have to do the calculation
from the registry-key again.

(all lines are only examples without testing, so maybe they are not correct in the syntax)


Regards Broesel

Daan

Quote from: Broeself.ex. xpos1, xpos2, ... for each city and ypos1, ypos2, ...
and then call it in the skin before displaying the picture like:

calcvar,var3,fromconfig,xpos%var9%
calcvar,var23,fromconfig,ypos%var9%

then display the image with:

image,%var3%,%var23%,%var9%.jpg

To reset the images to the right positon you have to do the calculation
from the registry-key again.

Regards Broesel

Maybe as elegant as well. I will try to implement the code tonight.

The reset is still a problem. How to force to do a calculation when pressing a button?

uk_skinner

Quote from: Daan
Quote from: Broeself.ex. xpos1, xpos2, ... for each city and ypos1, ypos2, ...
and then call it in the skin before displaying the picture like:

calcvar,var3,fromconfig,xpos%var9%
calcvar,var23,fromconfig,ypos%var9%

then display the image with:

image,%var3%,%var23%,%var9%.jpg

To reset the images to the right positon you have to do the calculation
from the registry-key again.

Regards Broesel

Maybe as elegant as well. I will try to implement the code tonight.

The reset is still a problem. How to force to do a calculation when pressing a button?

If I understood your intention correctly, you trying to change the start (x,y) of radar image of each city.  Broesel's approach is a good one.  You only need to set %var9% to get the desired (x,y) for each city.  In hammerskin, the botton codes has already included to set %var9% when you tap right/left arrows, once your %var9% change, your (x,y) will be changed too (if you have created the registry key as broesel described).  So, you really don't need to do extra calculation.

Daan

Quote from: uk_skinnerIf I understood your intention correctly, you trying to change the start (x,y) of radar image of each city.  Broesel's approach is a good one.  You only need to set %var9% to get the desired (x,y) for each city.  In hammerskin, the botton codes has already included to set %var9% when you tap right/left arrows, once your %var9% change, your (x,y) will be changed too (if you have created the registry key as broesel described).  So, you really don't need to do extra calculation.

I think you understand the problem quiet well.

The code would be something like:

Quote
load,city,%var9%

calcvar,var3,fromconfig,xpos%var9%
calcvar,var23,fromconfig,ypos%var9%

image,%var3%,%var23%,%var9%.png
image,%var3%,%var23%,%var9%.jpg
image,%var3%,%var23%,%var9%.gif

But now when pressing the reset button:
Code is like:
Quote
imagebutton,226,472,refresh.png,t,-1,6,var3=-16,7 //Reset Image Position
button,226,472,26,26,-1,6,var23=36,7 //Reset Image Position


And should be something like:
Quote

imagebutton,226,472,refresh.png,t,-1,6,"calcvar,var3,fromconfig,xpos%var9%" ,7 //Reset Image Position
button,226,472,26,26,-1,6,"calcvar,var23,fromconfig,ypos%var9%" ,7 //Reset Image Position

But how exactly?

uk_skinner

I think I only got half of your question right.  Let me rephrase again.

1)  When you go to a radar image of a particular city, you wish to load the preset (x,y) from the registry key.  Yes, then use

load,city,%var9%

calcvar,var3,fromconfig,xpos%var9%
calcvar,var23,fromconfig,ypos%var9%

image,%var3%,%var23%,%var9%.png
image,%var3%,%var23%,%var9%.jpg
image,%var3%,%var23%,%var9%.gif


That is fine.

2) Then you will wondering the image and would like to go back the preset (x,y) by taping the reset botton.  If that is the case, the only way I can think about is to store your preset (x,y) after you retrive them from registry key.

calcvar,var3,fromconfig,xpos%var9%
calcvar,var23,fromconfig,ypos%var9%
storevar,varxx,%var3%
storevar,varyy,%var23%



then you can have

imagebutton,226,472,refresh.png,t,-1,6,var3=%varxx% ,7 //Reset Image Position
button,226,472,26,26,-1,6,var23=%varyy% ,7 //Reset Image Position


The only thing needs to consider is to find the available vars.  This could be tricky.  The approach has been explored is "re-cycle" var.  I will take a look and give you some options.

Daan

Quote from: uk_skinner
2) Then you will wondering the image and would like to go back the preset (x,y) by taping the reset botton.  If that is the case, the only way I can think about is to store your preset (x,y) after you retrive them from registry key.

calcvar,var3,fromconfig,xpos%var9%
calcvar,var23,fromconfig,ypos%var9%
storevar,varxx,%var3%
storevar,varyy,%var23%



then you can have

imagebutton,226,472,refresh.png,t,-1,6,var3=%varxx% ,7 //Reset Image Position
button,226,472,26,26,-1,6,var23=%varyy% ,7 //Reset Image Position


The only thing needs to consider is to find the available vars.  This could be tricky.  The approach has been explored is "re-cycle" var.  I will take a look and give you some options.

Exactly. This was the exact problem I was thinking about.
Maybe not good enough decribed.
And storing it after retrieval of the original position in a (temp) var is also an option.  :wink:  :D

I wonder does a phrase like:

Quotevar3=%varxx%
works?

And second, indeed, which vars to use?

uk_skinner

var3=%varxx%
No, it will not work.  

correct usage
storevar,var3=%varXX%

And since you need to triger this with a botton, then you need put them in imagebotton or button code as I posted.

Daan

Sorry my fault.  :oops:
I was referring to
var3=%varxx%
as part of the line

imagebutton,226,472,refresh.png,t,-1,6,var3=%varxx%,7


Didn't see it before. Therefore my wondering  :wink:
So I understand it will work  :D

Daan

var30, var31, var38, var39?

Broesel

Quote from: Daanvar30, var31, var38, var39?

I think, var30 and var31 should work, can't remember, if var38 and var39
where "good" ones but they could work too. Try with 30 and 31 first ...


Regards Broesel

uk_skinner

Daan:

    You also can try var26 and var 27.  They were used in RSS section.  The idea to "recycle" them was they all are reset back to default value when you jump into RSS section, so the values they recieved in the weather section will not be carried over.  And when you jump to radar section, their value will be set to the preset (x,y) of city1 from registry keys.  This is the "recycle" strategy..

Daan


load,city,%var9%

       calcvar,var26,fromconfig,xpos%var9%
       calcvar,var27,fromconfig,ypos%var9%

       storevar,var3=%var26%
       storevar,var23=%var27%

image,%var3%,%var23%,%var9%.png
image,%var3%,%var23%,%var9%.jpg
image,%var3%,%var23%,%var9%.gif


and

imagebutton,113,236,refresh.png,t,-1,6,var3=%var26%,7  //Reset Image Position
button,113,236,13,13,-1,6,var23=%var27%,7  //Reset Image Position


and enterxpos=-118 and ypos=-118 in the register.

It works.
But as a side effect you cannot scroll in the radar pictures  :cry:
Its not clear to me why not.