xboxscene.org forums

Author Topic: Configurable Main Menu  (Read 912 times)

MrSin

  • Archived User
  • Newbie
  • *
  • Posts: 9
Configurable Main Menu
« on: January 04, 2005, 11:11:00 PM »

Configurable Main Menu

Search Default.xip / Default.Xap for

CODE

c.Button_01_Text.geometry.text = IniFile.GetIniValue( "Main Tab 1" );
c.Button_02_Text.geometry.text = IniFile.GetIniValue( "Main Tab 2" );
c.Button_03_Text.geometry.text = IniFile.GetIniValue( "Main Tab 3" );
c.Button_04_Text.geometry.text = IniFile.GetIniValue( "Main Tab 4" );


and change to:

CODE

c.Button_01_Text.geometry.text = IniFile.GetIniValue( "Tab Text 1" );
c.Button_02_Text.geometry.text = IniFile.GetIniValue( "Tab Text 2" );
c.Button_03_Text.geometry.text = IniFile.GetIniValue( "Tab Text 3" );
c.Button_04_Text.geometry.text = IniFile.GetIniValue( "Tab Text 4" );




Locate:

CODE

control DEF theMainMenuJoy Joystick
    {
        function OnADown()
        {
            PlaySoundA();


and replace:

CODE

            if(nCurMainMenuItem == 0)
            {
                theMusicMenuIn.Play();
                GoToMusic();
            }
            else if(nCurMainMenuItem == 1)
            {
                theSettingsMenuIn.Play();
                GoToHardDrive();
            }
            else if(nCurMainMenuItem == 2)
            {
            }
            else if(nCurMainMenuItem == 3)
            {
                theSettingsMenuIn.Play();
                GoToSettings();
            }
        }


with:

CODE

//
//  CONFIGURABLE MAIN MENU ACTIONS, FROM 'n3wbie' tHC LITE CODE.
//
//  Select menu action.
//
if (nCurMainMenuItem == 0)
{
     MenuAction("1");
}
else if (nCurMainMenuItem == 1)
{
     MenuAction("2");
}
else if (nCurMainMenuItem == 2)
{
     MenuAction("3");
}
else if (nCurMainMenuItem == 3)
{
     MenuAction("4");
}




Locate:

CODE

//InitializeMenus(); //not needed with new hd menu - use to init menus if using drop down menus
m_nbuttons = 3;//number of buttons in main menu


and change to:

CODE

m_nbuttons = 4; //number of buttons in main menu




Add the following functions to the end of the file:

CODE

//
//  CONFIGURABLE MAIN MENU ACTIONS, FROM 'n3wbie' tHC LITE CODE.
//
//  Launch Menu Actions.
//

function MenuAction(x)
{
       var menu = x;
       var IniFile = new Settings;
       IniFile.SetIniSection( "Main Menu Tabs" );
       var a = IniFile.GetIniValue( "Tab Action " + menu);
       IniFile.CloseIniFile();
       if (a == "RunMem")
       {
               theGamesMenuIn.Play();
               GoToMemory();
       }
       else if (a == "RunMusic")
       {
               theMusicMenuIn.Play();
               GoToMusic();
       }
       else if (a == "RunHDD")
       {
               theSettingsMenuIn.Play();
               GoToHardDrive();
       }
       else if (a == "RunSetting")
       {
               theSettingsMenuIn.Play();
               GoToSettings();
       }
       else if (a != " ")
       {
               MenuLaunch(a);
       }
       return;
}

//
//  CONFIGURABLE MAIN MENU ACTIONS, FROM 'n3wbie' tHC LITE CODE.
//
//  Launch custom actions, Code from tHC Lite QuickLaunch() function.
//
function MenuLaunch(x)
{
    var a = x;
    var launchPath;

    var b = a.substr(0,1);
    var c = a.indexOf("\\");
    var d = a.lastIndexOf("\\");
    var e;
    if(d > 4)
    {
         e = "\\" + a.substr(c + 2, d - 5);
    }
    else
    {
         e = "";
    }
    var launchXbe = a.substr(d + 1);
    if(b == "F")
    {
       launchPath = "\\Device\\Harddisk0\\Partition6" + e;
    }
    else if(b == "C")
    {
        launchPath = "\\Device\\Harddisk0\\Partition2" + e;
    }
    else if(b == "G")
    {
        launchPath = "\\Device\\Harddisk0\\Partition7" + e;
    }
    else if(b == "E")
    {
        launchPath = "\\Device\\Harddisk0\\Partition1" + e;
    }
    else
    {
        return;
    }
    launch (launchXbe, launchPath);
}



Update 'uix.ini', and rearrange (any order) as you like. 'RunSetting', 'RunHDD', 'RunMusic' & 'RunMem' are variables to access 'Settings', 'Hard Drive', 'Music', or 'Memory' sub menus.

[Main Menu Tabs]
Tab Text 4=SETTINGS
Tab Text 3=MEDIA CENTER
Tab Text 2=HARD DRIVE
Tab Text 1=MUSIC
Tab Action 4=RunSetting
Tab Action 3=E:\\Apps\\XBMC\\default.xbe
Tab Action 2=RunHDD
Tab Action 1=RunMusic


Done! <
Logged

b0oGy

  • Archived User
  • Newbie
  • *
  • Posts: 3
Configurable Main Menu
« Reply #1 on: January 05, 2005, 10:58:00 AM »

Hmmm would be a nice feature but i have tested the code and if i add this my UIX dont boot anymore :(
I have checked everything 3 times but has found nothing wat i am doing wrong is it eventually a bug in Code? Does it work for you?

Thx b0oGy! <
Logged

MrSin

  • Archived User
  • Newbie
  • *
  • Posts: 9
Configurable Main Menu
« Reply #2 on: January 05, 2005, 01:09:00 PM »

It works for me, I can see one thing wrong in the instructions, but the post can not be changed.

CODE

          if(nCurMainMenuItem == 0)
           {
               theMusicMenuIn.Play();
               GoToMusic();
           }
           else if(nCurMainMenuItem == 1)
           {
               theSettingsMenuIn.Play();
               GoToHardDrive();
           }
           else if(nCurMainMenuItem == 2)
           {
           }
           else if(nCurMainMenuItem == 3)
           {
               theSettingsMenuIn.Play();
               GoToSettings();
           }
       }


This part should not have the bottom '}', therefore it should read:

and replace:

CODE

if(nCurMainMenuItem == 0)
{
    theMusicMenuIn.Play();
    GoToMusic();
}
else if(nCurMainMenuItem == 1)
{
    theSettingsMenuIn.Play();
    GoToHardDrive();
}
else if(nCurMainMenuItem == 2)
{
}
else if(nCurMainMenuItem == 3)
{
    theSettingsMenuIn.Play();
    GoToSettings();
}


with:

CODE

//
//  CONFIGURABLE MAIN MENU ACTIONS, FROM 'n3wbie' tHC LITE CODE.
//
//  Select menu action.
//
if (nCurMainMenuItem == 0)
{
    MenuAction("1");
}
else if (nCurMainMenuItem == 1)
{
    MenuAction("2");
}
else if (nCurMainMenuItem == 2)
{
    MenuAction("3");
}
else if (nCurMainMenuItem == 3)
{
    MenuAction("4");
}


to make it look like the following:

CODE

control DEF theMainMenuJoy Joystick
{
function OnADown()
{
    PlaySoundA();
   //
   //  CONFIGURABLE MAIN MENU ACTIONS, FROM 'n3wbie' tHC LITE CODE.
   //
   //  Select menu action.
   //
     if (nCurMainMenuItem == 0)
     {
      MenuAction("1");
     }
     else if (nCurMainMenuItem == 1)
     {
      MenuAction("2");
     }
     else if (nCurMainMenuItem == 2)
     {
      MenuAction("3");
     }
     else if (nCurMainMenuItem == 3)
     {
      MenuAction("4");
     }
}

function OnLeftThumbMoveUp()


My 'default.xap' can be downloaded: default.xap, which has all the changes made.

I have include the my whole 'uix.ini', maybe you had a problem in there:

QUOTE
[Music On Boot]
Volume=0.89
Enabled=false
[Main Menu Tabs]
Tab Text 4=SETTINGS
Tab Text 3=MEDIA CENTER
Tab Text 2=HARD DRIVE
Tab Text 1=MUSIC
Tab Action 4=RunSetting
Tab Action 3=E:\\Apps\\XBMC\\default.xbe
Tab Action 2=RunHDD
Tab Action 1=RunMusic
[AutoLaunch Media]
Launch On Insert=ask
[Naming Method]
Use Xbe Names=true
[Dashboard Settings]
Current Skin=blue
Dash Style=stock
[Network Settings]
XboxIPType=static
XboxIP=192.168.1.50
SubnetMask=255.255.255.0
Gateway=192.168.1.1
FTP Login=xbox
FTP Password=xbox
FTP Port=21
FTP Show Sizes=true
FTP Use Caps=false
[Applications]
Path=apps
Name=Applications
[Dashboards]
Path=dashboards
Name=Dashboards
[Emulators]
Path=emulators
Name=Emulators
[Games]
Path=games
Name=Games
<
Logged

b0oGy

  • Archived User
  • Newbie
  • *
  • Posts: 3
Configurable Main Menu
« Reply #3 on: January 06, 2005, 09:01:00 AM »

Yeah now it works fine :) but is there a way to add this to the Dashboard Config Option in UIX? That I can change the Menu from UIX and dont need to edit the .ini this would be very nice.

And big thx for this code a very nice feature. <
Logged

carrico

  • Archived User
  • Jr. Member
  • *
  • Posts: 94
Configurable Main Menu
« Reply #4 on: January 06, 2005, 11:52:00 AM »

:beer:  GREAT  :beer:

Thx for this wonder!! One thing, Media Center takes a long time to start, 5~6 seconds, is this normal? <
Logged

mateoleone

  • Archived User
  • Newbie
  • *
  • Posts: 4
Configurable Main Menu
« Reply #5 on: January 06, 2005, 12:08:00 PM »

In the UIX dash go to setting and in the menu options there is a setup for creating the path and names for the buttons. You can change it there. <
Logged

b0oGy

  • Archived User
  • Newbie
  • *
  • Posts: 3
Configurable Main Menu
« Reply #6 on: January 06, 2005, 12:24:00 PM »

QUOTE(mateoleone @ Jan 6 2005, 07:28 PM)
In the UIX dash go to setting and in the menu options there is a setup for creating the path and names for the buttons. You can change it there.
*



NO not if you have already changed to the Configurable Main Menu.

This is from Original UIX:

c.Button_01_Text.geometry.text = IniFile.GetIniValue( "Main Tab 1" );
c.Button_02_Text.geometry.text = IniFile.GetIniValue( "Main Tab 2" );
c.Button_03_Text.geometry.text = IniFile.GetIniValue( "Main Tab 3" );
c.Button_04_Text.geometry.text = IniFile.GetIniValue( "Main Tab 4" );

and this from Configurable Main Menu:

c.Button_01_Text.geometry.text = IniFile.GetIniValue( "Tab Text 1" );
c.Button_02_Text.geometry.text = IniFile.GetIniValue( "Tab Text 2" );
c.Button_03_Text.geometry.text = IniFile.GetIniValue( "Tab Text 3" );
c.Button_04_Text.geometry.text = IniFile.GetIniValue( "Tab Text 4" );



"Main Tab" has changed to "Tab Text" so you cant configure it in UIX Dash/Settings. <
Logged

mateoleone

  • Archived User
  • Newbie
  • *
  • Posts: 4
Configurable Main Menu
« Reply #7 on: January 06, 2005, 12:59:00 PM »

Ah sorry about that. <
Logged

420Baker

  • Archived User
  • Newbie
  • *
  • Posts: 2
Configurable Main Menu
« Reply #8 on: January 06, 2005, 03:08:00 PM »

How can I add this feature to the hard drive menu? So I can have Games, Applications, Emulators and a specific game lets say Halo. <
Logged

420Baker

  • Archived User
  • Newbie
  • *
  • Posts: 2
Configurable Main Menu
« Reply #9 on: January 06, 2005, 03:37:00 PM »

or a fifth tab in the main menu. (will the THCLite code work here link- http://forums.xbox-scene.com/index.php?showtopic=204671) <
Logged

LiketHc

  • Archived User
  • Newbie
  • *
  • Posts: 8
Configurable Main Menu
« Reply #10 on: January 06, 2005, 04:29:00 PM »

QUOTE(b0oGy @ Jan 6 2005, 04:21 PM)
Yeah now it works fine :) but is there a way to add this to the Dashboard Config Option in UIX? That I can change the Menu from UIX and dont need to edit the .ini this would be very nice.

And big thx for this code a very nice feature.
*



Hello b0oGy,

of course there is a way  ;)  Follow these instructions:

Open default.xip / config.xap

Locate

CODE

function BuildMMList()


And change the whole function to:

CODE

function BuildMMList()
{
   var i = 0;
   configList = new Array;
   configValues = new Array;
   configSelect = new Array;
   configList = "Memory Tab Text:";
   configValues = "c-Main Menu Tabs-Tab Text 1";
   configSelect = "ConfigKeyB()";
   i = i + 1;
//
   configList = "Memory Tab Action:";
   configValues = "c-Main Menu Tabs-Tab Action 1";
   configSelect = "ConfigKeyB()";
   i = i + 1;

   configList = "Music Tab Text:";
   configValues = "c-Main Menu Tabs-Tab Text 2";
   configSelect = "ConfigKeyB()";
   i = i + 1;
//
   configList = "Music Tab Action:";
   configValues = "c-Main Menu Tabs-Tab Action 2";
   configSelect = "ConfigKeyB()";
   i = i + 1;

   configList = "Hard Drive Tab Text:";
   configValues = "c-Main Menu Tabs-Tab Text 3";
   configSelect = "ConfigKeyB()";
   i = i + 1;
//
   configList = "Hard Drive Tab Text:";
   configValues = "c-Main Menu Tabs-Tab Action 3";
   configSelect = "ConfigKeyB()";
   i = i + 1;

   configList = "Settings Tab Text:";
   configValues = "c-Main Menu Tabs-Tab Text 4";
   configSelect = "ConfigKeyB()";
   i = i + 1;
//
   configList = "Settings Tab Action:";
   configValues = "c-Main Menu Tabs-Tab Action 4";
   configSelect = "ConfigKeyB()";
   i = i + 1;

   ClearText();
   UpdateText();
}


And voila - you’re able to configure the tab actions via UIX'  configuration menu.

Remember: Valid UIX tab actions besides external programs own scripts are : 'RunSetting', 'RunHDD', 'RunMusic'  and  'RunMem' .

Have Fun

LiketHc  :beer:

This post has been edited by LiketHc: Jan 7 2005, 12:33 AM <
Logged

KingMike67

  • Archived User
  • Newbie
  • *
  • Posts: 2
Configurable Main Menu
« Reply #11 on: January 06, 2005, 11:40:00 PM »

This might sound like a dumb question, but is there a way to get the main menu to have a tab for games, and then have it jump to the menu that lists all the games, like in the hard drive menu.

I edit the default.xap with what I thought (GoToTheGamesMenu();), but I guess this is still a little above me.

Any help would be greatly appreciated.

Thanks In advance

KM

 <
Logged

trentdadi

  • Archived User
  • Sr. Member
  • *
  • Posts: 442
Configurable Main Menu
« Reply #12 on: January 08, 2005, 04:15:00 AM »

Kudos to MrSin.  Great job, It looks so much better now.  Thankyou for taking the time to write this for the good of the scene. <
Logged

Mozbius

  • Archived User
  • Jr. Member
  • *
  • Posts: 69
Configurable Main Menu
« Reply #13 on: January 14, 2005, 12:10:00 PM »

QUOTE(KingMike67 @ Jan 7 2005, 06:00 AM)
This might sound like a dumb question, but is there a way to get the main menu to have a tab for games, and then have it jump to the menu that lists all the games, like in the hard drive menu.

I edit the default.xap with what I thought (GoToTheGamesMenu();), but I guess this is still a little above me.

Any help would be greatly appreciated.

Thanks In advance

KM
*



That's exactly was I looking for! Direct access to games or apps or settings from the main menu just like I could do in tHc.
By doing so I was able to password protect the Applications and Settings tabs while leaving the Game tab opened for anyone who wanted to play games!
 
Can anyone help out?:huh:

This post has been edited by Mozbius: Jan 14 2005, 08:12 PM <
Logged

3dfx

  • Archived User
  • Newbie
  • *
  • Posts: 25
Configurable Main Menu
« Reply #14 on: January 15, 2005, 09:04:00 AM »

When ever I make the changes it loads the standard MS dash ??? .. the files I have are xip's and not xap's so I cant copy your default MrSin. Would it be possible for anyone to post their default.xip ??

Many
Thanks
Andy <
Logged