Fix missing main menu music when S3TC warning is displayed, by removing archive builder from GUI startup.

This was SVN commit r8368.
This commit is contained in:
Ykkrosh 2010-10-15 14:10:36 +00:00
parent 835609df20
commit eec07b3f85
3 changed files with 6 additions and 94 deletions

View File

@ -26,12 +26,4 @@
<script file="gui/common/functions_global_object.js" />
<!--
==========================================
- INCLUDE SCRIPT - GUI PAGE FUNCTIONS
==========================================
-->
<script file="gui/common/functions_page_pregame.js" />
</objects>

View File

@ -1,47 +1,24 @@
/*
DESCRIPTION : Main Pregame JS Script file.
NOTES : Contains functions and code for Main Menu.
*/
// ====================================================================
// Switch from the archive builder to the main menu.
function startMainMenu()
function init()
{
// Reveal the main menu now that the archive has been loaded.
guiHide ("ab");
guiUnHide ("pg");
// Play main 0 A.D. theme when the main menu starts.
global.curr_music = newRandomSound("music", "menu");
if (global.curr_music)
global.curr_music.loop();
// Set starting volume (I'm using a value of zero here for no sound; feel free to comment out these two lines to use defaults).
// global.curr_music.setGain (0.0);
// g_ConfigDB.system["sound.mastergain"] = 0.0;
}
// ====================================================================
// Helper function that enables the dark background mask, then reveals a given subwindow object.
function openMainMenuSubWindow (windowName)
{
guiUnHide ("pgSubWindow");
guiUnHide (windowName);
guiUnHide("pgSubWindow");
guiUnHide(windowName);
}
// ====================================================================
// Helper function that disables the dark background mask, then hides a given subwindow object.
function closeMainMenuSubWindow (windowName)
{
guiHide ("pgSubWindow");
guiHide (windowName);
guiHide("pgSubWindow");
guiHide(windowName);
}
// ====================================================================
// Switch to a given options tab window.
function openOptionsTab(tabName)
{
@ -75,8 +52,6 @@ function openOptionsTab(tabName)
getGUIObjectByName (tabName + "Button").enabled = false;
}
// ====================================================================
// Move the credits up the screen.
function updateCredits()
{
@ -95,6 +70,3 @@ function updateCredits()
guiUnHide ("pg");
}
}
// ====================================================================

View File

@ -2,60 +2,8 @@
<objects>
<script>
function init() { }
</script>
<script file="gui/pregame/mainmenu.js"/>
<!--
==========================================
- PROGRESS BAR FOR ARCHIVE BUILDER
==========================================
-->
<object name="ab"
type="button"
size="0 0 100% 100%"
hidden="true"
ghost="false"
hotkey="archive.abort"
sprite="bkFillBlack"
>
<action on="Press"><![CDATA[
// If the user aborts the archive, switch to the main menu.
archiveBuilderCancel();
startMainMenu();
]]></action>
<object name="abProgressBarText"
type="text"
size="25 100%-190 100%-25 100%-175"
font="serif-14"
textcolor="255 255 255"
text_align="center"
text_valign="center"
>
Rebuilding Archive ... Press Alt+F4 or Left-Click to Cancel
</object>
<object name="abProgressBar"
style="wheatProgressBarBlue"
type="progressbar"
size="25 100%-160 100%-25 100%-145"
>
<action on="Load"><![CDATA[
// Reset progress bar to zero at start of game.
this.caption = 0;
]]></action>
<action on="ArchiveBuilderProgress"><![CDATA[
this.caption = g_ArchiveBuilderProgress;
]]></action>
<action on="ArchiveBuilderComplete"><![CDATA[
// When the archive is finished, switch to the main menu.
startMainMenu();
]]></action>
</object>
</object>
<!--
==========================================
- MAIN MENU - "COMMANDER'S TENT" BACKDROP