Jump to content


Photo

24h Clockpanel


  • Please log in to reply
7 replies to this topic

#1 Mad3 Max3

Mad3 Max3

    X-S Enthusiast

  • Members
  • 14 posts
  • Location:Sweden
  • Interests:Bodybuilding,Karate,Aikido,Xbox,Gaming
  • Xbox Version:v1.6

Posted 19 February 2005 - 02:21 AM

I got a request to add this code for all of you that don't use the 12h and uses english as language in your xbox!

This code applies to them that has added the clockpanel to your dash!

main_menu/default.xap
find
CODE

geometry Text { font "body" justify "middle" translate false text <clock> }

replace with
CODE

geometry Text { font "body" justify "middle" translate false text "Error" }


default/default.xap
place this function at the end of the xap!
CODE

function UpdateListClock()
{
var d = new Date;
var c = theMainMenu.children[0].children[0];
var vDay;
var vMonth;
var vMinutes;

vMinutes = "14";

if((d.getMonth() + 1) < 10) {
 vMonth = "0" + (d.getMonth() + 1);
}
else {
 vMonth = d.getMonth() + 1;
}

if(d.getDate() < 10) {
 vDay = "0" + d.getDate();
}
else {
 vDay = d.getDate();
}

if(d.getMinutes() < 10) {
 vMinutes = "0" + d.getMinutes();
}
else {
 vMinutes = d.getMinutes();
}
 
c.theClock_text.children[0].children[0].geometry.text = d.getFullYear() + "/" + vMonth + "/" + vDay + "  " + d.getHours() + ":" + vMinutes;
c.Clock_panel_header_text.text = "Date";
c.Clock_panel_support_03_text.text = "Time";

}

find
CODE

function OnActivate()
   {
 EnableAudio();
 CurrentViewpoint = theMainMenuViewpoint;
 CurrentAltViewpoint = theMainMenuAlternateViewpoint;
   }

make it look like this
CODE

function OnActivate()
   {
    EnableAudio();
 CurrentViewpoint = theMainMenuViewpoint;
 CurrentAltViewpoint = theMainMenuAlternateViewpoint;
}
behavior
  {
      sleep 5;
 if(CurrentViewpoint == theMainMenuViewpoint)
 {
  if(bInScreenSaverView==false)
  {
   UpdateListClock();
  }
 }
}


find
CODE

MusicOnBootCheck();
UpdateMainMenu();
UpDateMainMenuButtonsText();
MainMenuAttract();
EnableAudio();

add after the last function call
CODE

UpdateListClock();


I think this will do the trick.. I might have forgotten something, if so tell me and I'll fix it. If you want to be able to change between 12h and 24h in the config, let me know and I add that.



#2 ImOkRuOk

ImOkRuOk

    X-S Senior Member

  • Members
  • PipPip
  • 264 posts
  • Location:USA
  • Interests:Xbox, games: fighting, action, Gore and blood and guts and death and violence and satan
  • Xbox Version:v1.1
  • 360 version:v4.0 (jasper)

Posted 19 February 2005 - 10:34 PM

QUOTE
I think this will do the trick.. I might have forgotten something, if so tell me and I'll fix it. If you want to be able to change between 12h and 24h in the config, let me know and I add that.


I'd love it:)

#3 Mad3 Max3

Mad3 Max3

    X-S Enthusiast

  • Members
  • 14 posts
  • Location:Sweden
  • Interests:Bodybuilding,Karate,Aikido,Xbox,Gaming
  • Xbox Version:v1.6

Posted 20 February 2005 - 05:21 PM

Here's a update of the code so you can set the 24h in config.

Find function UpdateListClock() and replace it with this!
CODE

function UpdateListClock()
{
var d = new Date;
var c = theMainMenu.children[0].children[0];
var vDay;
var vMonth;
var vMinutes;

if(bUse24h==true)
{
 if((d.getMonth() + 1) < 10) {
  vMonth = "0" + (d.getMonth() + 1);
 }
 else {
  vMonth = d.getMonth() + 1;
 }
 
 if(d.getDate() < 10) {
  vDay = "0" + d.getDate();
 }
 else {
  vDay = d.getDate();
 }
 
 if(d.getMinutes() < 10) {
  vMinutes = "0" + d.getMinutes();
 }
 else {
  vMinutes = d.getMinutes();
 }
 
 c.theClock_text.children[0].children[0].geometry.text = d.getFullYear() + "/" + vMonth + "/" + vDay + "  " + d.getHours() + ":" + vMinutes;
}
else
{
 c.theClock_text.children[0].children[0].geometry.text = "<clock>";
}

c.Clock_panel_header_text.text = "Date";
c.Clock_panel_support_03_text.text = "Time";
}

Find this
CODE

           else if(nCurMainMenuItem == 3)
           {
               theSettingsMenuIn.Play();
               GoToSettings();
            }

and make it look like this!
CODE

           else if(nCurMainMenuItem == 3)
           {
               theSettingsMenuIn.Play();
               GoToSettings();
               bCheckIni = true; // In case you changed someting in the ini! *!*
           }


Find this
CODE

function OnActivate()
      {
    EnableAudio();
CurrentViewpoint = theMainMenuViewpoint;
CurrentAltViewpoint = theMainMenuAlternateViewpoint;
       }

Make it look like this
CODE

function OnActivate()
{
    EnableAudio();
CurrentViewpoint = theMainMenuViewpoint;
CurrentAltViewpoint = theMainMenuAlternateViewpoint;
if(bCheckIni==true)
{
       var IniFile = new Settings;
 IniFile.SetIniSection( "List Display" );
 var iVal = IniFile.GetIniValue( "24h" );
 if(iVal=="true") {
  bUse24h = true;
 }
 else {
  bUse24h = false;
 }
 IniFile.CloseIniFile();
 bCheckIni = false;
}
}

Find
CODE

var b_restart;
var b_dvd;
var bInMusicMenu;
var bTrackListVisible;
var musicOnBoot;
var currentAlbum;
var currentTrack;

and add these variables at the end
CODE
var bUse24h;
var bCheckIni;

Find
CODE
function initialize()
{
musicOnBoot = false;
currentAlbum = 0;
currentTrack = 0;

add
CODE

function initialize()
{
musicOnBoot = false;
currentAlbum = 0;
currentTrack = 0;
       bUse24h = true;
bCheckIni = false;

find
CODE
function ApplyDashStyle()

add this in the top of the function
CODE

var IniFile = new Settings;
IniFile.SetIniSection( "List Display" );
e = IniFile.GetIniValue("24h"); // *!*
if(e == "true") {
bUse24h = true;
}
else {
bUse24h = false;
}

IniFile.CloseIniFile();


Now go to the config.xap
find
CODE
function BuildMainList()
{
var i = 0;
configList = new Array;
configValues = new Array;
configSelect = new Array;
configList[i] = "Dash Style:";
configValues[i] = "c-Dashboard Settings-Dash Style";
configSelect[i] = "ToggleMM()";
i = i + 1;
   configList[i] = "Menus Use Names From xbe:";
configValues[i] = "c-Naming Method-use xbe names";
configSelect[i] = "ToggleUseXBENames()";
i = i + 1;
   configList[i] = "AutoLaunch Inserted Media:";
configValues[i] = "c-AutoLaunch Media-Launch On Insert";
configSelect[i] = "ToggleAutoLaunchMedia()";
i = i + 1;
configList[i] = "Background Music Start on Boot:";
configValues[i] = "c-Music On Boot-enabled"; //section-value
configSelect[i] = "ToggleTF()";
i = i + 1;
configList[i] = "Music Initial Volume:";
configValues[i] = "c-Music On Boot-volume";
configSelect[i] = "ConfigKeyB()";
i = i + 1;

add
CODE
configList[i] = "24h Time System";
configValues[i] = "c-List Display-24h";
configSelect[i] = "ToggleTF()";
i = i + 1;


Now open up your uix.ini and and add
CODE
[List Display]
24h=false


this will do the trick.. I made the code so you don't need to restart UIX when you change between 24h and 12h time system.


#4 ImOkRuOk

ImOkRuOk

    X-S Senior Member

  • Members
  • PipPip
  • 264 posts
  • Location:USA
  • Interests:Xbox, games: fighting, action, Gore and blood and guts and death and violence and satan
  • Xbox Version:v1.1
  • 360 version:v4.0 (jasper)

Posted 21 February 2005 - 05:21 AM

ok, got the code all in, first time i messed it, dash wouldnt load, now i got the code in all right, dash loads, config shows whats in ini, but no effect, in 24h no matter~ lemme check another xap, I might have changed...

#5 ImOkRuOk

ImOkRuOk

    X-S Senior Member

  • Members
  • PipPip
  • 264 posts
  • Location:USA
  • Interests:Xbox, games: fighting, action, Gore and blood and guts and death and violence and satan
  • Xbox Version:v1.1
  • 360 version:v4.0 (jasper)

Posted 22 February 2005 - 02:46 AM

nope, should be fine, all code is good, shows in config, saves changes... no effect... stuck in 24 hour~

#6 Xsmurf

Xsmurf

    X-S Young Member

  • Members
  • Pip
  • 34 posts

Posted 24 March 2005 - 02:29 PM

Nope this isn't working for me also, would't be nice if someone could't come with a solution smile.gif


And is there a way to make the clock disappear when i click on the B-button.


Anyway keep up the good work

THIS DASH ROCKS

#7 Xsmurf

Xsmurf

    X-S Young Member

  • Members
  • Pip
  • 34 posts

Posted 08 April 2005 - 12:29 AM

Did anyone succeded in making this code to work.

#8 esdubu

esdubu

    X-S X-perience

  • Members
  • PipPip
  • 313 posts
  • Location:Preston, England
  • Xbox Version:v1.6
  • 360 version:v4.0 (jasper)

Posted 10 May 2005 - 05:00 PM

Just an idea off the top of my head would it be possible to get this working by when the clock gets to a certain time it adds 12 to the hour number?

eg: 1.00 pm + 12 gives 13.00 pm

Long shot and i don't really have the skills to try it for myself but you don't ask you don't get!




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users