1
0
forked from 0ad/0ad

Creating playlist sub-window to soon try out file access functions. (Committing in-development stuff to get an auto-build incorporating change to GUI .xml names.)

This was SVN commit r2214.
This commit is contained in:
Acumen 2005-05-02 22:04:29 +00:00
parent 87f4cc2592
commit cab424ce81
8 changed files with 532 additions and 453 deletions

View File

@ -179,6 +179,7 @@ hotkey.menu.resign = "Alt+X" ; End current game session and return to main m
; > HOTKEYS ONLY ; > HOTKEYS ONLY
hotkey.onlinehelp = "F1" ; Enable/disable online manual entry for current selection. hotkey.onlinehelp = "F1" ; Enable/disable online manual entry for current selection.
hotkey.jukebox = "Ctrl+M" ; Enable/disable tracklist viewer.
hotkey.next.song = "M" ; Start another music track. hotkey.next.song = "M" ; Start another music track.
hotkey.audio.toggle = "Ctrl+A" ; Enable/disable sound. hotkey.audio.toggle = "Ctrl+A" ; Enable/disable sound.

View File

@ -70,9 +70,6 @@
<script file="gui/test/functions_atlas.js"><![CDATA[ <script file="gui/test/functions_atlas.js"><![CDATA[
]]></script> ]]></script>
<script file="gui/test/functions_manual.js"><![CDATA[
]]></script>
<script file="gui/test/functions_session_group_pane.js"><![CDATA[ <script file="gui/test/functions_session_group_pane.js"><![CDATA[
]]></script> ]]></script>
@ -91,12 +88,17 @@
<script file="gui/test/functions_session_subwindows.js"><![CDATA[ <script file="gui/test/functions_session_subwindows.js"><![CDATA[
]]></script> ]]></script>
<script file="gui/test/functions_session_subwindows_manual.js"><![CDATA[
]]></script>
<script file="gui/test/functions_session_subwindows_jukebox.js"><![CDATA[
]]></script>
<script file="gui/test/functions_session.js"><![CDATA[ <script file="gui/test/functions_session.js"><![CDATA[
initCoord(); initCoord();
initGlobal(); initGlobal();
initPreGame(); initPreGame();
initSession(); initSession();
initManual();
initAtlas(); initAtlas();
]]></script> ]]></script>

View File

@ -0,0 +1,36 @@
<?xml version="1.0" encoding="iso-8859-1" standalone="no" ?>
<!DOCTYPE objects SYSTEM "../gui.dtd">
<!--
==========================================
- JUKEBOX DEFINITION -
==========================================
-->
<objects>
<object type="empty" name="JUKEBOX_GUI" size="0 0 100% 100%" z="1" hotkey="onlinehelp" hidden="true">
<action on="Press"><![CDATA[
// Toggle jukebox.
GUIObjectToggle("JUKEBOX_GUI");
GUIObjectToggle("SESSION_GUI");
]]></action>
<object type="text" name="JUKEBOX_BKG" sprite="0ad_window" font="prospero16" textcolor="0 0 0" z="100" hidden="false" ghost="true"><action on="Load"><![CDATA[ setSizeArray(this.name, Crd[JUKEBOX_BKG]); ]]></action>
<action on="Tick"><![CDATA[
if !( getGUIObjectByName( "MANUAL_GUI" ).hidden )
jukeboxDisplay();
]]></action>
</object>
<object type="button" name="JUKEBOX_EXIT_BUTTON" sprite="exit_sprite" sprite_over="exit_sprite_over" ghost="false" z="100" hidden="false"><action on="Load"><![CDATA[ setSizeArray(this.name, Crd[JUKEBOX_EXIT_BUTTON]); ]]></action>
<action on="Press"><![CDATA[
// Close jukebox.
GUIObjectHide("JUKEBOX_GUI");
GUIObjectUnhide("SESSION_GUI");
]]></action>
</object>
</object>
</objects>

View File

@ -29,6 +29,8 @@ function initSession()
initMapOrb(); initMapOrb();
initTeamTray(); initTeamTray();
initSubWindows(); initSubWindows();
initManual();
initJukebox();
} }
// ==================================================================== // ====================================================================

View File

@ -0,0 +1,38 @@
function initJukebox()
{
// ============================================ CONSTANTS ================================================
JUKEBOX = new Object();
JUKEBOX.span = 5;
// ============================================= GLOBALS =================================================
// Background of jukebox.
JUKEBOX_BKG = addArrayElement(Crd, Crd.last);
Crd[Crd.last-1].rleft = left_screen; Crd[Crd.last-1].rtop = top_screen;
Crd[Crd.last-1].rright = right_screen; Crd[Crd.last-1].rbottom = bottom_screen;
Crd[Crd.last-1].width = 50;
Crd[Crd.last-1].height = 50;
Crd[Crd.last-1].x = 50;
Crd[Crd.last-1].y = 50;
// Jukebox exit button.
JUKEBOX_EXIT_BUTTON = addArrayElement(Crd, Crd.last);
Crd[Crd.last-1].rleft = right_screen; Crd[Crd.last-1].rtop = top_screen;
Crd[Crd.last-1].rright = right_screen; Crd[Crd.last-1].rbottom = top_screen;
Crd[Crd.last-1].width = 16;
Crd[Crd.last-1].height = 16;
Crd[Crd.last-1].x = 26;
Crd[Crd.last-1].y = 25;
}
// ====================================================================
function jukeboxDisplay()
{
// Display heading.
JukeBoxBkg = getGUIObjectByName("MANUAL_BKG");
JukeBoxBkg.caption = "Jukebox";
}
// ====================================================================

View File

@ -1,447 +1,445 @@
function initManual() function initManual()
{ {
// ============================================ CONSTANTS ================================================ // ============================================ CONSTANTS ================================================
MANUAL = new Object(); MANUAL = new Object();
MANUAL.span = 5; MANUAL.span = 5;
// ============================================= GLOBALS ================================================= // ============================================= GLOBALS =================================================
// Background of online manual. // Background of online manual.
MANUAL_BKG = addArrayElement(Crd, Crd.last); MANUAL_BKG = addArrayElement(Crd, Crd.last);
Crd[Crd.last-1].rleft = left_screen; Crd[Crd.last-1].rtop = top_screen; Crd[Crd.last-1].rleft = left_screen; Crd[Crd.last-1].rtop = top_screen;
Crd[Crd.last-1].rright = right_screen; Crd[Crd.last-1].rbottom = bottom_screen; Crd[Crd.last-1].rright = right_screen; Crd[Crd.last-1].rbottom = bottom_screen;
Crd[Crd.last-1].width = 50; Crd[Crd.last-1].width = 50;
Crd[Crd.last-1].height = 50; Crd[Crd.last-1].height = 50;
Crd[Crd.last-1].x = 50; Crd[Crd.last-1].x = 50;
Crd[Crd.last-1].y = 50; Crd[Crd.last-1].y = 50;
// Online manual portrait. // Online manual portrait.
MANUAL_PORTRAIT = addArrayElement(Crd, Crd.last); MANUAL_PORTRAIT = addArrayElement(Crd, Crd.last);
Crd[Crd.last-1].rleft = left_screen; Crd[Crd.last-1].rtop = top_screen; Crd[Crd.last-1].rleft = left_screen; Crd[Crd.last-1].rtop = top_screen;
Crd[Crd.last-1].rright = left_screen; Crd[Crd.last-1].rbottom = top_screen; Crd[Crd.last-1].rright = left_screen; Crd[Crd.last-1].rbottom = top_screen;
Crd[Crd.last-1].width = crd_portrait_lrg_width; Crd[Crd.last-1].width = crd_portrait_lrg_width;
Crd[Crd.last-1].height = crd_portrait_lrg_height; Crd[Crd.last-1].height = crd_portrait_lrg_height;
Crd[Crd.last-1].x = Crd[MANUAL_BKG].x+10; Crd[Crd.last-1].x = Crd[MANUAL_BKG].x+10;
Crd[Crd.last-1].y = Crd[MANUAL_BKG].y+30; Crd[Crd.last-1].y = Crd[MANUAL_BKG].y+30;
// Online manual rollover. // Online manual rollover.
MANUAL_ROLLOVER = addArrayElement(Crd, Crd.last); MANUAL_ROLLOVER = addArrayElement(Crd, Crd.last);
Crd[Crd.last-1].rleft = left_screen; Crd[Crd.last-1].rtop = top_screen; Crd[Crd.last-1].rleft = left_screen; Crd[Crd.last-1].rtop = top_screen;
Crd[Crd.last-1].rright = right_screen; Crd[Crd.last-1].rbottom = top_screen; Crd[Crd.last-1].rright = right_screen; Crd[Crd.last-1].rbottom = top_screen;
Crd[Crd.last-1].width = 60; Crd[Crd.last-1].width = 60;
Crd[Crd.last-1].height = Crd[MANUAL_PORTRAIT].height; Crd[Crd.last-1].height = Crd[MANUAL_PORTRAIT].height;
Crd[Crd.last-1].x = Crd[MANUAL_PORTRAIT].x+Crd[MANUAL_PORTRAIT].width+MANUAL.span; Crd[Crd.last-1].x = Crd[MANUAL_PORTRAIT].x+Crd[MANUAL_PORTRAIT].width+MANUAL.span;
Crd[Crd.last-1].y = Crd[MANUAL_PORTRAIT].y; Crd[Crd.last-1].y = Crd[MANUAL_PORTRAIT].y;
// Online manual history. // Online manual history.
MANUAL_HISTORY = addArrayElement(Crd, Crd.last); MANUAL_HISTORY = addArrayElement(Crd, Crd.last);
Crd[Crd.last-1].rleft = left_screen; Crd[Crd.last-1].rtop = bottom_screen; Crd[Crd.last-1].rleft = left_screen; Crd[Crd.last-1].rtop = bottom_screen;
Crd[Crd.last-1].rright = right_screen; Crd[Crd.last-1].rbottom = bottom_screen; Crd[Crd.last-1].rright = right_screen; Crd[Crd.last-1].rbottom = bottom_screen;
Crd[Crd.last-1].width = Crd[MANUAL_ROLLOVER].width; Crd[Crd.last-1].width = Crd[MANUAL_ROLLOVER].width;
Crd[Crd.last-1].height = Crd[MANUAL_ROLLOVER].height; Crd[Crd.last-1].height = Crd[MANUAL_ROLLOVER].height;
Crd[Crd.last-1].x = Crd[MANUAL_PORTRAIT].x; Crd[Crd.last-1].x = Crd[MANUAL_PORTRAIT].x;
Crd[Crd.last-1].y = 60; Crd[Crd.last-1].y = 60;
// Online manual text. // Online manual text.
MANUAL_NAME = addArrayElement(Crd, Crd.last); MANUAL_NAME = addArrayElement(Crd, Crd.last);
Crd[Crd.last-1].rleft = left_screen; Crd[Crd.last-1].rtop = top_screen; Crd[Crd.last-1].rleft = left_screen; Crd[Crd.last-1].rtop = top_screen;
Crd[Crd.last-1].rright = right_screen; Crd[Crd.last-1].rbottom = bottom_screen; Crd[Crd.last-1].rright = right_screen; Crd[Crd.last-1].rbottom = bottom_screen;
Crd[Crd.last-1].width = Crd[MANUAL_HISTORY].width; Crd[Crd.last-1].width = Crd[MANUAL_HISTORY].width;
Crd[Crd.last-1].height = Crd[MANUAL_HISTORY].y+Crd[MANUAL_HISTORY].height+MANUAL.span; Crd[Crd.last-1].height = Crd[MANUAL_HISTORY].y+Crd[MANUAL_HISTORY].height+MANUAL.span;
Crd[Crd.last-1].x = Crd[MANUAL_HISTORY].x; Crd[Crd.last-1].x = Crd[MANUAL_HISTORY].x;
Crd[Crd.last-1].y = Crd[MANUAL_ROLLOVER].y+Crd[MANUAL_ROLLOVER].height+MANUAL.span; Crd[Crd.last-1].y = Crd[MANUAL_ROLLOVER].y+Crd[MANUAL_ROLLOVER].height+MANUAL.span;
// Online manual exit button. // Online manual exit button.
MANUAL_EXIT_BUTTON = addArrayElement(Crd, Crd.last); MANUAL_EXIT_BUTTON = addArrayElement(Crd, Crd.last);
Crd[Crd.last-1].rleft = right_screen; Crd[Crd.last-1].rtop = top_screen; Crd[Crd.last-1].rleft = right_screen; Crd[Crd.last-1].rtop = top_screen;
Crd[Crd.last-1].rright = right_screen; Crd[Crd.last-1].rbottom = top_screen; Crd[Crd.last-1].rright = right_screen; Crd[Crd.last-1].rbottom = top_screen;
Crd[Crd.last-1].width = 16; Crd[Crd.last-1].width = 16;
Crd[Crd.last-1].height = 16; Crd[Crd.last-1].height = 16;
Crd[Crd.last-1].x = 26; Crd[Crd.last-1].x = 26;
Crd[Crd.last-1].y = 25; Crd[Crd.last-1].y = 25;
} }
// ==================================================================== // ====================================================================
function manualDisplay() function manualDisplay()
{ {
// Display heading. // Display heading.
ManualBkg = getGUIObjectByName("MANUAL_BKG"); ManualBkg = getGUIObjectByName("MANUAL_BKG");
ManualBkg.caption = "In-Game Help: "; ManualBkg.caption = "In-Game Help: ";
if (selection[0].traits.id.civ) if (selection[0].traits.id.civ)
ManualBkg.caption += selection[0].traits.id.civ + ": "; ManualBkg.caption += selection[0].traits.id.civ + ": ";
if (selection[0].traits.id.generic) if (selection[0].traits.id.generic)
ManualBkg.caption += selection[0].traits.id.generic + ": "; ManualBkg.caption += selection[0].traits.id.generic + ": ";
if (selection[0].traits.id.specific) if (selection[0].traits.id.specific)
ManualBkg.caption += selection[0].traits.id.specific; ManualBkg.caption += selection[0].traits.id.specific;
// Display portrait. // Display portrait.
if (selection[0].traits.id.icon) if (selection[0].traits.id.icon)
{ {
setPortrait("MANUAL_PORTRAIT", selection[0].traits.id.icon, selection[0].traits.id.civ_code, selection[0].traits.id.icon_cell); setPortrait("MANUAL_PORTRAIT", selection[0].traits.id.icon, selection[0].traits.id.civ_code, selection[0].traits.id.icon_cell);
} }
// Display rollover text. // Display rollover text.
if (selection[0].traits.id.rollover) if (selection[0].traits.id.rollover)
{ {
ManualRollover = getGUIObjectByName("MANUAL_ROLLOVER"); ManualRollover = getGUIObjectByName("MANUAL_ROLLOVER");
ManualRollover.caption = selection[0].traits.id.rollover; ManualRollover.caption = selection[0].traits.id.rollover;
} }
// Display name(s). // Display name(s).
ManualRollover = getGUIObjectByName("MANUAL_NAME"); if (selection[0].traits.id.generic)
ManualRollover.caption = ""; ManualRollover.caption += selection[0].traits.id.generic;
if (selection[0].traits.id.generic) if (selection[0].traits.id.generic && selection[0].traits.id.specific)
ManualRollover.caption += selection[0].traits.id.generic; ManualRollover.caption += " - ";
if (selection[0].traits.id.generic && selection[0].traits.id.specific) if (selection[0].traits.id.specific)
ManualRollover.caption += " - "; ManualRollover.caption += selection[0].traits.id.specific;
if (selection[0].traits.id.specific) if (selection[0].traits.id.specific && selection[0].traits.id.ranked)
ManualRollover.caption += selection[0].traits.id.specific; ManualRollover.caption += " - ";
if (selection[0].traits.id.specific && selection[0].traits.id.ranked) if (selection[0].traits.id.ranked)
ManualRollover.caption += " - "; ManualRollover.caption += selection[0].traits.id.ranked;
if (selection[0].traits.id.ranked) // Personal name.
ManualRollover.caption += selection[0].traits.id.ranked; if (selection[0].traits.id.personal && selection[0].traits.id.personal != "")
// Personal name. ManualRollover.caption += " - " + selection[0].traits.id.personal;
if (selection[0].traits.id.personal && selection[0].traits.id.personal != "") ManualRollover.caption += "\n";
ManualRollover.caption += " - " + selection[0].traits.id.personal;
ManualRollover.caption += "\n"; // Display civilisation.
if (selection[0].traits.id.civ && selection[0].traits.id.civ_code)
// Display civilisation. ManualRollover.caption += "Civilisation: " + selection[0].traits.id.civ + " (" + selection[0].traits.id.civ_code + ")" + "\n";
if (selection[0].traits.id.civ && selection[0].traits.id.civ_code) if (!selection[0].traits.id.civ_code)
ManualRollover.caption += "Civilisation: " + selection[0].traits.id.civ + " (" + selection[0].traits.id.civ_code + ")" + "\n"; ManualRollover.caption += "Civilisation: " + selection[0].traits.id.civ + "\n";
if (!selection[0].traits.id.civ_code)
ManualRollover.caption += "Civilisation: " + selection[0].traits.id.civ + "\n"; // Display player info.
if (selection[0].player){
// Display player info. if (selection[0].player.name)
if (selection[0].player){ ManualRollover.caption += "Player Name: " + selection[0].player.name + "\n";
if (selection[0].player.name) if (selection[0].player.id)
ManualRollover.caption += "Player Name: " + selection[0].player.name + "\n"; ManualRollover.caption += "Player ID: " + selection[0].player.id + "\n";
if (selection[0].player.id) if (selection[0].player.colour)
ManualRollover.caption += "Player ID: " + selection[0].player.id + "\n"; ManualRollover.caption += "Player Colour: " + selection[0].player.colour + "\n";
if (selection[0].player.colour) if (selection[0].player.controlled)
ManualRollover.caption += "Player Colour: " + selection[0].player.colour + "\n"; ManualRollover.caption += "Player Controlled: " + selection[0].player.controlled + "\n";
if (selection[0].player.controlled) // if (players[])
ManualRollover.caption += "Player Controlled: " + selection[0].player.controlled + "\n"; // ManualRollover.caption += "Players[]: " + players[] + "\n";
// if (players[]) }
// ManualRollover.caption += "Players[]: " + players[] + "\n";
} // Display hitpoints.
if (selection[0].traits.health.curr && selection[0].traits.health.max && selection[0].traits.health)
// Display hitpoints. ManualRollover.caption += "Hitpoints: " + selection[0].traits.health.curr + "/" + selection[0].traits.health.max + "\n";
if (selection[0].traits.health.curr && selection[0].traits.health.max && selection[0].traits.health)
ManualRollover.caption += "Hitpoints: " + selection[0].traits.health.curr + "/" + selection[0].traits.health.max + "\n"; // Display rank.
if (selection[0].traits.up.rank)
// Display rank. ManualRollover.caption += "Rank: " + selection[0].traits.up.rank + "\n";
if (selection[0].traits.up.rank)
ManualRollover.caption += "Rank: " + selection[0].traits.up.rank + "\n"; // Display experience.
if (selection[0].traits.up && selection[0].traits.up.curr && selection[0].traits.up.req)
// Display experience. ManualRollover.caption += "XP: " + selection[0].traits.up.curr + "/" + selection[0].traits.up.req + "\n";
if (selection[0].traits.up && selection[0].traits.up.curr && selection[0].traits.up.req)
ManualRollover.caption += "XP: " + selection[0].traits.up.curr + "/" + selection[0].traits.up.req + "\n"; // Display population.
if (selection[0].traits.population)
// Display population. {
if (selection[0].traits.population) if (selection[0].traits.population.sub)
{ ManualRollover.caption += "Pop: -" + selection[0].traits.population.sub + "\n";
if (selection[0].traits.population.sub) if (selection[0].traits.population.add)
ManualRollover.caption += "Pop: -" + selection[0].traits.population.sub + "\n"; ManualRollover.caption += "Housing: +" + selection[0].traits.population.add + "\n";
if (selection[0].traits.population.add) }
ManualRollover.caption += "Housing: +" + selection[0].traits.population.add + "\n";
} // Display garrison.
if (selection[0].traits.garrison)
// Display garrison. {
if (selection[0].traits.garrison) if (selection[0].traits.garrison.curr && selection[0].traits.garrison.max)
{ ManualRollover.caption += "Garrison: " + selection[0].traits.garrison.curr + "/" + selection[0].traits.garrison.max + "\n";
if (selection[0].traits.garrison.curr && selection[0].traits.garrison.max) }
ManualRollover.caption += "Garrison: " + selection[0].traits.garrison.curr + "/" + selection[0].traits.garrison.max + "\n";
} // Display supply.
if (selection[0].traits.supply)
// Display supply. {
if (selection[0].traits.supply) if (selection[0].traits.supply.curr && selection[0].traits.supply.max && selection[0].traits.supply.type)
{ {
if (selection[0].traits.supply.curr && selection[0].traits.supply.max && selection[0].traits.supply.type) // If Supply is infinite,
{ if (selection[0].traits.supply.curr == "0" && selection[0].traits.supply.max == "0")
// If Supply is infinite, // Use infinity symbol.
if (selection[0].traits.supply.curr == "0" && selection[0].traits.supply.max == "0") ManualRollover.caption += "Supply: " + selection[0].traits.supply.curr + "/" + selection[0].traits.supply.max + " " + selection[0].traits.supply.type + " (" + selection[0].traits.supply.subtype + ")\n";
// Use infinity symbol. else
ManualRollover.caption += "Supply: " + selection[0].traits.supply.curr + "/" + selection[0].traits.supply.max + " " + selection[0].traits.supply.type + " (" + selection[0].traits.supply.subtype + ")\n"; // Use numbers.
else ManualRollover.caption += "Supply: 8 " + selection[0].traits.supply.type + " (" + selection[0].traits.supply.subtype + ")\n";
// Use numbers. }
ManualRollover.caption += "Supply: 8 " + selection[0].traits.supply.type + " (" + selection[0].traits.supply.subtype + ")\n"; }
}
} if (selection[0].traits.loot)
{
if (selection[0].traits.loot) // Display UP on death.
{ if (selection[0].traits.loot.up)
// Display UP on death. ManualRollover.caption += "UP: " + selection[0].traits.loot.up + "\n";
if (selection[0].traits.loot.up)
ManualRollover.caption += "UP: " + selection[0].traits.loot.up + "\n"; // Display loot.
if (selection[0].traits.loot.food || selection[0].traits.loot.wood || selection[0].traits.loot.stone || selection[0].traits.loot.ore)
// Display loot. {
if (selection[0].traits.loot.food || selection[0].traits.loot.wood || selection[0].traits.loot.stone || selection[0].traits.loot.ore) ManualRollover.caption += "Loot: ";
{ if (selection[0].traits.loot.food)
ManualRollover.caption += "Loot: "; ManualRollover.caption += selection[0].traits.loot.food + " Food ";
if (selection[0].traits.loot.food) if (selection[0].traits.loot.wood)
ManualRollover.caption += selection[0].traits.loot.food + " Food "; ManualRollover.caption += selection[0].traits.loot.wood + " Wood ";
if (selection[0].traits.loot.wood) if (selection[0].traits.loot.stone)
ManualRollover.caption += selection[0].traits.loot.wood + " Wood "; ManualRollover.caption += selection[0].traits.loot.stone + " Stone ";
if (selection[0].traits.loot.stone) if (selection[0].traits.loot.ore)
ManualRollover.caption += selection[0].traits.loot.stone + " Stone "; ManualRollover.caption += selection[0].traits.loot.ore + " Ore ";
if (selection[0].traits.loot.ore) ManualRollover.caption += "\n";
ManualRollover.caption += selection[0].traits.loot.ore + " Ore "; }
ManualRollover.caption += "\n"; }
}
} // Display minimap.
if (selection[0].traits.minimap)
// Display minimap. {
if (selection[0].traits.minimap)
{ if (selection[0].traits.minimap && selection[0].traits.minimap.type)
ManualRollover.caption += "Map Type: " + selection[0].traits.minimap.type + "\n";
if (selection[0].traits.minimap && selection[0].traits.minimap.type)
ManualRollover.caption += "Map Type: " + selection[0].traits.minimap.type + "\n"; if (selection[0].traits.minimap && selection[0].traits.minimap.red && selection[0].traits.minimap.green && selection[0].traits.minimap.blue)
ManualRollover.caption += "Map Colour: " + selection[0].traits.minimap.red + "-" + selection[0].traits.minimap.green + "-" + selection[0].traits.minimap.blue + "\n";
if (selection[0].traits.minimap && selection[0].traits.minimap.red && selection[0].traits.minimap.green && selection[0].traits.minimap.blue) }
ManualRollover.caption += "Map Colour: " + selection[0].traits.minimap.red + "-" + selection[0].traits.minimap.green + "-" + selection[0].traits.minimap.blue + "\n";
} // Armour.
if (selection[0].traits.armour)
// Armour. {
if (selection[0].traits.armour) ManualRollover.caption += "Armour: ";
{
ManualRollover.caption += "Armour: "; if (selection[0].traits.armour.value)
{
if (selection[0].traits.armour.value) ManualRollover.caption += selection[0].traits.armour.value + " [";
{
ManualRollover.caption += selection[0].traits.armour.value + " ["; if (selection[0].traits.armour.crush)
ManualRollover.caption += "Crush: " + Math.round(selection[0].traits.armour.crush*100) + "%, ";
if (selection[0].traits.armour.crush)
ManualRollover.caption += "Crush: " + Math.round(selection[0].traits.armour.crush*100) + "%, "; if (selection[0].traits.armour.hack)
ManualRollover.caption += "Hack: " + Math.round(selection[0].traits.armour.hack*100) + "%, ";
if (selection[0].traits.armour.hack)
ManualRollover.caption += "Hack: " + Math.round(selection[0].traits.armour.hack*100) + "%, "; if (selection[0].traits.armour.pierce)
ManualRollover.caption += "Pierce: " + Math.round(selection[0].traits.armour.pierce*100) + "%";
if (selection[0].traits.armour.pierce)
ManualRollover.caption += "Pierce: " + Math.round(selection[0].traits.armour.pierce*100) + "%"; ManualRollover.caption += "]\n";
}
ManualRollover.caption += "]\n"; }
}
} // Attack.
if (selection[0].actions.attack)
// Attack. {
if (selection[0].actions.attack) ManualRollover.caption += "Attack: ";
{
ManualRollover.caption += "Attack: "; if (selection[0].actions.attack.damage)
{
if (selection[0].actions.attack.damage) ManualRollover.caption += selection[0].actions.attack.damage + " [";
{
ManualRollover.caption += selection[0].actions.attack.damage + " ["; if (selection[0].actions.attack.crush)
ManualRollover.caption += "Crush: " + Math.round(selection[0].actions.attack.crush*100) + "%, ";
if (selection[0].actions.attack.crush)
ManualRollover.caption += "Crush: " + Math.round(selection[0].actions.attack.crush*100) + "%, "; if (selection[0].actions.attack.hack)
ManualRollover.caption += "Hack: " + Math.round(selection[0].actions.attack.hack*100) + "%, ";
if (selection[0].actions.attack.hack)
ManualRollover.caption += "Hack: " + Math.round(selection[0].actions.attack.hack*100) + "%, "; if (selection[0].actions.attack.pierce)
ManualRollover.caption += "Pierce: " + Math.round(selection[0].actions.attack.pierce*100) + "%";
if (selection[0].actions.attack.pierce)
ManualRollover.caption += "Pierce: " + Math.round(selection[0].actions.attack.pierce*100) + "%"; ManualRollover.caption += "]\n";
}
ManualRollover.caption += "]\n";
} if (selection[0].actions.attack.range)
ManualRollover.caption += "Attack Range: " + selection[0].actions.attack.range + "\n";
if (selection[0].actions.attack.range)
ManualRollover.caption += "Attack Range: " + selection[0].actions.attack.range + "\n"; if (selection[0].actions.attack.accuracy)
ManualRollover.caption += "Attack Accuracy: " + selection[0].actions.attack.accuracy*100 + "%\n";
if (selection[0].actions.attack.accuracy) }
ManualRollover.caption += "Attack Accuracy: " + selection[0].actions.attack.accuracy*100 + "%\n";
} // Speed.
if (selection[0].actions.move)
// Speed. {
if (selection[0].actions.move) if (selection[0].actions.move.speed)
{ ManualRollover.caption += "Speed: " + selection[0].actions.move.speed + "\n";
if (selection[0].actions.move.speed)
ManualRollover.caption += "Speed: " + selection[0].actions.move.speed + "\n"; // Turn Radius.
if (selection[0].actions.move.turningradius)
// Turn Radius. ManualRollover.caption += "TurnRadius: " + selection[0].actions.move.turningradius + "\n";
if (selection[0].actions.move.turningradius) }
ManualRollover.caption += "TurnRadius: " + selection[0].actions.move.turningradius + "\n";
} // Vision.
if (selection[0].traits.vision)
// Vision. {
if (selection[0].traits.vision) if (selection[0].traits.vision.los)
{ ManualRollover.caption += "LOS: " + selection[0].traits.vision.los + "\n";
if (selection[0].traits.vision.los) }
ManualRollover.caption += "LOS: " + selection[0].traits.vision.los + "\n";
} // Classes.
if (selection[0].traits.id.class1)
// Classes. ManualRollover.caption += "Class1: " + selection[0].traits.id.class1 + "\n";
if (selection[0].traits.id.class1) if (selection[0].traits.id.class2)
ManualRollover.caption += "Class1: " + selection[0].traits.id.class1 + "\n"; ManualRollover.caption += "Class2: " + selection[0].traits.id.class2 + "\n";
if (selection[0].traits.id.class2) if (selection[0].traits.id.class3)
ManualRollover.caption += "Class2: " + selection[0].traits.id.class2 + "\n"; ManualRollover.caption += "Class3: " + selection[0].traits.id.class3 + "\n";
if (selection[0].traits.id.class3)
ManualRollover.caption += "Class3: " + selection[0].traits.id.class3 + "\n"; // Name directory.
if (selection[0].traits.id.personal1 && selection[0].traits.id.personal2)
// Name directory. ManualRollover.caption += "Name File: " + selection[0].traits.id.personal1 + " & " + selection[0].traits.id.personal2 + "\n";
if (selection[0].traits.id.personal1 && selection[0].traits.id.personal2)
ManualRollover.caption += "Name File: " + selection[0].traits.id.personal1 + " & " + selection[0].traits.id.personal2 + "\n"; // Internal flag.
if (selection[0].traits.id.internal_only)
// Internal flag. ManualRollover.caption += "Internal: " + selection[0].traits.id.internal_only + "\n";
if (selection[0].traits.id.internal_only)
ManualRollover.caption += "Internal: " + selection[0].traits.id.internal_only + "\n"; // Icon.
if (selection[0].traits.id.icon)
// Icon. ManualRollover.caption += "Icon: " + selection[0].traits.id.icon + "\n";
if (selection[0].traits.id.icon) if (selection[0].traits.id.icon_cell)
ManualRollover.caption += "Icon: " + selection[0].traits.id.icon + "\n"; ManualRollover.caption += "Icon_Cell: " + selection[0].traits.id.icon_cell + "\n";
if (selection[0].traits.id.icon_cell)
ManualRollover.caption += "Icon_Cell: " + selection[0].traits.id.icon_cell + "\n"; // Version.
if (selection[0].traits.id.version)
// Version. ManualRollover.caption += "Version: " + selection[0].traits.id.version + "\n";
if (selection[0].traits.id.version)
ManualRollover.caption += "Version: " + selection[0].traits.id.version + "\n"; // Lists.
if (selection[0].actions.create && selection[0].actions.create.list)
// Lists. {
if (selection[0].actions.create && selection[0].actions.create.list) if (selection[0].actions.create.list.unit)
{ ManualRollover.caption += "Trains: " + selection[0].actions.create.list.unit + "\n";
if (selection[0].actions.create.list.unit) if (selection[0].actions.create.list.structciv || selection[0].actions.create.list.structmil)
ManualRollover.caption += "Trains: " + selection[0].actions.create.list.unit + "\n"; {
if (selection[0].actions.create.list.structciv || selection[0].actions.create.list.structmil) ManualRollover.caption += "Builds: ";
{ if (selection[0].actions.create.list.structciv)
ManualRollover.caption += "Builds: "; ManualRollover.caption += selection[0].actions.create.list.structciv + " ";
if (selection[0].actions.create.list.structciv) if (selection[0].actions.create.list.structmil)
ManualRollover.caption += selection[0].actions.create.list.structciv + " "; ManualRollover.caption += selection[0].actions.create.list.structmil + " ";
if (selection[0].actions.create.list.structmil) ManualRollover.caption += "\n";
ManualRollover.caption += selection[0].actions.create.list.structmil + " "; }
ManualRollover.caption += "\n"; if (selection[0].actions.create.list.tech)
} ManualRollover.caption += "Research: " + selection[0].actions.create.list.research + "\n";
if (selection[0].actions.create.list.tech) }
ManualRollover.caption += "Research: " + selection[0].actions.create.list.research + "\n";
}
// Display types.
if (selection[0].traits.id.type)
// Display types. {
if (selection[0].traits.id.type) ManualTypeString = "";
{ if (selection[0].traits.id.type.gaia)
ManualTypeString = ""; {
if (selection[0].traits.id.type.gaia) ManualTypeString += "gaia ";
{ if (selection[0].traits.id.type.gaia.group.aqua)
ManualTypeString += "gaia "; ManualTypeString += "gaia.group.aqua ";
if (selection[0].traits.id.type.gaia.group.aqua) if (selection[0].traits.id.type.gaia.group.fauna)
ManualTypeString += "gaia.group.aqua "; ManualTypeString += "gaia.group.fauna ";
if (selection[0].traits.id.type.gaia.group.fauna) if (selection[0].traits.id.type.gaia.group.flora)
ManualTypeString += "gaia.group.fauna "; ManualTypeString += "gaia.group.flora ";
if (selection[0].traits.id.type.gaia.group.flora) if (selection[0].traits.id.type.gaia.group.geo)
ManualTypeString += "gaia.group.flora "; ManualTypeString += "gaia.group.geo ";
if (selection[0].traits.id.type.gaia.group.geo) if (selection[0].traits.id.type.gaia.group.resource)
ManualTypeString += "gaia.group.geo "; ManualTypeString += "gaia.group.resource ";
if (selection[0].traits.id.type.gaia.group.resource) }
ManualTypeString += "gaia.group.resource "; if (selection[0].traits.id.type.unit)
} {
if (selection[0].traits.id.type.unit) ManualTypeString += "unit ";
{ if (selection[0].traits.id.type.unit.group.citizensoldier)
ManualTypeString += "unit "; ManualTypeString += "unit.group.citizensoldier ";
if (selection[0].traits.id.type.unit.group.citizensoldier) if (selection[0].traits.id.type.unit.group.hero)
ManualTypeString += "unit.group.citizensoldier "; ManualTypeString += "unit.group.hero ";
if (selection[0].traits.id.type.unit.group.hero) if (selection[0].traits.id.type.unit.group.military)
ManualTypeString += "unit.group.hero "; ManualTypeString += "unit.group.military ";
if (selection[0].traits.id.type.unit.group.military) if (selection[0].traits.id.type.unit.group.ship)
ManualTypeString += "unit.group.military "; ManualTypeString += "unit.group.ship ";
if (selection[0].traits.id.type.unit.group.ship) if (selection[0].traits.id.type.unit.group.siege)
ManualTypeString += "unit.group.ship "; ManualTypeString += "unit.group.siege ";
if (selection[0].traits.id.type.unit.group.siege) if (selection[0].traits.id.type.unit.group.superunit)
ManualTypeString += "unit.group.siege "; ManualTypeString += "unit.group.superunit ";
if (selection[0].traits.id.type.unit.group.superunit) if (selection[0].traits.id.type.unit.group.support)
ManualTypeString += "unit.group.superunit "; ManualTypeString += "unit.group.support ";
if (selection[0].traits.id.type.unit.group.support) if (selection[0].traits.id.type.unit.group.trade)
ManualTypeString += "unit.group.support "; ManualTypeString += "unit.group.trade ";
if (selection[0].traits.id.type.unit.group.trade) if (selection[0].traits.id.type.unit.group.warship)
ManualTypeString += "unit.group.trade "; ManualTypeString += "unit.group.warship ";
if (selection[0].traits.id.type.unit.group.warship) if (selection[0].traits.id.type.unit.group.worker)
ManualTypeString += "unit.group.warship "; ManualTypeString += "unit.group.worker ";
if (selection[0].traits.id.type.unit.group.worker) if (selection[0].traits.id.type.unit.material.mechanical)
ManualTypeString += "unit.group.worker "; ManualTypeString += "unit.material.mechanical ";
if (selection[0].traits.id.type.unit.material.mechanical) if (selection[0].traits.id.type.unit.material.organic)
ManualTypeString += "unit.material.mechanical "; ManualTypeString += "unit.material.organic ";
if (selection[0].traits.id.type.unit.material.organic) if (selection[0].traits.id.type.unit.attack.melee)
ManualTypeString += "unit.material.organic "; ManualTypeString += "unit.attack.melee ";
if (selection[0].traits.id.type.unit.attack.melee) if (selection[0].traits.id.type.unit.attack.ranged)
ManualTypeString += "unit.attack.melee "; ManualTypeString += "unit.attack.ranged ";
if (selection[0].traits.id.type.unit.attack.ranged) if (selection[0].traits.id.type.unit.foot)
ManualTypeString += "unit.attack.ranged "; {
if (selection[0].traits.id.type.unit.foot) ManualTypeString += "unit.foot ";
{ if (selection[0].traits.id.type.unit.foot.bow)
ManualTypeString += "unit.foot "; ManualTypeString += "unit.foot.bow ";
if (selection[0].traits.id.type.unit.foot.bow) if (selection[0].traits.id.type.unit.foot.javelin)
ManualTypeString += "unit.foot.bow "; ManualTypeString += "unit.foot.javelin ";
if (selection[0].traits.id.type.unit.foot.javelin) if (selection[0].traits.id.type.unit.foot.sling)
ManualTypeString += "unit.foot.javelin "; ManualTypeString += "unit.foot.sling ";
if (selection[0].traits.id.type.unit.foot.sling) if (selection[0].traits.id.type.unit.foot.spear)
ManualTypeString += "unit.foot.sling "; ManualTypeString += "unit.foot.spear ";
if (selection[0].traits.id.type.unit.foot.spear) if (selection[0].traits.id.type.unit.foot.sword)
ManualTypeString += "unit.foot.spear "; ManualTypeString += "unit.foot.sword ";
if (selection[0].traits.id.type.unit.foot.sword) }
ManualTypeString += "unit.foot.sword "; if (selection[0].traits.id.type.unit.mounted)
} {
if (selection[0].traits.id.type.unit.mounted) ManualTypeString += "unit.mounted ";
{ if (selection[0].traits.id.type.unit.mounted.bow)
ManualTypeString += "unit.mounted "; ManualTypeString += "unit.mounted.bow ";
if (selection[0].traits.id.type.unit.mounted.bow) if (selection[0].traits.id.type.unit.mounted.javelin)
ManualTypeString += "unit.mounted.bow "; ManualTypeString += "unit.mounted.javelin ";
if (selection[0].traits.id.type.unit.mounted.javelin) if (selection[0].traits.id.type.unit.mounted.spear)
ManualTypeString += "unit.mounted.javelin "; ManualTypeString += "unit.mounted.spear ";
if (selection[0].traits.id.type.unit.mounted.spear) if (selection[0].traits.id.type.unit.mounted.sword)
ManualTypeString += "unit.mounted.spear "; ManualTypeString += "unit.mounted.sword ";
if (selection[0].traits.id.type.unit.mounted.sword) if (selection[0].traits.id.type.unit.weapon.bow)
ManualTypeString += "unit.mounted.sword "; ManualTypeString += "unit.weapon.bow ";
if (selection[0].traits.id.type.unit.weapon.bow) if (selection[0].traits.id.type.unit.weapon.javelin)
ManualTypeString += "unit.weapon.bow "; ManualTypeString += "unit.weapon.javelin ";
if (selection[0].traits.id.type.unit.weapon.javelin) if (selection[0].traits.id.type.unit.weapon.sling)
ManualTypeString += "unit.weapon.javelin "; ManualTypeString += "unit.weapon.sling ";
if (selection[0].traits.id.type.unit.weapon.sling) if (selection[0].traits.id.type.unit.weapon.spear)
ManualTypeString += "unit.weapon.sling "; ManualTypeString += "unit.weapon.spear ";
if (selection[0].traits.id.type.unit.weapon.spear) if (selection[0].traits.id.type.unit.weapon.sword)
ManualTypeString += "unit.weapon.spear "; ManualTypeString += "unit.weapon.sword ";
if (selection[0].traits.id.type.unit.weapon.sword) }
ManualTypeString += "unit.weapon.sword "; }
} if (selection[0].traits.id.type.structure)
} {
if (selection[0].traits.id.type.structure) ManualTypeString += "structure ";
{ if (selection[0].traits.id.type.structure.group.defensive)
ManualTypeString += "structure "; ManualTypeString += "structure.group.defensive ";
if (selection[0].traits.id.type.structure.group.defensive) if (selection[0].traits.id.type.structure.group.housing)
ManualTypeString += "structure.group.defensive "; ManualTypeString += "structure.group.housing ";
if (selection[0].traits.id.type.structure.group.housing) if (selection[0].traits.id.type.structure.group.offensive)
ManualTypeString += "structure.group.housing "; ManualTypeString += "structure.group.offensive ";
if (selection[0].traits.id.type.structure.group.offensive) if (selection[0].traits.id.type.structure.group.supply)
ManualTypeString += "structure.group.offensive "; ManualTypeString += "structure.group.supply ";
if (selection[0].traits.id.type.structure.group.supply) if (selection[0].traits.id.type.structure.group.support)
ManualTypeString += "structure.group.supply "; ManualTypeString += "structure.group.support ";
if (selection[0].traits.id.type.structure.group.support) if (selection[0].traits.id.type.structure.group.tower)
ManualTypeString += "structure.group.support "; ManualTypeString += "structure.group.tower ";
if (selection[0].traits.id.type.structure.group.tower) if (selection[0].traits.id.type.structure.group.train)
ManualTypeString += "structure.group.tower "; ManualTypeString += "structure.group.train ";
if (selection[0].traits.id.type.structure.group.train) if (selection[0].traits.id.type.structure.group.wall)
ManualTypeString += "structure.group.train "; ManualTypeString += "structure.group.wall ";
if (selection[0].traits.id.type.structure.group.wall) if (selection[0].traits.id.type.structure.phase.cp)
ManualTypeString += "structure.group.wall "; ManualTypeString += "structure.phase.cp ";
if (selection[0].traits.id.type.structure.phase.cp) if (selection[0].traits.id.type.structure.phase.tp)
ManualTypeString += "structure.phase.cp "; ManualTypeString += "structure.phase.tp ";
if (selection[0].traits.id.type.structure.phase.tp) if (selection[0].traits.id.type.structure.phase.vp)
ManualTypeString += "structure.phase.tp "; ManualTypeString += "structure.phase.vp ";
if (selection[0].traits.id.type.structure.phase.vp) if (selection[0].traits.id.type.structure.material.stone)
ManualTypeString += "structure.phase.vp "; ManualTypeString += "structure.material.stone ";
if (selection[0].traits.id.type.structure.material.stone) if (selection[0].traits.id.type.structure.material.wood)
ManualTypeString += "structure.material.stone "; ManualTypeString += "structure.material.wood ";
if (selection[0].traits.id.type.structure.material.wood) }
ManualTypeString += "structure.material.wood ";
} if (ManualTypeString != "")
ManualRollover.caption = ManualRollover.caption + "Type(s): " + ManualTypeString + "\n";
if (ManualTypeString != "") }
ManualRollover.caption = ManualRollover.caption + "Type(s): " + ManualTypeString + "\n";
} // Display history text.
if (selection[0].traits.id.history)
// Display history text. {
if (selection[0].traits.id.history) ManualHistory = getGUIObjectByName("MANUAL_HISTORY");
{ ManualHistory.caption = "History: " + selection[0].traits.id.history;
ManualHistory = getGUIObjectByName("MANUAL_HISTORY"); }
ManualHistory.caption = "History: " + selection[0].traits.id.history; }
}
}

View File

@ -901,10 +901,12 @@ static void InitPs()
g_GUI.LoadXMLFile("gui/test/3_loading.xml");} g_GUI.LoadXMLFile("gui/test/3_loading.xml");}
{TIMER(ps_gui_4) {TIMER(ps_gui_4)
g_GUI.LoadXMLFile("gui/test/4_session.xml");} g_GUI.LoadXMLFile("gui/test/4_session.xml");}
{TIMER(ps_gui_5)
g_GUI.LoadXMLFile("gui/test/5_manual.xml");}
{TIMER(ps_gui_6) {TIMER(ps_gui_6)
g_GUI.LoadXMLFile("gui/test/6_subwindows.xml");} g_GUI.LoadXMLFile("gui/test/6_subwindows.xml");}
{TIMER(ps_gui_6_1)
g_GUI.LoadXMLFile("gui/test/6_1_manual.xml");}
{TIMER(ps_gui_6_2)
g_GUI.LoadXMLFile("gui/test/6_2_jukebox.xml");}
{TIMER(ps_gui_7) {TIMER(ps_gui_7)
g_GUI.LoadXMLFile("gui/test/7_atlas.xml");} g_GUI.LoadXMLFile("gui/test/7_atlas.xml");}
{TIMER(ps_gui_9) {TIMER(ps_gui_9)