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 }
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.
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:)
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 = "";
}
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 thisCODE
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;
addCODE
function initialize()
{
musicOnBoot = false;
currentAlbum = 0;
currentTrack = 0;
bUse24h = true;
bCheckIni = false;
find CODE
function ApplyDashStyle()
add this in the top of the functionCODE
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
findCODE
function BuildMainList()
{
var i = 0;
configList = new Array;
configValues = new Array;
configSelect = new Array;
configList = "Dash Style:";
configValues = "c-Dashboard Settings-Dash Style";
configSelect = "ToggleMM()";
i = i + 1;
configList = "Menus Use Names From xbe:";
configValues = "c-Naming Method-use xbe names";
configSelect = "ToggleUseXBENames()";
i = i + 1;
configList = "AutoLaunch Inserted Media:";
configValues = "c-AutoLaunch Media-Launch On Insert";
configSelect = "ToggleAutoLaunchMedia()";
i = i + 1;
configList = "Background Music Start on Boot:";
configValues = "c-Music On Boot-enabled"; //section-value
configSelect = "ToggleTF()";
i = i + 1;
configList = "Music Initial Volume:";
configValues = "c-Music On Boot-volume";
configSelect = "ConfigKeyB()";
i = i + 1;
add
CODE
configList = "24h Time System";
configValues = "c-List Display-24h";
configSelect = "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.