xboxscene.org forums

Pages: [1] 2

Author Topic: How To: Add A Radar Button To "my Weather"  (Read 297 times)

spongy

  • Archived User
  • Full Member
  • *
  • Posts: 109
How To: Add A Radar Button To "my Weather"
« on: October 05, 2005, 11:54:00 PM »

I've been wanting to add an xRadar button to “My Weather” for quite some time. I finally figured out how to do it. So I thought I would share it with others. I've only tried it in PMIII so far, but it should be similar in other skins.

First, ftp your xbox and  navigate to XBMC/skin/Project Mayhem III/PAL.
Copy over “MyWeather.xml” and open it with a text editor.
We need to add a new <control>. I recommend adding it between the “Refresh Button” control and the “Logo Image” control.
<control> Open our new control.
<description>Radar Button</description>  Describes our new control.Can be anything.
<type>button</type>  Type of our new control. We want a button.
<id>69</id> ID of our new control. Can be any number not already used between <id>-</id> tags in this file.
<posX>60</posX> This determins where the new button will be on the screen horizontally. Same as “Refresh Button” <posX>.
<posY>157</posY>  This determins where the new button will be on the screen vertically. Add 37 to the “Refresh Button” <posY>.
<width>135</width>  This determins the width of our new button.
<height>35</height>  This determins the height of our new button.
<label>Radar</label> This is the text we'll see on our new button.
<font>font13</font> Determins the font on our new button.
The directory of xRadar. Q:\ is xbmc home folder. This example shows xRadar in it's own folder within the scripts folder.
<onleft>3</onleft> Determins where the cursor will move when you push left on the d-pad. “3” is the <id> of the location selector.
<onright>3</onright> Determins where the cursor will move when you push right on the d-pad. “3” is the <id> of the location selector.
<onup>2</onup> Determins where the cursor will move when you push up on the d-pad. “2” is the <id> of the refresh button.
<ondown>2</ondown> Determins where the cursor will move when you push down on the d-pad. “2” is the <id> of the refresh button.
<align>center</align> Determins where the text will be in our new button???
</control> Close our new control.

You should end up with something like this. You can copy and paste this  if you like.
CODE
   
      Radar Button
      button
      69
      60
      157
      135
      35
      
      font13
      
      3
      3
      2
      2
      center
    
Now, In order to navigate to our new button we will need to edit the “Refresh Button” control.The <onup> and <ondown> tags should have the <id> of our new control.
Your new “Refresh Button” control should look like this. Again copy and paste if you like.
CODE
   
      Refresh Button
      button
      2
      60
      120
      135
      35
      
      font13
      3
      3
      69
      69
      center
    

All done. Reboot and see how it works.
You can also use this in other sections. Doing this along with using the DialogSubMenu.xml I no longer need a script browser.
 I added “Lyrics”,"iTunes" and “Music Videos” buttons to the “My Music” section(MyMusicSongs.xml).
 “Movie Trailers” and “Movie Guide” buttons to “My Videos” section (MyVideo.xml).
”Game Trailers” and “Game Saves” buttons to “My Programs” section (MyPrograms.xml).

Note: I don't really know xml, so some of this might be done the hard way. Or just plain wrong.

Note2: Some or all of this might be covered in the Online Manual.

Good luck
Logged

ClintiePoo

  • Archived User
  • Sr. Member
  • *
  • Posts: 441
How To: Add A Radar Button To "my Weather"
« Reply #1 on: October 06, 2005, 01:56:00 AM »

Looks good.  The xradar script doesn't work for my zip code, but all of the work you did is cool.  Good job.

Logged

cashkid

  • Archived User
  • Newbie
  • *
  • Posts: 33
How To: Add A Radar Button To "my Weather"
« Reply #2 on: October 23, 2005, 07:41:00 AM »

Sound great spongy, I added buttons to mine as well it saves alot of time searching though the scripts and apps looking for them not mention it makes it look cool as hell biggrin.gif .
But I was just wondering how you got the Music Videos in My Music setup because I couldent get mine to work so I scrapt it.
I also need a play cd button in my music that I havent gotten to yet.
And a copy dvd botton in my videos.
By the way this is my programs section.
View icons
sort by mame
Xlink kia
Games
Game cheats [xored mini launcher for trainers]
Emulatores
programs
dvd game
game saves  [gamesave manager]
download saves  [gamesave downloader]
game copy   [dvd to xbox]


I had to move the on screen display of music and videos to the top of the screen to make room for it though. beerchug.gif
Logged

sp44

  • Archived User
  • Newbie
  • *
  • Posts: 10
How To: Add A Radar Button To "my Weather"
« Reply #3 on: April 15, 2006, 11:31:00 PM »

QUOTE(ClintiePoo @ Oct 6 2005, 08:27 AM) *

Looks good.  The xradar script doesn't work for my zip code, but all of the work you did is cool.  Good job.



Yeah how come the script doesn't work on certain zip codes?
Logged

spongy

  • Archived User
  • Full Member
  • *
  • Posts: 109
How To: Add A Radar Button To "my Weather"
« Reply #4 on: April 15, 2006, 11:51:00 PM »

Well that's really a question you need to ask at weather.com. But... I believe they only cover highly populated areas.
Logged

grindar

  • Archived User
  • Newbie
  • *
  • Posts: 20
How To: Add A Radar Button To "my Weather"
« Reply #5 on: April 16, 2006, 12:20:00 PM »

Yeah, you'd think Mississippi State University would be covered, with its at least 16000 students plus the city of starkville, but no...

As an interesting note, according to the script, this is from noaa.gov . I wish I knew python so I could understand all of it.

No, apparently the actual data is from weather.com, as somebody suggested. What is wierd is these places both return data from their website for my zip, but not the radar script.

This post has been edited by grindar: Apr 16 2006, 07:39 PM
Logged

grindar

  • Archived User
  • Newbie
  • *
  • Posts: 20
How To: Add A Radar Button To "my Weather"
« Reply #6 on: April 16, 2006, 12:12:00 PM »

Can somebody give me a zip code they know works? And can someone please explain this snippet of code, taken from the script:
else:
         webroot = r"http://www.weather.c.../travel/local/"
         addr = webroot + zipcode

I know the else. I know how to set a string. Is the line with addr a string concatenation or something else. I'm trying to reverse engineer this so I know why it doesn't work for me.


I've tried three separate area codes from memphis, 3 that i've lived in, and 90210 for the hell of it. if they don't cover beverly hills, where do they cover?
Logged

sp44

  • Archived User
  • Newbie
  • *
  • Posts: 10
How To: Add A Radar Button To "my Weather"
« Reply #7 on: April 16, 2006, 02:37:00 PM »

QUOTE(grindar @ Apr 16 2006, 06:51 PM) View Post



No, apparently the actual data is from weather.com, as somebody suggested. What is wierd is these places both return data from their website for my zip, but not the radar script.



Yeah I don't understand that.
Logged

spongy

  • Archived User
  • Full Member
  • *
  • Posts: 109
How To: Add A Radar Button To "my Weather"
« Reply #8 on: April 16, 2006, 03:37:00 PM »

Works fine in 85305.
Here is my working version. It will only be available for a few days.
Logged

Affini

  • Archived User
  • Jr. Member
  • *
  • Posts: 61
How To: Add A Radar Button To "my Weather"
« Reply #9 on: April 17, 2006, 02:49:00 AM »

Spongy's code is for an older version of XBMC. Below I've posted the entire XML for the current release of XBMC (uses v2.0 of the skinning engine), animations and all.

btw... if you've mod'd your skins and you have not updated to a recent version of XBMC, you are in for some changes... I suggest you start read'n there are a lot of changes!

MyWeather.xml for current XBMC versions

I'm changed the Xradar script images to be a bit 'nicer', IMO, and match PM3 better. Just DL this ZIP and uncompress into the Xradar\pics folder.

Xradar pics to match PM3


Spongy... where in AZ are you? I'm in Chandler.
Logged

grindar

  • Archived User
  • Newbie
  • *
  • Posts: 20
How To: Add A Radar Button To "my Weather"
« Reply #10 on: April 17, 2006, 04:22:00 AM »

I'm just using the standard build from the 12th, plus the scripts i've downloaded. I tried patching in the xml in the skins folder and I went ahead and put the pics in the folder for the hell of it. Still no luck. I didn't even get his zip code working.
Logged

nuka1195

  • Archived User
  • Sr. Member
  • *
  • Posts: 290
How To: Add A Radar Button To "my Weather"
« Reply #11 on: April 17, 2006, 08:05:00 AM »

There were a few changes needed for the radar script to work. I don't know if the updated script was posted on xbmcscripts.com or not.

Is that where you downloaded it from?

Is anybody who is having trouble running the script, trying it from the scripts window. You may need to run it first from the scripts window to set the zipcode. Then after that it should run fine from the weather window.

This post has been edited by nuka1195: Apr 17 2006, 03:08 PM
Logged

spongy

  • Archived User
  • Full Member
  • *
  • Posts: 109
How To: Add A Radar Button To "my Weather"
« Reply #12 on: April 17, 2006, 09:04:00 AM »

QUOTE(Affini @ Apr 17 2006, 01:20 AM) View Post

Spongy's code is for an older version of XBMC. Below I've posted the entire XML for the current release of XBMC (uses v2.0 of the skinning engine), animations and all.
Spongy... where in AZ are you? I'm in Chandler.

I haven't compiled since the 28th of march. I noticed people talking about the animations shortly after.
thanks for the new images I'll try it out soon as I make a new build.

I'm in Glendale. A mile from the new stadiums.
Logged

Affini

  • Archived User
  • Jr. Member
  • *
  • Posts: 61
How To: Add A Radar Button To "my Weather"
« Reply #13 on: April 17, 2006, 01:40:00 PM »

you should really update to a current build... the new stuff is nice.

Since you are close we may be able to do some trading (software, etc).

PM me...
Logged

alexpoet

  • Archived User
  • Newbie
  • *
  • Posts: 12
How To: Add A Radar Button To "my Weather"
« Reply #14 on: July 10, 2006, 01:58:00 PM »

Nice! I like the button.

I'm the script author, btw, and just getting back into it after about three years off. Real life, an' all that....

In response to questions upthread:

I originally tried to get the images from NOAA. They have a more reliable database and much simpler searching, but they provided GIFs in a format that, for some reason, just would not display on XBMC. That was three years ago, though, and there's a chance one or the other of them may work now. The comment in the script, though, comes from the fact that I switched sources mid-development, and didn't fix all my comments.

Currently, all images come from Weather.com, which is incredibly unreliable and inconsistent in directory structure and naming. Probably intentional, to prevent things just like this.

The snippet of code quoted was just a string concatenation, that took the root of the URL and added the 5-digit zip code to the end of it.
Logged
Pages: [1] 2