xboxscene.org forums

Author Topic: New Info Panel  (Read 1268 times)

shank-

  • Archived User
  • Newbie
  • *
  • Posts: 7
New Info Panel
« on: July 05, 2005, 04:53:00 AM »

this is an info panel i came up with, i felt the others crouded the screen too much having info and clock seperate.
full credit goes out to the original creators of the info panels, i just copy and pasted most of there code.

music
disc type
ip address
disc space
cpu temp

paste at the very bottom of default.xip/default.xap

CODE

function DriveSpace( sDrive )
{
var nFreeSpace = theHardDrive.GetFreeSpace(sDrive + "\\");
      var nTotalSpace = theHardDrive.GetTotalSpace(sDrive + "\\");
if (nTotalSpace == 0) { return ""; }
return nFreeSpace + "MB";
}

function ChangeDisplay()
{

var coverpath;
var exists;
var albumtext = "";
var songtext = "";
var drive = "";
var c = theMainMenu.children[0].children[0];

var nMaxDisplay = 6;
if (nDisplayNum > nMaxDisplay) { nDisplayNum = 1; }
if (nDisplayNum < 1) { nDisplayNum = nMaxDisplay; }
var nIntTemp = theConfig.GetInternalTemp();
var nCPUTemp = theConfig.GetCPUTemp();
var sScale = "C";
var e = "";


  if( e == "fahrenheit" )
  {
      sScale = "F";
             nIntTemp = Math.round(nIntTemp * 9/5 + 32);
             nCPUTemp = Math.round(nCPUTemp * 9/5 + 32);
  }
  else if( e == "kelvin" )
  {
      sScale = "K";
             nIntTemp = nIntTemp + 273;
             nCPUTemp = nCPUTemp + 273;
  }

if (nDisplayNum == 1)
{
    albumtext = theMusicCollection.GetSoundtrackName(currentAlbum);
    songtext = theMusicCollection.GetSoundtrackSongName(currentAlbum, currentTrack);
    coverpath = "A:\\album covers\\" + albumtext + ".jpg";
    exists = theHardDrive.FileExists( coverpath );

    if( exists == true )
    {
    c.theScreenAlbumArt.url = coverpath;
    }
    else
    {
    c.theScreenAlbumArt.url = "A:\\album covers\\dvdempty.xbx";
    }
    }

else if (nDisplayNum == 2)
{
    albumtext = "Disc Type:";
    songtext = theDiscDrive.discType;

    if( theDiscDrive.discType == "Video" )
    {
    c.theScreenAlbumArt.url = "A:\\album covers\\dvdvideo.xbx";
    }

    else if(theDiscDrive.discType == "Title")
    {
    c.theScreenAlbumArt.url = "A:\\album covers\\dvdtitle.xbx";
    }

    else if(theDiscDrive.discType == "none")
    {
    c.theScreenAlbumArt.url = "A:\\album covers\\dvdempty.xbx";
    }

    else if(theDiscDrive.discType == "Audio")
    {
    c.theScreenAlbumArt.url = "A:\\album covers\\dvdaudio.xbx";
    }

    else if(theDiscDrive.discType == "unknown")
    {
    c.theScreenAlbumArt.url = "A:\\album covers\\dvdunknown.xbx";
    }
}

else if (nDisplayNum == 3)
{
    albumtext = "IP Address:";
    songtext = theXboxNetwork.GetXboxIP();
    c.theScreenAlbumArt.url = "A:\\album covers\\ipaddy.xbx";
}

else if (nDisplayNum == 4)
{
    drive = "F:";
    albumtext = "Free Space On F:";
    songtext = DriveSpace(drive);
    c.theScreenAlbumArt.url = "A:\\album covers\\harddisc.xbx";
}

//else if (nDisplayNum == 5)
//{
//    drive = "G:";
//    albumtext = "Free Space On G:";
//    songtext = DriveSpace(drive);
//    c.theScreenAlbumArt.url = "A:\\album covers\\dvdempty.xbx";
//}

else if (nDisplayNum == 5)
{
    albumtext = "CPU Temp:";
    songtext = nIntTemp + " " + sScale;
    c.theScreenAlbumArt.url = "A:\\album covers\\info.xbx";
}

else if (nDisplayNum == 6)
{
    albumtext = "MB Temp:";
    songtext = nCPUTemp + " " + sScale;
    c.theScreenAlbumArt.url = "A:\\album covers\\info.xbx";
}

c.theSoundtrackSongInfoText.text = songtext;
c.theSoundtrackAlbumInfoText.text = albumtext;

}



Then find:
CODE


function MusicPlayerPlay()
{
theMusicPlayer.url = "st:" + theMusicCollection.GetSoundtrackSongID( currentAlbum, currentTrack );
log("Playing " + theMusicPlayer.url);
DisableAmbientAudio();
theMusicPlayer.Play();
}



and add another line so it looks like this:

CODE


function MusicPlayerPlay()
{
theMusicPlayer.url = "st:" + theMusicCollection.GetSoundtrackSongID( currentAlbum, currentTrack );
log("Playing " + theMusicPlayer.url);
DisableAmbientAudio();
theMusicPlayer.Play();
if (nDisplayNum == 1) { ChangeDisplay(); }
}



next find

CODE


var currentAlbum;
var currentTrack;



and put this under:

CODE


var nDisplayNum;



scroll down a few lines to find:

CODE


currentAlbum = 0;
currentTrack = 0;



and add this right after:

CODE


nDisplayNum = 1;



now find:

CODE


  control DEF theMainMenuJoy Joystick
  {



and put this after that slash

CODE


function OnLeftThumbDown()
{
          PlaySoundB();
   nDisplayNum = nDisplayNum + 1;
   ChangeDisplay();
}

      function OnRightThumbDown()
{
          PlaySoundB();
   nDisplayNum = nDisplayNum - 1;
   ChangeDisplay();
}



another thing i like to use is this:

CODE


function OnYDown()
      {

       var c = theMainMenu.children[0].children[0];
       if ( c.theMainMenuClock.visible == true )
       {
        if (nDisplayNum == 1)
        {
         MusicPlayerRandom();
        }
        else if (nDisplayNum == 2)
        {
         AutoLaunch();
        }
       }
       else
       {}

      }            



that code will alow you to change track when in music panel and launch disc when in disc type by pressing the Y button

now open main_menu.xip/default.xap and paste this at the very bottom

CODE


DEF theMainMenuClock Transform
        {
        visible true
        fade 0.75
            children
            [
                DEF theMainMenuClock3 Transform
                {
                    children
                    [
                        Shape
                        {
                            appearance Appearance
                            {
                                material MaxMaterial
                                {
                                    name "Black80"
                                }
                                /*texture ImageTexture
                                {
                                    url "panel8.tga"
                                }*/
                            }
                            geometry DEF MU_panel_backing-FACES Mesh { url "MU_panel_backing-FACES.xm" }
                        }
                    ]
                    rotation -0.999200 -0.027600 0.027600 -1.572000
                    scale 0.492900 0.492900 0.492900
                    scaleOrientation -0.022670 0.396500 0.917700 -0.008776
                    translation -0.821800 -1.632000 0.457700
                }
                DEF MEM_L1_panel_meta Transform
                {
                    children
                    [
                        Shape
                        {
                            appearance Appearance
                            {
                                material MaxMaterial
                                {
                                    name "MenuCell"  //"GamePodb"
                                }
                            }
                            geometry DEF MEM_L1_panel_meta-FACES Mesh { url "MEM_L1_panel_meta-FACES.xm" }
                        }
                    ]
                    rotation -1.000000 0.000000 0.000000 -1.571000
                    scale 0.019720 0.019720 0.019720
                    translation -2.112000 -0.431600 0.021390
                }
                DEF theDateTime Transform
                {
                    children
                    [
                        Shape
                        {
                            appearance Appearance
                            {
                                material MaxMaterial
                                {
                                   name "NavType"
                                }
                            }
                            geometry DEF theDateTimeText Text { font "Heading" justify "middle" translate false text ""}
                        }
                    ]
                    scale 0.563580 0.563580 0.563580
                    translation -1.101000 1.370000 0.059800
                }
                DEF theSoundtrackAlbumInfo Transform
                {
                    children
                    [
                        Shape
                        {
                            appearance Appearance
                            {
                                material MaxMaterial
                                {
                                    name "CellEgg/Partsz"
                                }
                            }

                            geometry DEF theSoundtrackAlbumInfoText Text { font "Body" justify "left" width -9 translate false text "albumtext"}
                        }
                    ]
                    //rotation -1.000000 0.000000 0.000000 -1.571000
                    scale 0.7000 0.7000 0.063580
                    translation -4.03000 0.629800 0.059800
                }
                DEF theSoundtrackSongInfo Transform
                {
                    children
                    [
                        Shape
                        {
                            appearance Appearance
                            {
                                material MaxMaterial
                                {
                                    name "NavType"
                                }
                            }
                            geometry DEF theSoundtrackSongInfoText Text { font "body" translate false width -7 scrollRate 0.85 scrollDelay 0.2 text "songtext" justify "left"}
                        }
                    ]
                    //rotation -1.000000 0.000000 0.000000 -1.571000
                    scale .9 0.7000 0.063580
                    translation -4.035800 -.47500 0.059800
                }
                DEF MEM_L1_panel_metasupport Transform
                {
                    children
                    [
                        Shape
                        {
                            appearance Appearance
                            {
                                material MaxMaterial
                                {
                                    name "JwlSrfc01/InfoPnls"
                                }
                            }
                            geometry DEF MEM_L1_panel_metasupport-FACES Mesh { url "MEM_L1_panel_metasupport-FACES.xm" }
                        }
                    ]
                    rotation 1.000000 0.000000 0.000000 -1.571000
                    scale 0.021480 0.021480 0.021480
                    translation 0.108300 -1.269000 -0.075180
                }
                DEF MEM_L1_text_totalmemory Transform
                {
                    children
                    [
                        Shape
                        {
                            appearance Appearance
                            {
                                material MaxMaterial
                                {
                                    name "NavType"
                                }
                            }
                            geometry Text { font "Body" text "" justify "end" }
                        }
                    ]
                    //rotation -1.000000 0.000000 0.000000 -1.571000
                    scale 0.663580 0.663580 0.063580
                    translation -0.155800 -0.107500 0.059800
                }
                DEF MEM_L1_text_473blocks Transform
                {
                    children
                    [
                        Shape
                        {
                            appearance Appearance
                            {
                                material MaxMaterial
                                {
                                    name "CellEgg/Partsz"
                                }
                            }
                            geometry DEF AvailableMemoryText Text { font "Body" translate false }
                        }
                    ]
                    //rotation -1.000000 0.000000 0.000000 -1.571000
                    scale 0.663580 0.663580 0.663580
                    translation 0.155800 -0.666500 0.059800
                }
                DEF MEM_L1_text_8000blocks Transform
                {
                    children
                    [
                        Shape
                        {
                            appearance Appearance
                            {
                                material MaxMaterial
                                {
                                    name "CellEgg/Partsz"
                                }
                            }
                            geometry DEF TotalMemoryText Text { font "Body" translate false }
                        }
                    ]
                    //rotation -1.000000 0.000000 0.000000 -1.571000
                    scale 0.663580 0.663580 0.663580
                    translation 0.155800 -0.107500 0.059800
                }
                DEF DVDStatusIcon Transform
                {
                    children
                    [
                        Shape
                        {
                            appearance Appearance
                            {
                            material Material
                            {
                            }
                                texture DEF theScreenAlbumArt ImageTexture
                                {
                                    alpha true
                                    url "A:\album covers\dvdempty.xbx"
                                }
                            }
                             geometry Box
                                        {
                                        }
                        }
                    ]
                    scale 2.4 2.3 0
                    translation 3.655800 0.107500 0.059800
                    rotation 0 0 1 3.141592654
                }


            ]
            scale 18 18 18
            translation -105 -110 5
        }



you also need to copy these files from the memory.xip file and paste them into main_menu.xip

MEM_L1_panel_meta-FACES.xm
MEM_L1_panel_metasupport-FACES.xm
MU_panel_backing-FACES.xm

now you need to use files from comm build and paste them in the album covers directory. the files needed are:

dvdaudio.xbx
dvdempty.xbx
dvdtitle.xbx
dvdunknown.xbx
dvdvideo.xbx

others are custom files but you can just copy and rename dvdempty.xbx to:

harddisc.xbx
info.xbx
ipaddy.xbx

and thats SHOULD be it

good luck :)
Logged

shank-

  • Archived User
  • Newbie
  • *
  • Posts: 7
New Info Panel
« Reply #1 on: July 05, 2005, 05:01:00 AM »

Logged

coltxL2717

  • Archived User
  • Full Member
  • *
  • Posts: 170
New Info Panel
« Reply #2 on: July 05, 2005, 04:39:00 PM »

That's some nice code there man.  I especially like the fact that you included album art.  That's good shit.
Logged

ih8ny4ever

  • Archived User
  • Newbie
  • *
  • Posts: 1
New Info Panel
« Reply #3 on: October 31, 2005, 09:36:00 PM »

im sorry but for some reason every time i press the right analog it restarts and if i press the leht it says no disk and if i press it again it resarts. can someone help. is it posiple that it could be that i dont have these. i dont know where to get them                                                                                                       dvdaudio.xbx
dvdempty.xbx
dvdtitle.xbx
dvdunknown.xbx
dvdvideo.xbx

This post has been edited by ih8ny4ever: Nov 1 2005, 05:39 AM
Logged

neovash

  • Archived User
  • Newbie
  • *
  • Posts: 4
New Info Panel
« Reply #4 on: November 01, 2005, 01:42:00 PM »

they are in the Commemorative Build
Logged

slick50zd

  • Archived User
  • Newbie
  • *
  • Posts: 8
New Info Panel
« Reply #5 on: December 11, 2005, 03:18:00 PM »

wow great job man i give you props
Logged

motox88

  • Archived User
  • Newbie
  • *
  • Posts: 13
New Info Panel
« Reply #6 on: January 08, 2006, 10:28:00 PM »

would it be possible to post up the screen shots again?
Logged

Little-G

  • Archived User
  • Jr. Member
  • *
  • Posts: 62
New Info Panel
« Reply #7 on: January 09, 2006, 09:33:00 AM »

screen shots work fine remove the '-' from before and after 'imageshack'
Logged

Little-G

  • Archived User
  • Jr. Member
  • *
  • Posts: 62
New Info Panel
« Reply #8 on: January 11, 2006, 11:28:00 AM »

in an attempt to resolve the non displaying ip adress, cpu temp and free disk space i modified the code

i changed

CODE
function OnLeftThumbDown()
{
         PlaySoundB();
  nDisplayNum = nDisplayNum + 1;
  ChangeDisplay();


to

CODE
function OnLeftThumbDown()
{
         PlaySoundB();
  TogglenDisplayNum();
  ChangeDisplay();


and added
CODE
function TogglenDisplayNum
}
var c = theMainMenu.children[0].children[0];
if (b.toLowerCase() == "1") { RefreshMenu("2"); }
else if (b.toLowerCase() == "2") { RefreshMenu("3"); }
else if (b.toLowerCase() == "3") { RefreshMenu("4"); }
else if (b.toLowerCase() == "5") { RefreshMenu("6"); }
else if (b.toLowerCase() == "6") { RefreshMenu("1"); }
{

to the bottom of default .xap

does this code belong in config.xap/main menu.xip, or is it flawed? can someone with experience of uix code tell me?
Logged

Little-G

  • Archived User
  • Jr. Member
  • *
  • Posts: 62
New Info Panel
« Reply #9 on: January 14, 2006, 03:48:00 AM »

why is no one willing to spend a minute or two to help? im sure someone can help me  (IMG:style_emoticons/default/sad.gif)
Logged

t1x2irc2

  • Archived User
  • Newbie
  • *
  • Posts: 22
New Info Panel
« Reply #10 on: January 14, 2006, 07:35:00 AM »


i really haven't look through the whole code

but my guess would be

you want default.xip/config.xap

or

default.xip/default.xap


let me know if that works 4 ya

Logged

shank-

  • Archived User
  • Newbie
  • *
  • Posts: 7
New Info Panel
« Reply #11 on: January 15, 2006, 11:04:00 PM »

Logged

Little-G

  • Archived User
  • Jr. Member
  • *
  • Posts: 62
New Info Panel
« Reply #12 on: January 16, 2006, 12:22:00 PM »

how are you selecting those? i have the same issue as ih8ny4ever it reboots after pressing left thumb twice
Logged

Dazza

  • Archived User
  • Newbie
  • *
  • Posts: 5
New Info Panel
« Reply #13 on: January 16, 2006, 02:08:00 PM »

It should not be too difficult to get this working....

The code states that you need to create these 3 files

harddisc.xbx
info.xbx
ipaddy.xbx

Have you done that?

Mine would not work so I went through and commented out all of the references to a:/ and that fixed it.

Logged

shank-

  • Archived User
  • Newbie
  • *
  • Posts: 7
New Info Panel
« Reply #14 on: January 16, 2006, 10:53:00 PM »

extract these into album covers folder and everything should be sweet
info icons
i should have posted them at the start
please post resaults. its been a while (IMG:style_emoticons/default/smile.gif)
Logged