1
0
forked from 0ad/0ad

Added Stuart's UI changes

This was SVN commit r2557.
This commit is contained in:
Ykkrosh 2005-07-27 16:45:44 +00:00
parent d0516bc4a2
commit bb65fdc105
23 changed files with 0 additions and 4319 deletions

View File

@ -1,415 +0,0 @@
// Main Atlas Scenario Editor JS Script file
// Contains functions and code for the game's integrated Scenario Editor.
// ====================================================================
function initAtlas()
{
// ============================================ CONSTANTS =================================================
ATLAS_COUNTER_BOX = new Object();
ATLAS_COUNTER_BOX.width = 9;
ATLAS_COUNTER_BOX.height = 5;
// ============================================= GLOBALS ==================================================
initAtlasMainScreen();
initAtlasSectionMapCreator();
initAtlasSectionTerrainEditor();
initAtlasSectionObjectEditor();
}
// ====================================================================
function initAtlasMainScreen()
{
// Top-left corner piece of main editor frame.
ATLAS_MAINBORDER_LT_CORNER = addArrayElement(Crd, Crd.last);
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].width = 42;
Crd[Crd.last-1].height = 42;
Crd[Crd.last-1].x = 0;
Crd[Crd.last-1].y = 0;
// Top-right corner piece of main editor frame ("Info Selection Box").
ATLAS_MAINBORDER_RT_CORNER = 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 = 203;
Crd[Crd.last-1].height = 54;
Crd[Crd.last-1].x = 0;
Crd[Crd.last-1].y = Crd[ATLAS_MAINBORDER_LT_CORNER].y;
// Info window in top-right corner.
ATLAS_INFO_WINDOW = 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 = Crd[ATLAS_MAINBORDER_RT_CORNER].width-30-6;
Crd[Crd.last-1].height = Crd[ATLAS_MAINBORDER_RT_CORNER].height-9;
Crd[Crd.last-1].x = 3;
Crd[Crd.last-1].y = Crd[ATLAS_MAINBORDER_RT_CORNER].y+3;
// Top menu bar.
ATLAS_MAINBORDER_MENU_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 = top_screen;
Crd[Crd.last-1].width = Crd[ATLAS_MAINBORDER_RT_CORNER].width;
Crd[Crd.last-1].height = 19;
Crd[Crd.last-1].x = Crd[ATLAS_MAINBORDER_LT_CORNER].x+Crd[ATLAS_MAINBORDER_LT_CORNER].width;
Crd[Crd.last-1].y = Crd[ATLAS_MAINBORDER_LT_CORNER].y;
// Menu buttons.
ATLAS_MAINBORDER_MENU_BUTTON = new Object();
ATLAS_MAINBORDER_MENU_BUTTON.span = 0;
ATLAS_MAINBORDER_MENU_BUTTON.max = 12;
for (ATLAS_MAINBORDER_MENU_BUTTON.last = 1; ATLAS_MAINBORDER_MENU_BUTTON.last <= ATLAS_MAINBORDER_MENU_BUTTON.max; ATLAS_MAINBORDER_MENU_BUTTON.last++)
{
ATLAS_MAINBORDER_MENU_BUTTON[ATLAS_MAINBORDER_MENU_BUTTON.last] = Crd.last;
Crd[Crd.last] = new Object();
Crd[Crd.last].width = 60;
Crd[Crd.last].height = Crd[ATLAS_MAINBORDER_MENU_BKG].height;
Crd[Crd.last].rleft = left_screen;
Crd[Crd.last].rtop = top_screen;
Crd[Crd.last].rright = left_screen;
Crd[Crd.last].rbottom = top_screen;
if (ATLAS_MAINBORDER_MENU_BUTTON.last == 1)
Crd[Crd.last].x = Crd[ATLAS_MAINBORDER_MENU_BKG].x;
else
Crd[Crd.last].x = Crd[ATLAS_MAINBORDER_MENU_BUTTON[ATLAS_MAINBORDER_MENU_BUTTON.last]-1].x+Crd[Crd.last].width+ATLAS_MAINBORDER_MENU_BUTTON.span;
Crd[Crd.last].y = Crd[ATLAS_MAINBORDER_MENU_BKG].y;
Crd.last++;
}
// Top tool bar (1 row).
ATLAS_MAINBORDER_TOOLBAR_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 = top_screen;
Crd[Crd.last-1].width = Crd[ATLAS_MAINBORDER_RT_CORNER].width-Crd[ATLAS_MAINBORDER_LT_CORNER].width;
Crd[Crd.last-1].height = 20;
Crd[Crd.last-1].x = Crd[ATLAS_MAINBORDER_LT_CORNER].x;
Crd[Crd.last-1].y = Crd[ATLAS_MAINBORDER_MENU_BKG].y+Crd[ATLAS_MAINBORDER_MENU_BKG].height;
// Top tool bar (max: two rows).
ATLAS_MAINBORDER_TOOLBAR_BKG_MAX = 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 = top_screen;
Crd[Crd.last-1].width = Crd[ATLAS_MAINBORDER_TOOLBAR_BKG].width;
Crd[Crd.last-1].height = 35;
Crd[Crd.last-1].x = Crd[ATLAS_MAINBORDER_TOOLBAR_BKG].x;
Crd[Crd.last-1].y = Crd[ATLAS_MAINBORDER_TOOLBAR_BKG].y;
// Fully Minimise arrow on tool bar.
ATLAS_MAINBORDER_TOOLBAR_FULLY_MINIMISE_ARROW = 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 = 12;
Crd[Crd.last-1].height = 4;
Crd[Crd.last-1].x = Crd[ATLAS_MAINBORDER_RT_CORNER].x+Crd[ATLAS_MAINBORDER_RT_CORNER].width+Crd[ATLAS_MAINBORDER_TOOLBAR_FULLY_MINIMISE_ARROW].width-15;
Crd[Crd.last-1].y = Crd[ATLAS_MAINBORDER_TOOLBAR_BKG].y+3;
// Minimise arrow on tool bar.
ATLAS_MAINBORDER_TOOLBAR_MINIMISE_ARROW = 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 = Crd[ATLAS_MAINBORDER_TOOLBAR_FULLY_MINIMISE_ARROW].width;
Crd[Crd.last-1].height = Crd[ATLAS_MAINBORDER_TOOLBAR_FULLY_MINIMISE_ARROW].height;
Crd[Crd.last-1].x = Crd[ATLAS_MAINBORDER_TOOLBAR_FULLY_MINIMISE_ARROW].x;
Crd[Crd.last-1].y = Crd[ATLAS_MAINBORDER_TOOLBAR_BKG_MAX].y+Crd[ATLAS_MAINBORDER_TOOLBAR_BKG].height-Crd[ATLAS_MAINBORDER_TOOLBAR_FULLY_MINIMISE_ARROW].height-1;
// Fully Maximise arrow on tool bar.
ATLAS_MAINBORDER_TOOLBAR_FULLY_MAXIMISE_ARROW = 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 = Crd[ATLAS_MAINBORDER_TOOLBAR_FULLY_MINIMISE_ARROW].width;
Crd[Crd.last-1].height = Crd[ATLAS_MAINBORDER_TOOLBAR_FULLY_MINIMISE_ARROW].height;
Crd[Crd.last-1].x = Crd[ATLAS_MAINBORDER_TOOLBAR_FULLY_MINIMISE_ARROW].x;
Crd[Crd.last-1].y = Crd[ATLAS_MAINBORDER_TOOLBAR_BKG].y+Crd[ATLAS_MAINBORDER_TOOLBAR_BKG].height-Crd[ATLAS_MAINBORDER_TOOLBAR_FULLY_MAXIMISE_ARROW].height-Crd[ATLAS_MAINBORDER_TOOLBAR_FULLY_MAXIMISE_ARROW].height-1;
// Maximise arrow on tool bar.
ATLAS_MAINBORDER_TOOLBAR_MAXIMISE_ARROW = 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 = Crd[ATLAS_MAINBORDER_TOOLBAR_FULLY_MINIMISE_ARROW].width;
Crd[Crd.last-1].height = Crd[ATLAS_MAINBORDER_TOOLBAR_FULLY_MINIMISE_ARROW].height;
Crd[Crd.last-1].x = Crd[ATLAS_MAINBORDER_TOOLBAR_FULLY_MINIMISE_ARROW].x;
Crd[Crd.last-1].y = Crd[ATLAS_MAINBORDER_MENU_BKG].y+Crd[ATLAS_MAINBORDER_MENU_BKG].height-Crd[ATLAS_MAINBORDER_TOOLBAR_MAXIMISE_ARROW].height-Crd[ATLAS_MAINBORDER_TOOLBAR_MAXIMISE_ARROW].height-1;
// Toolbar buttons.
ATLAS_MAINBORDER_TOOLBAR_BUTTON = new Object();
ATLAS_MAINBORDER_TOOLBAR_BUTTON.span = 4;
ATLAS_MAINBORDER_TOOLBAR_BUTTON.max = 80;
for (ATLAS_MAINBORDER_TOOLBAR_BUTTON.last = 1; ATLAS_MAINBORDER_TOOLBAR_BUTTON.last <= ATLAS_MAINBORDER_TOOLBAR_BUTTON.max; ATLAS_MAINBORDER_TOOLBAR_BUTTON.last++)
{
ATLAS_MAINBORDER_TOOLBAR_BUTTON[ATLAS_MAINBORDER_TOOLBAR_BUTTON.last] = Crd.last;
Crd[Crd.last] = new Object();
Crd[Crd.last].width = 15;
Crd[Crd.last].height = 15;
Crd[Crd.last].rleft = left_screen;
Crd[Crd.last].rtop = top_screen;
Crd[Crd.last].rright = left_screen;
Crd[Crd.last].rbottom = top_screen;
if (ATLAS_MAINBORDER_TOOLBAR_BUTTON.last == 1)
Crd[Crd.last].x = Crd[ATLAS_MAINBORDER_MENU_BKG].x+5+ATLAS_MAINBORDER_TOOLBAR_BUTTON.span;
else
Crd[Crd.last].x = Crd[ATLAS_MAINBORDER_TOOLBAR_BUTTON[ATLAS_MAINBORDER_TOOLBAR_BUTTON.last]-1].x+Crd[Crd.last].width+ATLAS_MAINBORDER_TOOLBAR_BUTTON.span;
if (ATLAS_MAINBORDER_TOOLBAR_BUTTON.last == 41)
Crd[Crd.last].x = Crd[ATLAS_MAINBORDER_MENU_BKG].x+5+ATLAS_MAINBORDER_TOOLBAR_BUTTON.span;
if (ATLAS_MAINBORDER_TOOLBAR_BUTTON.last >= 41)
Crd[Crd.last].y = Crd[ATLAS_MAINBORDER_MENU_BKG].y+Crd[ATLAS_MAINBORDER_MENU_BKG].height+1+Crd[ATLAS_MAINBORDER_TOOLBAR_BUTTON[ATLAS_MAINBORDER_TOOLBAR_BUTTON.last]-1].height;
else
Crd[Crd.last].y = Crd[ATLAS_MAINBORDER_MENU_BKG].y+Crd[ATLAS_MAINBORDER_MENU_BKG].height+1;
Crd.last++;
}
// Left-hand selection pane.
ATLAS_LEFT_PANE_BKG = addArrayElement(Crd, Crd.last);
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 = bottom_screen;
Crd[Crd.last-1].width = 187;
Crd[Crd.last-1].height = 0;
Crd[Crd.last-1].x = Crd[ATLAS_MAINBORDER_LT_CORNER].x;
Crd[Crd.last-1].y = Crd[ATLAS_MAINBORDER_TOOLBAR_BKG].y+Crd[ATLAS_MAINBORDER_TOOLBAR_BKG].height;
// ============================================= GENERIC BOTTOM SECTION MENU ===============================================
// Bottom-right Mini Map Background.
ATLAS_MINIMAP_BKG = addArrayElement(Crd, Crd.last);
Crd[Crd.last-1].rleft = right_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].width = 182;
Crd[Crd.last-1].height = 182;
Crd[Crd.last-1].x = 0;
Crd[Crd.last-1].y = 0;
// Bottom-right Mini Map.
ATLAS_MINIMAP = addArrayElement(Crd, Crd.last);
Crd[Crd.last-1].rleft = right_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].width = 140;
Crd[Crd.last-1].height = 140;
Crd[Crd.last-1].x = 20;
Crd[Crd.last-1].y = 20;
// Bottom selection pane.
ATLAS_BOTTOM_PANE_BKG = addArrayElement(Crd, Crd.last);
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].width = Crd[ATLAS_LEFT_PANE_BKG].x-Crd[ATLAS_LEFT_PANE_BKG].width-Crd[ATLAS_MINIMAP_BKG].x-Crd[ATLAS_MINIMAP_BKG].width+6;
Crd[Crd.last-1].height = 148;
Crd[Crd.last-1].x = Crd[ATLAS_LEFT_PANE_BKG].x+Crd[ATLAS_LEFT_PANE_BKG].width-3;
Crd[Crd.last-1].y = Crd[ATLAS_LEFT_PANE_BKG].height;
// Left-Bottom selection pane corner.
ATLAS_LB_CORNER = addArrayElement(Crd, Crd.last);
Crd[Crd.last-1].rleft = left_screen; Crd[Crd.last-1].rtop = bottom_screen;
Crd[Crd.last-1].rright = left_screen; Crd[Crd.last-1].rbottom = bottom_screen;
Crd[Crd.last-1].width = 20;
Crd[Crd.last-1].height = 20;
Crd[Crd.last-1].x = Crd[ATLAS_BOTTOM_PANE_BKG].x;
Crd[Crd.last-1].y = Crd[ATLAS_BOTTOM_PANE_BKG].height-4;
// Right-Bottom selection pane corner.
ATLAS_RB_CORNER = addArrayElement(Crd, Crd.last);
Crd[Crd.last-1].rleft = right_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].width = Crd[ATLAS_MINIMAP_BKG].height-Crd[ATLAS_BOTTOM_PANE_BKG].height+3;
Crd[Crd.last-1].height = Crd[ATLAS_MINIMAP_BKG].height-Crd[ATLAS_BOTTOM_PANE_BKG].height+3;
Crd[Crd.last-1].x = Crd[ATLAS_MINIMAP_BKG].width-2;
Crd[Crd.last-1].y = Crd[ATLAS_LB_CORNER].y;
// Atlas tooltip window.
ATLAS_TOOLTIP = addArrayElement(Crd, Crd.last);
Crd[Crd.last-1].rleft = right_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].width = Crd[ATLAS_MINIMAP_BKG].width-20;
Crd[Crd.last-1].height = 82;
Crd[Crd.last-1].x = Crd[ATLAS_MINIMAP_BKG].x+10;
Crd[Crd.last-1].y = Crd[ATLAS_MINIMAP_BKG].y+Crd[ATLAS_MINIMAP_BKG].height+4;
// Setup margins for Bottom Section Menu.
ATLAS_BOTTOM_PANE_SECTION = new Object();
ATLAS_BOTTOM_PANE_SECTION.LMARGIN = 5;
ATLAS_BOTTOM_PANE_SECTION.RMARGIN = 5;
ATLAS_BOTTOM_PANE_SECTION.TMARGIN = 5;
ATLAS_BOTTOM_PANE_SECTION.BMARGIN = 5;
// ============================================= GENERIC LEFT SECTION MENU ===============================================
// Second heading of section menu.
ATLAS_LEFT_PANE_SECTION_HEADING_2 = addArrayElement(Crd, Crd.last);
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].width = Crd[ATLAS_LEFT_PANE_BKG].width-2;
Crd[Crd.last-1].height = 21+2;
Crd[Crd.last-1].x = Crd[ATLAS_LEFT_PANE_BKG].x;
Crd[Crd.last-1].y = Crd[ATLAS_MAINBORDER_TOOLBAR_BKG_MAX].y+Crd[ATLAS_MAINBORDER_TOOLBAR_BKG_MAX].height+29;
// Topmost heading of section menu.
ATLAS_LEFT_PANE_SECTION_HEADING_1 = addArrayElement(Crd, Crd.last);
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].width = Crd[ATLAS_LEFT_PANE_SECTION_HEADING_2].width;
Crd[Crd.last-1].height = 31;
Crd[Crd.last-1].x = Crd[ATLAS_LEFT_PANE_SECTION_HEADING_2].x;
Crd[Crd.last-1].y = Crd[ATLAS_MAINBORDER_TOOLBAR_BKG_MAX].y+Crd[ATLAS_MAINBORDER_TOOLBAR_BKG_MAX].height;
// Third heading of section menu.
ATLAS_LEFT_PANE_SECTION_HEADING_3 = addArrayElement(Crd, Crd.last);
Crd[Crd.last-1].rleft = left_screen; Crd[Crd.last-1].rtop = mid_screen;
Crd[Crd.last-1].rright = left_screen; Crd[Crd.last-1].rbottom = mid_screen;
Crd[Crd.last-1].width = Crd[ATLAS_LEFT_PANE_SECTION_HEADING_2].width;
Crd[Crd.last-1].height = Crd[ATLAS_LEFT_PANE_SECTION_HEADING_2].height;
Crd[Crd.last-1].x = Crd[ATLAS_LEFT_PANE_SECTION_HEADING_2].x;
Crd[Crd.last-1].y = 0;
// Setup margins for Left Section Menu.
ATLAS_LEFT_PANE_SECTION = new Object();
ATLAS_LEFT_PANE_SECTION.LMARGIN = 7;
ATLAS_LEFT_PANE_SECTION.RMARGIN = 10;
ATLAS_LEFT_PANE_SECTION.TMARGIN = 10;
ATLAS_LEFT_PANE_SECTION.BMARGIN = 12;
}
// ====================================================================
function atlasUpdateInfoWindow()
{
// Refresh content of Info Window.
getGUIObjectByName("ATLAS_INFO_WINDOW").caption = "File: something.map\nWorkspace: MyWorkspace\nFPS: " + getFPS();
}
// ====================================================================
function atlasFullyMinimiseToolbar()
{
// Hide toolbar.
guiHide("ATLAS_MAINBORDER_TOOLBAR");
guiUnHide("ATLAS_MAINBORDER_TOOLBAR_MAXIMISE_ARROW");
guiHide("ATLAS_MAINBORDER_TOOLBAR_BUTTON_ROW_1");
guiHide("ATLAS_MAINBORDER_TOOLBAR_BUTTON_ROW_2");
// Set toolbar height.
Crd[ATLAS_LEFT_PANE_BKG].y = Crd[ATLAS_MAINBORDER_MENU_BKG].y+Crd[ATLAS_MAINBORDER_MENU_BKG].height;
setSizeArray("ATLAS_LEFT_PANE_BKG", Crd[ATLAS_LEFT_PANE_BKG]);
}
// ====================================================================
function atlasMinimiseToolbar()
{
// Reduce toolbar to one row.
guiHide("ATLAS_MAINBORDER_TOOLBAR_MAX");
guiUnHide("ATLAS_MAINBORDER_TOOLBAR");
guiUnHide("ATLAS_MAINBORDER_TOOLBAR_BUTTON_ROW_1");
guiHide("ATLAS_MAINBORDER_TOOLBAR_BUTTON_ROW_2");
// Set toolbar height.
Crd[ATLAS_LEFT_PANE_BKG].y = Crd[ATLAS_MAINBORDER_TOOLBAR_BKG].y+Crd[ATLAS_MAINBORDER_TOOLBAR_BKG].height;
setSizeArray("ATLAS_LEFT_PANE_BKG", Crd[ATLAS_LEFT_PANE_BKG]);
}
// ====================================================================
function atlasFullyMaximiseToolbar()
{
// Extend toolbar to two rows.
guiHide("ATLAS_MAINBORDER_TOOLBAR");
guiUnHide("ATLAS_MAINBORDER_TOOLBAR_MAX");
guiUnHide("ATLAS_MAINBORDER_TOOLBAR_BUTTON_ROW_1");
guiUnHide("ATLAS_MAINBORDER_TOOLBAR_BUTTON_ROW_2");
// Set toolbar height.
Crd[ATLAS_LEFT_PANE_BKG].y = Crd[ATLAS_MAINBORDER_TOOLBAR_BKG_MAX].y+Crd[ATLAS_MAINBORDER_TOOLBAR_BKG_MAX].height;
setSizeArray("ATLAS_LEFT_PANE_BKG", Crd[ATLAS_LEFT_PANE_BKG]);
}
// ====================================================================
function atlasMaximiseToolbar()
{
// Extend toolbar to one row.
guiUnHide("ATLAS_MAINBORDER_TOOLBAR");
guiHide("ATLAS_MAINBORDER_TOOLBAR_MAXIMISE_ARROW");
guiUnHide("ATLAS_MAINBORDER_TOOLBAR_BUTTON_ROW_1");
guiHide("ATLAS_MAINBORDER_TOOLBAR_BUTTON_ROW_2");
// Set toolbar height.
Crd[ATLAS_LEFT_PANE_BKG].y = Crd[ATLAS_MAINBORDER_TOOLBAR_BKG].y+Crd[ATLAS_MAINBORDER_TOOLBAR_BKG].height;
setSizeArray("ATLAS_LEFT_PANE_BKG", Crd[ATLAS_LEFT_PANE_BKG]);
}
// ====================================================================
function atlasOpenSectionMenu(atlasMenuName)
{
// Open the specified Section Menu; only one is open at a time.
// Clear all section menus to begin.
guiHide("ATLAS_LEFT_PANE_SECTION_MAP");
guiHide("ATLAS_LEFT_PANE_SECTION_TERRAIN");
guiHide("ATLAS_BOTTOM_PANE_SECTION_TERRAIN");
guiHide("ATLAS_LEFT_PANE_SECTION_OBJECT");
guiHide("ATLAS_BOTTOM_PANE_SECTION_OBJECT");
switch (atlasMenuName)
{
case "none":
// Hide backgrounds.
guiHide("ATLAS_LEFT_PANE");
guiHide("ATLAS_BOTTOM_PANE");
// Hide headings.
guiHide("ATLAS_LEFT_PANE_SECTION_HEADING_1");
guiHide("ATLAS_LEFT_PANE_SECTION_HEADING_2");
guiHide("ATLAS_LEFT_PANE_SECTION_HEADING_3");
break;
case "ATLAS_LEFT_PANE_SECTION_MAP":
// Toggle backgrounds.
guiUnHide("ATLAS_LEFT_PANE");
guiHide("ATLAS_BOTTOM_PANE");
// Reveal headings.
guiRenameAndReveal("ATLAS_LEFT_PANE_SECTION_HEADING_1", "Map Creator");
guiRenameAndReveal("ATLAS_LEFT_PANE_SECTION_HEADING_2", "Map Type");
guiRenameAndReveal("ATLAS_LEFT_PANE_SECTION_HEADING_3", "Map Settings");
break;
case "ATLAS_LEFT_PANE_SECTION_TERRAIN":
// Toggle backgrounds.
guiUnHide("ATLAS_LEFT_PANE");
guiUnHide("ATLAS_BOTTOM_PANE");
guiUnHide("ATLAS_BOTTOM_PANE_SECTION_TERRAIN");
// Reveal headings.
guiRenameAndReveal("ATLAS_LEFT_PANE_SECTION_HEADING_1", "Terrain Editor");
guiRenameAndReveal("ATLAS_LEFT_PANE_SECTION_HEADING_2", "Edit Elevation");
guiHide("ATLAS_LEFT_PANE_SECTION_HEADING_3");
break;
case "ATLAS_LEFT_PANE_SECTION_OBJECT":
// Toggle backgrounds.
guiUnHide("ATLAS_LEFT_PANE");
guiUnHide("ATLAS_BOTTOM_PANE");
guiUnHide("ATLAS_BOTTOM_PANE_SECTION_OBJECT");
// Reveal headings.
guiRenameAndReveal("ATLAS_LEFT_PANE_SECTION_HEADING_1", "Object Editor");
guiRenameAndReveal("ATLAS_LEFT_PANE_SECTION_HEADING_2", "Object List");
guiHide("ATLAS_LEFT_PANE_SECTION_HEADING_3");
break;
}
// Reveal Section Menu content.
if (atlasMenuName != "none")
guiUnHide(atlasMenuName);
}
// ====================================================================

View File

@ -1,248 +0,0 @@
function initAtlasSectionMapCreator()
{
// ============================================= MAP CREATOR SECTION MENU ===============================================
// ============================================= MAP CREATOR: MAP TYPE ===============================================
// ============================================= MAP CREATOR: MAP TYPE: MAP SIZE ===============================================
// Height input box for map size.
ATLAS_LEFT_PANE_SECTION_MAP_TILE_HEIGHT_INPUT_BOX = addArrayElement(Crd, Crd.last);
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].width = 58;
Crd[Crd.last-1].height = 14;
Crd[Crd.last-1].x = Crd[ATLAS_LEFT_PANE_SECTION_HEADING_2].x+Crd[ATLAS_LEFT_PANE_SECTION_HEADING_2].width-Crd[ATLAS_LEFT_PANE_SECTION_MAP_TILE_HEIGHT_INPUT_BOX].width-ATLAS_LEFT_PANE_SECTION.RMARGIN;
Crd[Crd.last-1].y = Crd[ATLAS_LEFT_PANE_SECTION_HEADING_2].y+Crd[ATLAS_LEFT_PANE_SECTION_HEADING_2].height+ATLAS_LEFT_PANE_SECTION.TMARGIN+ATLAS_LEFT_PANE_SECTION.TMARGIN;
// "X" between map size input boxes.
ATLAS_LEFT_PANE_SECTION_MAP_TILE_X = addArrayElement(Crd, Crd.last);
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].width = 20;
Crd[Crd.last-1].height = Crd[ATLAS_LEFT_PANE_SECTION_MAP_TILE_HEIGHT_INPUT_BOX].height;
Crd[Crd.last-1].x = Crd[ATLAS_LEFT_PANE_SECTION_MAP_TILE_HEIGHT_INPUT_BOX].x-Crd[ATLAS_LEFT_PANE_SECTION_MAP_TILE_X].width;
Crd[Crd.last-1].y = Crd[ATLAS_LEFT_PANE_SECTION_MAP_TILE_HEIGHT_INPUT_BOX].y;
// Width input box for map size.
ATLAS_LEFT_PANE_SECTION_MAP_TILE_WIDTH_INPUT_BOX = addArrayElement(Crd, Crd.last);
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].width = Crd[ATLAS_LEFT_PANE_SECTION_MAP_TILE_HEIGHT_INPUT_BOX].width;
Crd[Crd.last-1].height = Crd[ATLAS_LEFT_PANE_SECTION_MAP_TILE_HEIGHT_INPUT_BOX].height;
Crd[Crd.last-1].x = Crd[ATLAS_LEFT_PANE_SECTION_MAP_TILE_X].x-Crd[ATLAS_LEFT_PANE_SECTION_MAP_TILE_HEIGHT_INPUT_BOX].width;
Crd[Crd.last-1].y = Crd[ATLAS_LEFT_PANE_SECTION_MAP_TILE_HEIGHT_INPUT_BOX].y;
// "Size:" label.
ATLAS_LEFT_PANE_SECTION_MAP_SIZE_LABEL = addArrayElement(Crd, Crd.last);
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].width = 32;
Crd[Crd.last-1].height = Crd[ATLAS_LEFT_PANE_SECTION_MAP_TILE_HEIGHT_INPUT_BOX].height;
Crd[Crd.last-1].x = Crd[ATLAS_LEFT_PANE_SECTION_MAP_TILE_WIDTH_INPUT_BOX].x-Crd[ATLAS_LEFT_PANE_SECTION_MAP_SIZE_LABEL].width;
Crd[Crd.last-1].y = Crd[ATLAS_LEFT_PANE_SECTION_MAP_TILE_HEIGHT_INPUT_BOX].y;
ATLAS_LEFT_PANE_SECTION_MAP_SIZE_BUTTON_SPAN = 3;
// "Huge" map size button.
ATLAS_LEFT_PANE_SECTION_MAP_SIZE_BUTTON_HUGE = addArrayElement(Crd, Crd.last);
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].width = 40;
Crd[Crd.last-1].height = 20;
Crd[Crd.last-1].x = Crd[ATLAS_LEFT_PANE_SECTION_HEADING_2].x+Crd[ATLAS_LEFT_PANE_SECTION_HEADING_2].width-Crd[ATLAS_LEFT_PANE_SECTION_MAP_SIZE_BUTTON_HUGE].width-ATLAS_LEFT_PANE_SECTION.RMARGIN+2;
Crd[Crd.last-1].y = Crd[ATLAS_LEFT_PANE_SECTION_MAP_TILE_HEIGHT_INPUT_BOX].y+Crd[ATLAS_LEFT_PANE_SECTION_MAP_TILE_HEIGHT_INPUT_BOX].height+ATLAS_LEFT_PANE_SECTION.TMARGIN;
// "Large" map size button.
ATLAS_LEFT_PANE_SECTION_MAP_SIZE_BUTTON_LARGE = addArrayElement(Crd, Crd.last);
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].width = Crd[ATLAS_LEFT_PANE_SECTION_MAP_SIZE_BUTTON_HUGE].width;
Crd[Crd.last-1].height = Crd[ATLAS_LEFT_PANE_SECTION_MAP_SIZE_BUTTON_HUGE].height;
Crd[Crd.last-1].x = Crd[ATLAS_LEFT_PANE_SECTION_MAP_SIZE_BUTTON_HUGE].x-Crd[ATLAS_LEFT_PANE_SECTION_MAP_SIZE_BUTTON_HUGE].width-ATLAS_LEFT_PANE_SECTION_MAP_SIZE_BUTTON_SPAN;
Crd[Crd.last-1].y = Crd[ATLAS_LEFT_PANE_SECTION_MAP_SIZE_BUTTON_HUGE].y;
// "Medium" map size button.
ATLAS_LEFT_PANE_SECTION_MAP_SIZE_BUTTON_MEDIUM = addArrayElement(Crd, Crd.last);
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].width = Crd[ATLAS_LEFT_PANE_SECTION_MAP_SIZE_BUTTON_HUGE].width;
Crd[Crd.last-1].height = Crd[ATLAS_LEFT_PANE_SECTION_MAP_SIZE_BUTTON_HUGE].height;
Crd[Crd.last-1].x = Crd[ATLAS_LEFT_PANE_SECTION_MAP_SIZE_BUTTON_LARGE].x-Crd[ATLAS_LEFT_PANE_SECTION_MAP_SIZE_BUTTON_LARGE].width-ATLAS_LEFT_PANE_SECTION_MAP_SIZE_BUTTON_SPAN;
Crd[Crd.last-1].y = Crd[ATLAS_LEFT_PANE_SECTION_MAP_SIZE_BUTTON_HUGE].y;
// "Small" map size button.
ATLAS_LEFT_PANE_SECTION_MAP_SIZE_BUTTON_SMALL = addArrayElement(Crd, Crd.last);
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].width = Crd[ATLAS_LEFT_PANE_SECTION_MAP_SIZE_BUTTON_HUGE].width;
Crd[Crd.last-1].height = Crd[ATLAS_LEFT_PANE_SECTION_MAP_SIZE_BUTTON_HUGE].height;
Crd[Crd.last-1].x = Crd[ATLAS_LEFT_PANE_SECTION_MAP_SIZE_BUTTON_MEDIUM].x-Crd[ATLAS_LEFT_PANE_SECTION_MAP_SIZE_BUTTON_MEDIUM].width-ATLAS_LEFT_PANE_SECTION_MAP_SIZE_BUTTON_SPAN;
Crd[Crd.last-1].y = Crd[ATLAS_LEFT_PANE_SECTION_MAP_SIZE_BUTTON_HUGE].y;
// Horizontal rule at end of Map Size settings.
ATLAS_LEFT_PANE_SECTION_MAP_SIZE_HR = addArrayElement(Crd, Crd.last);
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].width = Crd[ATLAS_LEFT_PANE_BKG].width-ATLAS_LEFT_PANE_SECTION.LMARGIN-ATLAS_LEFT_PANE_SECTION.RMARGIN;
Crd[Crd.last-1].height = 2;
Crd[Crd.last-1].x = Crd[ATLAS_LEFT_PANE_BKG].x+ATLAS_LEFT_PANE_SECTION.LMARGIN;
Crd[Crd.last-1].y = Crd[ATLAS_LEFT_PANE_SECTION_MAP_SIZE_BUTTON_HUGE].y+Crd[ATLAS_LEFT_PANE_SECTION_MAP_SIZE_BUTTON_HUGE].height+ATLAS_LEFT_PANE_SECTION.BMARGIN;
// ============================================= MAP CREATOR: MAP TYPE: RANDOM MAP ===============================================
// ============================================= MAP CREATOR: MAP SETTINGS ===============================================
// "Players:" label for Map Settings.
ATLAS_LEFT_PANE_SECTION_MAP_SETTINGS_PLAYER_LABEL = addArrayElement(Crd, Crd.last);
Crd[Crd.last-1].rleft = left_screen; Crd[Crd.last-1].rtop = mid_screen;
Crd[Crd.last-1].rright = left_screen; Crd[Crd.last-1].rbottom = mid_screen;
Crd[Crd.last-1].width = 45;
Crd[Crd.last-1].height = 15;
Crd[Crd.last-1].x = Crd[ATLAS_LEFT_PANE_SECTION_HEADING_3].x+ATLAS_LEFT_PANE_SECTION.LMARGIN;
Crd[Crd.last-1].y = Crd[ATLAS_LEFT_PANE_SECTION_HEADING_3].y+Crd[ATLAS_LEFT_PANE_SECTION_HEADING_3].height+ATLAS_LEFT_PANE_SECTION.TMARGIN+ATLAS_LEFT_PANE_SECTION.TMARGIN;
// Players "counter" input box for Map Settings.
ATLAS_LEFT_PANE_SECTION_MAP_SETTINGS_PLAYER_INPUT_BOX = addArrayElement(Crd, Crd.last);
Crd[Crd.last-1].rleft = left_screen; Crd[Crd.last-1].rtop = mid_screen;
Crd[Crd.last-1].rright = left_screen; Crd[Crd.last-1].rbottom = mid_screen;
Crd[Crd.last-1].width = 30;
Crd[Crd.last-1].height = Crd[ATLAS_LEFT_PANE_SECTION_MAP_SETTINGS_PLAYER_LABEL].height;
Crd[Crd.last-1].x = Crd[ATLAS_LEFT_PANE_SECTION_MAP_SETTINGS_PLAYER_LABEL].x+Crd[ATLAS_LEFT_PANE_SECTION_MAP_SETTINGS_PLAYER_LABEL].width;
Crd[Crd.last-1].y = Crd[ATLAS_LEFT_PANE_SECTION_MAP_SETTINGS_PLAYER_LABEL].y;
// Players up button for "counter" input box for Map Settings.
ATLAS_LEFT_PANE_SECTION_MAP_SETTINGS_PLAYER_INPUT_BOX_UP = addArrayElement(Crd, Crd.last);
Crd[Crd.last-1].rleft = left_screen; Crd[Crd.last-1].rtop = mid_screen;
Crd[Crd.last-1].rright = left_screen; Crd[Crd.last-1].rbottom = mid_screen;
Crd[Crd.last-1].width = ATLAS_COUNTER_BOX.width;
Crd[Crd.last-1].height = (Crd[ATLAS_LEFT_PANE_SECTION_MAP_SETTINGS_PLAYER_INPUT_BOX].height/2)+3;
Crd[Crd.last-1].x = Crd[ATLAS_LEFT_PANE_SECTION_MAP_SETTINGS_PLAYER_INPUT_BOX].x+Crd[ATLAS_LEFT_PANE_SECTION_MAP_SETTINGS_PLAYER_INPUT_BOX].width-Crd[ATLAS_LEFT_PANE_SECTION_MAP_SETTINGS_PLAYER_INPUT_BOX_UP].width;
Crd[Crd.last-1].y = Crd[ATLAS_LEFT_PANE_SECTION_MAP_SETTINGS_PLAYER_INPUT_BOX].y-3;
// Players down button for "counter" input box for Map Settings.
ATLAS_LEFT_PANE_SECTION_MAP_SETTINGS_PLAYER_INPUT_BOX_DN = addArrayElement(Crd, Crd.last);
Crd[Crd.last-1].rleft = left_screen; Crd[Crd.last-1].rtop = mid_screen;
Crd[Crd.last-1].rright = left_screen; Crd[Crd.last-1].rbottom = mid_screen;
Crd[Crd.last-1].width = ATLAS_COUNTER_BOX.width;
Crd[Crd.last-1].height = Crd[ATLAS_LEFT_PANE_SECTION_MAP_SETTINGS_PLAYER_INPUT_BOX_UP].height;
Crd[Crd.last-1].x = Crd[ATLAS_LEFT_PANE_SECTION_MAP_SETTINGS_PLAYER_INPUT_BOX].x+Crd[ATLAS_LEFT_PANE_SECTION_MAP_SETTINGS_PLAYER_INPUT_BOX].width-Crd[ATLAS_LEFT_PANE_SECTION_MAP_SETTINGS_PLAYER_INPUT_BOX_UP].width;
Crd[Crd.last-1].y = Crd[ATLAS_LEFT_PANE_SECTION_MAP_SETTINGS_PLAYER_INPUT_BOX].y+Crd[ATLAS_LEFT_PANE_SECTION_MAP_SETTINGS_PLAYER_INPUT_BOX].height-Crd[ATLAS_LEFT_PANE_SECTION_MAP_SETTINGS_PLAYER_INPUT_BOX_DN].height;
// Settlements "counter" input box for Map Settings.
ATLAS_LEFT_PANE_SECTION_MAP_SETTINGS_SETTLEMENT_INPUT_BOX = addArrayElement(Crd, Crd.last);
Crd[Crd.last-1].rleft = left_screen; Crd[Crd.last-1].rtop = mid_screen;
Crd[Crd.last-1].rright = left_screen; Crd[Crd.last-1].rbottom = mid_screen;
Crd[Crd.last-1].width = Crd[ATLAS_LEFT_PANE_SECTION_MAP_SETTINGS_PLAYER_INPUT_BOX].width;
Crd[Crd.last-1].height = Crd[ATLAS_LEFT_PANE_SECTION_MAP_SETTINGS_PLAYER_INPUT_BOX].height;
Crd[Crd.last-1].x = Crd[ATLAS_LEFT_PANE_SECTION_HEADING_3].x+Crd[ATLAS_LEFT_PANE_SECTION_HEADING_3].width-Crd[ATLAS_LEFT_PANE_SECTION_MAP_SETTINGS_SETTLEMENT_INPUT_BOX].width-ATLAS_LEFT_PANE_SECTION.RMARGIN;
Crd[Crd.last-1].y = Crd[ATLAS_LEFT_PANE_SECTION_MAP_SETTINGS_PLAYER_INPUT_BOX].y;
// Settlements up button for "counter" input box for Map Settings.
ATLAS_LEFT_PANE_SECTION_MAP_SETTINGS_SETTLEMENT_INPUT_BOX_UP = addArrayElement(Crd, Crd.last);
Crd[Crd.last-1].rleft = left_screen; Crd[Crd.last-1].rtop = mid_screen;
Crd[Crd.last-1].rright = left_screen; Crd[Crd.last-1].rbottom = mid_screen;
Crd[Crd.last-1].width = ATLAS_COUNTER_BOX.width;
Crd[Crd.last-1].height = (Crd[ATLAS_LEFT_PANE_SECTION_MAP_SETTINGS_SETTLEMENT_INPUT_BOX].height/2)+3;
Crd[Crd.last-1].x = Crd[ATLAS_LEFT_PANE_SECTION_MAP_SETTINGS_SETTLEMENT_INPUT_BOX].x+Crd[ATLAS_LEFT_PANE_SECTION_MAP_SETTINGS_SETTLEMENT_INPUT_BOX].width-Crd[ATLAS_LEFT_PANE_SECTION_MAP_SETTINGS_SETTLEMENT_INPUT_BOX_UP].width;
Crd[Crd.last-1].y = Crd[ATLAS_LEFT_PANE_SECTION_MAP_SETTINGS_SETTLEMENT_INPUT_BOX].y-3;
// Settlements down button for "counter" input box for Map Settings.
ATLAS_LEFT_PANE_SECTION_MAP_SETTINGS_SETTLEMENT_INPUT_BOX_DN = addArrayElement(Crd, Crd.last);
Crd[Crd.last-1].rleft = left_screen; Crd[Crd.last-1].rtop = mid_screen;
Crd[Crd.last-1].rright = left_screen; Crd[Crd.last-1].rbottom = mid_screen;
Crd[Crd.last-1].width = ATLAS_COUNTER_BOX.width;
Crd[Crd.last-1].height = Crd[ATLAS_LEFT_PANE_SECTION_MAP_SETTINGS_SETTLEMENT_INPUT_BOX_UP].height;
Crd[Crd.last-1].x = Crd[ATLAS_LEFT_PANE_SECTION_MAP_SETTINGS_SETTLEMENT_INPUT_BOX].x+Crd[ATLAS_LEFT_PANE_SECTION_MAP_SETTINGS_SETTLEMENT_INPUT_BOX].width-Crd[ATLAS_LEFT_PANE_SECTION_MAP_SETTINGS_SETTLEMENT_INPUT_BOX_UP].width;
Crd[Crd.last-1].y = Crd[ATLAS_LEFT_PANE_SECTION_MAP_SETTINGS_SETTLEMENT_INPUT_BOX].y+Crd[ATLAS_LEFT_PANE_SECTION_MAP_SETTINGS_SETTLEMENT_INPUT_BOX].height-Crd[ATLAS_LEFT_PANE_SECTION_MAP_SETTINGS_SETTLEMENT_INPUT_BOX_DN].height;
// "Settlements" label for Map Settings.
ATLAS_LEFT_PANE_SECTION_MAP_SETTINGS_SETTLEMENT_LABEL = addArrayElement(Crd, Crd.last);
Crd[Crd.last-1].rleft = left_screen; Crd[Crd.last-1].rtop = mid_screen;
Crd[Crd.last-1].rright = left_screen; Crd[Crd.last-1].rbottom = mid_screen;
Crd[Crd.last-1].width = 62;
Crd[Crd.last-1].height = Crd[ATLAS_LEFT_PANE_SECTION_MAP_SETTINGS_PLAYER_LABEL].height;
Crd[Crd.last-1].x = Crd[ATLAS_LEFT_PANE_SECTION_MAP_SETTINGS_SETTLEMENT_INPUT_BOX].x-Crd[ATLAS_LEFT_PANE_SECTION_MAP_SETTINGS_SETTLEMENT_LABEL].width;
Crd[Crd.last-1].y = Crd[ATLAS_LEFT_PANE_SECTION_MAP_SETTINGS_SETTLEMENT_INPUT_BOX].y;
// "Resources:" label for Map Settings.
ATLAS_LEFT_PANE_SECTION_MAP_SETTINGS_RESOURCES_LABEL = addArrayElement(Crd, Crd.last);
Crd[Crd.last-1].rleft = left_screen; Crd[Crd.last-1].rtop = mid_screen;
Crd[Crd.last-1].rright = left_screen; Crd[Crd.last-1].rbottom = mid_screen;
Crd[Crd.last-1].width = 60;
Crd[Crd.last-1].height = 15;
Crd[Crd.last-1].x = Crd[ATLAS_LEFT_PANE_SECTION_MAP_SETTINGS_PLAYER_LABEL].x;
Crd[Crd.last-1].y = Crd[ATLAS_LEFT_PANE_SECTION_MAP_SETTINGS_PLAYER_LABEL].y+Crd[ATLAS_LEFT_PANE_SECTION_MAP_SETTINGS_PLAYER_LABEL].height+ATLAS_LEFT_PANE_SECTION.TMARGIN+ATLAS_LEFT_PANE_SECTION.TMARGIN;
// Resources "drop-down" box for Map Settings.
ATLAS_LEFT_PANE_SECTION_MAP_SETTINGS_RESOURCES_COMBO_BOX = addArrayElement(Crd, Crd.last);
Crd[Crd.last-1].rleft = left_screen; Crd[Crd.last-1].rtop = mid_screen;
Crd[Crd.last-1].rright = left_screen; Crd[Crd.last-1].rbottom = mid_screen;
Crd[Crd.last-1].width = 55;
Crd[Crd.last-1].height = Crd[ATLAS_LEFT_PANE_SECTION_MAP_SETTINGS_PLAYER_LABEL].height;
Crd[Crd.last-1].x = Crd[ATLAS_LEFT_PANE_SECTION_MAP_SETTINGS_RESOURCES_LABEL].x+Crd[ATLAS_LEFT_PANE_SECTION_MAP_SETTINGS_RESOURCES_LABEL].width;
Crd[Crd.last-1].y = Crd[ATLAS_LEFT_PANE_SECTION_MAP_SETTINGS_RESOURCES_LABEL].y;
// ============================================= MAP CREATOR: MAP SETTINGS: TERRITORIES ===============================================
// ============================================= MAP CREATOR: GENERATE ===============================================
// Terrain Map input box.
ATLAS_LEFT_PANE_SECTION_GENERATE_TERRAIN_MAP_INPUT_BOX = addArrayElement(Crd, Crd.last);
Crd[Crd.last-1].rleft = left_screen; Crd[Crd.last-1].rtop = bottom_screen;
Crd[Crd.last-1].rright = left_screen; Crd[Crd.last-1].rbottom = bottom_screen;
Crd[Crd.last-1].width = Crd[ATLAS_LEFT_PANE_SECTION_HEADING_3].width-ATLAS_LEFT_PANE_SECTION.LMARGIN-ATLAS_LEFT_PANE_SECTION.RMARGIN-ATLAS_LEFT_PANE_SECTION.LMARGIN;
Crd[Crd.last-1].height = 15;
Crd[Crd.last-1].x = Crd[ATLAS_LEFT_PANE_SECTION_HEADING_3].x+ATLAS_LEFT_PANE_SECTION.LMARGIN+ATLAS_LEFT_PANE_SECTION.LMARGIN;
Crd[Crd.last-1].y = ATLAS_LEFT_PANE_SECTION.BMARGIN;
// "Terrain Map:" label.
ATLAS_LEFT_PANE_SECTION_GENERATE_TERRAIN_MAP_LABEL = addArrayElement(Crd, Crd.last);
Crd[Crd.last-1].rleft = left_screen; Crd[Crd.last-1].rtop = bottom_screen;
Crd[Crd.last-1].rright = left_screen; Crd[Crd.last-1].rbottom = bottom_screen;
Crd[Crd.last-1].width = Crd[ATLAS_LEFT_PANE_SECTION_GENERATE_TERRAIN_MAP_INPUT_BOX].width;
Crd[Crd.last-1].height = 20;
Crd[Crd.last-1].x = Crd[ATLAS_LEFT_PANE_SECTION_GENERATE_TERRAIN_MAP_INPUT_BOX].x;
Crd[Crd.last-1].y = Crd[ATLAS_LEFT_PANE_SECTION_GENERATE_TERRAIN_MAP_INPUT_BOX].y+Crd[ATLAS_LEFT_PANE_SECTION_GENERATE_TERRAIN_MAP_INPUT_BOX].height;
// Height Map input box.
ATLAS_LEFT_PANE_SECTION_GENERATE_HEIGHT_MAP_INPUT_BOX = addArrayElement(Crd, Crd.last);
Crd[Crd.last-1].rleft = left_screen; Crd[Crd.last-1].rtop = bottom_screen;
Crd[Crd.last-1].rright = left_screen; Crd[Crd.last-1].rbottom = bottom_screen;
Crd[Crd.last-1].width = Crd[ATLAS_LEFT_PANE_SECTION_GENERATE_TERRAIN_MAP_INPUT_BOX].width;
Crd[Crd.last-1].height = Crd[ATLAS_LEFT_PANE_SECTION_GENERATE_TERRAIN_MAP_INPUT_BOX].height;
Crd[Crd.last-1].x = Crd[ATLAS_LEFT_PANE_SECTION_GENERATE_TERRAIN_MAP_INPUT_BOX].x;
Crd[Crd.last-1].y = Crd[ATLAS_LEFT_PANE_SECTION_GENERATE_TERRAIN_MAP_LABEL].y+Crd[ATLAS_LEFT_PANE_SECTION_GENERATE_TERRAIN_MAP_LABEL].height;
// "Height Map:" label.
ATLAS_LEFT_PANE_SECTION_GENERATE_HEIGHT_MAP_LABEL = addArrayElement(Crd, Crd.last);
Crd[Crd.last-1].rleft = left_screen; Crd[Crd.last-1].rtop = bottom_screen;
Crd[Crd.last-1].rright = left_screen; Crd[Crd.last-1].rbottom = bottom_screen;
Crd[Crd.last-1].width = Crd[ATLAS_LEFT_PANE_SECTION_GENERATE_TERRAIN_MAP_INPUT_BOX].width;
Crd[Crd.last-1].height = Crd[ATLAS_LEFT_PANE_SECTION_GENERATE_TERRAIN_MAP_LABEL].height;
Crd[Crd.last-1].x = Crd[ATLAS_LEFT_PANE_SECTION_GENERATE_TERRAIN_MAP_INPUT_BOX].x;
Crd[Crd.last-1].y = Crd[ATLAS_LEFT_PANE_SECTION_GENERATE_HEIGHT_MAP_INPUT_BOX].y+Crd[ATLAS_LEFT_PANE_SECTION_GENERATE_HEIGHT_MAP_INPUT_BOX].height;
// "Generate!" border.
ATLAS_LEFT_PANE_SECTION_GENERATE_BORDER = addArrayElement(Crd, Crd.last);
Crd[Crd.last-1].rleft = left_screen; Crd[Crd.last-1].rtop = bottom_screen;
Crd[Crd.last-1].rright = left_screen; Crd[Crd.last-1].rbottom = bottom_screen;
Crd[Crd.last-1].width = Crd[ATLAS_LEFT_PANE_SECTION_GENERATE_TERRAIN_MAP_INPUT_BOX].width;
Crd[Crd.last-1].height = 40;
Crd[Crd.last-1].x = Crd[ATLAS_LEFT_PANE_SECTION_GENERATE_TERRAIN_MAP_INPUT_BOX].x;
Crd[Crd.last-1].y = Crd[ATLAS_LEFT_PANE_SECTION_GENERATE_HEIGHT_MAP_INPUT_BOX].y+Crd[ATLAS_LEFT_PANE_SECTION_GENERATE_HEIGHT_MAP_INPUT_BOX].height+Crd[ATLAS_LEFT_PANE_SECTION_GENERATE_BORDER].height+ATLAS_LEFT_PANE_SECTION.BMARGIN;
ATLAS_LEFT_PANE_SECTION_GENERATE_SPAN = 7;
// "Generate!" button.
ATLAS_LEFT_PANE_SECTION_GENERATE_BUTTON = addArrayElement(Crd, Crd.last);
Crd[Crd.last-1].rleft = left_screen; Crd[Crd.last-1].rtop = bottom_screen;
Crd[Crd.last-1].rright = left_screen; Crd[Crd.last-1].rbottom = bottom_screen;
Crd[Crd.last-1].width = Crd[ATLAS_LEFT_PANE_SECTION_GENERATE_TERRAIN_MAP_INPUT_BOX].width-ATLAS_LEFT_PANE_SECTION_GENERATE_SPAN-ATLAS_LEFT_PANE_SECTION_GENERATE_SPAN;
Crd[Crd.last-1].height = Crd[ATLAS_LEFT_PANE_SECTION_GENERATE_BORDER].height-ATLAS_LEFT_PANE_SECTION_GENERATE_SPAN-ATLAS_LEFT_PANE_SECTION_GENERATE_SPAN;
Crd[Crd.last-1].x = Crd[ATLAS_LEFT_PANE_SECTION_GENERATE_BORDER].x+ATLAS_LEFT_PANE_SECTION_GENERATE_SPAN;
Crd[Crd.last-1].y = Crd[ATLAS_LEFT_PANE_SECTION_GENERATE_BORDER].y+ATLAS_LEFT_PANE_SECTION_GENERATE_SPAN;
}
// ====================================================================

View File

@ -1,163 +0,0 @@
function initAtlasSectionObjectEditor()
{
// ============================================= OBJECT EDITOR: SELECTION ==============================================
// Object category label.
ATLAS_LEFT_PANE_SECTION_OBJECT_CATEGORY_LABEL = addArrayElement(Crd, Crd.last);
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].width = Crd[ATLAS_LEFT_PANE_SECTION_HEADING_2].width-ATLAS_LEFT_PANE_SECTION.LMARGIN-ATLAS_LEFT_PANE_SECTION.RMARGIN-ATLAS_LEFT_PANE_SECTION.LMARGIN;
Crd[Crd.last-1].height = 20;
Crd[Crd.last-1].x = Crd[ATLAS_LEFT_PANE_SECTION_HEADING_2].x+ATLAS_LEFT_PANE_SECTION.LMARGIN+ATLAS_LEFT_PANE_SECTION.LMARGIN;
Crd[Crd.last-1].y = Crd[ATLAS_LEFT_PANE_SECTION_HEADING_2].y+Crd[ATLAS_LEFT_PANE_SECTION_HEADING_2].height;
// Object category input box.
ATLAS_LEFT_PANE_SECTION_OBJECT_CATEGORY_COMBO_BOX = addArrayElement(Crd, Crd.last);
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].width = Crd[ATLAS_LEFT_PANE_SECTION_OBJECT_CATEGORY_LABEL].width;
Crd[Crd.last-1].height = 15;
Crd[Crd.last-1].x = Crd[ATLAS_LEFT_PANE_SECTION_OBJECT_CATEGORY_LABEL].x;
Crd[Crd.last-1].y = Crd[ATLAS_LEFT_PANE_SECTION_OBJECT_CATEGORY_LABEL].y+Crd[ATLAS_LEFT_PANE_SECTION_OBJECT_CATEGORY_LABEL].height;
// Custom button.
ATLAS_LEFT_PANE_SECTION_OBJECT_BUTTON_CUSTOM_ACTOR = addArrayElement(Crd, Crd.last);
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].width = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_CLIFF_BUTTON_CUSTOM].width;
Crd[Crd.last-1].height = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_CLIFF_BUTTON_CUSTOM].height;
Crd[Crd.last-1].x = Crd[ATLAS_LEFT_PANE_SECTION_OBJECT_CATEGORY_COMBO_BOX].x-4;
Crd[Crd.last-1].y = Crd[ATLAS_LEFT_PANE_SECTION_OBJECT_CATEGORY_COMBO_BOX].y+Crd[ATLAS_LEFT_PANE_SECTION_OBJECT_CATEGORY_COMBO_BOX].height+ATLAS_LEFT_PANE_SECTION.TMARGIN;
// Custom button.
ATLAS_LEFT_PANE_SECTION_OBJECT_BUTTON_CUSTOM_ENTITY = addArrayElement(Crd, Crd.last);
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].width = Crd[ATLAS_LEFT_PANE_SECTION_OBJECT_BUTTON_CUSTOM_ACTOR].width;
Crd[Crd.last-1].height = Crd[ATLAS_LEFT_PANE_SECTION_OBJECT_BUTTON_CUSTOM_ACTOR].height;
Crd[Crd.last-1].x = Crd[ATLAS_LEFT_PANE_SECTION_OBJECT_CATEGORY_COMBO_BOX].x+4+Crd[ATLAS_LEFT_PANE_SECTION_OBJECT_CATEGORY_COMBO_BOX].width-Crd[ATLAS_LEFT_PANE_SECTION_OBJECT_BUTTON_CUSTOM_ENTITY].width;
Crd[Crd.last-1].y = Crd[ATLAS_LEFT_PANE_SECTION_OBJECT_BUTTON_CUSTOM_ACTOR].y;
// ============================================= OBJECT EDITOR: LIST ==============================================
// Background of Object List.
ATLAS_LEFT_PANE_SECTION_OBJECT_LIST_BKG = addArrayElement(Crd, Crd.last);
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 = bottom_screen;
Crd[Crd.last-1].width = Crd[ATLAS_LEFT_PANE_SECTION_OBJECT_CATEGORY_COMBO_BOX].width+2;
Crd[Crd.last-1].height = 163+2;
Crd[Crd.last-1].x = Crd[ATLAS_LEFT_PANE_SECTION_OBJECT_CATEGORY_COMBO_BOX].x;
Crd[Crd.last-1].y = Crd[ATLAS_LEFT_PANE_SECTION_OBJECT_BUTTON_CUSTOM_ACTOR].y+Crd[ATLAS_LEFT_PANE_SECTION_OBJECT_BUTTON_CUSTOM_ACTOR].height+ATLAS_LEFT_PANE_SECTION.TMARGIN;
// Player input box.
ATLAS_LEFT_PANE_SECTION_OBJECT_LIST_PLAYER_INPUT_BOX = addArrayElement(Crd, Crd.last);
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].width = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_WATER_DEPTH_INPUT_BOX].width;
Crd[Crd.last-1].height = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_WATER_DEPTH_INPUT_BOX].height;
Crd[Crd.last-1].x = Crd[ATLAS_LEFT_PANE_SECTION_OBJECT_LIST_BKG].x+10;
Crd[Crd.last-1].y = Crd[ATLAS_LEFT_PANE_SECTION_OBJECT_LIST_BKG].y+10;
// Up button for Player input box.
ATLAS_LEFT_PANE_SECTION_OBJECT_LIST_PLAYER_INPUT_BOX_UP = addArrayElement(Crd, Crd.last);
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].width = ATLAS_COUNTER_BOX.width;
Crd[Crd.last-1].height = (Crd[ATLAS_LEFT_PANE_SECTION_OBJECT_LIST_PLAYER_INPUT_BOX].height/2)+3;
Crd[Crd.last-1].x = Crd[ATLAS_LEFT_PANE_SECTION_OBJECT_LIST_PLAYER_INPUT_BOX].x+Crd[ATLAS_LEFT_PANE_SECTION_OBJECT_LIST_PLAYER_INPUT_BOX].width-Crd[ATLAS_LEFT_PANE_SECTION_OBJECT_LIST_PLAYER_INPUT_BOX_UP].width;
Crd[Crd.last-1].y = Crd[ATLAS_LEFT_PANE_SECTION_OBJECT_LIST_PLAYER_INPUT_BOX].y-3;
// Down button for Player input box.
ATLAS_LEFT_PANE_SECTION_OBJECT_LIST_PLAYER_INPUT_BOX_DN = addArrayElement(Crd, Crd.last);
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].width = ATLAS_COUNTER_BOX.width;
Crd[Crd.last-1].height = Crd[ATLAS_LEFT_PANE_SECTION_OBJECT_LIST_PLAYER_INPUT_BOX_UP].height;
Crd[Crd.last-1].x = Crd[ATLAS_LEFT_PANE_SECTION_OBJECT_LIST_PLAYER_INPUT_BOX].x+Crd[ATLAS_LEFT_PANE_SECTION_OBJECT_LIST_PLAYER_INPUT_BOX].width-Crd[ATLAS_LEFT_PANE_SECTION_OBJECT_LIST_PLAYER_INPUT_BOX_UP].width;
Crd[Crd.last-1].y = Crd[ATLAS_LEFT_PANE_SECTION_OBJECT_LIST_PLAYER_INPUT_BOX].y+Crd[ATLAS_LEFT_PANE_SECTION_OBJECT_LIST_PLAYER_INPUT_BOX].height-Crd[ATLAS_LEFT_PANE_SECTION_OBJECT_LIST_PLAYER_INPUT_BOX_DN].height;
// Player label.
ATLAS_LEFT_PANE_SECTION_OBJECT_LIST_PLAYER_LABEL = addArrayElement(Crd, Crd.last);
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].width = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_WATER_DEPTH_LABEL].width;
Crd[Crd.last-1].height = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_WATER_DEPTH_LABEL].height;
Crd[Crd.last-1].x = Crd[ATLAS_LEFT_PANE_SECTION_OBJECT_LIST_PLAYER_INPUT_BOX].x+Crd[ATLAS_LEFT_PANE_SECTION_OBJECT_LIST_PLAYER_INPUT_BOX].width;
Crd[Crd.last-1].y = Crd[ATLAS_LEFT_PANE_SECTION_OBJECT_LIST_PLAYER_INPUT_BOX].y;
// Objects heading.
ATLAS_LEFT_PANE_SECTION_OBJECT_LIST_HEADING = addArrayElement(Crd, Crd.last);
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].width = 65;
Crd[Crd.last-1].height = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_WATER_DEPTH_LABEL].height;
Crd[Crd.last-1].x = Crd[ATLAS_LEFT_PANE_SECTION_OBJECT_LIST_BKG].x+Crd[ATLAS_LEFT_PANE_SECTION_OBJECT_LIST_BKG].width-Crd[ATLAS_LEFT_PANE_SECTION_OBJECT_LIST_HEADING].width;
Crd[Crd.last-1].y = Crd[ATLAS_LEFT_PANE_SECTION_OBJECT_LIST_PLAYER_INPUT_BOX].y;
// Object list sort input box.
ATLAS_LEFT_PANE_SECTION_OBJECT_LIST_SORT_COMBO_BOX = addArrayElement(Crd, Crd.last);
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].width = 90;
Crd[Crd.last-1].height = 15;
Crd[Crd.last-1].x = Crd[ATLAS_LEFT_PANE_SECTION_OBJECT_LIST_BKG].x+Crd[ATLAS_LEFT_PANE_SECTION_OBJECT_LIST_BKG].width-Crd[ATLAS_LEFT_PANE_SECTION_OBJECT_LIST_SORT_COMBO_BOX].width-10;
Crd[Crd.last-1].y = Crd[ATLAS_LEFT_PANE_SECTION_OBJECT_LIST_HEADING].y+Crd[ATLAS_LEFT_PANE_SECTION_OBJECT_LIST_HEADING].height+10;
// Object list sort label.
ATLAS_LEFT_PANE_SECTION_OBJECT_LIST_SORT_LABEL = addArrayElement(Crd, Crd.last);
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].width = 35;
Crd[Crd.last-1].height = Crd[ATLAS_LEFT_PANE_SECTION_OBJECT_LIST_SORT_COMBO_BOX].height;
Crd[Crd.last-1].x = Crd[ATLAS_LEFT_PANE_SECTION_OBJECT_LIST_SORT_COMBO_BOX].x-Crd[ATLAS_LEFT_PANE_SECTION_OBJECT_LIST_SORT_LABEL].width;
Crd[Crd.last-1].y = Crd[ATLAS_LEFT_PANE_SECTION_OBJECT_LIST_SORT_COMBO_BOX].y-3;
// Object List.
ATLAS_LEFT_PANE_SECTION_OBJECT_LIST = addArrayElement(Crd, Crd.last);
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 = bottom_screen;
Crd[Crd.last-1].width = Crd[ATLAS_LEFT_PANE_SECTION_OBJECT_LIST_BKG].width;
Crd[Crd.last-1].height = Crd[ATLAS_LEFT_PANE_SECTION_OBJECT_LIST_BKG].height;
Crd[Crd.last-1].x = Crd[ATLAS_LEFT_PANE_SECTION_OBJECT_LIST_BKG].x;
Crd[Crd.last-1].y = Crd[ATLAS_LEFT_PANE_SECTION_OBJECT_LIST_SORT_COMBO_BOX].y+Crd[ATLAS_LEFT_PANE_SECTION_OBJECT_LIST_SORT_COMBO_BOX].height+ATLAS_LEFT_PANE_SECTION.TMARGIN;
// ============================================= OBJECT EDITOR: ANIMATION VIEWER ===============================================
// Animation Viewer combobox label.
ATLAS_BOTTOM_PANE_SECTION_OBJECT_ANIM_COMBO_BOX_LABEL = addArrayElement(Crd, Crd.last);
Crd[Crd.last-1].rleft = left_screen; Crd[Crd.last-1].rtop = bottom_screen;
Crd[Crd.last-1].rright = left_screen; Crd[Crd.last-1].rbottom = bottom_screen;
Crd[Crd.last-1].width = 60;
Crd[Crd.last-1].height = 20;
Crd[Crd.last-1].x = ATLAS_LEFT_PANE_SECTION.LMARGIN;
Crd[Crd.last-1].y = 2;
// Animation Viewer combobox.
ATLAS_BOTTOM_PANE_SECTION_OBJECT_ANIM_COMBO_BOX = addArrayElement(Crd, Crd.last);
Crd[Crd.last-1].rleft = left_screen; Crd[Crd.last-1].rtop = bottom_screen;
Crd[Crd.last-1].rright = left_screen; Crd[Crd.last-1].rbottom = bottom_screen;
Crd[Crd.last-1].width = 65;
Crd[Crd.last-1].height = 10;
Crd[Crd.last-1].x = Crd[ATLAS_BOTTOM_PANE_SECTION_OBJECT_ANIM_COMBO_BOX_LABEL].x+Crd[ATLAS_BOTTOM_PANE_SECTION_OBJECT_ANIM_COMBO_BOX_LABEL].width;
Crd[Crd.last-1].y = Crd[ATLAS_BOTTOM_PANE_SECTION_OBJECT_ANIM_COMBO_BOX_LABEL].y+5;
// Animation Viewer.
ATLAS_BOTTOM_PANE_SECTION_OBJECT_ANIM_VIEWER = addArrayElement(Crd, Crd.last);
Crd[Crd.last-1].rleft = left_screen; Crd[Crd.last-1].rtop = bottom_screen;
Crd[Crd.last-1].rright = left_screen; Crd[Crd.last-1].rbottom = bottom_screen;
Crd[Crd.last-1].width = 125;
Crd[Crd.last-1].height = 125;
Crd[Crd.last-1].x = Crd[ATLAS_BOTTOM_PANE_SECTION_OBJECT_ANIM_COMBO_BOX_LABEL].x;
Crd[Crd.last-1].y = Crd[ATLAS_BOTTOM_PANE_SECTION_OBJECT_ANIM_COMBO_BOX_LABEL].y+Crd[ATLAS_BOTTOM_PANE_SECTION_OBJECT_ANIM_COMBO_BOX_LABEL].height;
// Animation Viewer label.
ATLAS_BOTTOM_PANE_SECTION_OBJECT_ANIM_VIEWER_LABEL = addArrayElement(Crd, Crd.last);
Crd[Crd.last-1].rleft = left_screen; Crd[Crd.last-1].rtop = bottom_screen;
Crd[Crd.last-1].rright = left_screen; Crd[Crd.last-1].rbottom = bottom_screen;
Crd[Crd.last-1].width = Crd[ATLAS_BOTTOM_PANE_SECTION_OBJECT_ANIM_VIEWER].width;
Crd[Crd.last-1].height = 15;
Crd[Crd.last-1].x = Crd[ATLAS_BOTTOM_PANE_SECTION_OBJECT_ANIM_VIEWER].x;
Crd[Crd.last-1].y = Crd[ATLAS_BOTTOM_PANE_SECTION_OBJECT_ANIM_VIEWER].y+Crd[ATLAS_BOTTOM_PANE_SECTION_OBJECT_ANIM_VIEWER].height;
}
// ====================================================================

View File

@ -1,614 +0,0 @@
function initAtlasSectionTerrainEditor()
{
// ============================================= TERRAIN EDITOR SECTION MENU ===============================================
// ============================================= TERRAIN EDITOR: EDIT ELEVATION ===============================================
ATLAS_LEFT_PANE_SECTION_TERRAIN_ELEVATION_BUTTON_SPAN = 10;
// Modify button.
ATLAS_LEFT_PANE_SECTION_TERRAIN_ELEVATION_MODIFY_BUTTON = addArrayElement(Crd, Crd.last);
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].width = 50;
Crd[Crd.last-1].height = 15;
Crd[Crd.last-1].x = Crd[ATLAS_LEFT_PANE_SECTION_HEADING_2].x+ATLAS_LEFT_PANE_SECTION.LMARGIN;
Crd[Crd.last-1].y = Crd[ATLAS_LEFT_PANE_SECTION_HEADING_2].y+Crd[ATLAS_LEFT_PANE_SECTION_HEADING_2].height+ATLAS_LEFT_PANE_SECTION.TMARGIN;
// Smooth button.
ATLAS_LEFT_PANE_SECTION_TERRAIN_ELEVATION_SMOOTH_BUTTON = addArrayElement(Crd, Crd.last);
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].width = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_ELEVATION_MODIFY_BUTTON].width;
Crd[Crd.last-1].height = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_ELEVATION_MODIFY_BUTTON].height;
Crd[Crd.last-1].x = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_ELEVATION_MODIFY_BUTTON].x+Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_ELEVATION_MODIFY_BUTTON].width+ATLAS_LEFT_PANE_SECTION_TERRAIN_ELEVATION_BUTTON_SPAN;
Crd[Crd.last-1].y = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_ELEVATION_MODIFY_BUTTON].y;
// Sample button.
ATLAS_LEFT_PANE_SECTION_TERRAIN_ELEVATION_SAMPLE_BUTTON = addArrayElement(Crd, Crd.last);
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].width = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_ELEVATION_MODIFY_BUTTON].width;
Crd[Crd.last-1].height = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_ELEVATION_MODIFY_BUTTON].height;
Crd[Crd.last-1].x = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_ELEVATION_SMOOTH_BUTTON].x+Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_ELEVATION_SMOOTH_BUTTON].width+ATLAS_LEFT_PANE_SECTION_TERRAIN_ELEVATION_BUTTON_SPAN;
Crd[Crd.last-1].y = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_ELEVATION_MODIFY_BUTTON].y;
// Intensity slider bar.
ATLAS_LEFT_PANE_SECTION_TERRAIN_ELEVATION_INTENSITY_SLIDER_BAR = addArrayElement(Crd, Crd.last);
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].width = 138;
Crd[Crd.last-1].height = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_ELEVATION_SMOOTH_BUTTON].height;
Crd[Crd.last-1].x = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_ELEVATION_SMOOTH_BUTTON].x;
Crd[Crd.last-1].y = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_ELEVATION_SMOOTH_BUTTON].y+Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_ELEVATION_SMOOTH_BUTTON].height+ATLAS_LEFT_PANE_SECTION.TMARGIN;
// Intensity slider marker.
ATLAS_LEFT_PANE_SECTION_TERRAIN_ELEVATION_INTENSITY_SLIDER_MARKER = addArrayElement(Crd, Crd.last);
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].width = 8;
Crd[Crd.last-1].height = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_ELEVATION_INTENSITY_SLIDER_BAR].height;
Crd[Crd.last-1].x = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_ELEVATION_INTENSITY_SLIDER_BAR].x+40;
Crd[Crd.last-1].y = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_ELEVATION_INTENSITY_SLIDER_BAR].y+(Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_ELEVATION_INTENSITY_SLIDER_BAR].height/3);
// Intensity label.
ATLAS_LEFT_PANE_SECTION_TERRAIN_ELEVATION_INTENSITY_LABEL = addArrayElement(Crd, Crd.last);
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].width = 50;
Crd[Crd.last-1].height = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_ELEVATION_INTENSITY_SLIDER_BAR].height;
Crd[Crd.last-1].x = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_ELEVATION_INTENSITY_SLIDER_BAR].x-Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_ELEVATION_INTENSITY_LABEL].width;
Crd[Crd.last-1].y = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_ELEVATION_INTENSITY_SLIDER_BAR].y;
// Roughen button.
ATLAS_LEFT_PANE_SECTION_TERRAIN_ELEVATION_ROUGHEN_BUTTON = addArrayElement(Crd, Crd.last);
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].width = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_ELEVATION_MODIFY_BUTTON].width;
Crd[Crd.last-1].height = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_ELEVATION_MODIFY_BUTTON].height;
Crd[Crd.last-1].x = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_ELEVATION_MODIFY_BUTTON].x;
Crd[Crd.last-1].y = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_ELEVATION_INTENSITY_LABEL].y+Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_ELEVATION_MODIFY_BUTTON].height+ATLAS_LEFT_PANE_SECTION.TMARGIN;
// Roughen style combo box.
ATLAS_LEFT_PANE_SECTION_TERRAIN_ELEVATION_STYLE_COMBO_BOX = addArrayElement(Crd, Crd.last);
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].width = 75;
Crd[Crd.last-1].height = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_ELEVATION_SAMPLE_BUTTON].height;
Crd[Crd.last-1].x = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_ELEVATION_SAMPLE_BUTTON].x+Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_ELEVATION_SAMPLE_BUTTON].width-Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_ELEVATION_STYLE_COMBO_BOX].width;
Crd[Crd.last-1].y = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_ELEVATION_ROUGHEN_BUTTON].y+4;
// Roughen style label.
ATLAS_LEFT_PANE_SECTION_TERRAIN_ELEVATION_STYLE_LABEL = addArrayElement(Crd, Crd.last);
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].width = 40;
Crd[Crd.last-1].height = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_ELEVATION_ROUGHEN_BUTTON].height;
Crd[Crd.last-1].x = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_ELEVATION_STYLE_COMBO_BOX].x-Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_ELEVATION_STYLE_LABEL].width;
Crd[Crd.last-1].y = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_ELEVATION_ROUGHEN_BUTTON].y;
// Power input box.
ATLAS_LEFT_PANE_SECTION_TERRAIN_ELEVATION_POWER_INPUT_BOX = addArrayElement(Crd, Crd.last);
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].width = 40;
Crd[Crd.last-1].height = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_ELEVATION_SAMPLE_BUTTON].height;
Crd[Crd.last-1].x = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_ELEVATION_SAMPLE_BUTTON].x+Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_ELEVATION_SAMPLE_BUTTON].width-Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_ELEVATION_POWER_INPUT_BOX].width;
Crd[Crd.last-1].y = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_ELEVATION_ROUGHEN_BUTTON].y+4+Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_ELEVATION_ROUGHEN_BUTTON].height+ATLAS_LEFT_PANE_SECTION.TMARGIN;
ATLAS_LEFT_PANE_SECTION_TERRAIN_ELEVATION_POWER_INPUT_BOX_UP = addArrayElement(Crd, Crd.last);
ATLAS_LEFT_PANE_SECTION_TERRAIN_ELEVATION_POWER_INPUT_BOX_DN = addArrayElement(Crd, Crd.last);
setCoordInputUpDown(Crd[Crd.last-2], Crd[Crd.last-1], ATLAS_LEFT_PANE_SECTION_TERRAIN_ELEVATION_POWER_INPUT_BOX,
left_screen, top_screen, left_screen, top_screen);
// Power label.
ATLAS_LEFT_PANE_SECTION_TERRAIN_ELEVATION_POWER_LABEL = addArrayElement(Crd, Crd.last);
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].width = 40;
Crd[Crd.last-1].height = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_ELEVATION_ROUGHEN_BUTTON].height;
Crd[Crd.last-1].x = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_ELEVATION_POWER_INPUT_BOX].x-Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_ELEVATION_POWER_LABEL].width;
Crd[Crd.last-1].y = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_ELEVATION_POWER_INPUT_BOX].y;
// Scale label.
ATLAS_LEFT_PANE_SECTION_TERRAIN_ELEVATION_SCALE_LABEL = addArrayElement(Crd, Crd.last);
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].width = 40;
Crd[Crd.last-1].height = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_ELEVATION_ROUGHEN_BUTTON].height;
Crd[Crd.last-1].x = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_ELEVATION_ROUGHEN_BUTTON].x;
Crd[Crd.last-1].y = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_ELEVATION_POWER_INPUT_BOX].y;
// Scale input box.
ATLAS_LEFT_PANE_SECTION_TERRAIN_ELEVATION_SCALE_INPUT_BOX = addArrayElement(Crd, Crd.last);
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].width = 40;
Crd[Crd.last-1].height = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_ELEVATION_SAMPLE_BUTTON].height;
Crd[Crd.last-1].x = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_ELEVATION_SCALE_LABEL].x+Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_ELEVATION_SCALE_LABEL].width;
Crd[Crd.last-1].y = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_ELEVATION_POWER_INPUT_BOX].y;
ATLAS_LEFT_PANE_SECTION_TERRAIN_ELEVATION_SCALE_INPUT_BOX_UP = addArrayElement(Crd, Crd.last);
ATLAS_LEFT_PANE_SECTION_TERRAIN_ELEVATION_SCALE_INPUT_BOX_DN = addArrayElement(Crd, Crd.last);
setCoordInputUpDown(Crd[Crd.last-2], Crd[Crd.last-1], ATLAS_LEFT_PANE_SECTION_TERRAIN_ELEVATION_SCALE_INPUT_BOX,
left_screen, top_screen, left_screen, top_screen);
// Increment button.
ATLAS_LEFT_PANE_SECTION_TERRAIN_ELEVATION_INCREMENT_BUTTON = addArrayElement(Crd, Crd.last);
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].width = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_ELEVATION_ROUGHEN_BUTTON].width;
Crd[Crd.last-1].height = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_ELEVATION_ROUGHEN_BUTTON].height;
Crd[Crd.last-1].x = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_ELEVATION_ROUGHEN_BUTTON].x;
Crd[Crd.last-1].y = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_ELEVATION_SCALE_INPUT_BOX].y+Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_ELEVATION_SCALE_INPUT_BOX].height+ATLAS_LEFT_PANE_SECTION.TMARGIN;
// Amount input box.
ATLAS_LEFT_PANE_SECTION_TERRAIN_ELEVATION_AMOUNT_INPUT_BOX = addArrayElement(Crd, Crd.last);
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].width = 40;
Crd[Crd.last-1].height = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_ELEVATION_SAMPLE_BUTTON].height;
Crd[Crd.last-1].x = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_ELEVATION_SAMPLE_BUTTON].x+Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_ELEVATION_SAMPLE_BUTTON].width-Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_ELEVATION_POWER_INPUT_BOX].width;
Crd[Crd.last-1].y = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_ELEVATION_INCREMENT_BUTTON].y;
ATLAS_LEFT_PANE_SECTION_TERRAIN_ELEVATION_AMOUNT_INPUT_BOX_UP = addArrayElement(Crd, Crd.last);
ATLAS_LEFT_PANE_SECTION_TERRAIN_ELEVATION_AMOUNT_INPUT_BOX_DN = addArrayElement(Crd, Crd.last);
setCoordInputUpDown(Crd[Crd.last-2], Crd[Crd.last-1], ATLAS_LEFT_PANE_SECTION_TERRAIN_ELEVATION_AMOUNT_INPUT_BOX,
left_screen, top_screen, left_screen, top_screen);
// Amount label.
ATLAS_LEFT_PANE_SECTION_TERRAIN_ELEVATION_AMOUNT_LABEL = addArrayElement(Crd, Crd.last);
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].width = 45;
Crd[Crd.last-1].height = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_ELEVATION_ROUGHEN_BUTTON].height;
Crd[Crd.last-1].x = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_ELEVATION_AMOUNT_INPUT_BOX].x-Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_ELEVATION_AMOUNT_LABEL].width;
Crd[Crd.last-1].y = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_ELEVATION_AMOUNT_INPUT_BOX].y;
// Horizontal rule at end of Edit Elevation.
ATLAS_LEFT_PANE_SECTION_TERRAIN_ELEVATION_HR = addArrayElement(Crd, Crd.last);
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].width = Crd[ATLAS_LEFT_PANE_BKG].width-ATLAS_LEFT_PANE_SECTION.LMARGIN-ATLAS_LEFT_PANE_SECTION.RMARGIN;
Crd[Crd.last-1].height = 2;
Crd[Crd.last-1].x = Crd[ATLAS_LEFT_PANE_BKG].x+ATLAS_LEFT_PANE_SECTION.LMARGIN;
Crd[Crd.last-1].y = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_ELEVATION_INCREMENT_BUTTON].y+Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_ELEVATION_INCREMENT_BUTTON].height+ATLAS_LEFT_PANE_SECTION.BMARGIN;
// ============================================= TERRAIN EDITOR: CLIFF ===============================================
// List of cliff portraits.
ATLAS_LEFT_PANE_SECTION_TERRAIN_CLIFF_LIST = addArrayElement(Crd, Crd.last);
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].width = 75;
Crd[Crd.last-1].height = 162;
Crd[Crd.last-1].x = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_ELEVATION_HR].x+3;
Crd[Crd.last-1].y = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_ELEVATION_HR].y+Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_ELEVATION_HR].x+3;
// "Cliff" heading.
ATLAS_LEFT_PANE_SECTION_TERRAIN_CLIFF_HEADING = addArrayElement(Crd, Crd.last);
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].width = Crd[ATLAS_LEFT_PANE_SECTION_HEADING_2].x+Crd[ATLAS_LEFT_PANE_SECTION_HEADING_2].width-Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_CLIFF_LIST].x-Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_CLIFF_LIST].width;
Crd[Crd.last-1].height = 22;
Crd[Crd.last-1].x = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_CLIFF_LIST].x+Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_CLIFF_LIST].width;
Crd[Crd.last-1].y = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_ELEVATION_HR].y+Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_ELEVATION_HR].height;
// Horizontal rule under heading.
ATLAS_LEFT_PANE_SECTION_TERRAIN_CLIFF_HEADING_HR = addArrayElement(Crd, Crd.last);
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].width = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_CLIFF_HEADING].width-ATLAS_LEFT_PANE_SECTION.LMARGIN-ATLAS_LEFT_PANE_SECTION.RMARGIN;
Crd[Crd.last-1].height = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_ELEVATION_HR].height;
Crd[Crd.last-1].x = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_CLIFF_HEADING].x+ATLAS_LEFT_PANE_SECTION.LMARGIN;
Crd[Crd.last-1].y = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_CLIFF_HEADING].y+Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_CLIFF_HEADING].height;
// Place button.
ATLAS_LEFT_PANE_SECTION_TERRAIN_CLIFF_BUTTON_PLACE = addArrayElement(Crd, Crd.last);
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].width = 84;
Crd[Crd.last-1].height = 15;
Crd[Crd.last-1].x = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_CLIFF_HEADING_HR].x;
Crd[Crd.last-1].y = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_CLIFF_HEADING_HR].y+Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_CLIFF_HEADING_HR].height+(ATLAS_LEFT_PANE_SECTION.TMARGIN/2);
// Height label.
ATLAS_LEFT_PANE_SECTION_TERRAIN_CLIFF_HEIGHT_LABEL = addArrayElement(Crd, Crd.last);
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].width = 48;
Crd[Crd.last-1].height = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_CLIFF_BUTTON_PLACE].height;
Crd[Crd.last-1].x = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_CLIFF_HEADING].x+2;
Crd[Crd.last-1].y = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_CLIFF_BUTTON_PLACE].y+Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_CLIFF_BUTTON_PLACE].height+ATLAS_LEFT_PANE_SECTION.TMARGIN*1.5;
// Height input box.
ATLAS_LEFT_PANE_SECTION_TERRAIN_CLIFF_HEIGHT_INPUT_BOX = addArrayElement(Crd, Crd.last);
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].width = 40;
Crd[Crd.last-1].height = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_CLIFF_HEIGHT_LABEL].height;
Crd[Crd.last-1].x = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_CLIFF_HEIGHT_LABEL].x+Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_CLIFF_HEIGHT_LABEL].width;
Crd[Crd.last-1].y = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_CLIFF_HEIGHT_LABEL].y;
ATLAS_LEFT_PANE_SECTION_TERRAIN_CLIFF_HEIGHT_INPUT_BOX_UP = addArrayElement(Crd, Crd.last);
ATLAS_LEFT_PANE_SECTION_TERRAIN_CLIFF_HEIGHT_INPUT_BOX_DN = addArrayElement(Crd, Crd.last);
setCoordInputUpDown(Crd[Crd.last-2], Crd[Crd.last-1], ATLAS_LEFT_PANE_SECTION_TERRAIN_CLIFF_HEIGHT_INPUT_BOX,
left_screen, top_screen, left_screen, top_screen);
// Angle label.
ATLAS_LEFT_PANE_SECTION_TERRAIN_CLIFF_ANGLE_LABEL = addArrayElement(Crd, Crd.last);
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].width = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_CLIFF_HEIGHT_LABEL].width;
Crd[Crd.last-1].height = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_CLIFF_HEIGHT_LABEL].height;
Crd[Crd.last-1].x = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_CLIFF_HEIGHT_LABEL].x;
Crd[Crd.last-1].y = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_CLIFF_HEIGHT_LABEL].y+Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_CLIFF_HEIGHT_LABEL].height+ATLAS_LEFT_PANE_SECTION.TMARGIN*1.5;
// Angle input box.
ATLAS_LEFT_PANE_SECTION_TERRAIN_CLIFF_ANGLE_INPUT_BOX = addArrayElement(Crd, Crd.last);
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].width = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_CLIFF_HEIGHT_INPUT_BOX].width;
Crd[Crd.last-1].height = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_CLIFF_HEIGHT_INPUT_BOX].height;
Crd[Crd.last-1].x = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_CLIFF_HEIGHT_INPUT_BOX].x;
Crd[Crd.last-1].y = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_CLIFF_HEIGHT_INPUT_BOX].y+Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_CLIFF_HEIGHT_INPUT_BOX].height+ATLAS_LEFT_PANE_SECTION.TMARGIN*1.5;
ATLAS_LEFT_PANE_SECTION_TERRAIN_CLIFF_ANGLE_INPUT_BOX_UP = addArrayElement(Crd, Crd.last);
ATLAS_LEFT_PANE_SECTION_TERRAIN_CLIFF_ANGLE_INPUT_BOX_DN = addArrayElement(Crd, Crd.last);
setCoordInputUpDown(Crd[Crd.last-2], Crd[Crd.last-1], ATLAS_LEFT_PANE_SECTION_TERRAIN_CLIFF_ANGLE_INPUT_BOX,
left_screen, top_screen, left_screen, top_screen);
// Smooth label.
ATLAS_LEFT_PANE_SECTION_TERRAIN_CLIFF_SMOOTH_LABEL = addArrayElement(Crd, Crd.last);
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].width = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_CLIFF_HEIGHT_LABEL].width;
Crd[Crd.last-1].height = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_CLIFF_HEIGHT_LABEL].height;
Crd[Crd.last-1].x = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_CLIFF_HEIGHT_LABEL].x;
Crd[Crd.last-1].y = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_CLIFF_ANGLE_LABEL].y+Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_CLIFF_ANGLE_LABEL].height+ATLAS_LEFT_PANE_SECTION.TMARGIN*1.5;
// Smooth input box.
ATLAS_LEFT_PANE_SECTION_TERRAIN_CLIFF_SMOOTH_INPUT_BOX = addArrayElement(Crd, Crd.last);
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].width = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_CLIFF_HEIGHT_INPUT_BOX].width;
Crd[Crd.last-1].height = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_CLIFF_HEIGHT_INPUT_BOX].height;
Crd[Crd.last-1].x = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_CLIFF_HEIGHT_INPUT_BOX].x;
Crd[Crd.last-1].y = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_CLIFF_ANGLE_INPUT_BOX].y+Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_CLIFF_ANGLE_INPUT_BOX].height+ATLAS_LEFT_PANE_SECTION.TMARGIN*1.5;
ATLAS_LEFT_PANE_SECTION_TERRAIN_CLIFF_SMOOTH_INPUT_BOX_UP = addArrayElement(Crd, Crd.last);
ATLAS_LEFT_PANE_SECTION_TERRAIN_CLIFF_SMOOTH_INPUT_BOX_DN = addArrayElement(Crd, Crd.last);
setCoordInputUpDown(Crd[Crd.last-2], Crd[Crd.last-1], ATLAS_LEFT_PANE_SECTION_TERRAIN_CLIFF_SMOOTH_INPUT_BOX,
left_screen, top_screen, left_screen, top_screen);
// Custom button.
ATLAS_LEFT_PANE_SECTION_TERRAIN_CLIFF_BUTTON_CUSTOM = addArrayElement(Crd, Crd.last);
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].width = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_CLIFF_BUTTON_PLACE].width;
Crd[Crd.last-1].height = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_CLIFF_BUTTON_PLACE].height;
Crd[Crd.last-1].x = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_CLIFF_BUTTON_PLACE].x;
Crd[Crd.last-1].y = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_CLIFF_LIST].y+Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_CLIFF_LIST].height-Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_CLIFF_BUTTON_CUSTOM].height;
// Horizontal rule at end of Paint Cliff.
ATLAS_LEFT_PANE_SECTION_TERRAIN_CLIFF_HR = addArrayElement(Crd, Crd.last);
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].width = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_ELEVATION_HR].width;
Crd[Crd.last-1].height = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_ELEVATION_HR].height;
Crd[Crd.last-1].x = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_ELEVATION_HR].x;
Crd[Crd.last-1].y = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_CLIFF_LIST].y+Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_CLIFF_LIST].height+ATLAS_LEFT_PANE_SECTION.BMARGIN;
// ============================================= TERRAIN EDITOR: WATER ===============================================
// List of water portraits.
ATLAS_LEFT_PANE_SECTION_TERRAIN_WATER_LIST = addArrayElement(Crd, Crd.last);
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].width = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_CLIFF_LIST].width;
Crd[Crd.last-1].height = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_CLIFF_LIST].height;
Crd[Crd.last-1].x = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_CLIFF_LIST].x;
Crd[Crd.last-1].y = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_CLIFF_HR].y+Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_CLIFF_HR].x+3;
// "Water" heading.
ATLAS_LEFT_PANE_SECTION_TERRAIN_WATER_HEADING = addArrayElement(Crd, Crd.last);
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].width = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_CLIFF_HEADING].width;
Crd[Crd.last-1].height = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_CLIFF_HEADING].height;
Crd[Crd.last-1].x = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_CLIFF_HEADING].x;
Crd[Crd.last-1].y = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_CLIFF_HR].y;
// Horizontal rule under heading.
ATLAS_LEFT_PANE_SECTION_TERRAIN_WATER_HEADING_HR = addArrayElement(Crd, Crd.last);
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].width = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_CLIFF_HEADING_HR].width;
Crd[Crd.last-1].height = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_CLIFF_HEADING_HR].height;
Crd[Crd.last-1].x = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_CLIFF_HEADING_HR].x;
Crd[Crd.last-1].y = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_WATER_HEADING].y+Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_WATER_HEADING].height;
// Place button.
ATLAS_LEFT_PANE_SECTION_TERRAIN_WATER_BUTTON_PLACE = addArrayElement(Crd, Crd.last);
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].width = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_CLIFF_BUTTON_PLACE].width-15;
Crd[Crd.last-1].height = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_CLIFF_BUTTON_PLACE].height;
Crd[Crd.last-1].x = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_CLIFF_BUTTON_PLACE].x;
Crd[Crd.last-1].y = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_WATER_HEADING_HR].y+Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_WATER_HEADING_HR].height+(ATLAS_LEFT_PANE_SECTION.TMARGIN/2);
// Beautify Water button.
ATLAS_LEFT_PANE_SECTION_TERRAIN_WATER_BUTTON_BEAUTIFY = addArrayElement(Crd, Crd.last);
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].width = 15;
Crd[Crd.last-1].height = 15;
Crd[Crd.last-1].x = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_WATER_BUTTON_PLACE].x+Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_WATER_BUTTON_PLACE].width+1;
Crd[Crd.last-1].y = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_WATER_BUTTON_PLACE].y;
// Depth label.
ATLAS_LEFT_PANE_SECTION_TERRAIN_WATER_DEPTH_LABEL = addArrayElement(Crd, Crd.last);
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].width = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_CLIFF_HEIGHT_LABEL].width;
Crd[Crd.last-1].height = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_CLIFF_HEIGHT_LABEL].height;
Crd[Crd.last-1].x = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_CLIFF_HEIGHT_LABEL].x;
Crd[Crd.last-1].y = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_WATER_BUTTON_PLACE].y+Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_WATER_BUTTON_PLACE].height+ATLAS_LEFT_PANE_SECTION.TMARGIN;
// Depth input box.
ATLAS_LEFT_PANE_SECTION_TERRAIN_WATER_DEPTH_INPUT_BOX = addArrayElement(Crd, Crd.last);
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].width = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_CLIFF_HEIGHT_INPUT_BOX].width;
Crd[Crd.last-1].height = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_CLIFF_HEIGHT_INPUT_BOX].height;
Crd[Crd.last-1].x = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_CLIFF_HEIGHT_INPUT_BOX].x;
Crd[Crd.last-1].y = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_WATER_DEPTH_LABEL].y;
ATLAS_LEFT_PANE_SECTION_TERRAIN_WATER_DEPTH_INPUT_BOX_UP = addArrayElement(Crd, Crd.last);
ATLAS_LEFT_PANE_SECTION_TERRAIN_WATER_DEPTH_INPUT_BOX_DN = addArrayElement(Crd, Crd.last);
setCoordInputUpDown(Crd[Crd.last-2], Crd[Crd.last-1], ATLAS_LEFT_PANE_SECTION_TERRAIN_WATER_DEPTH_INPUT_BOX,
left_screen, top_screen, left_screen, top_screen);
// Colour label.
ATLAS_LEFT_PANE_SECTION_TERRAIN_WATER_COLOUR_LABEL = addArrayElement(Crd, Crd.last);
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].width = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_WATER_DEPTH_LABEL].width;
Crd[Crd.last-1].height = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_WATER_DEPTH_LABEL].height;
Crd[Crd.last-1].x = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_WATER_DEPTH_LABEL].x;
Crd[Crd.last-1].y = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_WATER_DEPTH_LABEL].y+Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_WATER_DEPTH_LABEL].height+ATLAS_LEFT_PANE_SECTION.TMARGIN*1.5;
// Colour input box.
ATLAS_LEFT_PANE_SECTION_TERRAIN_WATER_COLOUR_R_INPUT_BOX = addArrayElement(Crd, Crd.last);
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].width = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_WATER_DEPTH_INPUT_BOX].width;
Crd[Crd.last-1].height = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_WATER_DEPTH_INPUT_BOX].height/1.5;
Crd[Crd.last-1].x = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_WATER_DEPTH_INPUT_BOX].x;
Crd[Crd.last-1].y = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_WATER_DEPTH_INPUT_BOX].y+Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_WATER_DEPTH_INPUT_BOX].height+ATLAS_LEFT_PANE_SECTION.TMARGIN/1.2;
// Colour input box.
ATLAS_LEFT_PANE_SECTION_TERRAIN_WATER_COLOUR_G_INPUT_BOX = addArrayElement(Crd, Crd.last);
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].width = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_WATER_DEPTH_INPUT_BOX].width;
Crd[Crd.last-1].height = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_WATER_DEPTH_INPUT_BOX].height/1.5;
Crd[Crd.last-1].x = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_WATER_DEPTH_INPUT_BOX].x;
Crd[Crd.last-1].y = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_WATER_COLOUR_R_INPUT_BOX].y+Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_WATER_COLOUR_R_INPUT_BOX].height+ATLAS_LEFT_PANE_SECTION.TMARGIN/1.2;
// Colour input box.
ATLAS_LEFT_PANE_SECTION_TERRAIN_WATER_COLOUR_B_INPUT_BOX = addArrayElement(Crd, Crd.last);
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].width = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_WATER_DEPTH_INPUT_BOX].width;
Crd[Crd.last-1].height = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_WATER_DEPTH_INPUT_BOX].height/1.5;
Crd[Crd.last-1].x = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_WATER_DEPTH_INPUT_BOX].x;
Crd[Crd.last-1].y = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_WATER_COLOUR_G_INPUT_BOX].y+Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_WATER_COLOUR_G_INPUT_BOX].height+ATLAS_LEFT_PANE_SECTION.TMARGIN/1.2;
// Colour tint box.
ATLAS_LEFT_PANE_SECTION_TERRAIN_WATER_COLOUR_TINT_BOX = addArrayElement(Crd, Crd.last);
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].width = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_WATER_COLOUR_LABEL].width/3;
Crd[Crd.last-1].height = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_WATER_COLOUR_TINT_BOX].width;
Crd[Crd.last-1].x = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_WATER_COLOUR_LABEL].x+Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_WATER_COLOUR_LABEL].width/5;
Crd[Crd.last-1].y = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_WATER_COLOUR_LABEL].y+Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_WATER_COLOUR_LABEL].height+Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_WATER_COLOUR_LABEL].height/3;
// Smooth input box.
ATLAS_LEFT_PANE_SECTION_TERRAIN_WATER_SMOOTH_INPUT_BOX = addArrayElement(Crd, Crd.last);
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].width = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_WATER_DEPTH_INPUT_BOX].width;
Crd[Crd.last-1].height = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_WATER_DEPTH_INPUT_BOX].height;
Crd[Crd.last-1].x = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_WATER_DEPTH_INPUT_BOX].x;
Crd[Crd.last-1].y = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_WATER_COLOUR_B_INPUT_BOX].y+Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_WATER_COLOUR_B_INPUT_BOX].height+ATLAS_LEFT_PANE_SECTION.TMARGIN;
ATLAS_LEFT_PANE_SECTION_TERRAIN_WATER_SMOOTH_INPUT_BOX_UP = addArrayElement(Crd, Crd.last);
ATLAS_LEFT_PANE_SECTION_TERRAIN_WATER_SMOOTH_INPUT_BOX_DN = addArrayElement(Crd, Crd.last);
setCoordInputUpDown(Crd[Crd.last-2], Crd[Crd.last-1], ATLAS_LEFT_PANE_SECTION_TERRAIN_WATER_SMOOTH_INPUT_BOX,
left_screen, top_screen, left_screen, top_screen);
// Smooth label.
ATLAS_LEFT_PANE_SECTION_TERRAIN_WATER_SMOOTH_LABEL = addArrayElement(Crd, Crd.last);
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].width = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_WATER_DEPTH_LABEL].width;
Crd[Crd.last-1].height = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_WATER_DEPTH_LABEL].height;
Crd[Crd.last-1].x = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_WATER_DEPTH_LABEL].x;
Crd[Crd.last-1].y = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_WATER_SMOOTH_INPUT_BOX].y-2;
// Custom button.
ATLAS_LEFT_PANE_SECTION_TERRAIN_WATER_BUTTON_CUSTOM = addArrayElement(Crd, Crd.last);
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].width = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_CLIFF_BUTTON_CUSTOM].width;
Crd[Crd.last-1].height = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_CLIFF_BUTTON_CUSTOM].height;
Crd[Crd.last-1].x = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_CLIFF_BUTTON_CUSTOM].x;
Crd[Crd.last-1].y = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_WATER_LIST].y+Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_WATER_LIST].height-Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_WATER_BUTTON_CUSTOM].height;
// Horizontal rule at end of Paint Water.
ATLAS_LEFT_PANE_SECTION_TERRAIN_WATER_HR = addArrayElement(Crd, Crd.last);
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].width = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_CLIFF_HR].width;
Crd[Crd.last-1].height = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_CLIFF_HR].height;
Crd[Crd.last-1].x = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_CLIFF_HR].x;
Crd[Crd.last-1].y = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_WATER_LIST].y+Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_WATER_LIST].height+ATLAS_LEFT_PANE_SECTION.BMARGIN;
// ============================================= TERRAIN EDITOR: BRUSH SETTINGS ==============================================
// Terrain Preview.
ATLAS_BOTTOM_PANE_SECTION_TERRAIN_PREVIEW = addArrayElement(Crd, Crd.last);
Crd[Crd.last-1].rleft = left_screen; Crd[Crd.last-1].rtop = bottom_screen;
Crd[Crd.last-1].rright = left_screen; Crd[Crd.last-1].rbottom = bottom_screen;
Crd[Crd.last-1].width = 125;
Crd[Crd.last-1].height = 125;
Crd[Crd.last-1].x = ATLAS_LEFT_PANE_SECTION.LMARGIN;
Crd[Crd.last-1].y = ATLAS_LEFT_PANE_SECTION.LMARGIN;
// Terrain Preview label.
ATLAS_BOTTOM_PANE_SECTION_TERRAIN_PREVIEW_LABEL = addArrayElement(Crd, Crd.last);
Crd[Crd.last-1].rleft = left_screen; Crd[Crd.last-1].rtop = bottom_screen;
Crd[Crd.last-1].rright = left_screen; Crd[Crd.last-1].rbottom = bottom_screen;
Crd[Crd.last-1].width = Crd[ATLAS_BOTTOM_PANE_SECTION_TERRAIN_PREVIEW].width;
Crd[Crd.last-1].height = 15;
Crd[Crd.last-1].x = Crd[ATLAS_BOTTOM_PANE_SECTION_TERRAIN_PREVIEW].x;
Crd[Crd.last-1].y = Crd[ATLAS_BOTTOM_PANE_SECTION_TERRAIN_PREVIEW].y+Crd[ATLAS_BOTTOM_PANE_SECTION_TERRAIN_PREVIEW].height;
// Brush border.
ATLAS_BOTTOM_PANE_SECTION_TERRAIN_BRUSH_BORDER = addArrayElement(Crd, Crd.last);
Crd[Crd.last-1].rleft = left_screen; Crd[Crd.last-1].rtop = bottom_screen;
Crd[Crd.last-1].rright = left_screen; Crd[Crd.last-1].rbottom = bottom_screen;
Crd[Crd.last-1].width = Crd[ATLAS_RB_CORNER].x-Crd[ATLAS_BOTTOM_PANE_SECTION_TERRAIN_PREVIEW].width;
Crd[Crd.last-1].height = Crd[ATLAS_BOTTOM_PANE_SECTION_TERRAIN_PREVIEW].height;
Crd[Crd.last-1].x = Crd[ATLAS_BOTTOM_PANE_SECTION_TERRAIN_PREVIEW].x+Crd[ATLAS_BOTTOM_PANE_SECTION_TERRAIN_PREVIEW].width+(Crd[ATLAS_RB_CORNER].width/4);
Crd[Crd.last-1].y = Crd[ATLAS_BOTTOM_PANE_SECTION_TERRAIN_PREVIEW].y;
// Brush border label.
ATLAS_BOTTOM_PANE_SECTION_TERRAIN_BRUSH_BORDER_LABEL = addArrayElement(Crd, Crd.last);
Crd[Crd.last-1].rleft = left_screen; Crd[Crd.last-1].rtop = bottom_screen;
Crd[Crd.last-1].rright = left_screen; Crd[Crd.last-1].rbottom = bottom_screen;
Crd[Crd.last-1].width = Crd[ATLAS_BOTTOM_PANE_SECTION_TERRAIN_BRUSH_BORDER].width;
Crd[Crd.last-1].height = 15;
Crd[Crd.last-1].x = Crd[ATLAS_BOTTOM_PANE_SECTION_TERRAIN_BRUSH_BORDER].x;
Crd[Crd.last-1].y = Crd[ATLAS_BOTTOM_PANE_SECTION_TERRAIN_BRUSH_BORDER].y+Crd[ATLAS_BOTTOM_PANE_SECTION_TERRAIN_BRUSH_BORDER].height;
// Brush size slider bar.
ATLAS_BOTTOM_PANE_SECTION_TERRAIN_BRUSH_SIZE_SLIDER_BAR = addArrayElement(Crd, Crd.last);
Crd[Crd.last-1].rleft = left_screen; Crd[Crd.last-1].rtop = bottom_screen;
Crd[Crd.last-1].rright = left_screen; Crd[Crd.last-1].rbottom = bottom_screen;
Crd[Crd.last-1].width = 15;
Crd[Crd.last-1].height = Crd[ATLAS_BOTTOM_PANE_SECTION_TERRAIN_BRUSH_BORDER].height+11;
Crd[Crd.last-1].x = Crd[ATLAS_BOTTOM_PANE_SECTION_TERRAIN_BRUSH_BORDER].x+Crd[ATLAS_BOTTOM_PANE_SECTION_TERRAIN_BRUSH_BORDER].width-Crd[ATLAS_BOTTOM_PANE_SECTION_TERRAIN_BRUSH_SIZE_SLIDER_BAR].width-5;
Crd[Crd.last-1].y = Crd[ATLAS_BOTTOM_PANE_SECTION_TERRAIN_BRUSH_BORDER].y-22;
// Brush size slider marker.
ATLAS_BOTTOM_PANE_SECTION_TERRAIN_BRUSH_SIZE_SLIDER_MARKER = addArrayElement(Crd, Crd.last);
Crd[Crd.last-1].rleft = left_screen; Crd[Crd.last-1].rtop = bottom_screen;
Crd[Crd.last-1].rright = left_screen; Crd[Crd.last-1].rbottom = bottom_screen;
Crd[Crd.last-1].width = Crd[ATLAS_BOTTOM_PANE_SECTION_TERRAIN_BRUSH_SIZE_SLIDER_BAR].width;
Crd[Crd.last-1].height = 8;
Crd[Crd.last-1].x = Crd[ATLAS_BOTTOM_PANE_SECTION_TERRAIN_BRUSH_SIZE_SLIDER_BAR].x-3;
Crd[Crd.last-1].y = Crd[ATLAS_BOTTOM_PANE_SECTION_TERRAIN_BRUSH_SIZE_SLIDER_BAR].y+70;
ATLAS_BOTTOM_PANE_SECTION_TERRAIN_BRUSH_BUTTON_SPAN = 5;
// Brush button.
ATLAS_BOTTOM_PANE_SECTION_TERRAIN_BRUSH_BUTTON_1 = addArrayElement(Crd, Crd.last);
Crd[Crd.last-1].rleft = left_screen; Crd[Crd.last-1].rtop = bottom_screen;
Crd[Crd.last-1].rright = left_screen; Crd[Crd.last-1].rbottom = bottom_screen;
Crd[Crd.last-1].width = 15;
Crd[Crd.last-1].height = 15;
Crd[Crd.last-1].x = Crd[ATLAS_BOTTOM_PANE_SECTION_TERRAIN_BRUSH_BORDER].x+10;
Crd[Crd.last-1].y = Crd[ATLAS_BOTTOM_PANE_SECTION_TERRAIN_BRUSH_BORDER].y+Crd[ATLAS_BOTTOM_PANE_SECTION_TERRAIN_BRUSH_BORDER].height-15-10;
// Brush button.
ATLAS_BOTTOM_PANE_SECTION_TERRAIN_BRUSH_BUTTON_2 = addArrayElement(Crd, Crd.last);
Crd[Crd.last-1].rleft = left_screen; Crd[Crd.last-1].rtop = bottom_screen;
Crd[Crd.last-1].rright = left_screen; Crd[Crd.last-1].rbottom = bottom_screen;
Crd[Crd.last-1].width = Crd[ATLAS_BOTTOM_PANE_SECTION_TERRAIN_BRUSH_BUTTON_1].width;
Crd[Crd.last-1].height = Crd[ATLAS_BOTTOM_PANE_SECTION_TERRAIN_BRUSH_BUTTON_1].height;
Crd[Crd.last-1].x = Crd[ATLAS_BOTTOM_PANE_SECTION_TERRAIN_BRUSH_BUTTON_1].x;
Crd[Crd.last-1].y = Crd[ATLAS_BOTTOM_PANE_SECTION_TERRAIN_BRUSH_BUTTON_1].y-Crd[ATLAS_BOTTOM_PANE_SECTION_TERRAIN_BRUSH_BUTTON_1].height-ATLAS_BOTTOM_PANE_SECTION_TERRAIN_BRUSH_BUTTON_SPAN;
// Brush button.
ATLAS_BOTTOM_PANE_SECTION_TERRAIN_BRUSH_BUTTON_3 = addArrayElement(Crd, Crd.last);
Crd[Crd.last-1].rleft = left_screen; Crd[Crd.last-1].rtop = bottom_screen;
Crd[Crd.last-1].rright = left_screen; Crd[Crd.last-1].rbottom = bottom_screen;
Crd[Crd.last-1].width = Crd[ATLAS_BOTTOM_PANE_SECTION_TERRAIN_BRUSH_BUTTON_1].width;
Crd[Crd.last-1].height = Crd[ATLAS_BOTTOM_PANE_SECTION_TERRAIN_BRUSH_BUTTON_1].height;
Crd[Crd.last-1].x = Crd[ATLAS_BOTTOM_PANE_SECTION_TERRAIN_BRUSH_BUTTON_1].x;
Crd[Crd.last-1].y = Crd[ATLAS_BOTTOM_PANE_SECTION_TERRAIN_BRUSH_BUTTON_2].y-Crd[ATLAS_BOTTOM_PANE_SECTION_TERRAIN_BRUSH_BUTTON_2].height-ATLAS_BOTTOM_PANE_SECTION_TERRAIN_BRUSH_BUTTON_SPAN;
// Brush button.
ATLAS_BOTTOM_PANE_SECTION_TERRAIN_BRUSH_BUTTON_4 = addArrayElement(Crd, Crd.last);
Crd[Crd.last-1].rleft = left_screen; Crd[Crd.last-1].rtop = bottom_screen;
Crd[Crd.last-1].rright = left_screen; Crd[Crd.last-1].rbottom = bottom_screen;
Crd[Crd.last-1].width = Crd[ATLAS_BOTTOM_PANE_SECTION_TERRAIN_BRUSH_BUTTON_1].width;
Crd[Crd.last-1].height = Crd[ATLAS_BOTTOM_PANE_SECTION_TERRAIN_BRUSH_BUTTON_1].height;
Crd[Crd.last-1].x = Crd[ATLAS_BOTTOM_PANE_SECTION_TERRAIN_BRUSH_BUTTON_1].x;
Crd[Crd.last-1].y = Crd[ATLAS_BOTTOM_PANE_SECTION_TERRAIN_BRUSH_BUTTON_3].y-Crd[ATLAS_BOTTOM_PANE_SECTION_TERRAIN_BRUSH_BUTTON_3].height-ATLAS_BOTTOM_PANE_SECTION_TERRAIN_BRUSH_BUTTON_SPAN;
// Beautify Terrain button.
ATLAS_BOTTOM_PANE_SECTION_TERRAIN_BRUSH_BUTTON_BEAUTIFY = addArrayElement(Crd, Crd.last);
Crd[Crd.last-1].rleft = left_screen; Crd[Crd.last-1].rtop = bottom_screen;
Crd[Crd.last-1].rright = left_screen; Crd[Crd.last-1].rbottom = bottom_screen;
Crd[Crd.last-1].width = Crd[ATLAS_BOTTOM_PANE_SECTION_TERRAIN_BRUSH_BUTTON_1].width;
Crd[Crd.last-1].height = Crd[ATLAS_BOTTOM_PANE_SECTION_TERRAIN_BRUSH_BUTTON_1].height;
Crd[Crd.last-1].x = Crd[ATLAS_BOTTOM_PANE_SECTION_TERRAIN_BRUSH_BUTTON_1].x;
Crd[Crd.last-1].y = Crd[ATLAS_BOTTOM_PANE_SECTION_TERRAIN_BRUSH_BORDER].y+10;
// ============================================= TERRAIN EDITOR: PAINT TERRAIN ===============================================
// Terrain Palette Background.
ATLAS_BOTTOM_PANE_SECTION_TERRAIN_PALETTE_BKG = addArrayElement(Crd, Crd.last);
Crd[Crd.last-1].rleft = right_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].width = 603;
Crd[Crd.last-1].height = 122;
Crd[Crd.last-1].x = Crd[ATLAS_RB_CORNER].x+Crd[ATLAS_RB_CORNER].width;
Crd[Crd.last-1].y = Crd[ATLAS_BOTTOM_PANE_BKG].y+5;
// Terrain Palette Tabs.
ATLAS_BOTTOM_PANE_SECTION_TERRAIN_PALETTE_TAB = new Object();
ATLAS_BOTTOM_PANE_SECTION_TERRAIN_PALETTE_TAB.span = 9;
ATLAS_BOTTOM_PANE_SECTION_TERRAIN_PALETTE_TAB.max = 9;
for (ATLAS_BOTTOM_PANE_SECTION_TERRAIN_PALETTE_TAB.last = 1; ATLAS_BOTTOM_PANE_SECTION_TERRAIN_PALETTE_TAB.last <= ATLAS_BOTTOM_PANE_SECTION_TERRAIN_PALETTE_TAB.max; ATLAS_BOTTOM_PANE_SECTION_TERRAIN_PALETTE_TAB.last++)
{
ATLAS_BOTTOM_PANE_SECTION_TERRAIN_PALETTE_TAB[ATLAS_BOTTOM_PANE_SECTION_TERRAIN_PALETTE_TAB.last] = Crd.last;
Crd[Crd.last] = new Object();
Crd[Crd.last].width = 63;
Crd[Crd.last].height = 17;
Crd[Crd.last].rleft = right_screen; Crd[Crd.last].rtop = bottom_screen;
Crd[Crd.last].rright = right_screen; Crd[Crd.last].rbottom = bottom_screen;
if (ATLAS_BOTTOM_PANE_SECTION_TERRAIN_PALETTE_TAB.last == 1)
Crd[Crd.last].x = Crd[ATLAS_BOTTOM_PANE_SECTION_TERRAIN_PALETTE_BKG].x+Crd[ATLAS_BOTTOM_PANE_SECTION_TERRAIN_PALETTE_BKG].width-Crd[Crd.last].width+2;
else
Crd[Crd.last].x = Crd[ATLAS_BOTTOM_PANE_SECTION_TERRAIN_PALETTE_TAB[ATLAS_BOTTOM_PANE_SECTION_TERRAIN_PALETTE_TAB.last]-1].x-Crd[Crd.last].width+ATLAS_BOTTOM_PANE_SECTION_TERRAIN_PALETTE_TAB.span;
Crd[Crd.last].y = Crd[ATLAS_BOTTOM_PANE_SECTION_TERRAIN_PALETTE_BKG].y+Crd[ATLAS_BOTTOM_PANE_SECTION_TERRAIN_PALETTE_BKG].height;
Crd.last++;
}
// Custom button.
ATLAS_BOTTOM_PANE_SECTION_TERRAIN_PALETTE_BUTTON_CUSTOM = addArrayElement(Crd, Crd.last);
Crd[Crd.last-1].rleft = right_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].width = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_CLIFF_BUTTON_CUSTOM].width;
Crd[Crd.last-1].height = Crd[ATLAS_LEFT_PANE_SECTION_TERRAIN_CLIFF_BUTTON_CUSTOM].height;
Crd[Crd.last-1].x = Crd[ATLAS_BOTTOM_PANE_SECTION_TERRAIN_PALETTE_BKG].x-1;
Crd[Crd.last-1].y = Crd[ATLAS_BOTTOM_PANE_SECTION_TERRAIN_PALETTE_BKG].y+Crd[ATLAS_BOTTOM_PANE_SECTION_TERRAIN_PALETTE_BKG].height+3;
// Right arrow on Terrain Palette.
ATLAS_BOTTOM_PANE_SECTION_TERRAIN_PALETTE_RT_ARROW = addArrayElement(Crd, Crd.last);
Crd[Crd.last-1].rleft = right_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].width = 6;
Crd[Crd.last-1].height = 12;
Crd[Crd.last-1].x = Crd[ATLAS_BOTTOM_PANE_SECTION_TERRAIN_PALETTE_TAB[ATLAS_BOTTOM_PANE_SECTION_TERRAIN_PALETTE_TAB.last-1]].x-Crd[ATLAS_BOTTOM_PANE_SECTION_TERRAIN_PALETTE_RT_ARROW].width-Crd[ATLAS_BOTTOM_PANE_SECTION_TERRAIN_PALETTE_RT_ARROW].width;
Crd[Crd.last-1].y = Crd[ATLAS_BOTTOM_PANE_SECTION_TERRAIN_PALETTE_BUTTON_CUSTOM].y-2;
}
// ====================================================================

View File

@ -1,148 +0,0 @@
/*
***************************************
functions_global.js
Contains global GUI functions, which will
later be accessible from every GUI script/file.
So far, only the message box-related functions
are implemented.
***************************************
File version: 0.1
Edited by: Malte, Nov 14 2004
***************************************
Further comments:
Changelog:
v0.1: - first version.
***************************************
*/
// *******************************************
// messageBox
// *******************************************
// @params: int mbWidth, int mbHeight, string mbMessage, string mbTitle, int mbMode, arr mbButtonCaptions
// @return: void
// @desc: Displays a new message box. So far, we can only display one message box at
// a time, since the message box is based on one base-object which is modified
// according to the parameters. Later, we should probably be able to create GUI
// Objects (like the message box) at runtime.
// *******************************************
/*
TODO: Make button code work for any number of buttons without extending the code each time! ((arrays | nested variables) & calculating sizes)
*/
// ====================================================================
function initGlobal()
{
// Bottom-left product logo; used when taking official screenshots.
GLOBAL_WATERMARK_PRODUCT_LOGO = addArrayElement(Crd, Crd.last);
Crd[Crd.last-1].rleft = left_screen; Crd[Crd.last-1].rtop = bottom_screen;
Crd[Crd.last-1].rright = left_screen; Crd[Crd.last-1].rbottom = bottom_screen;
Crd[Crd.last-1].width = 200;
Crd[Crd.last-1].height = 98;
Crd[Crd.last-1].x = 0;
Crd[Crd.last-1].y = 0;
// Bottom-right company logo; used when taking official screenshots.
GLOBAL_WATERMARK_COMPANY_LOGO = addArrayElement(Crd, Crd.last);
Crd[Crd.last-1].rleft = right_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].width = 207;
Crd[Crd.last-1].height = 28;
Crd[Crd.last-1].x = 0;
Crd[Crd.last-1].y = 0;
}
// ====================================================================
function messageBox(mbWidth, mbHeight, mbMessage, mbTitle, mbMode, mbButtonCaptions, mbButtonsCode) {
mbMainObj = getGUIObjectByName("mb_main");
mbTitleObj = getGUIObjectByName("mb_titlebar_text");
mbTextObj = getGUIObjectByName("mb_text");
mbButton1Obj = getGUIObjectByName("mb_button1");
mbButton2Obj = getGUIObjectByName("mb_button2");
mbButton3Obj = getGUIObjectByName("mb_button3");
// Calculate size
mbLRDiff = mbWidth / 2; // Message box left/right difference from 50% of screen
mbUDDiff = mbHeight / 2; // Message box up/down difference from 50% of screen
mbSizeString = "50%-" + mbLRDiff + " 50%-" + mbUDDiff + " 50%+" + mbLRDiff + " 50%+" + mbUDDiff;
mbMainObj.size = mbSizeString;
// Texts
mbTitleObj.caption = mbTitle;
mbTextObj.caption = mbMessage;
// Message box modes
// There is a number of standard modes, and if none of these is used (mbMode == 0), the button captions will be
// taken from the array mbButtonCaptions; there currently is a maximum of three buttons.
switch (mbMode) {
case 1:
// Simple Yes/No question box
mbButtonCaptions = new Array("Yes", "No");
break;
case 2:
// Okay-only box
mbButtonCaptions = new Array("OK");
break;
case 3:
// Retry/Abort/Ignore box (will we ever need this?!)
mbButtonCaptions = new Array("Retry", "Ignore", "Abort");
default:
}
// Buttons
switch (mbButtonCaptions.length) {
case 1:
// One Button only
mbButton1Obj.caption = mbButtonCaptions[0];
mbButton1Obj.size = "30% 100%-80 70% 100%-50";
mbButton1Obj.hidden = false;
mbButton2Obj.hidden = true;
mbButton3Obj.hidden = true;
break;
case 2:
// Two Buttons
mbButton1Obj.caption = mbButtonCaptions[0];
mbButton2Obj.caption = mbButtonCaptions[1];
mbButton1Obj.size = "10% 100%-80 45% 100%-50";
mbButton2Obj.size = "55% 100%-80 90% 100%-50";
mbButton1Obj.hidden = false;
mbButton2Obj.hidden = false;
mbButton3Obj.hidden = true;
break;
case 3:
// Three Buttons
mbButton1Obj.caption = mbButtonCaptions[0];
mbButton2Obj.caption = mbButtonCaptions[1];
mbButton3Obj.caption = mbButtonCaptions[2];
mbButton1Obj.size = "10% 100%-80 30% 100%-50";
mbButton2Obj.size = "40% 100%-80 60% 100%-50";
mbButton3Obj.size = "70% 100%-80 90% 100%-50";
mbButton1Obj.hidden = false;
mbButton2Obj.hidden = false;
mbButton3Obj.hidden = false;
break;
}
// Show the message box
mbMainObj.hidden=false;
// Testing
getGUIGlobal().mbButton1Code = mbButtonsCode[0];
getGUIGlobal().mbButton2Code = mbButtonsCode[1];
getGUIGlobal().mbButton3Code = mbButtonsCode[2];
}

View File

@ -1,31 +0,0 @@
// Main Pregame JS Script file
// Contains functions and code for Main Menu.
// ====================================================================
function openMainMenuSubWindow (windowName)
{
// Helper function that enables the dark background mask, then reveals a given subwindow object.
guiUnHide ("pregame_subwindow_bkg");
guiUnHide (windowName);
}
// ====================================================================
function closeMainMenuSubWindow (windowName)
{
// Helper function that disables the dark background mask, then hides a given subwindow object.
guiHide ("pregame_subwindow_bkg");
guiHide (windowName);
}
// ====================================================================
function initPreGame()
{
}
// ====================================================================

View File

@ -1,177 +0,0 @@
// ====================================================================
function StartMap (MapName, OpenWindow, GameMode)
{
// Starts the map, closing the current window.
// MapName: .pmp to load.
// OpenWindow: Window group (usually parent string) of control that called the function. It'll be hidden.
// GameMode: 0: SP
// 1: MP
// Check whether we have a correct file extension, to avoid crashes
Extension = MapName.substring(MapName.length, MapName.length-4);
if (Extension != ".pmp")
{
// Add .pmp to the file name - shouldn't help if the name is mistyped, but may be useful in some cases.
MapName = MapName + ".pmp";
console.write ("Trying to fix the map name (probably missing extension).");
}
// Set up game
g_GameAttributes.mapFile = MapName;
// Close setup window
closeMainMenuSubWindow (OpenWindow);
// Display loading screen.
StartLoadingScreen();
// Begin game session.
if (! startGame())
{
// Failed to start the game; go back to the main menu.
guiHide ("loading_screen");
guiUnHide ("pregame_gui");
// Show an error message
btCaptions = new Array("OK");
btCode = new Array("");
messageBox(400, 200, "The game could not be started with the given parameters. You probably have entered an invalid map name.", "Error", 0, btCaptions, btCode);
}
}
// ====================================================================
function StartLoadingScreen()
{
// Switch screens from main menu to loading screen.
guiSwitch ("pregame_gui", "loading_screen");
console.write ("Loading " + g_GameAttributes.mapFile + " (" + g_GameAttributes.numPlayers + " players) ...");
// Generate random number for random concept art (should be depending on the selected civ later)
RandVar = getRandom(1, 6);
switch (RandVar) {
case 1:
sprite = "load_concept_he";
break;
case 2:
sprite = "load_concept_ce";
break;
case 3:
sprite = "load_concept_pe";
break;
case 4:
sprite = "load_concept_ro";
break;
case 5:
sprite = "load_concept_ca";
break;
case 6:
sprite = "load_concept_ib";
break;
}
getGUIObjectByName ("loading_screen_background_concept").sprite = sprite;
console.write (getGUIObjectByName ("loading_screen_background_concept").sprite);
// janwas: main loop now sets progress / description, but that won't
// happen until the first timeslice completes, so set initial values.
getGUIObjectByName ("loading_screen_titlebar").caption = "Loading Scenario ...";
getGUIObjectByName ("loading_screen_progress_bar_text").caption = "";
getGUIObjectByName ("loading_screen_progress_bar").caption = 0;
getGUIObjectByName ("loading_screen_text").caption = "LOADING " + g_GameAttributes.mapFile + " ...\nPlease wait ...";
// Pick a random tip of the day (each line is a separate tip).
tipArray = readFileLines("gui/text/tips.txt");
// Set tip string.
getGUIObjectByName ("loading_screen_tip").caption = tipArray[getRandom(0, tipArray.length-1)];
}
// ====================================================================
function reallyStartGame()
{
// This is a reserved function name that is executed by the engine when it is ready
// to start the game (ie loading progress has reached 100%).
// Create resource pools for each player, etc.
SetupSession();
// Switch GUI from loading screen to game session.
guiSwitch ("loading_screen", "session_gui");
}
// ====================================================================
function SetupSession (GameMode)
{
// GameMode: 0: SP
// 1: MP
// Do essentials that can only be done when the session has been loaded ...
// For example, create the resource types, scores, etc, for each player.
// Initialise Resource Pools by attaching them to the Player object.
// (CPlayer code takes care of giving a copy to each player.)
CreateResources();
if (GameMode == "0")
{
// Set up a bunch of players so we can see them pretty colours. :P
console.write ("Setting Up Temporary Single Players");
// The first player is by default allocated to the local player in SP, so
// adding 7 players means that we'll have 8 players in total
for (i=0; i<7; i++)
{
g_GameAttributes.slots[i+1].assignLocal();
console.write ("Slot "+(i+1)+" is assigned: " + g_GameAttributes.slots[i+1].assignment);
}
}
// Set starting UI layout.
FlipGUI(GUIType);
// Select session peace track.
curr_session_playlist_1 = newRandomSound("music", "peace");
// Fade out main theme and fade in session theme.
CrossFade(curr_music, curr_session_playlist_1, 0.1);
// janwas: greatly accelerate this timesink;
// will be replaced soon by native version that doesn't block.
// Start refreshing the session controls.
setInterval( getObjectInfo, 1, 100 );
}
// ====================================================================
function EndSession (CloseType)
{
// Occurs when the player chooses to close the current game.
switch (CloseType)
{
case ("return"):
// If the player has chosen to quit game and return to main menu,
// End the session.
endGame();
// Fade out current music and return to playing menu theme.
curr_music = newRandomSound('music', 'menu');
CrossFade(curr_session_playlist_1, curr_music, 0.1);
// janwas: greatly accelerate this timesink;
// will be replaced soon by native version that doesn't block.
// Swap GUIs to display main menu.
guiSwitch ("session_gui", "pregame_gui");
break;
case ("exit"):
// If the player has chosen to shutdown and immediately return to operating system,
exit();
break;
}
}
// ====================================================================

View File

@ -1,102 +0,0 @@
// ====================================================================
function initMPSessionHost()
{
var gameName = getGUIObjectByName("pregame_mp_host_gamename").caption;
guiSwitch ("pregame_mp_host", "pregame_mp_setup_host");
guiHide("pregame_mainmenu_versionnumber");
// Set up the server
var server = createServer();
// Welcome message
server.welcomeMessage = getGUIObjectByName("pregame_mp_host_welcomemsg").caption;
// Server Name
server.serverName = gameName;
// start listening
var success = server.open();
if(!success) {
messageBox(400, 200, "Failed to start server. Please review the logfile for more information on the problem.", "Problem", 2, new Array(), new Array());
}
// Set the title for the setup screen
getGUIObjectByName("pregame_mp_setup_host_titlebar").caption = "Hosting: " + getGUIObjectByName("pregame_mp_host_gamename").caption;
// Set the host player's name on the setup screen
getGUIObjectByName("pregame_mp_setup_host_p1_txt").caption = "P1: " + getGUIObjectByName("pregame_mp_modesel_playername").caption + " (Host)";
// Set the map to use
//g_GameAttributes.mapFile = mapName;
// -------------------------
// INCOMING CONNECTIONS
// -------------------------
server.onClientConnect=function (event) {
console.write("Client connected.");
//console.write("A new client has successfully connected! ID: " + event.id + ", Name: " + event.name + ", Session: " + event.session);
//console.write("New client.");
//var playerSlot = g_GameAttributes.getOpenSlot();
// assign a slot
//playerSlot.assignToSession(event.session);
//console.write("slot: " + playerSlot.player);
//console.write("got here");
// need to refresh the dialog control data here
};
server.onClientDisconnect=function (event) {
console.write("Client disconnected.");
};
// CHAT
/*server.onChat=function (event) {
messageBox(400, 200, event.sender+" says: "+event.message, "Chat Message", 2, new Array(), new Array());
};*/
// Need "waiting for more players to join and start game" code here
/*btCaptions = new Array("OK");
btCode = new Array("startLoadingScreen();");
messageBox(400, 200, "Waiting for clients to join - Click OK to start the game.", "Ready", 0, btCaptions, btCode);*/
}
// ====================================================================
function initMPSessionClient(playerName, serverIP)
{
GUIObjectHide("pregame_mp_ip");
GUIObjectHide("pregame_subwindow_bkg");
var client=createClient();
client.playerName=playerName;
client.onStartGame=function () {
messageBox(400, 200, "The game starts now!!!", "Get Ready!", 2, new Array(), new Array());
startLoadingScreen();
};
client.onChat=function (event) {
messageBox(400, 200, event.sender+" says: "+event.message, "Chat Message", 2, new Array(), new Array());
};
client.onConnectComplete=function (event) {
messageBox(400, 200, "Result message: "+event.message, "Connect complete", 2, new Array(), new Array());
};
// Join MP game
var success = client.beginConnect(serverIP);
if(!success) {
messageBox(400, 200, "Failed to join game. Please review the logfile for more information on the problem.", "Failure", 2, new Array(), new Array());
}
// Need "waiting for game to start" code here - it should automatically start if the client recieves the start signal from the server,
// but I currently don't know how that could be done.
/*btCaptions = new Array("OK");
btCode = new Array("");
messageBox(400, 200, "Data: " + playerName + ";" + serverIP + ";", "Test", 0, btCaptions, btCode);*/
}
// ====================================================================

View File

@ -1,426 +0,0 @@
function initSession()
{
// ============================================= CONSTANTS =================================================
GUIType="bottom";
// Coord-style size table.
SizeCoord = new Array();
SizeCoord.last = 0;
// Standard portrait widths.
crd_portrait_lrg_width = 64;
crd_portrait_lrg_height = crd_portrait_lrg_width;
crd_portrait_sml_width = 32;
crd_portrait_sml_height = crd_portrait_sml_width;
// Small icons (eg Movement Rate, Food).
crd_mini_icon_width = 20;
crd_mini_icon_height = crd_mini_icon_width;
// Define cell reference constants for icon sheets.
initCellReference();
// ============================================= GLOBALS =================================================
initGroupPane();
initResourcePool();
initStatusOrb();
initMapOrb();
initTeamTray();
initSubWindows();
initManual();
initJukebox();
}
// ====================================================================
function initCellReference()
{
// Define cell reference constants for icon sheets.
// icon_sheet_statistic
stat_accuracy = 0;
stat_attack = 1;
stat_armour = 2;
stat_los = 3;
stat_speed = 4;
stat_range = 5;
stat_hack = 6;
stat_pierce = 7;
stat_crush = 8;
stat_rank1 = 9;
stat_rank2 = 10;
stat_rank3 = 11;
stat_garrison = 12;
stat_heart = 13;
// portrait_sheet_action
// generic actions
action_empty = 0;
action_attack = 1;
action_patrol = 2;
action_stop = 3;
action_gather_food = 4;
action_gather_wood = 5;
action_gather_stone = 6;
action_gather_ore = 7;
action_rally = 8;
action_repair = 9;
action_heal = 10;
action_scout = 11;
action_townbell = 12;
action_lock = 13;
action_unlock = 14;
// formation actions
action_formation_box = 23;
action_formation_column_c = 24;
action_formation_column_o = 25;
action_formation_line_c = 26;
action_formation_line_o = 27;
action_formation_phalanx = 28;
action_formation_skirmish = 29;
action_formation_testudo = 30;
action_formation_wedge = 31;
// stance actions
action_stance_aggress = 39;
action_stance_avoid = 40;
action_stance_defend = 41;
action_stance_hold = 42;
action_stance_stand = 43;
// tab actions
action_tab_command = 48;
action_tab_train = 49;
action_tab_buildciv = 50;
action_tab_buildmil = 51;
action_tab_research = 52;
action_tab_formation = 53;
action_tab_stance = 54;
action_tab_barter = 55;
}
// ====================================================================
function setPortrait(objectName, portraitString, portraitSuffix, portraitCell)
{
// Use this function as a shortcut to change a portrait object to a different portrait image.
// Accepts an object and specifies its default, rollover (lit) and disabled (grey) sprites.
// Sprite Format: "ui_portrait_"portraitString"_"portraitSuffix
// Sprite Format: "ui_portrait_"portraitString"_"portraitSuffix"_lit"
// Sprite Format: "ui_portrait_"portraitString"_"portraitSuffix"_grey"
// Note: Make sure the file follows this naming convention or bad things could happen.
// Get GUI object
setPortraitGUIObject = getGUIObjectByName(objectName);
// Set the three portraits.
if (portraitSuffix && portraitSuffix != "")
setPortraitGUIObject.sprite = "ui_portrait_" + portraitString + "_" + portraitSuffix;
else
setPortraitGUIObject.sprite = "ui_portrait_" + portraitString;
setPortraitGUIObject.sprite_over = setPortraitGUIObject.sprite + "_lit";
setPortraitGUIObject.sprite_disabled = setPortraitGUIObject.sprite + "_grey";
// If the source texture is a multi-frame image (icon sheet), specify correct cell.
if (portraitCell && portraitCell != "")
setPortraitGUIObject.cell_id = portraitCell;
else
setPortraitGUIObject.cell_id = "";
}
// ====================================================================
function getObjectInfo()
{
// Updated each tick to extract entity information from selected unit(s).
// Don't process GUI when we're full-screen.
if (GUIType != "none")
{
if (!selection.length) // If no entity selected,
{
// Hide Status Orb
getGUIObjectByName("session_status_orb").hidden = true;
// Hide Group Pane.
getGUIObjectByName("session_group_pane").hidden = true;
getGlobal().MultipleEntitiesSelected = 0;
}
else // If at least one entity selected,
{
// Store globals for entity information.
// strString = "" + selection[0].position;
// EntityPos = strString.substring(20,strString.length-3);
UpdateStatusOrb(); // (later, we need to base this on the selected unit's stats changing)
// Check if a group of entities selected
if (selection.length > 1)
{
// If a group pane isn't already open, and we don't have the same set as last time,
// NOTE: This "if" is an optimisation because the game crawls if this set of processing occurs every frame.
// It's quite possible for the player to select another group of the same size and for it to not be recognised.
// Best solution would be to base this off a "new entities selected" instead of an on-tick.
if (
// getGUIObjectByName("session_group_pane").hidden == true ||
selection.length != getGlobal().MultipleEntitiesSelected)
{
UpdateGroupPane(); // (later, we need to base this on the selection changing)
getGlobal().MultipleEntitiesSelected = selection.length;
}
}
else
{
getGlobal().MultipleEntitiesSelected = 0;
// Hide Group Pane.
getGUIObjectByName("session_group_pane").hidden = true;
}
}
// Modify any resources given/taken (later, we need to base this on a resource-changing event).
UpdateResourcePool();
// Update Team Tray (later, we need to base this on the player creating a group).
UpdateTeamTray();
}
}
// ====================================================================
function MakeUnit(x, y, z, MakeUnitName)
{
// Spawn an entity at the given coordinates.
DudeSpawnPoint = new Vector3D(x, y, z);
new Entity(getEntityTemplate(MakeUnitName), DudeSpawnPoint, 1.0);
// writeConsole(MakeUnitName + " created at " + DudeSpawnPoint);
}
// ====================================================================
function selected()
{
// Returns how many units selected.
if( selection.length > 0 )
return( selection[0] );
return( null );
}
// ====================================================================
function FlipGUI(NewGUIType)
{
// Sets the GUI coordinates and graphics so that the panel is either at the top or bottom of the screen.
switch (NewGUIType)
{
// Set which GUI to use.
case "top":
case "bottom":
case "none":
GUIType=NewGUIType;
break;
default:
// If no type specified, toggle.
if (GUIType == "top")
GUIType = "bottom";
else
if (GUIType == "bottom")
GUIType = "none";
else
GUIType = "top";
break;
}
if (GUIType != "none")
{
guiUnHide("session_gui");
guiUnHide("always_on");
// Seek through all sizes created.
for (FlipGUILoop = 0; FlipGUILoop <= SizeCoord.last-1; FlipGUILoop++)
{
// Set each object to the other size.
switch (GUIType)
{
case "bottom":
setSize(SizeCoord[FlipGUILoop].name, SizeCoord[FlipGUILoop].size1);
switch (SizeCoord[FlipGUILoop].name){
case "SN_MAP_ORB_SEGBOTTOM1":
getGUIObjectByName(SizeCoord[FlipGUILoop].name).sprite = "session_panel_minimap_segtop1";
getGUIObjectByName(SizeCoord[FlipGUILoop].name).sprite_over = "session_panel_minimap_segtop1" + "_lit";
break;
case "SN_MAP_ORB_SEGBOTTOM2":
getGUIObjectByName(SizeCoord[FlipGUILoop].name).sprite = "session_panel_minimap_segtop2";
getGUIObjectByName(SizeCoord[FlipGUILoop].name).sprite_over = "session_panel_minimap_segtop2" + "_lit";
break;
case "SN_MAP_ORB_SEGBOTTOM3":
getGUIObjectByName(SizeCoord[FlipGUILoop].name).sprite = "session_panel_minimap_segtop3";
getGUIObjectByName(SizeCoord[FlipGUILoop].name).sprite_over = "session_panel_minimap_segtop3" + "_lit";
break;
case "SN_MAP_ORB_SEGBOTTOM4":
getGUIObjectByName(SizeCoord[FlipGUILoop].name).sprite = "session_panel_minimap_segtop4";
getGUIObjectByName(SizeCoord[FlipGUILoop].name).sprite_over = "session_panel_minimap_segtop4" + "_lit";
break;
case "SN_STATUS_PANE_BG":
getGUIObjectByName(SizeCoord[FlipGUILoop].name).sprite = "session_panel_status_bg_top";
break;
default:
break;
}
break;
case "top":
setSize(SizeCoord[FlipGUILoop].name, SizeCoord[FlipGUILoop].size2);
switch (SizeCoord[FlipGUILoop].name){
case "SN_MAP_ORB_SEGBOTTOM1":
getGUIObjectByName(SizeCoord[FlipGUILoop].name).sprite = "session_panel_minimap_segbottom1";
getGUIObjectByName(SizeCoord[FlipGUILoop].name).sprite_over = "session_panel_minimap_segbottom1_lit";
break;
case "SN_MAP_ORB_SEGBOTTOM2":
getGUIObjectByName(SizeCoord[FlipGUILoop].name).sprite = "session_panel_minimap_segbottom2";
getGUIObjectByName(SizeCoord[FlipGUILoop].name).sprite_over = "session_panel_minimap_segbottom2_lit";
break;
case "SN_MAP_ORB_SEGBOTTOM3":
getGUIObjectByName(SizeCoord[FlipGUILoop].name).sprite = "session_panel_minimap_segbottom3";
getGUIObjectByName(SizeCoord[FlipGUILoop].name).sprite_over = "session_panel_minimap_segbottom3_lit";
break;
case "SN_MAP_ORB_SEGBOTTOM4":
getGUIObjectByName(SizeCoord[FlipGUILoop].name).sprite = "session_panel_minimap_segbottom4";
getGUIObjectByName(SizeCoord[FlipGUILoop].name).sprite_over = "session_panel_minimap_segbottom4_lit";
break;
case "SN_STATUS_PANE_BG":
getGUIObjectByName(SizeCoord[FlipGUILoop].name).sprite = "session_panel_status_bg_bottom";
break;
default:
break;
}
break;
}
}
UpdateGroupPane();
}
else
{
guiHide("session_gui");
guiHide("always_on");
}
writeConsole("GUI flipped to " + GUIType + ".");
}
// ====================================================================
function selectEntity(handler)
{
endSelection();
startSelection(function (event) {
// Selection is performed when single-clicking the right mouse
// button.
if (event.button == SDL_BUTTON_RIGHT && event.clicks == 1)
{
handler(event.entity);
}
// End selection on first mouse-click
endSelection();
});
}
function selectLocation(handler)
{
endSelection();
startSelection(function (event) {
// Selection is performed when single-clicking the right mouse
// button.
if (event.button == SDL_BUTTON_RIGHT && event.clicks == 1)
{
handler(event.x, event.y);
}
// End selection on first mouse-click
endSelection();
});
}
function startSelection(handler)
{
gameView.startCustomSelection();
getGlobal().selectionWorldClickHandler=handler;
console.write("isSelecting(): "+isSelecting());
}
function endSelection()
{
if (!isSelecting())
return;
gameView.endCustomSelection();
getGlobal().selectionWorldClickHandler = null;
}
function isSelecting()
{
return getGlobal().selectionWorldClickHandler != null;
}
// The world-click handler - called whenever the user clicks the terrain
function worldClickHandler(event)
{
args=new Array(null, null);
console.write("worldClickHandler: button "+event.button+", clicks "+event.clicks);
if (isSelecting())
{
getGlobal().selectionWorldClickHandler(event);
return;
}
// Right button single- or double-clicks
if (event.button == SDL_BUTTON_RIGHT && event.clicks <= 2)
{
if (event.clicks == 1)
cmd = event.command;
else if (event.clicks == 2)
{
console.write("Issuing secondary command");
cmd = event.secondaryCommand;
}
}
else
return;
switch (cmd)
{
// location target commands
case NMT_Goto:
case NMT_Patrol:
if (event.queued)
{
cmd = NMT_AddWaypoint;
}
case NMT_AddWaypoint:
args[0]=event.x;
args[1]=event.y;
break;
// entity target commands
case NMT_AttackMelee:
case NMT_Gather:
args[0]=event.entity;
args[1]=null;
break;
default:
console.write("worldClickHandler: Unknown command: "+cmd);
return;
}
issueCommand(selection, cmd, args[0], args[1]);
}
addGlobalHandler("worldClick", worldClickHandler);

View File

@ -1,218 +0,0 @@
function initGroupPane()
{
// Populate the table of Group Pane portrait coordinates.
// Group Pane table.
crd_grppane_prt_col = new Array();
crd_grppane_prt_col.last = 0; // Last size added.
crd_grppane_prt_col.style = 2; // Style length.
crd_grppane_prt_row = new Array();
crd_grppane_prt_row_bar = new Array();
crd_grppane_prt_row.last = 0; // Last size added.
crd_grppane_prt_row.style = 2; // Style length.
crd_grppane_prt = new Array();
crd_grppane_prt.last = 0; // Total group portraits.
// Build table of group pane coordinates.
initGroupPaneTable();
}
// ====================================================================
function initGroupPaneTable()
{
AddGroupPaneRow(0, 24, 100, -62); // Row 0
AddGroupPaneRow(0, 70, 100, -102); // Row 1
AddGroupPaneRow(0, 116, 100, -148); // Row 2
AddGroupPaneRow(0, 162, 100, -194); // Row 3
// AddGroupPaneRow(0, 208, 100, -240); // Row 4
// AddGroupPaneRow(0, 254, 100, -286); // Row 5
// AddGroupPaneRow(0, 300, 100, -332); // Row 6
AddGroupPaneCol(50, -16, 50, -16); // Col 0
AddGroupPaneCol(50, -52, 50, -52); // Col 1
AddGroupPaneCol(50, 20, 50, 20); // Col 2
AddGroupPaneCol(50, -88, 50, -88); // Col 3
AddGroupPaneCol(50, 56, 50, 56); // Col 4
AddGroupPaneCol(50, -124, 50, -124); // Col 5
AddGroupPaneCol(50, 92, 50, 92); // Col 6
AddGroupPaneCol(50, -160, 50, -160); // Col 7
AddGroupPaneCol(50, 128, 50, 128); // Col 8
AddGroupPaneCol(50, -196, 50, -196); // Col 9
AddGroupPaneCol(50, 164, 50, 164); // Col 10
AddGroupPaneCol(50, 200, 50, 200); // Col 11
AddGroupPaneCol(50, 236, 50, 236); // Col 12
}
// ====================================================================
function AddGroupPaneCol(rleft1, left1, rleft2, left2)
{
// Add a set of column coordinates to the Group Pane table.
crd_grppane_prt_col[crd_grppane_prt_col.last] = new Array();
style=1;
crd_grppane_prt_col[crd_grppane_prt_col.last][style] = new Array();
crd_grppane_prt_col[crd_grppane_prt_col.last][style].size = new GUISize(left1, 0, left1 + crd_portrait_sml_width, 0, rleft1, 0, rleft1, 0);
style=0;
crd_grppane_prt_col[crd_grppane_prt_col.last][style] = new Array();
crd_grppane_prt_col[crd_grppane_prt_col.last][style].size = new GUISize(left2, 0, left2 + crd_portrait_sml_width, 0, rleft2, 0, rleft2, 0);
crd_grppane_prt_col.last++; // Increment array.
}
// ====================================================================
function AddGroupPaneRow(rtop1, top1, rtop2, top2)
{
// Add a set of row coordinates to the Group Pane table.
crd_grppane_prt_row[crd_grppane_prt_row.last] = new Array();
style=1;
crd_grppane_prt_row[crd_grppane_prt_row.last][style] = new Array();
crd_grppane_prt_row[crd_grppane_prt_row.last][style].size = new GUISize(0, top1, 0, top1 + crd_portrait_sml_height, 0, rtop1, 0, rtop1);
style=0;
crd_grppane_prt_row[crd_grppane_prt_row.last][style] = new Array();
crd_grppane_prt_row[crd_grppane_prt_row.last][style].size = new GUISize(0, top2, 0, top2 + crd_portrait_sml_height, 0, rtop2, 0, rtop2);
crd_grppane_prt_row.last++; // Increment array.
}
// ====================================================================
function AddSizeGroupPane(objectName, row, col)
{
// Used to store the two GUI style sizes for an object on creation.
// This is a special method that uses the group pane table to specify values.
// Used later by FlipGUI() to switch the objects to a new set of positions.
SizeCoord[SizeCoord.last] = new Object();
SizeCoord[SizeCoord.last].name = objectName;
style = 0; // Set top GUI style.
size_col = crd_grppane_prt_col[col][style].size;
size_row = crd_grppane_prt_row[row][style].size;
SizeCoord[SizeCoord.last].size1 = new GUISize(size_col.left, size_row.top, size_col.right, size_row.bottom, size_col.rleft, size_row.rtop, size_col.rright, size_row.rbottom);
style = 1; // Set bottom GUI style.
size_col = crd_grppane_prt_col[col][style].size;
size_row = crd_grppane_prt_row[row][style].size;
SizeCoord[SizeCoord.last].size2 = new GUISize(size_col.left, size_row.top, size_col.right, size_row.bottom, size_col.rleft, size_row.rtop, size_col.rright, size_row.rbottom);
SizeCoord.last++; // Increment counter for next entry.
crd_grppane_prt.last++; // Increment group pane portrait counter.
}
// ====================================================================
function AddSizeGroupPaneBar(objectName)
{
// Create a health bar for the last group pane portrait created.
var size1 = SizeCoord[SizeCoord.last-1].size1;
var size2 = SizeCoord[SizeCoord.last-1].size2;
AddSizeCoord(objectName,
size1.left, size1.bottom+2, size1.right, size1.bottom+6, size1.rleft, size1.rtop, size1.rright, size1.rbottom,
size2.left, size2.bottom+2, size2.right, size2.bottom+6, size2.rleft, size2.rtop, size2.rright, size2.rbottom);
}
// ====================================================================
function SelectUnit(unitNumber)
{
// Sets the current unit selection to a given number in the selection[] array (selects a unit in the current selection).
// Occurs when clicking a portrait in the Group Pane.
clickedUnit = selection[unitNumber-1];
selection.clear();
selection.push(clickedUnit);
}
// ====================================================================
function UpdateGroupPane()
{
// Reveal Group Pane.
getGUIObjectByName("session_group_pane").hidden = false;
/*
// Set size of Group Pane background.
if (selection.length <= 13)
{
switch (GUIType)
{
case "top":
setSize("session_group_pane_bg", "50%-215 0% 50%+285 0%+86");
break;
case "bottom":
setSize("session_group_pane_bg", "50%-215 100%-86 50%+285 100%");
break;
}
}
else
if (selection.length > 13 && selection.length <= 26)
{
switch (GUIType)
{
case "top":
setSize("session_group_pane_bg", "50%-215 0% 50%+285 0%+127");
break;
case "bottom":
setSize("session_group_pane_bg", "50%-215 100%-127 50%+285 100%");
break;
}
}
else
if (selection.length > 26 && selection.length <= 39)
{
switch (GUIType)
{
case "top":
setSize("session_group_pane_bg", "50%-215 0% 50%+285 0%+168");
break;
case "bottom":
setSize("session_group_pane_bg", "50%-215 100%-168 50%+285 100%");
break;
}
}
else
{
switch (GUIType)
{
case "top":
setSize("session_group_pane_bg", "50%-215 0% 50%+285 0%+209");
break;
case "bottom":
setSize("session_group_pane_bg", "50%-215 100%-209 50%+285 100%");
break;
}
}
*/
// Display appropriate portraits.
for (groupPaneLoop = 1; groupPaneLoop <= crd_grppane_prt.last; groupPaneLoop++)
{
groupPanePortrait = getGUIObjectByName("SESSION_GROUP_PANE_PORTRAIT_" + groupPaneLoop);
groupPaneBar = getGUIObjectByName("SESSION_GROUP_PANE_PORTRAIT_" + groupPaneLoop + "_BAR");
// If it's a valid entity,
if (groupPaneLoop <= selection.length){
// Reveal and set to display this entity's portrait in the group pane.
groupPanePortrait.hidden = false;
groupPaneBar.hidden = false;
// Set progress bar for hitpoints.
if (selection[groupPaneLoop-1].traits.health.curr && selection[groupPaneLoop-1].traits.health.max)
groupPaneBar.caption = ((Math.round(selection[groupPaneLoop-1].traits.health.curr) * 100 ) / Math.round(selection[groupPaneLoop-1].traits.health.max));
// Set portrait.
setPortrait("SESSION_GROUP_PANE_PORTRAIT_" + groupPaneLoop, selection[groupPaneLoop-1].traits.id.icon, selection[groupPaneLoop-1].traits.id.civ_code, selection[groupPaneLoop-1].traits.id.icon_cell);
}
// If it's empty, hide its group portrait.
else
{
groupPanePortrait.hidden = true;
groupPaneBar.hidden = true;
}
}
}

View File

@ -1,140 +0,0 @@
function initMapOrb()
{
SN_MINIMAP = addArrayElement(Crd, Crd.last);
Crd[Crd.last-1].rleft = right_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].width = 180;
Crd[Crd.last-1].height = Crd[Crd.last-1].width;
Crd[Crd.last-1].x = 0;
Crd[Crd.last-1].y = 0;
SN_MAP_ORB_SEGLEFT1 = addArrayElement(Crd, Crd.last);
Crd[Crd.last-1].rleft = right_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].width = 32;
Crd[Crd.last-1].height = 46;
Crd[Crd.last-1].x = Crd[SN_MINIMAP].width;
Crd[Crd.last-1].y = Crd[SN_MINIMAP].height-Crd[Crd.last-1].height;
SN_MAP_ORB_SEGLEFT1_FLP = addArrayElement(Crd, Crd.last);
Crd[Crd.last-1].rleft = Crd[Crd.last-2].rleft; Crd[Crd.last-1].rtop = top_screen;
Crd[Crd.last-1].rright = Crd[Crd.last-2].rright; Crd[Crd.last-1].rbottom = top_screen;
Crd[Crd.last-1].width = Crd[Crd.last-2].width;
Crd[Crd.last-1].height = Crd[Crd.last-2].height;
Crd[Crd.last-1].x = Crd[SN_MINIMAP].width;
Crd[Crd.last-1].y = 0;
SN_MAP_ORB_SEGLEFT2 = addArrayElement(Crd, Crd.last);
Crd[Crd.last-1].rleft = right_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].width = 40;
Crd[Crd.last-1].height = 44;
Crd[Crd.last-1].x = Crd[SN_MAP_ORB_SEGLEFT1].x;
Crd[Crd.last-1].y = Crd[SN_MAP_ORB_SEGLEFT1].y-Crd[Crd.last-1].height;
SN_MAP_ORB_SEGLEFT2_FLP = addArrayElement(Crd, Crd.last);
Crd[Crd.last-1].rleft = Crd[Crd.last-2].rleft; Crd[Crd.last-1].rtop = top_screen;
Crd[Crd.last-1].rright = Crd[Crd.last-2].rright; Crd[Crd.last-1].rbottom = top_screen;
Crd[Crd.last-1].width = Crd[Crd.last-2].width;
Crd[Crd.last-1].height = Crd[Crd.last-2].height;
Crd[Crd.last-1].x = Crd[SN_MAP_ORB_SEGLEFT1].x;
Crd[Crd.last-1].y = Crd[SN_MAP_ORB_SEGLEFT2].y-Crd[Crd.last-1].height;
SN_MAP_ORB_SEGLEFT3 = addArrayElement(Crd, Crd.last);
Crd[Crd.last-1].rleft = right_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].width = Crd[SN_MAP_ORB_SEGLEFT2].width;
Crd[Crd.last-1].height = Crd[SN_MAP_ORB_SEGLEFT2].height;
Crd[Crd.last-1].x = Crd[SN_MAP_ORB_SEGLEFT2].x;
Crd[Crd.last-1].y = Crd[SN_MAP_ORB_SEGLEFT2].y-Crd[Crd.last-1].height;
SN_MAP_ORB_SEGLEFT3_FLP = addArrayElement(Crd, Crd.last);
Crd[Crd.last-1].rleft = Crd[Crd.last-2].rleft; Crd[Crd.last-1].rtop = top_screen;
Crd[Crd.last-1].rright = Crd[Crd.last-2].rright; Crd[Crd.last-1].rbottom = top_screen;
Crd[Crd.last-1].width = Crd[Crd.last-2].width;
Crd[Crd.last-1].height = Crd[Crd.last-2].height;
Crd[Crd.last-1].x = Crd[SN_MAP_ORB_SEGLEFT2].x;
Crd[Crd.last-1].y = Crd[SN_MAP_ORB_SEGLEFT1].y-Crd[Crd.last-1].height;
SN_MAP_ORB_SEGLEFT4 = new Object();
SN_MAP_ORB_SEGLEFT4 = addArrayElement(Crd, Crd.last);
Crd[Crd.last-1].rleft = right_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].width = Crd[SN_MAP_ORB_SEGLEFT1].width;
Crd[Crd.last-1].height = Crd[SN_MAP_ORB_SEGLEFT1].height;
Crd[Crd.last-1].x = Crd[SN_MAP_ORB_SEGLEFT2].x;
Crd[Crd.last-1].y = Crd[SN_MAP_ORB_SEGLEFT3].y-Crd[Crd.last-1].height;
SN_MAP_ORB_SEGLEFT4_FLP = addArrayElement(Crd, Crd.last);
Crd[Crd.last-1].rleft = Crd[Crd.last-2].rleft; Crd[Crd.last-1].rtop = top_screen;
Crd[Crd.last-1].rright = Crd[Crd.last-2].rright; Crd[Crd.last-1].rbottom = top_screen;
Crd[Crd.last-1].width = Crd[Crd.last-2].width;
Crd[Crd.last-1].height = Crd[Crd.last-2].height;
Crd[Crd.last-1].x = Crd[SN_MAP_ORB_SEGLEFT2].x;
Crd[Crd.last-1].y = Crd[SN_MINIMAP].height-Crd[Crd.last-1].height;
SN_MAP_ORB_SEGBOTTOM1 = addArrayElement(Crd, Crd.last);
Crd[Crd.last-1].rleft = right_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].width = 46;
Crd[Crd.last-1].height = 32;
Crd[Crd.last-1].x = Crd[SN_MINIMAP].width-Crd[Crd.last-1].width;
Crd[Crd.last-1].y = Crd[SN_MINIMAP].height;
SN_MAP_ORB_SEGBOTTOM1_FLP = addArrayElement(Crd, Crd.last);
Crd[Crd.last-1].rleft = Crd[Crd.last-2].rleft; Crd[Crd.last-1].rtop = top_screen;
Crd[Crd.last-1].rright = Crd[Crd.last-2].rright; Crd[Crd.last-1].rbottom = top_screen;
Crd[Crd.last-1].width = Crd[Crd.last-2].width;
Crd[Crd.last-1].height = Crd[Crd.last-2].height;
Crd[Crd.last-1].x = Crd[SN_MINIMAP].width-Crd[Crd.last-1].width;
Crd[Crd.last-1].y = Crd[SN_MINIMAP].height;
SN_MAP_ORB_SEGBOTTOM2 = addArrayElement(Crd, Crd.last);
Crd[Crd.last-1].rleft = right_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].width = 44;
Crd[Crd.last-1].height = 40;
Crd[Crd.last-1].x = Crd[SN_MAP_ORB_SEGBOTTOM1].x-Crd[Crd.last-1].width;
Crd[Crd.last-1].y = Crd[SN_MAP_ORB_SEGBOTTOM1].y;
SN_MAP_ORB_SEGBOTTOM2_FLP = addArrayElement(Crd, Crd.last);
Crd[Crd.last-1].rleft = Crd[Crd.last-2].rleft; Crd[Crd.last-1].rtop = top_screen;
Crd[Crd.last-1].rright = Crd[Crd.last-2].rright; Crd[Crd.last-1].rbottom = top_screen;
Crd[Crd.last-1].width = Crd[Crd.last-2].width;
Crd[Crd.last-1].height = Crd[Crd.last-2].height;
Crd[Crd.last-1].x = Crd[SN_MAP_ORB_SEGBOTTOM1].x-Crd[Crd.last-1].width;
Crd[Crd.last-1].y = Crd[SN_MAP_ORB_SEGBOTTOM1].y;
SN_MAP_ORB_SEGBOTTOM3 = addArrayElement(Crd, Crd.last);
Crd[Crd.last-1].rleft = right_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].width = Crd[SN_MAP_ORB_SEGBOTTOM2].width;
Crd[Crd.last-1].height = Crd[SN_MAP_ORB_SEGBOTTOM2].height;
Crd[Crd.last-1].x = Crd[SN_MAP_ORB_SEGBOTTOM2].x-Crd[Crd.last-1].width;
Crd[Crd.last-1].y = Crd[SN_MAP_ORB_SEGBOTTOM2].y;
SN_MAP_ORB_SEGBOTTOM3_FLP = addArrayElement(Crd, Crd.last);
Crd[Crd.last-1].rleft = Crd[Crd.last-2].rleft; Crd[Crd.last-1].rtop = top_screen;
Crd[Crd.last-1].rright = Crd[Crd.last-2].rright; Crd[Crd.last-1].rbottom = top_screen;
Crd[Crd.last-1].width = Crd[Crd.last-2].width;
Crd[Crd.last-1].height = Crd[Crd.last-2].height;
Crd[Crd.last-1].x = Crd[SN_MAP_ORB_SEGBOTTOM2].x-Crd[Crd.last-1].width;
Crd[Crd.last-1].y = Crd[SN_MAP_ORB_SEGBOTTOM2].y;
SN_MAP_ORB_SEGBOTTOM4 = new Object();
SN_MAP_ORB_SEGBOTTOM4 = addArrayElement(Crd, Crd.last);
Crd[Crd.last-1].rleft = right_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].width = Crd[SN_MAP_ORB_SEGBOTTOM1].width;
Crd[Crd.last-1].height = Crd[SN_MAP_ORB_SEGBOTTOM1].height;
Crd[Crd.last-1].x = Crd[SN_MAP_ORB_SEGBOTTOM3].x-Crd[Crd.last-1].width;
Crd[Crd.last-1].y = Crd[SN_MAP_ORB_SEGBOTTOM2].y;
SN_MAP_ORB_SEGBOTTOM4_FLP = addArrayElement(Crd, Crd.last);
Crd[Crd.last-1].rleft = Crd[Crd.last-2].rleft; Crd[Crd.last-1].rtop = top_screen;
Crd[Crd.last-1].rright = Crd[Crd.last-2].rright; Crd[Crd.last-1].rbottom = top_screen;
Crd[Crd.last-1].width = Crd[Crd.last-2].width;
Crd[Crd.last-1].height = Crd[Crd.last-2].height;
Crd[Crd.last-1].x = 0;
Crd[Crd.last-1].y = Crd[SN_MAP_ORB_SEGBOTTOM2].y;
}

View File

@ -1,143 +0,0 @@
function initResourcePool()
{
SN_RESOURCE_COUNTER_SPAN = 5;
SN_RESOURCE_COUNTER_FOOD = addArrayElement(Crd, Crd.last);
Crd[Crd.last-1].rleft = mid_screen; Crd[Crd.last-1].rtop = top_screen;
Crd[Crd.last-1].rright = mid_screen; Crd[Crd.last-1].rbottom = top_screen;
Crd[Crd.last-1].width = crd_mini_icon_width+54;
Crd[Crd.last-1].height = crd_mini_icon_height;
Crd[Crd.last-1].x = -200;
Crd[Crd.last-1].y = 4;
SN_RESOURCE_COUNTER_WOOD = addArrayElement(Crd, Crd.last);
Crd[Crd.last-1].rleft = mid_screen; Crd[Crd.last-1].rtop = top_screen;
Crd[Crd.last-1].rright = mid_screen; Crd[Crd.last-1].rbottom = top_screen;
Crd[Crd.last-1].width = Crd[SN_RESOURCE_COUNTER_FOOD].width;
Crd[Crd.last-1].height = Crd[SN_RESOURCE_COUNTER_FOOD].height;
Crd[Crd.last-1].x = Crd[SN_RESOURCE_COUNTER_FOOD].x+Crd[SN_RESOURCE_COUNTER_FOOD].width+SN_RESOURCE_COUNTER_SPAN;
Crd[Crd.last-1].y = Crd[SN_RESOURCE_COUNTER_FOOD].y;
SN_RESOURCE_COUNTER_STONE = addArrayElement(Crd, Crd.last);
Crd[Crd.last-1].rleft = mid_screen; Crd[Crd.last-1].rtop = top_screen;
Crd[Crd.last-1].rright = mid_screen; Crd[Crd.last-1].rbottom = top_screen;
Crd[Crd.last-1].width = Crd[SN_RESOURCE_COUNTER_FOOD].width;
Crd[Crd.last-1].height = Crd[SN_RESOURCE_COUNTER_FOOD].height;
Crd[Crd.last-1].x = Crd[SN_RESOURCE_COUNTER_WOOD].x+Crd[SN_RESOURCE_COUNTER_WOOD].width+SN_RESOURCE_COUNTER_SPAN;
Crd[Crd.last-1].y = Crd[SN_RESOURCE_COUNTER_FOOD].y;
SN_RESOURCE_COUNTER_ORE = addArrayElement(Crd, Crd.last);
Crd[Crd.last-1].rleft = mid_screen; Crd[Crd.last-1].rtop = top_screen;
Crd[Crd.last-1].rright = mid_screen; Crd[Crd.last-1].rbottom = top_screen;
Crd[Crd.last-1].width = Crd[SN_RESOURCE_COUNTER_FOOD].width;
Crd[Crd.last-1].height = Crd[SN_RESOURCE_COUNTER_FOOD].height;
Crd[Crd.last-1].x = Crd[SN_RESOURCE_COUNTER_STONE].x+Crd[SN_RESOURCE_COUNTER_STONE].width+SN_RESOURCE_COUNTER_SPAN;
Crd[Crd.last-1].y = Crd[SN_RESOURCE_COUNTER_FOOD].y;
SN_RESOURCE_COUNTER_POPULATION = addArrayElement(Crd, Crd.last);
Crd[Crd.last-1].rleft = mid_screen; Crd[Crd.last-1].rtop = top_screen;
Crd[Crd.last-1].rright = mid_screen; Crd[Crd.last-1].rbottom = top_screen;
Crd[Crd.last-1].width = Crd[SN_RESOURCE_COUNTER_FOOD].width+9;
Crd[Crd.last-1].height = Crd[SN_RESOURCE_COUNTER_FOOD].height;
Crd[Crd.last-1].x = Crd[SN_RESOURCE_COUNTER_ORE].x+Crd[SN_RESOURCE_COUNTER_ORE].width+SN_RESOURCE_COUNTER_SPAN;
Crd[Crd.last-1].y = Crd[SN_RESOURCE_COUNTER_FOOD].y;
}
// ====================================================================
function AddResource(resourceName, resourceQty)
{
// Creates a resource type.
// MT: Rewritten to use JavaScript's nice associative-array-alikes. Requires the valueOf() hack - I'm looking into this.
if (!localPlayer.resource)
{
// Define the base resource group if it does not exist.
localPlayer.resource = new Array();
}
// Set resource name to upper-case to ensure it matches resource control name.
resourceName = resourceName.toUpperCase();
// Store resource's name and starting value.
localPlayer.resource.valueOf()[resourceName] = resourceQty;
console.write("Added " + resourceName );
}
// ====================================================================
function CreateResources()
{
// Defines all resource types for future use.
AddResource("Food", 0);
AddResource("Wood", 0);
AddResource("Stone", 0);
AddResource("Ore", 0);
AddResource("Population", 0);
AddResource("Housing", 0);
}
// ====================================================================
function GiveResources(resourceName, resourceQty)
{
// Generic function to add resources to the player's Pool.
if( localPlayer.resource.valueOf()[resourceName] )
{
localPlayer.resource.valueOf()[resourceName] += resourceQty;
console.write("Earned " + resourceQty + " resources.");
return( true );
}
// If the resource wasn't in the list, report an error.
return false;
}
// ====================================================================
function DeductResources(resourceName, resourceQty)
{
// Generic function to remove resources from the player's Pool.
if( localPlayer.resource.valueOf()[resourceName] )
{
localPlayer.resource.valueOf()[resourceName] -= resourceQty;
console.write("Deducted " + resourceQty + " resources.");
return( true );
}
// If the resource wasn't in the list, report an error.
return false;
}
// ====================================================================
function UpdateResourcePool()
{
// Populate the resource pool with current quantities.
// MT: Rewritten to use JavaScript's nice associative-array-alikes. Requires the valueOf() hack - I'm looking into this.
pool = localPlayer.resource.valueOf();
for( resource in pool )
{
switch( resource )
{
case "POPULATION":
// If it's population, combine population and housing in one string.
getGUIObjectByName("SN_RESOURCE_COUNTER_POPULATION").caption = pool.POPULATION + "/" + pool.HOUSING;
break;
case "HOUSING":
// Skip housing, as it's handled as a component of population.
break;
default:
// Set the value of a normal resource caption.
getGUIObjectByName("SN_RESOURCE_COUNTER_" + resource ).caption = pool[resource].toString();
break;
}
}
}

View File

@ -1,838 +0,0 @@
function initStatusOrb()
{
SN_STATUS_PANE_BG = addArrayElement(Crd, Crd.last);
Crd[Crd.last-1].rleft = left_screen; Crd[Crd.last-1].rtop = bottom_screen;
Crd[Crd.last-1].rright = left_screen; Crd[Crd.last-1].rbottom = bottom_screen;
Crd[Crd.last-1].width = 255;
Crd[Crd.last-1].height = 170;
Crd[Crd.last-1].x = 0;
Crd[Crd.last-1].y = 0;
SN_STATUS_PANE_HEADING = addArrayElement(Crd, Crd.last);
Crd[Crd.last-1].rleft = left_screen; Crd[Crd.last-1].rtop = bottom_screen;
Crd[Crd.last-1].rright = left_screen; Crd[Crd.last-1].rbottom = bottom_screen;
Crd[Crd.last-1].width = Crd[SN_STATUS_PANE_BG].width;
Crd[Crd.last-1].height = 14;
Crd[Crd.last-1].x = Crd[SN_STATUS_PANE_BG].x+2;
Crd[Crd.last-1].y = Crd[SN_STATUS_PANE_BG].y+Crd[SN_STATUS_PANE_BG].height-Crd[Crd.last-1].height-3;
SN_STATUS_PANE_HEADING_FLP = addArrayElement(Crd, Crd.last);
Crd[Crd.last-1].rleft = Crd[Crd.last-2].rleft; Crd[Crd.last-1].rtop = top_screen;
Crd[Crd.last-1].rright = Crd[Crd.last-2].rright; Crd[Crd.last-1].rbottom = top_screen;
Crd[Crd.last-1].width = Crd[Crd.last-2].width;
Crd[Crd.last-1].height = Crd[Crd.last-2].height;
Crd[Crd.last-1].x = Crd[Crd.last-2].x;
Crd[Crd.last-1].y = Crd[SN_STATUS_PANE_BG].y+3;
SN_STATUS_PANE_PORTRAIT = addArrayElement(Crd, Crd.last);
Crd[Crd.last-1].rleft = left_screen; Crd[Crd.last-1].rtop = bottom_screen;
Crd[Crd.last-1].rright = left_screen; Crd[Crd.last-1].rbottom = bottom_screen;
Crd[Crd.last-1].width = crd_portrait_lrg_width;
Crd[Crd.last-1].height = crd_portrait_lrg_height;
Crd[Crd.last-1].x = Crd[SN_STATUS_PANE_HEADING].x+5;
Crd[Crd.last-1].y = Crd[SN_STATUS_PANE_HEADING].y-Crd[Crd.last-1].height-7;
SN_STATUS_PANE_PORTRAIT_FLP = addArrayElement(Crd, Crd.last);
Crd[Crd.last-1].rleft = Crd[Crd.last-2].rleft; Crd[Crd.last-1].rtop = top_screen;
Crd[Crd.last-1].rright = Crd[Crd.last-2].rright; Crd[Crd.last-1].rbottom = top_screen;
Crd[Crd.last-1].width = Crd[Crd.last-2].width;
Crd[Crd.last-1].height = Crd[Crd.last-2].height;
Crd[Crd.last-1].x = Crd[Crd.last-2].x;
Crd[Crd.last-1].y = Crd[SN_STATUS_PANE_HEADING_FLP].y+Crd[SN_STATUS_PANE_HEADING_FLP].height+7;
SN_STATUS_PANE_ICON_RANK = addArrayElement(Crd, Crd.last);
Crd[Crd.last-1].rleft = left_screen; Crd[Crd.last-1].rtop = bottom_screen;
Crd[Crd.last-1].rright = left_screen; Crd[Crd.last-1].rbottom = bottom_screen;
Crd[Crd.last-1].width = crd_mini_icon_width;
Crd[Crd.last-1].height = crd_mini_icon_height;
Crd[Crd.last-1].x = Crd[SN_STATUS_PANE_PORTRAIT].x+Crd[SN_STATUS_PANE_PORTRAIT].width-Crd[Crd.last-1].width;
Crd[Crd.last-1].y = Crd[SN_STATUS_PANE_PORTRAIT].y;
SN_STATUS_PANE_ICON_RANK_FLP = addArrayElement(Crd, Crd.last);
Crd[Crd.last-1].rleft = Crd[Crd.last-2].rleft; Crd[Crd.last-1].rtop = top_screen;
Crd[Crd.last-1].rright = Crd[Crd.last-2].rright; Crd[Crd.last-1].rbottom = top_screen;
Crd[Crd.last-1].width = Crd[Crd.last-2].width;
Crd[Crd.last-1].height = Crd[Crd.last-2].height;
Crd[Crd.last-1].x = Crd[Crd.last-2].x;
Crd[Crd.last-1].y = Crd[SN_STATUS_PANE_PORTRAIT_FLP].y;
SN_STATUS_PANE_NAME1 = addArrayElement(Crd, Crd.last);
Crd[Crd.last-1].rleft = left_screen; Crd[Crd.last-1].rtop = bottom_screen;
Crd[Crd.last-1].rright = left_screen; Crd[Crd.last-1].rbottom = bottom_screen;
Crd[Crd.last-1].width = Crd[SN_STATUS_PANE_BG].width-Crd[SN_STATUS_PANE_PORTRAIT].width-10;
Crd[Crd.last-1].height = Crd[SN_STATUS_PANE_PORTRAIT].height;
Crd[Crd.last-1].x = Crd[SN_STATUS_PANE_PORTRAIT].x+Crd[SN_STATUS_PANE_PORTRAIT].width+2;
Crd[Crd.last-1].y = Crd[SN_STATUS_PANE_PORTRAIT].y;
SN_STATUS_PANE_NAME1_FLP = addArrayElement(Crd, Crd.last);
Crd[Crd.last-1].rleft = Crd[Crd.last-2].rleft; Crd[Crd.last-1].rtop = top_screen;
Crd[Crd.last-1].rright = Crd[Crd.last-2].rright; Crd[Crd.last-1].rbottom = top_screen;
Crd[Crd.last-1].width = Crd[Crd.last-2].width;
Crd[Crd.last-1].height = Crd[Crd.last-2].height;
Crd[Crd.last-1].x = Crd[Crd.last-2].x;
Crd[Crd.last-1].y = Crd[SN_STATUS_PANE_PORTRAIT_FLP].y;
SN_STATUS_PANE_ICON_HP_BAR_SPAN = 2;
SN_STATUS_PANE_ICON_HP_TEXT_X_SPAN = 4;
SN_STATUS_PANE_ICON_HP_TEXT_Y_SPAN = 0;
SN_STATUS_PANE_ICON_HP_BAR = addArrayElement(Crd, Crd.last);
Crd[Crd.last-1].rleft = left_screen; Crd[Crd.last-1].rtop = bottom_screen;
Crd[Crd.last-1].rright = left_screen; Crd[Crd.last-1].rbottom = bottom_screen;
Crd[Crd.last-1].width = Crd[SN_STATUS_PANE_PORTRAIT].width;
Crd[Crd.last-1].height = 6;
Crd[Crd.last-1].x = Crd[SN_STATUS_PANE_PORTRAIT].x;
Crd[Crd.last-1].y = Crd[SN_STATUS_PANE_PORTRAIT].y-Crd[Crd.last-1].height-SN_STATUS_PANE_ICON_HP_BAR_SPAN;
SN_STATUS_PANE_ICON_HP_BAR_FLP = addArrayElement(Crd, Crd.last);
Crd[Crd.last-1].rleft = Crd[Crd.last-2].rleft; Crd[Crd.last-1].rtop = top_screen;
Crd[Crd.last-1].rright = Crd[Crd.last-2].rright; Crd[Crd.last-1].rbottom = top_screen;
Crd[Crd.last-1].width = Crd[Crd.last-2].width;
Crd[Crd.last-1].height = Crd[Crd.last-2].height;
Crd[Crd.last-1].x = Crd[Crd.last-2].x;
Crd[Crd.last-1].y = Crd[SN_STATUS_PANE_PORTRAIT_FLP].y+Crd[SN_STATUS_PANE_PORTRAIT_FLP].height+SN_STATUS_PANE_ICON_HP_BAR_SPAN;
SN_STATUS_PANE_ICON_HP_TEXT = addArrayElement(Crd, Crd.last);
Crd[Crd.last-1].rleft = left_screen; Crd[Crd.last-1].rtop = bottom_screen;
Crd[Crd.last-1].rright = left_screen; Crd[Crd.last-1].rbottom = bottom_screen;
Crd[Crd.last-1].width = 55;
Crd[Crd.last-1].height = Crd[SN_STATUS_PANE_ICON_HP_BAR].height;
Crd[Crd.last-1].x = Crd[SN_STATUS_PANE_NAME1].x;
Crd[Crd.last-1].y = Crd[SN_STATUS_PANE_ICON_HP_BAR].y+SN_STATUS_PANE_ICON_HP_TEXT_Y_SPAN;
SN_STATUS_PANE_ICON_HP_TEXT_FLP = addArrayElement(Crd, Crd.last);
Crd[Crd.last-1].rleft = Crd[Crd.last-2].rleft; Crd[Crd.last-1].rtop = top_screen;
Crd[Crd.last-1].rright = Crd[Crd.last-2].rright; Crd[Crd.last-1].rbottom = top_screen;
Crd[Crd.last-1].width = Crd[Crd.last-2].width;
Crd[Crd.last-1].height = Crd[Crd.last-2].height;
Crd[Crd.last-1].x = Crd[Crd.last-2].x;
Crd[Crd.last-1].y = Crd[SN_STATUS_PANE_ICON_HP_BAR_FLP].y+SN_STATUS_PANE_ICON_HP_TEXT_Y_SPAN;
SN_STATUS_PANE_ICON_XP_BAR = addArrayElement(Crd, Crd.last);
Crd[Crd.last-1].rleft = left_screen; Crd[Crd.last-1].rtop = bottom_screen;
Crd[Crd.last-1].rright = left_screen; Crd[Crd.last-1].rbottom = bottom_screen;
Crd[Crd.last-1].width = Crd[SN_STATUS_PANE_ICON_HP_BAR].width;
Crd[Crd.last-1].height = Crd[SN_STATUS_PANE_ICON_HP_BAR].height;
Crd[Crd.last-1].x = Crd[SN_STATUS_PANE_ICON_HP_BAR].x;
Crd[Crd.last-1].y = Crd[SN_STATUS_PANE_ICON_HP_BAR].y-Crd[SN_STATUS_PANE_ICON_HP_BAR].height-SN_STATUS_PANE_ICON_HP_BAR_SPAN-1;
SN_STATUS_PANE_ICON_XP_BAR_FLP = addArrayElement(Crd, Crd.last);
Crd[Crd.last-1].rleft = Crd[Crd.last-2].rleft; Crd[Crd.last-1].rtop = top_screen;
Crd[Crd.last-1].rright = Crd[Crd.last-2].rright; Crd[Crd.last-1].rbottom = top_screen;
Crd[Crd.last-1].width = Crd[Crd.last-2].width;
Crd[Crd.last-1].height = Crd[Crd.last-2].height;
Crd[Crd.last-1].x = Crd[Crd.last-2].x;
Crd[Crd.last-1].y = Crd[SN_STATUS_PANE_ICON_HP_BAR_FLP].y+Crd[SN_STATUS_PANE_ICON_HP_BAR_FLP].height+SN_STATUS_PANE_ICON_HP_BAR_SPAN+1;
SN_STATUS_PANE_ICON_XP_TEXT = addArrayElement(Crd, Crd.last);
Crd[Crd.last-1].rleft = left_screen; Crd[Crd.last-1].rtop = bottom_screen;
Crd[Crd.last-1].rright = left_screen; Crd[Crd.last-1].rbottom = bottom_screen;
Crd[Crd.last-1].width = Crd[SN_STATUS_PANE_ICON_HP_TEXT].width;
Crd[Crd.last-1].height = Crd[SN_STATUS_PANE_ICON_HP_TEXT].height;
Crd[Crd.last-1].x = Crd[SN_STATUS_PANE_ICON_HP_TEXT].x;
Crd[Crd.last-1].y = Crd[SN_STATUS_PANE_ICON_XP_BAR].y+SN_STATUS_PANE_ICON_HP_TEXT_Y_SPAN;
SN_STATUS_PANE_ICON_XP_TEXT_FLP = addArrayElement(Crd, Crd.last);
Crd[Crd.last-1].rleft = Crd[Crd.last-2].rleft; Crd[Crd.last-1].rtop = top_screen;
Crd[Crd.last-1].rright = Crd[Crd.last-2].rright; Crd[Crd.last-1].rbottom = top_screen;
Crd[Crd.last-1].width = Crd[Crd.last-2].width;
Crd[Crd.last-1].height = Crd[Crd.last-2].height;
Crd[Crd.last-1].x = Crd[Crd.last-2].x;
Crd[Crd.last-1].y = Crd[SN_STATUS_PANE_ICON_XP_BAR_FLP].y+SN_STATUS_PANE_ICON_HP_TEXT_Y_SPAN;
SN_STATUS_PANE_2STAT = addArrayElement(Crd, Crd.last);
Crd[Crd.last-1].rleft = left_screen; Crd[Crd.last-1].rtop = bottom_screen;
Crd[Crd.last-1].rright = left_screen; Crd[Crd.last-1].rbottom = bottom_screen;
Crd[Crd.last-1].width = 126;
Crd[Crd.last-1].height = 30;
Crd[Crd.last-1].x = Crd[SN_STATUS_PANE_ICON_HP_TEXT].x+Crd[SN_STATUS_PANE_ICON_HP_TEXT].width;
Crd[Crd.last-1].y = Crd[SN_STATUS_PANE_ICON_HP_BAR].y+crd_mini_icon_width+1;
SN_STATUS_PANE_2STAT_FLP = addArrayElement(Crd, Crd.last);
Crd[Crd.last-1].rleft = Crd[Crd.last-2].rleft; Crd[Crd.last-1].rtop = top_screen;
Crd[Crd.last-1].rright = Crd[Crd.last-2].rright; Crd[Crd.last-1].rbottom = top_screen;
Crd[Crd.last-1].width = Crd[Crd.last-2].width;
Crd[Crd.last-1].height = Crd[Crd.last-2].height;
Crd[Crd.last-1].x = Crd[Crd.last-2].x;
Crd[Crd.last-1].y = Crd[SN_STATUS_PANE_ICON_HP_BAR_FLP].y+crd_mini_icon_width+1;
SN_STATUS_PANE_STAT = new Array();
SN_STATUS_PANE_STAT_FLP = new Array();
SN_STATUS_PANE_STAT.last = 0;
SN_STATUS_PANE_STAT.row_curr = 1;
SN_STATUS_PANE_STAT.col_curr = 1;
SN_STATUS_PANE_STAT.row = 2;
SN_STATUS_PANE_STAT.col = 6;
SN_STATUS_PANE_STAT.max = 12;
for (SN_STATUS_PANE_STAT.curr = 1; SN_STATUS_PANE_STAT.curr <= SN_STATUS_PANE_STAT.max; SN_STATUS_PANE_STAT.curr++)
{
SN_STATUS_PANE_STAT[SN_STATUS_PANE_STAT.curr] = addArrayElement(Crd, Crd.last);
Crd[Crd.last-1].rleft = left_screen; Crd[Crd.last-1].rtop = bottom_screen;
Crd[Crd.last-1].rright = left_screen; Crd[Crd.last-1].rbottom = bottom_screen;
Crd[Crd.last-1].width = (Crd[SN_STATUS_PANE_BG].width-14)/6;
Crd[Crd.last-1].height = 30;
if (SN_STATUS_PANE_STAT.col_curr == 1)
Crd[Crd.last-1].x = Crd[SN_STATUS_PANE_PORTRAIT].x;
else
Crd[Crd.last-1].x = Crd[Crd.last-3].x+Crd[Crd.last-3].width;
if (SN_STATUS_PANE_STAT.row_curr == 1)
Crd[Crd.last-1].y = Crd[SN_STATUS_PANE_ICON_XP_BAR].y-Crd[Crd.last-1].height;
else
Crd[Crd.last-1].y = Crd[SN_STATUS_PANE_ICON_XP_BAR].y-Crd[Crd.last-1].height-Crd[Crd.last-3].height;
SN_STATUS_PANE_STAT_FLP[SN_STATUS_PANE_STAT.curr] = addArrayElement(Crd, Crd.last);
Crd[Crd.last-1].rleft = Crd[Crd.last-2].rleft; Crd[Crd.last-1].rtop = top_screen;
Crd[Crd.last-1].rright = Crd[Crd.last-2].rright; Crd[Crd.last-1].rbottom = top_screen;
Crd[Crd.last-1].width = Crd[Crd.last-2].width;
Crd[Crd.last-1].height = Crd[Crd.last-2].height;
if (SN_STATUS_PANE_STAT.col_curr == 1)
Crd[Crd.last-1].x = Crd[SN_STATUS_PANE_PORTRAIT_FLP].x;
else
Crd[Crd.last-1].x = Crd[Crd.last-3].x+Crd[Crd.last-3].width;
if (SN_STATUS_PANE_STAT.row_curr == 1)
Crd[Crd.last-1].y = Crd[SN_STATUS_PANE_ICON_XP_BAR_FLP].y+Crd[SN_STATUS_PANE_ICON_XP_BAR_FLP].height;
else
Crd[Crd.last-1].y = Crd[SN_STATUS_PANE_ICON_XP_BAR_FLP].y+Crd[SN_STATUS_PANE_ICON_XP_BAR_FLP].height+Crd[Crd.last-3].height;
if (SN_STATUS_PANE_STAT.col_curr == SN_STATUS_PANE_STAT.col)
{
SN_STATUS_PANE_STAT.row_curr++;
SN_STATUS_PANE_STAT.col_curr = 0;
}
SN_STATUS_PANE_STAT.col_curr++;
}
SN_STATUS_PANE_STAT.last = SN_STATUS_PANE_STAT.curr;
SN_STATUS_PANE_COMMAND = new Array();
SN_STATUS_PANE_COMMAND.tab = new Object();
SN_STATUS_PANE_COMMAND.list = new Object();
SN_STATUS_PANE_COMMAND.button = new Object();
SN_STATUS_PANE_COMMAND.tab.max = 13; // Maximum number of buttons (either single or lists).
SN_STATUS_PANE_COMMAND.list.max = 11; // Maximum number of entries in a list.
SN_STATUS_PANE_COMMAND.button.max = 5; // Number of tabs that are single buttons (no list).
SN_STATUS_PANE_COMMAND.split = 9; // When we reach this button, split the rows (remainder are vertical, not horizontal).
SN_STATUS_PANE_COMMAND.span = 2; // Spacing between lists.
for (loop = 0; loop < SN_STATUS_PANE_COMMAND.list.max+1; loop++)
SN_STATUS_PANE_COMMAND[loop] = new Array();
SN_STATUS_PANE_COMMAND_FLP = new Array();
for (loop = 0; loop < SN_STATUS_PANE_COMMAND.list.max+1; loop++)
SN_STATUS_PANE_COMMAND_FLP[loop] = new Array();
for (SN_STATUS_PANE_COMMAND.tab.curr = 1; SN_STATUS_PANE_COMMAND.tab.curr <= SN_STATUS_PANE_COMMAND.tab.max; SN_STATUS_PANE_COMMAND.tab.curr++)
{
for (SN_STATUS_PANE_COMMAND.list.curr = 1; SN_STATUS_PANE_COMMAND.list.curr <= SN_STATUS_PANE_COMMAND.list.max; SN_STATUS_PANE_COMMAND.list.curr++)
{
SN_STATUS_PANE_COMMAND[SN_STATUS_PANE_COMMAND.list.curr][SN_STATUS_PANE_COMMAND.tab.curr] = new Number( addArrayElement(Crd, Crd.last) );
Crd[Crd.last-1].rleft = left_screen; Crd[Crd.last-1].rtop = bottom_screen;
Crd[Crd.last-1].rright = left_screen; Crd[Crd.last-1].rbottom = bottom_screen;
Crd[Crd.last-1].width = crd_portrait_sml_width;
Crd[Crd.last-1].height = crd_portrait_sml_height;
SN_STATUS_PANE_COMMAND[SN_STATUS_PANE_COMMAND.list.curr][SN_STATUS_PANE_COMMAND.tab.curr].type = new Object();
SN_STATUS_PANE_COMMAND[SN_STATUS_PANE_COMMAND.list.curr][SN_STATUS_PANE_COMMAND.tab.curr].name = new Object();
SN_STATUS_PANE_COMMAND[SN_STATUS_PANE_COMMAND.list.curr][SN_STATUS_PANE_COMMAND.tab.curr].last = new Object();
if (SN_STATUS_PANE_COMMAND.tab.curr >= SN_STATUS_PANE_COMMAND.split)
{
if (SN_STATUS_PANE_COMMAND.list.curr == 1)
{
Crd[Crd.last-1].x = Crd[SN_STATUS_PANE_BG].x+Crd[SN_STATUS_PANE_BG].width;
if (SN_STATUS_PANE_COMMAND.tab.curr == SN_STATUS_PANE_COMMAND.split && SN_STATUS_PANE_COMMAND.list.curr == 1)
Crd[Crd.last-1].y = Crd[SN_STATUS_PANE_BG].y;
else
Crd[Crd.last-1].y = Crd[Crd.last-3].y+Crd[Crd.last-3].height;
}
else
{
Crd[Crd.last-1].x = Crd[Crd.last-3].x+Crd[Crd.last-3].width+SN_STATUS_PANE_COMMAND.span;
Crd[Crd.last-1].y = Crd[Crd.last-3].y;
}
}
else
{
if (SN_STATUS_PANE_COMMAND.list.curr == 1)
{
if (SN_STATUS_PANE_COMMAND.tab.curr == 1 && SN_STATUS_PANE_COMMAND.list.curr == 1)
Crd[Crd.last-1].x = Crd[SN_STATUS_PANE_BG].x;
else
Crd[Crd.last-1].x = Crd[Crd.last-3].x+Crd[Crd.last-3].width;
Crd[Crd.last-1].y = Crd[SN_STATUS_PANE_BG].y+Crd[SN_STATUS_PANE_BG].height;
}
else
{
Crd[Crd.last-1].x = Crd[Crd.last-3].x;
Crd[Crd.last-1].y = Crd[Crd.last-3].y+Crd[Crd.last-3].height+SN_STATUS_PANE_COMMAND.span;
}
}
SN_STATUS_PANE_COMMAND_FLP[SN_STATUS_PANE_COMMAND.list.curr][SN_STATUS_PANE_COMMAND.tab.curr] = addArrayElement(Crd, Crd.last);
Crd[Crd.last-1].rleft = Crd[Crd.last-2].rleft; Crd[Crd.last-1].rtop = top_screen;
Crd[Crd.last-1].rright = Crd[Crd.last-2].rright; Crd[Crd.last-1].rbottom = top_screen;
Crd[Crd.last-1].width = Crd[Crd.last-2].width;
Crd[Crd.last-1].height = Crd[Crd.last-2].height;
if (SN_STATUS_PANE_COMMAND.tab.curr >= SN_STATUS_PANE_COMMAND.split)
{
if (SN_STATUS_PANE_COMMAND.list.curr == 1)
{
Crd[Crd.last-1].x = Crd[SN_STATUS_PANE_BG].x+Crd[SN_STATUS_PANE_BG].width;
if (SN_STATUS_PANE_COMMAND.tab.curr == SN_STATUS_PANE_COMMAND.split && SN_STATUS_PANE_COMMAND.list.curr == 1)
Crd[Crd.last-1].y = Crd[SN_STATUS_PANE_BG].y;
else
Crd[Crd.last-1].y = Crd[Crd.last-3].y+Crd[Crd.last-3].height;
}
else
{
Crd[Crd.last-1].x = Crd[Crd.last-3].x+Crd[Crd.last-3].width+SN_STATUS_PANE_COMMAND.span;
Crd[Crd.last-1].y = Crd[Crd.last-3].y;
}
}
else
{
if (SN_STATUS_PANE_COMMAND.list.curr == 1)
{
if (SN_STATUS_PANE_COMMAND.tab.curr == 1 && SN_STATUS_PANE_COMMAND.list.curr == 1)
Crd[Crd.last-1].x = Crd[SN_STATUS_PANE_BG].x;
else
Crd[Crd.last-1].x = Crd[Crd.last-3].x+Crd[Crd.last-3].width;
Crd[Crd.last-1].y = Crd[SN_STATUS_PANE_BG].y+Crd[SN_STATUS_PANE_BG].height;
}
else
{
Crd[Crd.last-1].x = Crd[Crd.last-3].x;
Crd[Crd.last-1].y = Crd[Crd.last-3].y+Crd[Crd.last-3].height+SN_STATUS_PANE_COMMAND.span;
}
}
}
}
SN_STATUS_PANE_COMMAND_PROGRESS = addArrayElement(Crd, Crd.last);
Crd[Crd.last-1].rleft = left_screen; Crd[Crd.last-1].rtop = bottom_screen;
Crd[Crd.last-1].rright = left_screen; Crd[Crd.last-1].rbottom = bottom_screen;
Crd[Crd.last-1].width = crd_portrait_sml_width;
Crd[Crd.last-1].height = crd_portrait_sml_height;
Crd[Crd.last-1].x = Crd[SN_STATUS_PANE_BG].x+Crd[SN_STATUS_PANE_BG].width;
Crd[Crd.last-1].y = Crd[SN_STATUS_PANE_BG].y;
}
// ====================================================================
function UpdateList(listIcon, listCol)
{
// Populates a given column of command icons with appropriate build portraits for the selected object.
// Returns an array of this selection.
// Build unit list.
if (selection[0].traits.id.civ_code && selection[0].actions.create && selection[0].actions.create.list)
{
listName = "";
switch (listIcon)
{
case action_tab_train:
if (selection[0].actions.create.list.unit)
listName = selection[0].actions.create.list.unit.toString();
break;
case action_tab_buildciv:
if (selection[0].actions.create.list.structciv)
listName = selection[0].actions.create.list.structciv.toString();
break;
case action_tab_buildmil:
if (selection[0].actions.create.list.structmil)
listName = selection[0].actions.create.list.structmil.toString();
break;
case action_tab_research:
if (selection[0].actions.create.list.tech)
listName = selection[0].actions.create.list.tech.toString();
break;
default:
return 0;
break;
}
if (listName != "")
{
// Enable tab portrait.
setPortrait("SN_STATUS_PANE_COMMAND_" + listCol + "_1", "sheet_action", "", listIcon);
guiUnHide("SN_STATUS_PANE_COMMAND_" + listCol + "_1");
// Store content info in tab button for future reference.
SN_STATUS_PANE_COMMAND[1][listCol].type = "list";
// Extract entity list into an array.
listArray = parseDelimiterString(listName, ";", listName.length);
// Reset list length.
SN_STATUS_PANE_COMMAND[1][listCol].last = 0;
// Populate appropriate command buttons.
for (createLoop = 0; createLoop < SN_STATUS_PANE_COMMAND.list.max; createLoop++)
{
if (createLoop < listArray.length)
{
// Get name of entity to display in list.
UpdateListEntityName = selection[0].traits.id.civ_code + "_" + listArray[createLoop];
setPortrait("SN_STATUS_PANE_COMMAND_" + listCol + "_" + parseInt(createLoop+2), getEntityTemplate(UpdateListEntityName).traits.id.icon, selection[0].traits.id.civ_code, getEntityTemplate(UpdateListEntityName).traits.id.icon_cell);
getGUIObjectByName("SN_STATUS_PANE_COMMAND_" + listCol + "_" + parseInt(createLoop+2)).caption = "";
guiUnHide("SN_STATUS_PANE_COMMAND_" + listCol + "_" + parseInt(createLoop+2));
// Store content info in tab button for future reference.
SN_STATUS_PANE_COMMAND[parseInt(createLoop+2)][listCol].name = listArray[createLoop];
SN_STATUS_PANE_COMMAND[parseInt(createLoop+2)][listCol].last++;
}
else
guiHide("SN_STATUS_PANE_COMMAND_" + listCol + "_" + parseInt(createLoop+2));
}
return listArray;
}
}
return 0;
}
// ====================================================================
function UpdateCommand(listIcon, listCol)
{
// Similar to UpdateList, but without the list.
// Updates a particular command button with a particular action.
if (
(listIcon == action_attack && selection[0].actions.attack)
|| (listIcon == action_patrol && selection[0].actions.patrol)
|| (listIcon == action_repair && selection[0].actions.repair)
|| (listIcon == action_gather_food && selection[0].actions.gather && selection[0].actions.gather.food)
|| (listIcon == action_gather_wood && selection[0].actions.gather && selection[0].actions.gather.wood)
|| (listIcon == action_gather_stone && selection[0].actions.gather && selection[0].actions.gather.stone)
|| (listIcon == action_gather_ore && selection[0].actions.gather && selection[0].actions.gather.ore)
)
{
setPortrait("SN_STATUS_PANE_COMMAND_" + listCol + "_1", "sheet_action", "", listIcon);
guiUnHide("SN_STATUS_PANE_COMMAND_" + listCol + "_1");
// Store content info in tab button for future reference.
SN_STATUS_PANE_COMMAND[1][listCol].type = "command";
SN_STATUS_PANE_COMMAND[1][listCol].last = 0;
SN_STATUS_PANE_COMMAND[1][listCol].name = listIcon;
return (listCol-1);
}
else
return (listCol);
}
// ====================================================================
function PressCommandButton(GUIObject, list, tab)
{
switch (list)
{
case 1:
GUIObject.caption = "";
if (SN_STATUS_PANE_COMMAND[list][tab].type == "list")
{
//console.write("Clicked [" + list + "," + tab + "]: tab of type " + SN_STATUS_PANE_COMMAND[list][tab].type + "; " + SN_STATUS_PANE_COMMAND[list][tab].last + "; " + SN_STATUS_PANE_COMMAND[list][tab].name);
// Click the tab button to toggle visibility of its list (if it's of a list type).
GUIObjectToggle("SN_STATUS_PANE_COMMAND_" + tab + "_GROUP");
}
else
{
// Perform appropriate actions for different command buttons.
console.write("Clicked [" + list + "," + tab + "]: command of type " + SN_STATUS_PANE_COMMAND[list][tab].type + "; " + SN_STATUS_PANE_COMMAND[list][tab].last + "; " + SN_STATUS_PANE_COMMAND[list][tab].name);
switch (SN_STATUS_PANE_COMMAND[list][tab].name)
{
case action_patrol:
// setCursor(...)
selectLocation(
function (x, y) {
issueCommand(selection, NMT_Patrol, x, y);
});
break;
case action_attack:
// setCursor(...)
selectEntity(
function (target) {
issueCommand(selection, NMT_AttackMelee, target);
});
break;
}
}
break;
default:
// Left-clicked list button.
console.write("Clicked [" + list + "," + tab + "]: list of type " + SN_STATUS_PANE_COMMAND[list][tab].type + "; " + SN_STATUS_PANE_COMMAND[list][tab].name);
// Attempt to add the entry to the queue.
attempt_add_to_build_queue( selection[0], selection[0].traits.id.civ_code + "_" + SN_STATUS_PANE_COMMAND[list][tab].name, list, tab);
break;
}
}
// ====================================================================
function UpdateCommandButtons()
{
if( shouldUpdateStat( "actions.create.list" ) )
{
// Everything in this block is tied to properties in
// actions.create.list, the above check should limit the
// number of times this update is needlessly made.
// Update train/research/build lists.
listCounter = 1;
unitArray = UpdateList(action_tab_train, listCounter); if (unitArray != 0) listCounter++;
structcivArray = UpdateList(action_tab_buildciv, listCounter); if (structcivArray != 0) listCounter++;
structmilArray = UpdateList(action_tab_buildmil, listCounter); if (structmilArray != 0) listCounter++;
techArray = UpdateList(action_tab_research, listCounter); if (techArray != 0) listCounter++;
formationArray = UpdateList(action_tab_formation, listCounter); if (formationArray != 0) listCounter++;
stanceArray = UpdateList(action_tab_stance, listCounter); if (stanceArray != 0) listCounter++;
}
if( shouldUpdateStat( "actions" ) )
{
// Update commands.
commandCounter = SN_STATUS_PANE_COMMAND.tab.max;
commandCounter = UpdateCommand(action_attack, commandCounter);
commandCounter = UpdateCommand(action_patrol, commandCounter);
commandCounter = UpdateCommand(action_repair, commandCounter);
commandCounter = UpdateCommand(action_gather_food, commandCounter);
commandCounter = UpdateCommand(action_gather_wood, commandCounter);
commandCounter = UpdateCommand(action_gather_stone, commandCounter);
commandCounter = UpdateCommand(action_gather_ore, commandCounter);
// Clear remaining buttons between them.
for (commandClearLoop = listCounter; commandClearLoop <= commandCounter; commandClearLoop++)
{
guiHide("SN_STATUS_PANE_COMMAND_" + commandClearLoop + "_1");
// If this slot could possibly contain a list, hide that too.
guiHide("SN_STATUS_PANE_COMMAND_" + commandClearLoop + "_GROUP");
}
}
// Update production queue.
GUIObject = getGUIObjectByName("SN_STATUS_PANE_COMMAND_PROGRESS");
// If the entity has a production item underway,
if (selection[0].actions.create && selection[0].actions.create.progress && selection[0].actions.create.progress.valueOf() && selection[0].actions.create.progress.valueOf().current && selection[0].actions.create.queue.valueOf() && selection[0].actions.create.queue.valueOf()[0].traits.creation.time)
{
// Set the value of the production progress bar.
GUIObject.caption = ((Math.round(Math.round(selection[0].actions.create.progress.valueOf().current)) * 100 ) / Math.round(selection[0].actions.create.queue.valueOf()[0].traits.creation.time));
// Set position of progress bar.
GUIObject.size = getGUIObjectByName("SN_STATUS_PANE_COMMAND_" + selection[0].actions.create.queue.valueOf()[0].tab + "_" + selection[0].actions.create.queue.valueOf()[0].list).size;
// Set progress bar tooltip.
GUIObject.tooltip = "Training " + selection[0].actions.create.queue.valueOf()[0].traits.id.generic + " ... " + (Math.round(selection[0].actions.create.queue.valueOf()[0].traits.creation.time-Math.round(selection[0].actions.create.progress.valueOf().current)) + " seconds remaining.");
// Reveal progressbar.
GUIObject.hidden = false;
// Seek through queue.
for( queueEntry = 0; queueEntry < selection[0].actions.create.queue.valueOf().length; queueEntry++)
{
// Update list buttons so that they match the number of entries of that type in the queue.
getGUIObjectByName("SN_STATUS_PANE_COMMAND_" + selection[0].actions.create.queue.valueOf()[queueEntry].tab + "_" + selection[0].actions.create.queue.valueOf()[queueEntry].list).caption++;
}
}
else
{
// Hide the progress bar.
GUIObject.hidden = true;
GUIObject.tooltip = "";
}
}
// ====================================================================
// Update-on-alteration trickery...
// We don't really want to update every single time we get a
// selection-changed or property-changed event; that could happen
// a lot. Instead, use this bunch of globals to cache any changes
// that happened between GUI updates.
// This boolean determines whether the selection has been changed.
var selectionChanged = false;
// This boolean determines what the template of the selected object
// was when last we looked
var selectionTemplate = null;
// This array holds the name of all properties that need to be updated
var selectionPropertiesChanged = new Array();
// This array holds a list of all the objects we hold property-change
// watches on
var propertyWatches = new Array();
// This function resets all the update variables, above
function resetUpdateVars()
{
if( selectionChanged )
{
for( watchedObject in propertyWatches )
propertyWatches[watchedObject].unwatchAll( selectionWatchHandler ); // Remove the handler
propertyWatches = new Array();
if( selection[0] )
{
// Watch the object itself
selection[0].watchAll( selectionWatchHandler );
propertyWatches.push( selection[0] );
// And every parent back up the tree (changes there will affect
// displayed properties via inheritance)
var parent = selection[0].template
while( parent )
{
parent.watchAll( selectionWatchHandler );
propertyWatches.push( selection[0] );
parent = parent.parent;
}
}
}
selectionChanged = false;
if( selection[0] )
{
selectionTemplate = selection[0].template;
}
else
selectionTemplate = null;
selectionPropertiesChanged = new Array();
}
// This function returns whether we should update a particular statistic
// in the GUI (e.g. "actions.attack") - this should happen if: the selection
// changed, the selection had its template altered (changing lots of stuff)
// or an assignment has been made to that stat or any property within that
// stat.
function shouldUpdateStat( statname )
{
if( selectionChanged || ( selectionTemplate != selection[0].template ) )
return( true );
for( var property in selectionPropertiesChanged )
{
// If property starts with statname
if( selectionPropertiesChanged[property].substring( 0, statname.length ) == statname )
return( true );
}
return( false );
}
// This function is a handler for the 'selectionChanged' event,
// it updates the selectionChanged flag
function selectionChangedHandler()
{
selectionChanged = true;
}
// Register it.
addGlobalHandler( "selectionChanged", selectionChangedHandler );
// This function is a handler for a watch event; it updates the
// selectionPropertiesChanged array
function selectionWatchHandler( propname, oldvalue, newvalue )
{
selectionPropertiesChanged.push( propname );
// This bit's important (watches allow the handler to change the value
// before it gets written; we don't want to affect things, so make sure
// the value we send back is the one that was going to be written)
return( newvalue );
}
function UpdateStatusOrb()
{
// Update heading.
if( shouldUpdateStat( "player" ) || shouldUpdateStat( "traits.id.civ" ) )
{
GUIObject = getGUIObjectByName("SN_STATUS_PANE_HEADING");
GUIObject.caption = selection[0].player.name; // Player name (placeholder; replace with proper callsign).
if (selection[0].traits.id.civ)
GUIObject.caption += " [icon=bullet_icon] " + selection[0].traits.id.civ;
}
// Update name text.
if( shouldUpdateStat( "traits.id" ) )
{
GUIObject = getGUIObjectByName("SN_STATUS_PANE_NAME1");
GUIObject.caption = "";
// Personal name.
if (selection[0].traits.id.personal && selection[0].traits.id.personal != "")
GUIObject.caption += selection[0].traits.id.personal + "\n";
// Generic name.
if (selection[0].traits.id.generic)
GUIObject.caption += selection[0].traits.id.generic + "\n";
// Specific/ranked name.
if (selection[0].traits.id.ranked)
{
GUIObject = getGUIObjectByName("SN_STATUS_PANE_NAME1");
GUIObject.caption += selection[0].traits.id.ranked + "\n";
}
else{
if (selection[0].traits.id.specific)
{
GUIObject.caption += selection[0].traits.id.specific + "\n";
}
}
}
if( shouldUpdateStat( "traits.id.icon" ) )
{
// Update portrait
if (selection[0].traits.id.icon)
setPortrait("SN_STATUS_PANE_PORTRAIT", selection[0].traits.id.icon, selection[0].traits.id.civ_code, selection[0].traits.id.icon_cell);
}
if( shouldUpdateStat( "traits.up.rank" ) )
{
// Update rank.
GUIObject = getGUIObjectByName("SN_STATUS_PANE_ICON_RANK");
if (selection[0].traits.up.rank > 1)
{
GUIObject.sprite = "ui_icon_sheet_statistic";
GUIObject.cell_id = stat_rank1 + (selection[0].traits.up.rank-2);
}
else
GUIObject.sprite = "";
}
if( shouldUpdateStat( "traits.health" ) )
{
// Update hitpoints
if (selection[0].traits.health.curr && selection[0].traits.health.max)
{
getGUIObjectByName("SN_STATUS_PANE_ICON_HP_TEXT").caption = Math.round(selection[0].traits.health.curr) + "/" + Math.round(selection[0].traits.health.max);
getGUIObjectByName("SN_STATUS_PANE_ICON_HP_TEXT").hidden = false;
getGUIObjectByName("SN_STATUS_PANE_ICON_HP_BAR").caption = ((Math.round(selection[0].traits.health.curr) * 100 ) / Math.round(selection[0].traits.health.max));
getGUIObjectByName("SN_STATUS_PANE_ICON_HP_BAR").hidden = false;
}
else
{
getGUIObjectByName("SN_STATUS_PANE_ICON_HP_TEXT").hidden = true;
getGUIObjectByName("SN_STATUS_PANE_ICON_HP_BAR").hidden = true;
}
}
if( shouldUpdateStat( "traits.up" ) )
{
// Update upgrade points
if (selection[0].traits.up && selection[0].traits.up.curr && selection[0].traits.up.req)
{
getGUIObjectByName("SN_STATUS_PANE_ICON_XP_TEXT").caption = Math.round(selection[0].traits.up.curr) + "/" + Math.round(selection[0].traits.up.req);
getGUIObjectByName("SN_STATUS_PANE_ICON_XP_TEXT").hidden = false;
getGUIObjectByName("SN_STATUS_PANE_ICON_XP_BAR").caption = ((Math.round(selection[0].traits.up.curr) * 100 ) / Math.round(selection[0].traits.up.req));
getGUIObjectByName("SN_STATUS_PANE_ICON_XP_BAR").hidden = false;
}
else
{
getGUIObjectByName("SN_STATUS_PANE_ICON_XP_TEXT").hidden = true;
getGUIObjectByName("SN_STATUS_PANE_ICON_XP_BAR").hidden = true;
}
}
if( shouldUpdateStat( "traits.garrison" ) )
{
// Update Supply/Garrison
GUIObject = getGUIObjectByName("SN_STATUS_PANE_2STAT");
GUIObject.caption = '';
if (selection[0].traits.garrison)
{
if (selection[0].traits.garrison.curr && selection[0].traits.garrison.max)
{
GUIObject.caption += '[icon="icon_statistic_garrison"] [color="100 100 255"]' + selection[0].traits.garrison.curr + '/' + selection[0].traits.garrison.max + '[/color] ';
}
}
}
if( shouldUpdateStat( "traits.supply" ) )
{
GUIObject = getGUIObjectByName("SN_STATUS_PANE_2STAT");
GUIObject.caption = '';
if (selection[0].traits.supply)
{
if (selection[0].traits.supply.curr && selection[0].traits.supply.max && selection[0].traits.supply.type)
{
// Special case for infinity.
if (selection[0].traits.supply.curr == "0" && selection[0].traits.supply.max == "0")
GUIObject.caption += '[icon="icon_resource_' + selection[0].traits.supply.type + '"] [color="100 100 255"] [icon="infinity_icon"] [/color] ';
else
GUIObject.caption += '[icon="icon_resource_' + selection[0].traits.supply.type + '"] [color="100 100 255"]' + selection[0].traits.supply.curr + '/' + selection[0].traits.supply.max + '[/color] ';
}
}
}
// Update Attack stats
if( shouldUpdateStat( "actions.attack" ) )
{
if (selection[0].actions.attack && selection[0].actions.attack.damage && selection[0].actions.attack.damage > 0)
getGUIObjectByName("SN_STATUS_PANE_STAT1").caption = '[icon="icon_statistic_attack"]' + selection[0].actions.attack.damage;
else
getGUIObjectByName("SN_STATUS_PANE_STAT1").caption = "";
if (selection[0].actions.attack && selection[0].actions.attack.hack && selection[0].actions.attack.hack > 0)
getGUIObjectByName("SN_STATUS_PANE_STAT2").caption = '[icon="icon_statistic_hack"]' + Math.round(selection[0].actions.attack.hack*100) + '%';
else
getGUIObjectByName("SN_STATUS_PANE_STAT2").caption = "";
if (selection[0].actions.attack && selection[0].actions.attack.pierce && selection[0].actions.attack.pierce > 0)
getGUIObjectByName("SN_STATUS_PANE_STAT3").caption = '[icon="icon_statistic_pierce"]' + Math.round(selection[0].actions.attack.pierce*100) + '%';
else
getGUIObjectByName("SN_STATUS_PANE_STAT3").caption = "";
if (selection[0].actions.attack && selection[0].actions.attack.crush && selection[0].actions.attack.crush > 0)
getGUIObjectByName("SN_STATUS_PANE_STAT4").caption = '[icon="icon_statistic_crush"]' + Math.round(selection[0].actions.attack.crush*100) + '%';
else
getGUIObjectByName("SN_STATUS_PANE_STAT4").caption = "";
if (selection[0].actions.attack && selection[0].actions.attack.range && selection[0].actions.attack.range > 0)
getGUIObjectByName("SN_STATUS_PANE_STAT5").caption = '[icon="icon_statistic_range"]' + selection[0].actions.attack.range;
else
getGUIObjectByName("SN_STATUS_PANE_STAT5").caption = "";
if (selection[0].actions.attack && selection[0].actions.attack.accuracy && selection[0].actions.attack.accuracy > 0)
getGUIObjectByName("SN_STATUS_PANE_STAT6").caption = '[icon="icon_statistic_accuracy"]' + Math.round(selection[0].actions.attack.accuracy*100) + '%';
else
getGUIObjectByName("SN_STATUS_PANE_STAT6").caption = "";
}
// Update Armour & Other stats
if( shouldUpdateStat( "traits.armour" ) )
{
if (selection[0].traits.armour && selection[0].traits.armour.value && selection[0].traits.armour.value > 0)
getGUIObjectByName("SN_STATUS_PANE_STAT7").caption = '[icon="icon_statistic_armour"]' + selection[0].traits.armour.value;
else getGUIObjectByName("SN_STATUS_PANE_STAT7").caption = "";
if (selection[0].traits.armour && selection[0].traits.armour.hack && selection[0].traits.armour.hack > 0)
getGUIObjectByName("SN_STATUS_PANE_STAT8").caption = '[icon="icon_statistic_hack"]' + Math.round(selection[0].traits.armour.hack*100) + '%';
else getGUIObjectByName("SN_STATUS_PANE_STAT8").caption = "";
if (selection[0].traits.armour && selection[0].traits.armour.pierce && selection[0].traits.armour.pierce > 0)
getGUIObjectByName("SN_STATUS_PANE_STAT9").caption = '[icon="icon_statistic_pierce"]' + Math.round(selection[0].traits.armour.pierce*100) + '%';
else getGUIObjectByName("SN_STATUS_PANE_STAT9").caption = "";
if (selection[0].traits.armour && selection[0].traits.armour.crush && selection[0].traits.armour.crush > 0)
getGUIObjectByName("SN_STATUS_PANE_STAT10").caption = '[icon="icon_statistic_crush"]' + Math.round(selection[0].traits.armour.crush*100) + '%';
else getGUIObjectByName("SN_STATUS_PANE_STAT10").caption = "";
}
if( shouldUpdateStat( "actions.move" ) )
{
if (selection[0].actions.move && selection[0].actions.move.speed)
getGUIObjectByName("SN_STATUS_PANE_STAT11").caption = '[icon="icon_statistic_speed"]' + selection[0].actions.move.speed;
else getGUIObjectByName("SN_STATUS_PANE_STAT11").caption = "";
}
if( shouldUpdateStat( "traits.vision" ) )
{
if (selection[0].traits.vision && selection[0].traits.vision.los)
getGUIObjectByName("SN_STATUS_PANE_STAT12").caption = '[icon="icon_statistic_los"]' + selection[0].traits.vision.los;
else getGUIObjectByName("SN_STATUS_PANE_STAT12").caption = "";
}
// Reveal Status Orb
getGUIObjectByName("session_status_orb").hidden = false;
// Update Command Buttons.
UpdateCommandButtons();
resetUpdateVars();
}

View File

@ -1,78 +0,0 @@
function initJukebox()
{
// ============================================= 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].x = 80; // 120;
Crd[Crd.last-1].y = 180; // 150;
Crd[Crd.last-1].width = Crd[Crd.last-1].x*2-Crd[Crd.last-1].x;
Crd[Crd.last-1].height = Crd[Crd.last-1].y*2-Crd[Crd.last-1].y;
// Title background of jukebox.
JUKEBOX_TITLEBAR = addArrayElement(Crd, Crd.last);
Crd[Crd.last-1].rleft = mid_screen; Crd[Crd.last-1].rtop = top_screen;
Crd[Crd.last-1].rright = mid_screen; Crd[Crd.last-1].rbottom = top_screen;
Crd[Crd.last-1].width = 200;
Crd[Crd.last-1].height = 32;
Crd[Crd.last-1].x = -(Crd[Crd.last-1].width/2);
Crd[Crd.last-1].y = Crd[JUKEBOX_BKG].y-Crd[Crd.last-1].height;
// Title left of jukebox.
JUKEBOX_TITLEBAR_LEFT = addArrayElement(Crd, Crd.last);
Crd[Crd.last-1].rleft = mid_screen; Crd[Crd.last-1].rtop = top_screen;
Crd[Crd.last-1].rright = mid_screen; Crd[Crd.last-1].rbottom = top_screen;
Crd[Crd.last-1].width = 50;
Crd[Crd.last-1].height = Crd[JUKEBOX_TITLEBAR].height;
Crd[Crd.last-1].x = -Crd[JUKEBOX_TITLEBAR].width+Crd[Crd.last-1].width;
Crd[Crd.last-1].y = Crd[JUKEBOX_TITLEBAR].y;
// Title right of jukebox.
JUKEBOX_TITLEBAR_RIGHT = addArrayElement(Crd, Crd.last);
Crd[Crd.last-1].rleft = mid_screen; Crd[Crd.last-1].rtop = top_screen;
Crd[Crd.last-1].rright = mid_screen; Crd[Crd.last-1].rbottom = top_screen;
Crd[Crd.last-1].width = Crd[JUKEBOX_TITLEBAR_LEFT].width;
Crd[Crd.last-1].height = Crd[JUKEBOX_TITLEBAR_LEFT].height;
Crd[Crd.last-1].x = -Crd[JUKEBOX_TITLEBAR].x;
Crd[Crd.last-1].y = Crd[JUKEBOX_TITLEBAR_LEFT].y;
// List of tracks.
JUKEBOX_LIST_FILE = 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].x = Crd[JUKEBOX_BKG].x+50;
Crd[Crd.last-1].y = Crd[JUKEBOX_BKG].y+50;
Crd[Crd.last-1].width = Crd[Crd.last-1].x*2-Crd[Crd.last-1].x;
Crd[Crd.last-1].height = Crd[Crd.last-1].y*2-Crd[Crd.last-1].y+10;
// Combobox to select category of tracks to list.
JUKEBOX_CATEGORY = addArrayElement(Crd, Crd.last);
Crd[Crd.last-1].rleft = right_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].width = 90;
Crd[Crd.last-1].height = 35;
Crd[Crd.last-1].x = Crd[JUKEBOX_LIST_FILE].x;
Crd[Crd.last-1].y = Crd[JUKEBOX_BKG].y+10;
// 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 = Crd[JUKEBOX_BKG].x-Crd[Crd.last-1].width-10;
Crd[Crd.last-1].y = Crd[JUKEBOX_BKG].y-Crd[Crd.last-1].height-10;
}
// ====================================================================
function jukeboxDisplay()
{
// // Display heading.
// JukeBoxBkg = getGUIObjectByName("JUKEBOX_TITLEBAR");
// JukeBoxBkg.caption = "Jukebox";
}
// ====================================================================

View File

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

View File

@ -1,47 +0,0 @@
function initSubWindows()
{
SN_INGAME_MENU_BG = addArrayElement(Crd, Crd.last);
Crd[Crd.last-1].rleft = mid_screen; Crd[Crd.last-1].rtop = mid_screen;
Crd[Crd.last-1].rright = mid_screen; Crd[Crd.last-1].rbottom = mid_screen;
Crd[Crd.last-1].x = -100;
Crd[Crd.last-1].y = -150;
Crd[Crd.last-1].width = (Crd[Crd.last-1].x * -1) * 2;
Crd[Crd.last-1].height = (Crd[Crd.last-1].y * -1) * 2;
SN_INGAME_MENU_BTN = new Object();
SN_INGAME_MENU_BTN.span = 5;
SN_INGAME_MENU_BTN_RETURN = addArrayElement(Crd, Crd.last);
Crd[Crd.last-1].rleft = mid_screen; Crd[Crd.last-1].rtop = mid_screen;
Crd[Crd.last-1].rright = mid_screen; Crd[Crd.last-1].rbottom = mid_screen;
Crd[Crd.last-1].width = Crd[SN_INGAME_MENU_BG].width;
Crd[Crd.last-1].height = 34;
Crd[Crd.last-1].x = Crd[SN_INGAME_MENU_BG].x;
Crd[Crd.last-1].y = Crd[SN_INGAME_MENU_BG].y+Crd[SN_INGAME_MENU_BG].height-Crd[Crd.last-1].height;
SN_INGAME_MENU_BTN_EXIT = addArrayElement(Crd, Crd.last);
Crd[Crd.last-1].rleft = mid_screen; Crd[Crd.last-1].rtop = mid_screen;
Crd[Crd.last-1].rright = mid_screen; Crd[Crd.last-1].rbottom = mid_screen;
Crd[Crd.last-1].width = Crd[SN_INGAME_MENU_BTN_RETURN].width;
Crd[Crd.last-1].height = Crd[SN_INGAME_MENU_BTN_RETURN].height;
Crd[Crd.last-1].x = Crd[SN_INGAME_MENU_BTN_RETURN].x;
Crd[Crd.last-1].y = Crd[SN_INGAME_MENU_BTN_RETURN].y-Crd[SN_INGAME_MENU_BTN_RETURN].height-SN_INGAME_MENU_BTN.span;
SN_INGAME_MENU_BTN_RESIGN = addArrayElement(Crd, Crd.last);
Crd[Crd.last-1].rleft = mid_screen; Crd[Crd.last-1].rtop = mid_screen;
Crd[Crd.last-1].rright = mid_screen; Crd[Crd.last-1].rbottom = mid_screen;
Crd[Crd.last-1].width = Crd[SN_INGAME_MENU_BTN_RETURN].width;
Crd[Crd.last-1].height = Crd[SN_INGAME_MENU_BTN_RETURN].height;
Crd[Crd.last-1].x = Crd[SN_INGAME_MENU_BTN_RETURN].x;
Crd[Crd.last-1].y = Crd[SN_INGAME_MENU_BTN_EXIT].y-Crd[SN_INGAME_MENU_BTN_EXIT].height-SN_INGAME_MENU_BTN.span;
SN_INGAME_MENU_BTN_JUKEBOX = addArrayElement(Crd, Crd.last);
Crd[Crd.last-1].rleft = mid_screen; Crd[Crd.last-1].rtop = mid_screen;
Crd[Crd.last-1].rright = mid_screen; Crd[Crd.last-1].rbottom = mid_screen;
Crd[Crd.last-1].width = Crd[SN_INGAME_MENU_BTN_RETURN].width;
Crd[Crd.last-1].height = Crd[SN_INGAME_MENU_BTN_RETURN].height;
Crd[Crd.last-1].x = Crd[SN_INGAME_MENU_BTN_RETURN].x;
Crd[Crd.last-1].y = Crd[SN_INGAME_MENU_BTN_RESIGN].y-Crd[SN_INGAME_MENU_BTN_RESIGN].height-SN_INGAME_MENU_BTN.span;
}
// ====================================================================

View File

@ -1,65 +0,0 @@
function initTeamTray()
{
SN_TEAM_TRAY = new Array();
SN_TEAM_TRAY.last = 0;
SN_TEAM_TRAY.max = 9;
for (SN_TEAM_TRAY.curr = 1; SN_TEAM_TRAY.curr <= SN_TEAM_TRAY.max; SN_TEAM_TRAY.curr++)
{
SN_TEAM_TRAY[SN_TEAM_TRAY.curr] = addArrayElement(Crd, Crd.last);
Crd[Crd.last-1].rleft = right_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].width = crd_portrait_sml_width;
Crd[Crd.last-1].height = crd_portrait_sml_height;
Crd[Crd.last-1].x = -(Crd[Crd.last-1].width/2);
if (SN_TEAM_TRAY.curr == 1)
Crd[Crd.last-1].y = Crd[SN_MINIMAP].height+(Crd[Crd.last-1].height/2);
else
Crd[Crd.last-1].y = Crd[Crd.last-2].y+Crd[Crd.last-2].width;
}
SN_TEAM_TRAY.last = SN_TEAM_TRAY.curr;
}
// ====================================================================
function SelectGroup(groupNumber)
{
// Set the current selection to the specified group (team) number, 1-9.
// If the group is already selected, centre on the group.
console.write( groupNumber );
if (groups[groupNumber].length > 0)
{
// If group already selected,
if (selection.equals( groups[groupNumber] ) )
{
// Find the average position of the group
position_avg = new Vector3D();
for( t = 0; t < selection.length; t++ )
position_avg = position_avg.add( selection[t].position );
position_avg = position_avg.divide( selection.length );
setCameraTarget( position_avg ); // Centre on it.
}
else
selection = groups[groupNumber]; // If not, select it.
}
}
// ====================================================================
function UpdateTeamTray()
{
// Enable a Team Tray icon if its group has been created.
for (SN_TEAM_TRAY.curr = 1; SN_TEAM_TRAY.curr < SN_TEAM_TRAY.last; SN_TEAM_TRAY.curr++)
{
if (groups[SN_TEAM_TRAY.curr].length > 0)
getGUIObjectByName("SN_TEAM_TRAY_" + SN_TEAM_TRAY.curr).hidden = false;
else
getGUIObjectByName("SN_TEAM_TRAY_" + SN_TEAM_TRAY.curr).hidden = true;
}
}
// ====================================================================

View File

@ -1,7 +0,0 @@
function UpdateFPSCounter(mouse)
{
g_mouse_x = mouse.x;
g_mouse_y = mouse.y;
getGUIObjectByName('FPS_Counter').caption = "FPS: " + getFPS() + " " + g_mouse_x + " " + g_mouse_y;
}

View File

@ -1,11 +0,0 @@
function GetAttrib(getAttribName)
{
// Simple helper function that elegantly checks if an entity attribute exists.
// Returns blank if it doesn't, or it's value if it does.
if (getAttribName)
return getAttribName;
else
return "";
}