Converted menu hotkey and ai config to new style. Added basic sliding menus. (Need to evaluate potential performance issues here.)

This was SVN commit r10146.
This commit is contained in:
WhiteTreePaladin 2011-08-31 02:41:21 +00:00
parent b48c35c512
commit 9a00398e24
11 changed files with 830 additions and 689 deletions

View File

@ -5,54 +5,50 @@
<script file="gui/aiconfig/aiconfig.js"/>
<!-- Add a translucent black background to fade out the menu page -->
<object type="image" z="0" sprite="bkTranslucent"/>
<object type="image" z="0" sprite="BackgroundTranslucent"/>
<object type="image" style="wheatWindow" size="50%-250 50%-100 50%+250 50%+100">
<object type="image" style="StonePanelLight" size="50%-250 50%-100 50%+250 50%+100">
<object style="wheatWindowTitleBar" type="text">AI configuration</object>
<object style="StoneDialogTitleBar" type="text" size="50%-128 -16 50%+128 16">AI Configuration</object>
<object type="button" style="wheatExit" tooltip_style="snToolTip">
<object type="button" style="StoneExit" tooltip_style="snToolTip">
<action on="Press"><![CDATA[
Engine.PopGuiPage();
]]></action>
</object>
<object size="25 10 100%-25 40">
<object
type="text"
font="serif-bold-18"
text_align="right"
size="0 0 100 100%">
<object size="50%-128 46 50%+128 66">
<object type="text" style="RightLabelText" size="0 0 100 100%">
AI Player
</object>
<object name="aiSelection" type="dropdown" style="wheatDropDown" size="110 0 310 30">
<object name="aiSelection" type="dropdown" style="StoneDropDown" size="110 0 310 28">
<action on="SelectionChange">selectAI(this.selected);</action>
</object>
</object>
<object size="25 50 100%-25 65%-5">
<object size="50%-192 66 50%+192 100%-52">
<object name="aiDescription" type="text" size="0 0 100% 100%"/>
<object name="aiDescription" type="text" style="CenteredLabelText" size="0 0 100% 100%"/>
<!-- TODO: we might want to add things like difficulty controls into here -->
</object>
<object type="button" style="wheatButton" size="100%-203 100%-33 100%-103 100%-3">
OK
<action on="Press"><![CDATA[
returnAI();
]]></action>
</object>
<object type="button" style="wheatButton" size="100%-103 100%-33 100%-3 100%-3">
<object type="button" style="StoneButton" size="100%-280 100%-48 100%-154 100%-20">
Cancel
<action on="Press"><![CDATA[
Engine.PopGuiPage();
]]></action>
</object>
<object type="button" style="StoneButton" size="100%-146 100%-48 100%-20 100%-20">
OK
<action on="Press"><![CDATA[
returnAI();
]]></action>
</object>
</object>
</objects>

View File

@ -23,7 +23,7 @@
</object>
<object type="image" style="StonePanelLight" size="0 16 100% 100%" hidden="true" name="setupWindow">
<object type="image" style="StonePanelLight" size="24 24 100%-24 100%-24" hidden="true" name="setupWindow">
<action on="Tick">
onTick();
@ -34,7 +34,7 @@
</object>
<!-- Map selection -->
<object size="20 64 250 100%-20">
<object size="20 64 300 100%-20">
<object size="0 0 40% 100%">
<object name="mapTypeHeading" type="text" style="RightLabelText" size="0 0 100% 28">Match Type:</object>
@ -76,7 +76,7 @@
</object>
<!-- Player assignments -->
<object name="numPlayersBox" size="260 28 100% 30" hidden="true">
<object name="numPlayersBox" size="320 28 100% 30" hidden="true">
<object name="numPlayersSelectionHeading" type="text" style="LeftLabelText" size="160 0 100% 32">Number of Players</object>
<object name="numPlayersSelection"
type="dropdown"
@ -88,7 +88,7 @@
</object>
</object>
<object size="260 64 100%-20 100%-260" type="image" sprite="BackgroundIndentFillDark">
<object size="320 64 100%-20 100%-260" type="image" sprite="BackgroundIndentFillDark">
<object size="0 6 100% 30">
<object name="playerNameHeading" type="text" style="CenteredLabelText" size="100 0 250 100%">Player Name</object>
<object name="playerCivHeading" type="text" style="CenteredLabelText" size="250 0 400 100%">Civilization</object>
@ -127,7 +127,7 @@
<!-- Options -->
<object name="gameOptionsBox" size="260 100%-260 100% 100%-190">
<object name="gameOptionsBox" size="320 100%-260 100% 100%-190">
<object size="2 2 100% 50%-2"> <!-- Top row -->
<object name="mapSizeText" size="0 0 175 100%" type="text" style="LeftLabelText">Map size:</object>
<object name="mapSize" size="75 -2 225 100%-6" type="dropdown" style="StoneDropDown" hidden="true" tooltip_style="onscreenToolTip" tooltip="Select map size (larger may reduce performance)"/>
@ -144,7 +144,7 @@
<!-- Chat window -->
<object name="chatPanel" size="260 100%-190 100%-20 100%-58" type="image" sprite="BackgroundIndentFillDark">
<object name="chatPanel" size="320 100%-190 100%-20 100%-64" type="image" sprite="BackgroundIndentFillDark">
<object name="chatText" size="3 1 100%-1 100%-25" type="text" style="chatPanel"/>
@ -160,16 +160,17 @@
</object>
<!-- Other things -->
<!-- Tooltip -->
<object name="onscreenToolTip"
type="text"
font="serif-14"
textcolor="white"
sprite="BackgroundTranslucent"
hidden="true"
size="260 100%-64 100%-310 100%-16"
size="100%-656 100%-64 100%-304 100%-16"
>[Tooltip text]</object>
<!-- Cancel Button -->
<object
name="cancelGame"
type="button"
@ -184,6 +185,7 @@
]]></action>
</object>
<!-- Start Button -->
<object
name="startGame"
type="button"

View File

@ -3,5 +3,9 @@
<include>common/setup.xml</include>
<include>common/sprite1.xml</include>
<include>common/styles.xml</include>
<include>common/common_sprites.xml</include>
<include>common/common_styles.xml</include>
<include>aiconfig/aiconfig.xml</include>
</page>

View File

@ -83,8 +83,12 @@ function formatUserReportStatus(status)
function onTick()
{
// Animate backgrounds
scrollBackgrounds();
// Animate submenu
updateMenuPosition();
if (Engine.IsUserReportEnabled())
{
getGUIObjectByName("userReportDisabled").hidden = true;
@ -101,23 +105,40 @@ function onTick()
}
}
// Sizes right border on main menu panel to match the submenu
function blendSubmenuIntoMain(topPosition, bottomPosition)
/*
* MENU FUNCTIONS
*/
// Slide menu
function updateMenuPosition()
{
var topSprite = getGUIObjectByName("MainMenuPanelRightBorderTop");
topSprite.size = "100%-2 0 100% " + (topPosition + MARGIN);
console.write(topSprite.size);
var bottomSprite = getGUIObjectByName("MainMenuPanelRightBorderBottom");
bottomSprite.size = "100%-2 " + (bottomPosition) + " 100% 100%";
if (getGUIObjectByName("submenuScreen").hidden == false)
{
var submenu = getGUIObjectByName("submenu");
// The offset is the increment or number of units/pixels to move
// the menu. An offset of one is always accurate, but it is too
// slow. The offset must divide into the travel distance evenly
// in order for the menu to end up at the right spot. The travel
// distance is the max-initial. The travel distance in this
// example is 300-60 = 240. We choose an offset of 5 because it
// divides into 240 evenly and provided the speed we wanted.
var OFFSET = 5;
if (submenu.size.left < getGUIObjectByName("mainMenu").size.right)
{
submenu.size = (submenu.size.left + OFFSET) + " " + submenu.size.top + " " + (submenu.size.right + OFFSET) + " " + submenu.size.bottom;
}
}
}
// Update the submenu
function updateSubmenu(newSubmenu, position, buttonHeight, numButtons)
// Opens the menu by revealing the screen which contains the menu
function openMenu(newSubmenu, position, buttonHeight, numButtons)
{
// remove old submenu
getGUIObjectByName(currentSubmenu).hidden = true;
// switch to new submenu
currentSubmenu = newSubmenu;
getGUIObjectByName(currentSubmenu).hidden = false;
@ -127,29 +148,54 @@ function updateSubmenu(newSubmenu, position, buttonHeight, numButtons)
var top = position - MARGIN;
var bottom = position + ((buttonHeight + MARGIN) * numButtons);
submenu.size = submenu.size.left + " " + top + " " + submenu.size.right + " " + bottom;
submenu.hidden = false;
// Blend in right border of main menu into the left border of the submenu
blendSubmenuIntoMain(top, bottom);
// prepare to hide the submenu when the mouse moves off of the submenu
getGUIObjectByName("submenuScreen").hidden = false;
getGUIObjectByName("secondarySubmenuScreen").hidden = false;
}
// Helper function that enables the dark background mask, then reveals a given subwindow object.
// Closes the menu and resets position
function closeMenu()
{
getGUIObjectByName("submenuScreen").hidden = true;
getGUIObjectByName("secondarySubmenuScreen").hidden = true;
getGUIObjectByName("submenu").size = getGUIObjectByName("mainMenu").size;
getGUIObjectByName("MainMenuPanelRightBorderTop").size = "100%-2 0 100% 100%";
}
// Sizes right border on main menu panel to match the submenu
function blendSubmenuIntoMain(topPosition, bottomPosition)
{
var topSprite = getGUIObjectByName("MainMenuPanelRightBorderTop");
topSprite.size = "100%-2 0 100% " + (topPosition + MARGIN);
var bottomSprite = getGUIObjectByName("MainMenuPanelRightBorderBottom");
bottomSprite.size = "100%-2 " + (bottomPosition) + " 100% 100%";
}
// Reveals submenu
function openMainMenuSubWindow (windowName)
{
guiUnHide("pgSubWindow");
guiUnHide(windowName);
}
// Helper function that disables the dark background mask, then hides a given subwindow object.
// Hides submenu
function closeMainMenuSubWindow (windowName)
{
guiHide("pgSubWindow");
guiHide(windowName);
}
/*
* FUNCTIONS BELOW DO NOT WORK YET
*/
// Switch to a given options tab window.
function openOptionsTab(tabName)
{

View File

@ -146,16 +146,184 @@ Status: $status.
</object>
</object>
<!--
==========================================
- SUBMENU
==========================================
-->
<object name="submenuScreen"
type="image"
hidden="true"
>
<!-- hides the submenu when the mouse leaves the mainMenuButtons or submenu -->
<action on="MouseEnter">
closeMenu();
</action>
<!-- submenu -->
<object name="submenu"
type="image"
style="SubmenuPanel"
size="60 50%-100 300 50%+100"
>
<!-- submenuSinglePlayer -->
<object name="submenuSinglePlayer"
type="image"
size="0 4 100%-4 100%-4"
tooltip_style="pgToolTip"
tooltip="The 0 A.D. Game Manual."
hidden="true"
>
<object name="subMenuSinglePlayerButton"
type="button"
style="StoneButtonFancy"
size="0 0 100% 28"
tooltip_style="pgToolTip"
tooltip="Click here to start a new single player game."
>
Matches
<action on="Press">
closeMenu();
Engine.PushGuiPage("page_gamesetup.xml", { type: "offline" });
</action>
</object>
<object name="subMenuCampaignButton"
type="button"
style="StoneButtonFancy"
size="0 32 100% 60"
tooltip_style="pgToolTip"
tooltip="Relive history through historical military campaigns. [NOT YET IMPLEMENTED]"
enabled="false"
>
Campaigns
<action on="Press">
closeMenu();
<![CDATA[
// Open Campaigns window.
// NOT IMPLEMENTED YET
]]>
</action>
</object>
</object>
<!-- submenuMultiplayer -->
<object name="submenuMultiplayer"
type="image"
size="0 4 100%-4 100%-4"
tooltip_style="pgToolTip"
tooltip="The 0 A.D. Game Manual"
hidden="true"
>
<object name="subMenuMultiplayerJoinButton"
type="button"
style="StoneButtonFancy"
size="0 0 100% 28"
tooltip_style="pgToolTip"
tooltip="Joining an existing multiplayer game."
>
Join Game
<action on="Press">
closeMenu();
// Open Multiplayer connection window with join option.
Engine.PushGuiPage("page_gamesetup_mp.xml", "join");
</action>
</object>
<object name="subMenuMultiplayerHostButton"
type="button"
style="StoneButtonFancy"
size="0 32 100% 60"
tooltip_style="pgToolTip"
tooltip="Host a multiplayer game."
>
Host Game
<action on="Press">
closeMenu();
// Open Multiplayer connection window with host option.
Engine.PushGuiPage("page_gamesetup_mp.xml", "host");
</action>
</object>
</object>
<!-- submenuToolsAndOptions -->
<object name="submenuToolsAndOptions"
type="image"
size="0 4 100%-4 100%-4"
tooltip_style="pgToolTip"
tooltip="The 0 A.D. Game Manual"
hidden="true"
>
<object name="submenuOptionsButton"
style="StoneButtonFancy"
type="button"
size="0 0 100% 28"
tooltip_style="pgToolTip"
tooltip="Adjust game settings. [NOT YET IMPLEMENTED]"
enabled="false"
>
Options
<action on="Press">
closeMenu();
<![CDATA[
// Open Options window.
Engine.PushGuiPage("page_options.xml");
]]>
</action>
</object>
<object name="submenuEditorButton"
style="StoneButtonFancy"
type="button"
size="0 32 100% 60"
tooltip_style="pgToolTip"
tooltip="Open the Atlas Scenario Editor in a new window. You can run this more reliably by starting the game with the command-line argument &quot;-editor&quot;."
>
Scenario Editor
<action on="Press">
closeMenu();
<![CDATA[
// Start Atlas
if (Engine.AtlasIsAvailable())
Engine.RestartInAtlas();
else
messageBox(400, 200, "The scenario editor is not available or failed to load.", "Error", 2);
]]>
</action>
</object>
</object>
</object><!-- end of submenu -->
</object><!-- end of submenu screen -->
<!--
==========================================
- MAIN MENU PANEL
==========================================
-->
<object type="image"
<object name="mainMenu"
type="image"
style="MainMenuPanel"
size="60 -2 300 100%+2"
z="50"
>
<!-- These hides the submenu if you move the mouse over
the main menu panel. The regular submenu screen canot
handle this because it must be below the main menu panel
in order for the submenu to slide out from behind the
main menu panel. -->
<object name="secondarySubmenuScreen"
type="image"
hidden="true"
size="0 0 100% 100%"
>
<!-- hides the submenu when the mouse leaves the mainMenuButtons or submenu -->
<action on="MouseEnter">
closeMenu();
</action>
</object>
<!-- These are used to make the right side blend in with the submenu -->
<object name="MainMenuPanelRightBorderTop"
type="image"
@ -182,7 +350,11 @@ Status: $status.
size="8 156 100%-8 356"
ghost="false"
>
<!-- Allows sliding the mouse over to submenu without it closing automatically -->
<!-- Allows sliding the mouse over to the submenu.
Without this, the submenu will close automatically
when the mouse encounters the "secondarySubmenuScreen"
in the thin space between the main menu buttons
and the submenu buttons. -->
<object
type="image"
size="100% 0 100%+8 100%"
@ -199,7 +371,7 @@ Status: $status.
>
Learn To Play
<action on="Press">
getGUIObjectByName("submenu").hidden = true;
closeMenu();
<![CDATA[
Engine.PushGuiPage("page_manual.xml", { "page": "intro" });
]]>
@ -216,9 +388,8 @@ Status: $status.
>
Single Player
<action on="Press">
<![CDATA[
updateSubmenu("submenuSinglePlayer", (this.parent.size.top+this.size.top), (this.size.bottom-this.size.top), 2);
]]>
closeMenu();
openMenu("submenuSinglePlayer", (this.parent.size.top+this.size.top), (this.size.bottom-this.size.top), 2);
</action>
</object>
@ -232,9 +403,8 @@ Status: $status.
>
Multiplayer
<action on="Press">
<![CDATA[
updateSubmenu("submenuMultiplayer", (this.parent.size.top+this.size.top), (this.size.bottom-this.size.top), 2);
]]>
closeMenu();
openMenu("submenuMultiplayer", (this.parent.size.top+this.size.top), (this.size.bottom-this.size.top), 2);
</action>
</object>
@ -248,9 +418,8 @@ Status: $status.
>
Tools <![CDATA[&]]> Options
<action on="Press">
<![CDATA[
updateSubmenu("submenuToolsAndOptions", (this.parent.size.top+this.size.top), (this.size.bottom-this.size.top), 2);
]]>
closeMenu();
openMenu("submenuToolsAndOptions", (this.parent.size.top+this.size.top), (this.size.bottom-this.size.top), 2);
</action>
</object>
@ -264,7 +433,7 @@ Status: $status.
>
History
<action on="Press">
getGUIObjectByName("submenu").hidden = true;
closeMenu();
<![CDATA[
Engine.PushGuiPage("page_civinfo.xml");
]]>
@ -281,7 +450,7 @@ Status: $status.
>
Exit
<action on="Press">
getGUIObjectByName("submenu").hidden = true;
closeMenu();
<![CDATA[
var btCaptions = ["Yes", "No"];
var btCode = [exit, null];
@ -379,158 +548,7 @@ Get involved at: wildfiregames.com/0ad
</object>
<!--
==========================================
- SUBMENU
==========================================
-->
<object name="submenuScreen"
type="image"
hidden="true"
>
<!-- hides the submenu when the mouse leaves the mainMenuButtons or submenu -->
<action on="MouseEnter">
getGUIObjectByName("submenu").hidden = true;
getGUIObjectByName("MainMenuPanelRightBorderTop").size = "100%-2 0 100% 100%";
</action>
<!-- submenu -->
<object name="submenu"
type="image"
style="SubmenuPanel"
size="300 50%-100 536 50%+100"
>
<!-- submenuSinglePlayer -->
<object name="submenuSinglePlayer"
type="image"
size="0 4 100%-4 100%-4"
tooltip_style="pgToolTip"
tooltip="The 0 A.D. Game Manual."
hidden="true"
>
<object name="subMenuSinglePlayerButton"
type="button"
style="StoneButtonFancy"
size="0 0 100% 28"
tooltip_style="pgToolTip"
tooltip="Click here to start a new single player game."
>
Matches
<action on="Press"><![CDATA[
// Hide submenu
this.parent.parent.hidden = true;
// Open Session Setup window.
Engine.PushGuiPage("page_gamesetup.xml", { type: "offline" });
]]></action>
</object>
<object name="subMenuCampaignButton"
type="button"
style="StoneButtonFancy"
size="0 32 100% 60"
tooltip_style="pgToolTip"
tooltip="Relive history through historical military campaigns. [NOT YET IMPLEMENTED]"
enabled="false"
>
Campaigns
<action on="Press"><![CDATA[
// Hide submenu
this.parent.parent.hidden = true;
// Open Campaigns window.
// NOT IMPLEMENTED YET
]]></action>
</object>
</object>
<!-- submenuMultiplayer -->
<object name="submenuMultiplayer"
type="image"
size="0 4 100%-4 100%-4"
tooltip_style="pgToolTip"
tooltip="The 0 A.D. Game Manual"
hidden="true"
>
<object name="subMenuMultiplayerJoinButton"
type="button"
style="StoneButtonFancy"
size="0 0 100% 28"
tooltip_style="pgToolTip"
tooltip="Joining an existing multiplayer game."
>
Join Game
<action on="Press"><![CDATA[
// Hide submenu
this.parent.parent.hidden = true;
// Open Multiplayer connection window with join option.
Engine.PushGuiPage("page_gamesetup_mp.xml", "join");
]]></action>
</object>
<object name="subMenuMultiplayerHostButton"
type="button"
style="StoneButtonFancy"
size="0 32 100% 60"
tooltip_style="pgToolTip"
tooltip="Host a multiplayer game."
>
Host Game
<action on="Press"><![CDATA[
// Hide submenu
this.parent.parent.hidden = true;
// Open Multiplayer connection window with host option.
Engine.PushGuiPage("page_gamesetup_mp.xml", "host");
]]></action>
</object>
</object>
<!-- submenuToolsAndOptions -->
<object name="submenuToolsAndOptions"
type="image"
size="0 4 100%-4 100%-4"
tooltip_style="pgToolTip"
tooltip="The 0 A.D. Game Manual"
hidden="true"
>
<object name="submenuOptionsButton"
style="StoneButtonFancy"
type="button"
size="0 0 100% 28"
tooltip_style="pgToolTip"
tooltip="Adjust game settings. [NOT YET IMPLEMENTED]"
enabled="false"
>
Options
<action on="Press"><![CDATA[
// Hide submenu
this.parent.parent.hidden = true;
// Open Options window.
Engine.PushGuiPage("page_options.xml");
]]></action>
</object>
<object name="submenuEditorButton"
style="StoneButtonFancy"
type="button"
size="0 32 100% 60"
tooltip_style="pgToolTip"
tooltip="Open the Atlas Scenario Editor in a new window. You can run this more reliably by starting the game with the command-line argument &quot;-editor&quot;."
>
Scenario Editor
<action on="Press"><![CDATA[
// Hide submenu
this.parent.parent.hidden = true;
// Start Atlas
if (Engine.AtlasIsAvailable())
Engine.RestartInAtlas();
else
messageBox(400, 200, "The scenario editor is not available or failed to load.", "Error", 2);
]]></action>
</object>
</object>
</object><!-- end of submenu -->
</object><!-- end of submenu screen -->

View File

@ -1,13 +1,63 @@
function openMenu()
/*
* MENU POSITION CONSTANTS
*/
// Menu / panel border size
const MARGIN = 4;
// Includes the main menu button
const NUM_BUTTONS = 5;
// Regular menu buttons
const BUTTON_HEIGHT = 32;
// The position where the bottom of the menu will end up (currently 164)
const END_MENU_POSITION = (BUTTON_HEIGHT * NUM_BUTTONS) + MARGIN;
// Menu starting position - bottom
const MENU_BOTTOM = 36;
// Menu starting position - top
const MENU_TOP = MENU_BOTTOM - END_MENU_POSITION;
// Menu starting position - overall
const INITIAL_MENU_POSITION = "100%-" + END_MENU_POSITION + " " + MENU_TOP + " 100% " + MENU_BOTTOM;
// Slide menu
function updateMenuPosition()
{
getGUIObjectByName("menuScreen").hidden = false;
getGUIObjectByName("menu").hidden = false;
if (getGUIObjectByName("menuScreen").hidden == false)
{
var menu = getGUIObjectByName("menu");
// The offset is the increment or number of units/pixels to move
// the menu. An offset of one is always accurate, but it is too
// slow. The offset must divide into the travel distance evenly
// in order for the menu to end up at the right spot. The travel
// distance is the max-initial. The travel distance in this
// example is 164-36 = 128. We choose an offset of 8 because it
// divides into 128 evenly and provided the speed we wanted.
var OFFSET = 8;
if (menu.size.bottom < END_MENU_POSITION)
{
menu.size = "100%-" + END_MENU_POSITION + " " + (menu.size.top + OFFSET) + " 100% " + (menu.size.bottom + OFFSET);
}
}
}
// Opens the menu by revealing the screen which contains the menu
function openMenu()
{
getGUIObjectByName("menuScreen").hidden = false;
}
// Closes the menu and resets position
function closeMenu()
{
getGUIObjectByName("menuScreen").hidden = true;
getGUIObjectByName("menu").hidden = true;
getGUIObjectByName("menuScreen").hidden = true;
getGUIObjectByName("menu").size = INITIAL_MENU_POSITION;
}
function openSettings()
@ -28,7 +78,7 @@ function openChat()
closeSettings();
getGUIObjectByName("chatInput").focus(); // Grant focus to the input area
getGUIObjectByName("chatDialogPanel").hidden = false;
}
function closeChat()
@ -40,7 +90,7 @@ function closeChat()
function toggleChatWindow()
{
closeSettings();
var chatWindow = getGUIObjectByName("chatDialogPanel");
var chatInput = getGUIObjectByName("chatInput");
@ -57,7 +107,7 @@ function togglePause()
closeMenu();
closeChat();
closeSettings();
var pauseOverlay = getGUIObjectByName("pauseOverlay");
if (pauseOverlay.hidden)

View File

@ -126,7 +126,7 @@ function handleNetMessage(message)
case "chat":
addChatMessage({ "type": "message", "guid": message.guid, "text": message.text });
break;
// To prevent errors, ignore these message types that occur during autostart
case "gamesetup":
case "start":
@ -163,7 +163,7 @@ function submitChatInput()
}
input.blur(); // Remove focus
toggleChatWindow();
}
@ -183,7 +183,7 @@ function addChatMessage(msg)
}
var message = escapeText(msg.text);
var formatted;
switch (msg.type)

View File

@ -63,9 +63,9 @@ function init(initData, hotloadData)
}
else // Needed for autostart loading option
{
g_Players = getPlayerData(null);
g_Players = getPlayerData(null);
}
// Cache civ data
g_CivData = loadCivData();
g_CivData["gaia"] = { "Code": "gaia", "Name": "Gaia" };
@ -76,7 +76,7 @@ function init(initData, hotloadData)
{
g_Selection.selected = hotloadData.selection;
}
else
else
{
startMusic(g_CivData[g_Players[Engine.GetPlayerID()].civ].Music); // Starting for the first time:
}
@ -101,7 +101,7 @@ function reportPerformance(time)
size: settings.Size, // only defined for random maps
profiler: Engine.GetProfilerState()
};
Engine.SubmitUserReport("profile", 3, JSON.stringify(data));
}
@ -129,16 +129,16 @@ function leaveGame()
"type": "defeat-player",
"playerId": Engine.GetPlayerID()
});
}
stopMusic();
endGame();
Engine.SwitchGuiPage("page_summary.xml",
{ "gameResult" : gameResult,
"timeElapsed" : extendedSimState.timeElapsed,
"playerStates": extendedSimState.players
Engine.SwitchGuiPage("page_summary.xml",
{ "gameResult" : gameResult,
"timeElapsed" : extendedSimState.timeElapsed,
"playerStates": extendedSimState.players
});
}
@ -174,12 +174,15 @@ function onTick()
// Run timers
updateTimers();
// Animate menu
updateMenuPosition();
// When training is blocked, flash population (alternates colour every 500msec)
if (g_IsTrainingQueueBlocked && (Date.now() % 1000) < 500)
getGUIObjectByName("resourcePop").textcolor = "255 165 0";
else
getGUIObjectByName("resourcePop").textcolor = "white";
// Clear renamed entities list
Engine.GuiInterfaceCall("ClearRenamedEntities", {});
}
@ -188,7 +191,7 @@ function checkPlayerState()
{
var simState = Engine.GuiInterfaceCall("GetSimulationState");
var playerState = simState.players[Engine.GetPlayerID()];
if (!g_GameEnded)
{
if (playerState.state == "defeated")
@ -201,10 +204,10 @@ function checkPlayerState()
{
g_GameEnded = true;
switchMusic("win_1", 0.0);
if (!getGUIObjectByName("devCommandsRevealMap").checked)
getGUIObjectByName("devCommandsRevealMap").checked = true;
g_SessionDialog.open("Victory", "You have won the battle!\nDo you want to leave the game now?", null, 320, 160, leaveGame);
}
}
@ -215,7 +218,7 @@ function onSimulationUpdate()
g_Selection.dirty = false;
g_EntityStates = {};
g_TemplateData = {};
var simState = Engine.GuiInterfaceCall("GetSimulationState");
// If we're called during init when the game is first loading, there will be no simulation yet, so do nothing
@ -272,7 +275,7 @@ function updateDebug(simState)
var conciseSimState = deepcopy(simState);
conciseSimState.players = "<<<omitted>>>";
var text = "simulation: " + uneval(conciseSimState);
var selection = g_Selection.toList();
if (selection.length)
{
@ -301,6 +304,6 @@ function updatePlayerDisplay(simState)
getGUIObjectByName("resourceStone").caption = playerState.resourceCounts.stone;
getGUIObjectByName("resourceMetal").caption = playerState.resourceCounts.metal;
getGUIObjectByName("resourcePop").caption = playerState.popCount + "/" + playerState.popLimit;
g_IsTrainingQueueBlocked = playerState.trainingQueueBlocked;
}

View File

@ -52,7 +52,7 @@
<!-- Menu -->
<object hotkey="menu.toggle">
<action on="Press">openMenuDialog();</action>
<action on="Press">openMenu();</action>
</object>
<!-- Pause -->
@ -195,83 +195,6 @@
</object>
<!-- ================================ ================================ -->
<!-- Menu -->
<!-- ================================ ================================ -->
<object name="menuScreen"
type="image"
hidden="true"
>
<!-- hides the submenu when the mouse leaves the mainMenuButtons or submenu -->
<action on="MouseEnter">
closeMenu();
</action>
<object name="menu"
style="StonePanelThinBorder"
type="image"
size="100%-164 0 100% 164"
hidden="true"
>
<object size="4 36 100%-4 50%+20">
<!-- Settings button -->
<object type="button"
name="settingsButton"
style="StoneButtonFancy"
size="0 0 100% 28"
tooltip_style="sessionToolTip"
>
Settings
<action on="Press">
openSettings();
</action>
</object>
<!-- Chat button -->
<object type="button"
name="chatButton"
style="StoneButtonFancy"
size="0 32 100% 60"
tooltip_style="sessionToolTip"
>
Chat
<action on="Press">
openChat();
</action>
</object>
<!-- Pause Button -->
<object type="button"
name="pauseButton"
style="StoneButtonFancy"
size="0 64 100% 92"
tooltip_style="sessionToolTip"
>
<object name="pauseButtonText" type="text" style="CenteredButtonText" ghost="true">Pause</object>
<action on="Press">
togglePause();
</action>
</object>
<!-- Exit button -->
<object type="button"
name="menuExitButton"
style="StoneButtonFancy"
size="0 96 100% 124"
tooltip_style="sessionToolTip"
>
Exit
<action on="Press">escapeKeyAction();<![CDATA[
var btCaptions = ["Yes", "No"];
var btCode = [leaveGame, null];
messageBox(400, 200, "Are you sure you want to quit?", "Confirmation", 0, btCaptions, btCode);
]]></action>
</object>
</object>
</object>
</object>
<!-- ================================ ================================ -->
<!-- Settings Window -->
<!-- ================================ ================================ -->
@ -334,399 +257,490 @@
</object>
</object>
<!-- ================================ ================================ -->
<!-- Top Panel -->
<!-- ================================ ================================ -->
<object name="topPanel"
type="image"
sprite="topPanel"
size="-3 0 100%+3 36"
>
<!-- ================================ ================================ -->
<!-- Player resource bar -->
<!-- ================================ ================================ -->
<object
size="10 0 45% 100%"
>
<!-- Food -->
<object size="0 0 90 100%" type="image" style="resourceCounter" tooltip="Food" tooltip_style="sessionToolTipBold">
<object size="0 -4 40 36" type="image" style="resourceIcon" cell_id="0"/>
<object size="32 0 100% 100%-2" type="text" style="resourceText" name="resourceFood"/>
</object>
<!-- ================================ ================================ -->
<!-- Top Panel -->
<!-- ================================ ================================ -->
<object name="topPanel"
type="image"
sprite="topPanel"
size="-3 0 100%+3 36"
>
<!-- ================================ ================================ -->
<!-- Player resource bar -->
<!-- ================================ ================================ -->
<object
size="10 0 45% 100%"
>
<!-- Food -->
<object size="0 0 90 100%" type="image" style="resourceCounter" tooltip="Food" tooltip_style="sessionToolTipBold">
<object size="0 -4 40 36" type="image" style="resourceIcon" cell_id="0"/>
<object size="32 0 100% 100%-2" type="text" style="resourceText" name="resourceFood"/>
</object>
<!-- Wood -->
<object size="90 0 180 100%" type="image" style="resourceCounter" tooltip="Wood" tooltip_style="sessionToolTipBold">
<object size="0 -4 40 36" type="image" style="resourceIcon" cell_id="1"/>
<object size="32 0 100% 100%-2" type="text" style="resourceText" name="resourceWood"/>
</object>
<!-- Wood -->
<object size="90 0 180 100%" type="image" style="resourceCounter" tooltip="Wood" tooltip_style="sessionToolTipBold">
<object size="0 -4 40 36" type="image" style="resourceIcon" cell_id="1"/>
<object size="32 0 100% 100%-2" type="text" style="resourceText" name="resourceWood"/>
</object>
<!-- Stone -->
<object size="180 0 270 100%" type="image" style="resourceCounter" tooltip="Stone" tooltip_style="sessionToolTipBold">
<object size="0 -4 40 36" type="image" style="resourceIcon" cell_id="2"/>
<object size="32 0 100% 100%-2" type="text" style="resourceText" name="resourceStone"/>
</object>
<!-- Stone -->
<object size="180 0 270 100%" type="image" style="resourceCounter" tooltip="Stone" tooltip_style="sessionToolTipBold">
<object size="0 -4 40 36" type="image" style="resourceIcon" cell_id="2"/>
<object size="32 0 100% 100%-2" type="text" style="resourceText" name="resourceStone"/>
</object>
<!-- Metal -->
<object size="270 0 360 100%" type="image" style="resourceCounter" tooltip="Metal" tooltip_style="sessionToolTipBold">
<object size="0 -4 40 36" type="image" style="resourceIcon" cell_id="3"/>
<object size="32 0 100% 100%-2" type="text" style="resourceText" name="resourceMetal"/>
</object>
<!-- Metal -->
<object size="270 0 360 100%" type="image" style="resourceCounter" tooltip="Metal" tooltip_style="sessionToolTipBold">
<object size="0 -4 40 36" type="image" style="resourceIcon" cell_id="3"/>
<object size="32 0 100% 100%-2" type="text" style="resourceText" name="resourceMetal"/>
</object>
<!-- Population -->
<object size="360 0 450 100%" type="image" style="resourceCounter" tooltip="Population (current / limit)" tooltip_style="sessionToolTipBold">
<object size="0 -4 40 34" type="image" style="resourceIcon" cell_id="4"/>
<object size="32 0 100% 100%-2" type="text" style="resourceText" name="resourcePop"/>
</object>
</object>
<!-- Population -->
<object size="360 0 450 100%" type="image" style="resourceCounter" tooltip="Population (current / limit)" tooltip_style="sessionToolTipBold">
<object size="0 -4 40 34" type="image" style="resourceIcon" cell_id="4"/>
<object size="32 0 100% 100%-2" type="text" style="resourceText" name="resourcePop"/>
</object>
</object>
<!-- ================================ ================================ -->
<!-- Civ Icon -->
<!-- ================================ ================================ -->
<object size="50%-48 -26 50%+48 70" name="civIcon" type="image"/>
<!-- ================================ ================================ -->
<!-- Civ Icon -->
<!-- ================================ ================================ -->
<object size="50%-48 -26 50%+48 70" name="civIcon" type="image"/>
<!-- ================================ ================================ -->
<!-- Phase -->
<!-- ================================ ================================ -->
<!--<object size="50%+50 4 50%+300 100%-2" name="PhaseTitleBar" type="text" font="serif-bold-stroke-14" textcolor="white"> Death Match :: Village Phase</object>-->
<!-- ================================ ================================ -->
<!-- Phase -->
<!-- ================================ ================================ -->
<!--<object size="50%+50 4 50%+300 100%-2" name="PhaseTitleBar" type="text" font="serif-bold-stroke-14" textcolor="white"> Death Match :: Village Phase</object>-->
<!-- ================================ ================================ -->
<!-- ALPHA LABELS (alpha, build time, revision) -->
<!-- ================================ ================================ -->
<!-- Displays Alpha name and number -->
<object size="70%-128 0 70%+128 100%" name="alphaLabel" type="text" style="CenteredLabelText" text_valign="top" ghost="true">
ALPHA VI : Fortuna
<!-- Displays build date and revision number-->
<object size="50%-128 0 50%+128 100%-2" name="buildTimeLabel" type="text" text_align="center" text_valign="bottom" font="serif-12" textcolor="white" ghost="true">
<action on="Load"><![CDATA[this.caption = buildTime(0) + " (" + buildTime(2) + ")";]]></action>
</object>
</object>
<!-- ================================ ================================ -->
<!-- Menu Button -->
<!-- ================================ ================================ -->
<object type="button"
name="menuButton"
size="100%-164 4 100%-8 32"
style="StoneButtonFancy"
tooltip_style="sessionToolTip"
z="50"
>
<!-- This object covers up the text on the menu
buttons as they slide by so that you don't see
them on top of the main menu button -->
<object size="0 -4 100% 0" type="image" sprite="horizontalThinBorder" ghost="true"/>
<object size="50%-32 50%-16 50%+32 50%+16" type="image" sprite="menuButton" ghost="true">MENU</object>
<action on="Press">
openMenu();
</action>
</object> <!-- END OF MENU BUTTON -->
</object> <!-- END OF TOP PANEL -->
<!-- ================================ ================================ -->
<!-- ALPHA LABELS (alpha, build time, revision) -->
<!-- Menu -->
<!-- ================================ ================================ -->
<object name="menuScreen"
type="image"
hidden="true"
size="0 0 100% 100%"
>
<!-- hides the menu when the mouse leaves the menu -->
<action on="MouseEnter">
closeMenu();
</action>
<!-- Displays Alpha name and number -->
<object size="70%-128 0 70%+128 100%" name="alphaLabel" type="text" style="CenteredLabelText" text_valign="top" ghost="true">
ALPHA VI : Fortuna
<object name="menu"
style="StonePanelThinBorder"
type="image"
size="100%-164 -128 100% 36"
>
<object size="4 36 100%-4 50%+20">
<!-- Displays build date and revision number-->
<object size="50%-128 0 50%+128 100%-2" name="buildTimeLabel" type="text" text_align="center" text_valign="bottom" font="serif-12" textcolor="white" ghost="true">
<action on="Load"><![CDATA[this.caption = buildTime(0) + " (" + buildTime(2) + ")";]]></action>
<!-- Settings button -->
<object type="button"
name="settingsButton"
style="StoneButtonFancy"
size="0 0 100% 28"
tooltip_style="sessionToolTip"
>
Settings
<action on="Press">
closeMenu();
openSettings();
</action>
</object>
<!-- Chat button -->
<object type="button"
name="chatButton"
style="StoneButtonFancy"
size="0 32 100% 60"
tooltip_style="sessionToolTip"
>
Chat
<action on="Press">
closeMenu();
openChat();
</action>
</object>
<!-- Pause Button -->
<object type="button"
name="pauseButton"
style="StoneButtonFancy"
size="0 64 100% 92"
tooltip_style="sessionToolTip"
>
<object name="pauseButtonText" type="text" style="CenteredButtonText" ghost="true">Pause</object>
<action on="Press">
closeMenu();
togglePause();
</action>
</object>
<!-- Exit button -->
<object type="button"
name="menuExitButton"
style="StoneButtonFancy"
size="0 96 100% 124"
tooltip_style="sessionToolTip"
>
Exit
<action on="Press">
closeMenu();
escapeKeyAction();
<![CDATA[
var btCaptions = ["Yes", "No"];
var btCode = [leaveGame, null];
messageBox(400, 200, "Are you sure you want to quit?", "Confirmation", 0, btCaptions, btCode);
]]>
</action>
</object>
</object>
</object>
</object>
</object>
<!-- ================================ ================================ -->
<!-- Menu Button -->
<!-- ================================ ================================ -->
<object type="button"
name="menuButton"
size="100%-164 4 100%-8 32"
style="StoneButtonFancy"
tooltip_style="sessionToolTip"
>
<object size="50%-32 50%-16 50%+32 50%+16" type="image" sprite="menuButton" name="menuButtonText" ghost="true">MENU</object>
<action on="Press">openMenu();</action>
</object> <!-- END OF MENU BUTTON -->
<!-- ================================ ================================ -->
<!-- Unit Selection Groups -->
<!-- ================================ ================================ -->
<object
name="unitGroupPanel"
size="0% 50%-216 0%+36 50%+144"
>
<repeat count="10">
<object name="unitGroupButton[n]" size="0 0 36 36" type="button" hidden="false" style="iconButton" tooltip_style="sessionToolTipBottomBold"
tooltip="Click to select grouped units.">
<object name="unitGroupIcon[n]" size="3 3 33 33" type="image" sprite="groupsIcon" ghost="true"/>
<object name="unitGroupLabel[n]" type="text" style="largeCenteredOutlinedText" ghost="true"/>
</object>
</repeat>
</object>
</object> <!-- END OF TOP PANEL -->
<!-- ================================ ================================ -->
<!-- START of BOTTOM PANEL -->
<!-- ================================ ================================ -->
<!-- ================================ ================================ -->
<!-- Unit Selection Groups -->
<!-- ================================ ================================ -->
<object
name="unitGroupPanel"
size="0% 50%-216 0%+36 50%+144"
>
<repeat count="10">
<object name="unitGroupButton[n]" size="0 0 36 36" type="button" hidden="false" style="iconButton" tooltip_style="sessionToolTipBottomBold"
tooltip="Click to select grouped units.">
<object name="unitGroupIcon[n]" size="3 3 33 33" type="image" sprite="groupsIcon" ghost="true"/>
<object name="unitGroupLabel[n]" type="text" style="largeCenteredOutlinedText" ghost="true"/>
</object>
</repeat>
</object>
<object size="50%-512 100%-180 50%+512 100%">
<!-- ================================ ================================ -->
<!-- START of BOTTOM PANEL -->
<!-- ================================ ================================ -->
<!-- ================================ ================================ -->
<!-- Minimap -->
<!-- ================================ ================================ -->
<object
name="minimapPanel"
size="0 100%-212 212 100%"
type="image"
sprite="mapPanel"
z="20"
>
<object name="minimap"
type="minimap"
size="14 14 100%-14 100%-14"
>
<action on="WorldClick">handleMinimapEvent(arguments[0]);</action>
</object>
<object size="50%-512 100%-180 50%+512 100%">
<object name="minimapOverlay" size="10 10 100%-10 100%-10" type="image" sprite="stretched:session/minimap_circle.png" ghost="true"/>
<!-- ================================ ================================ -->
<!-- Minimap -->
<!-- ================================ ================================ -->
<object
name="minimapPanel"
size="0 100%-212 212 100%"
type="image"
sprite="mapPanel"
z="20"
>
<object name="minimap"
type="minimap"
size="14 14 100%-14 100%-14"
>
<action on="WorldClick">handleMinimapEvent(arguments[0]);</action>
</object>
<!-- Idle Worker Button -->
<object type="image"
size="100%-36 4 100%-4 36"
>
<object type="button"
style="iconButton"
tooltip_style="sessionToolTip"
tooltip="Find idle worker"
hotkey="selection.idleworker"
>
<!-- TODO: should highlight the button if there's non-zero idle workers -->
<object size="0 0 100% 100%" type="image" sprite="idleWorker" ghost="true" />
<action on="Press">findIdleUnit(["Worker", "Trade", "CitizenSoldier"]);</action>
</object>
</object>
</object>
<object name="minimapOverlay" size="10 10 100%-10 100%-10" type="image" sprite="stretched:session/minimap_circle.png" ghost="true"/>
<!-- ================================ ================================ -->
<!-- Supplemental Details Panel on Left -->
<!-- ================================ ================================ -->
<object size="208 100%-170 50%-110 100%" name="supplementalSelectionDetails" type="image" sprite="bottomLeft" z="30">
<!-- Idle Worker Button -->
<object type="image"
size="100%-36 4 100%-4 36"
>
<object type="button"
style="iconButton"
tooltip_style="sessionToolTip"
tooltip="Find idle worker"
hotkey="selection.idleworker"
>
<!-- TODO: should highlight the button if there's non-zero idle workers -->
<object size="0 0 100% 100%" type="image" sprite="idleWorker" ghost="true" />
<action on="Press">findIdleUnit(["Worker", "Trade", "CitizenSoldier"]);</action>
</object>
</object>
</object>
<object name="unitFormationPanel"
size="24 12 100% 100%"
>
<object size="0 0 100% 100%">
<repeat count="16">
<object name="unitFormationButton[n]" hidden="true" style="iconButton" type="button" size="0 0 36 36" tooltip_style="sessionToolTipBottomBold" z="100">
<object name="unitFormationIcon[n]" type="image" style="formationIcon" ghost="true" size="3 3 33 33"/>
</object>
</repeat>
</object>
</object>
<!-- ================================ ================================ -->
<!-- Supplemental Details Panel on Left -->
<!-- ================================ ================================ -->
<object size="208 100%-170 50%-110 100%" name="supplementalSelectionDetails" type="image" sprite="bottomLeft" z="30">
<object name="unitGarrisonPanel"
size="24 12 100% 100%"
>
<object size="0 0 100% 100%">
<repeat count="16">
<object name="unitGarrisonButton[n]" hidden="true" style="iconButton" type="button" size="0 0 36 36" tooltip_style="sessionToolTipBottomBold" z="100">
<object name="unitGarrisonIcon[n]" type="image" ghost="true" size="3 3 33 33"/>
<object name="unitGarrisonCount[n]" ghost="true" style="groupIconsText" type="text" size="0 0 100% 100%"/>
</object>
</repeat>
</object>
</object>
<object name="unitFormationPanel"
size="24 12 100% 100%"
>
<object size="0 0 100% 100%">
<repeat count="16">
<object name="unitFormationButton[n]" hidden="true" style="iconButton" type="button" size="0 0 36 36" tooltip_style="sessionToolTipBottomBold" z="100">
<object name="unitFormationIcon[n]" type="image" style="formationIcon" ghost="true" size="3 3 33 33"/>
</object>
</repeat>
</object>
</object>
<!-- Stance Selection -->
<object name="unitStancePanel"
style="TranslucentPanel"
size="0 100%-43 100% 100%"
type="text"
>
<object size="5 3 100% 100%">
<repeat count="5">
<object name="unitStanceButton[n]" hidden="true" style="iconButton" type="button" size="0 0 36 36" tooltip_style="sessionToolTipBottomBold" z="100">
<object name="unitStanceIcon[n]" type="image" ghost="true" size="3 3 33 33"/>
</object>
</repeat>
</object>
</object>
</object>
<object name="unitGarrisonPanel"
size="24 12 100% 100%"
>
<object size="0 0 100% 100%">
<repeat count="16">
<object name="unitGarrisonButton[n]" hidden="true" style="iconButton" type="button" size="0 0 36 36" tooltip_style="sessionToolTipBottomBold" z="100">
<object name="unitGarrisonIcon[n]" type="image" ghost="true" size="3 3 33 33"/>
<object name="unitGarrisonCount[n]" ghost="true" style="groupIconsText" type="text" size="0 0 100% 100%"/>
</object>
</repeat>
</object>
</object>
<!-- ================================ ================================ -->
<!-- Details Panel -->
<!-- ================================ ================================ -->
<object name="selectionDetails"
type="image"
sprite="bottomMiddle"
size="50%-114 100%-205 50%+114 100%"
hidden="false"
>
<!-- Unit details for Single Unit -->
<object size="50%-112 0 50%+112 100%" name="detailsAreaSingle">
<!-- Stance Selection -->
<object name="unitStancePanel"
style="TranslucentPanel"
size="0 100%-43 100% 100%"
type="text"
>
<object size="5 3 100% 100%">
<repeat count="5">
<object name="unitStanceButton[n]" hidden="true" style="iconButton" type="button" size="0 0 36 36" tooltip_style="sessionToolTipBottomBold" z="100">
<object name="unitStanceIcon[n]" type="image" ghost="true" size="3 3 33 33"/>
</object>
</repeat>
</object>
</object>
</object>
<!-- Player Name -->
<object size="0 0 100% 40" name="player" type="text" style="largeCenteredOutlinedText" tooltip_style="sessionToolTipBold"/>
<!-- ================================ ================================ -->
<!-- Details Panel -->
<!-- ================================ ================================ -->
<object name="selectionDetails"
type="image"
sprite="bottomMiddle"
size="50%-114 100%-205 50%+114 100%"
hidden="false"
>
<!-- Unit details for Single Unit -->
<object size="50%-112 0 50%+112 100%" name="detailsAreaSingle">
<!-- Stats -->
<object size="8 36 50%-48 100%" name="statsArea" type="image">
<!-- Attack icon -->
<object hidden="true" size="0 0 48 48" type="image" name="attackIcon" sprite="snIconSheetStance" cell_id="1" tooltip_style="sessionToolTip"/>
<!-- Player Name -->
<object size="0 0 100% 40" name="player" type="text" style="largeCenteredOutlinedText" tooltip_style="sessionToolTipBold"/>
<!-- Armour icon "0 48 48 96"-->
<object size="0 0 48 48" type="image" name="armourIcon" sprite="snIconSheetStance" cell_id="3" tooltip_style="sessionToolTip"/>
<!-- Stats -->
<object size="8 36 50%-48 100%" name="statsArea" type="image">
<!-- Attack icon -->
<object hidden="true" size="0 0 48 48" type="image" name="attackIcon" sprite="snIconSheetStance" cell_id="1" tooltip_style="sessionToolTip"/>
<!-- Resource carrying icon/counter -->
<object size="0 40 48 88" type="image" name="resourceCarryingIcon" style="resourceIcon"/>
<object size="0 80 48 100" type="text" name="resourceCarryingText" style="statsText"/>
<!-- Armour icon "0 48 48 96"-->
<object size="0 0 48 48" type="image" name="armourIcon" sprite="snIconSheetStance" cell_id="3" tooltip_style="sessionToolTip"/>
</object>
<!-- Resource carrying icon/counter -->
<object size="0 40 48 88" type="image" name="resourceCarryingIcon" style="resourceIcon"/>
<object size="0 80 48 100" type="text" name="resourceCarryingText" style="statsText"/>
<!-- Big unit icon -->
<object size= "50%-48 40 50%+48 136" type="image" name="iconBorder" tooltip_style="sessionToolTip">
<object size="2 2 100%-2 100%-2" type="image" name="icon" ghost="true"/>
<object size="100%-20 4 100%-4 20" name="rankIcon" type="image" sprite="" ghost="true"/>
<object type="image" sprite="glassSquareIcon" ghost="true"/>
</object>
</object>
<!-- Stats Bars -->
<object size= "50%+48 40 100% 136" type="image" tooltip_style="sessionToolTip">
<!-- Health bar -->
<object size="18 0 30 100%" type="image" name="health" tooltip="Health" tooltip_style="sessionToolTip">
<object type="image" sprite="healthBackground" ghost="true"/>
<object type="image" sprite="healthForeground" ghost="true" name="healthBar"/>
<object type="image" sprite="statsBarShader" ghost="true"/>
</object>
<!-- Big unit icon -->
<object size= "50%-48 40 50%+48 136" type="image" name="iconBorder" tooltip_style="sessionToolTip">
<object size="2 2 100%-2 100%-2" type="image" name="icon" ghost="true"/>
<object size="100%-20 4 100%-4 20" name="rankIcon" type="image" sprite="" ghost="true"/>
<object type="image" sprite="glassSquareIcon" ghost="true"/>
</object>
<!-- Stamina bar -->
<object size="32 0 44 100%" type="image" name="stamina" tooltip="Stamina" tooltip_style="sessionToolTip">
<object type="image" sprite="staminaBackground" ghost="true"/>
<object type="image" sprite="staminaForeground" ghost="true" name="staminaBar"/>
<object type="image" sprite="statsBarShader" ghost="true"/>
</object>
<!-- Stats Bars -->
<object size= "50%+48 40 100% 136" type="image" tooltip_style="sessionToolTip">
<!-- Health bar -->
<object size="18 0 30 100%" type="image" name="health" tooltip="Health" tooltip_style="sessionToolTip">
<object type="image" sprite="healthBackground" ghost="true"/>
<object type="image" sprite="healthForeground" ghost="true" name="healthBar"/>
<object type="image" sprite="statsBarShader" ghost="true"/>
</object>
<!-- Resource bar -->
<object size="18 0 30 100%" type="image" name="resources" tooltip="Resources" tooltip_style="sessionToolTip">
<object type="image" sprite="resourceBackground" ghost="true"/>
<object type="image" sprite="resourceForeground" ghost="true" name="resourceBar"/>
<object type="image" sprite="statsBarShader" ghost="true"/>
</object>
<!-- Stamina bar -->
<object size="32 0 44 100%" type="image" name="stamina" tooltip="Stamina" tooltip_style="sessionToolTip">
<object type="image" sprite="staminaBackground" ghost="true"/>
<object type="image" sprite="staminaForeground" ghost="true" name="staminaBar"/>
<object type="image" sprite="statsBarShader" ghost="true"/>
</object>
<!-- Experience bar -->
<object size="46 0 58 100%" type="image" name="experience" tooltip="Experience" tooltip_style="sessionToolTip">
<object type="image" sprite="experienceBackground" ghost="true"/>
<object type="image" sprite="experienceForeground" ghost="true" name="experienceBar"/>
<object type="image" sprite="statsBarShader" ghost="true"/>
</object>
</object>
<!-- Resource bar -->
<object size="18 0 30 100%" type="image" name="resources" tooltip="Resources" tooltip_style="sessionToolTip">
<object type="image" sprite="resourceBackground" ghost="true"/>
<object type="image" sprite="resourceForeground" ghost="true" name="resourceBar"/>
<object type="image" sprite="statsBarShader" ghost="true"/>
</object>
<!-- Specific Name -->
<object size="0 142 100% 162" name="specific" type="text" style="largeCenteredOutlinedText" tooltip_style="sessionToolTipBold"/>
</object>
<!-- Experience bar -->
<object size="46 0 58 100%" type="image" name="experience" tooltip="Experience" tooltip_style="sessionToolTip">
<object type="image" sprite="experienceBackground" ghost="true"/>
<object type="image" sprite="experienceForeground" ghost="true" name="experienceBar"/>
<object type="image" sprite="statsBarShader" ghost="true"/>
</object>
</object>
<!-- Unit details for Multiple Units -->
<object size="50%-112 0 50%+112 100%" name="detailsAreaMultiple">
<!-- Specific Name -->
<object size="0 142 100% 162" name="specific" type="text" style="largeCenteredOutlinedText" tooltip_style="sessionToolTipBold"/>
</object>
<object name="unitSelectionPanel"
size="20 12 100%-20 100%"
>
<object size="0 0 100% 100%">
<repeat count="16">
<object name="unitSelectionButton[n]" hidden="true" style="iconButton" type="button" size="0 0 36 36" tooltip_style="sessionToolTipBold" z="100">
<object name="unitSelectionIcon[n]" type="image" ghost="true" size="3 3 33 33"/>
<object name="unitSelectionCount[n]" ghost="true" style="groupIconsText" type="text" size="0 0 100% 100%"/>
<object size="0 100%-3 100% 100%" name="unitSelectionHealth[n]" ghost="true">
</object>
</object>
</repeat>
</object>
</object>
<!-- Unit details for Multiple Units -->
<object size="50%-112 0 50%+112 100%" name="detailsAreaMultiple">
<!-- Total -->
<object size="100%-42 12 100%-8 46" type="image" sprite="groupsIcon">
<object size="0 0 100% 100%" type="text" style="largeCenteredOutlinedText" name="numberOfUnits"/>
</object>
<object name="unitSelectionPanel"
size="20 12 100%-20 100%"
>
<object size="0 0 100% 100%">
<repeat count="16">
<object name="unitSelectionButton[n]" hidden="true" style="iconButton" type="button" size="0 0 36 36" tooltip_style="sessionToolTipBold" z="100">
<object name="unitSelectionIcon[n]" type="image" ghost="true" size="3 3 33 33"/>
<object name="unitSelectionCount[n]" ghost="true" style="groupIconsText" type="text" size="0 0 100% 100%"/>
<object size="0 100%-3 100% 100%" name="unitSelectionHealth[n]" ghost="true">
</object>
</object>
</repeat>
</object>
</object>
<!-- Stats Bars -->
<object size= "100%-38 52 100%-18 100%-40" type="image" tooltip_style="sessionToolTip">
<!-- Health bar -->
<object size="0 0 12 100%" type="image" name="healthMultiple" tooltip="Hitpoints" tooltip_style="sessionToolTip">
<object type="image" sprite="healthBackground" ghost="true"/>
<object type="image" sprite="healthForeground" ghost="true" name="healthBarMultiple"/>
<object type="image" sprite="statsBarShader" ghost="true"/>
</object>
<!-- Total -->
<object size="100%-42 12 100%-8 46" type="image" sprite="groupsIcon">
<object size="0 0 100% 100%" type="text" style="largeCenteredOutlinedText" name="numberOfUnits"/>
</object>
<!-- Stamina bar -->
<object size="14 0 26 100%" type="image" name="staminaMultiple" tooltip="Stamina" tooltip_style="sessionToolTipBold">
<object type="image" sprite="staminaBackground" ghost="true"/>
<object type="image" sprite="staminaForeground" ghost="true" name="staminaBarMultiple"/>
<object type="image" sprite="statsBarShader" ghost="true"/>
</object>
</object>
<!-- Stats Bars -->
<object size= "100%-38 52 100%-18 100%-40" type="image" tooltip_style="sessionToolTip">
<!-- Health bar -->
<object size="0 0 12 100%" type="image" name="healthMultiple" tooltip="Hitpoints" tooltip_style="sessionToolTip">
<object type="image" sprite="healthBackground" ghost="true"/>
<object type="image" sprite="healthForeground" ghost="true" name="healthBarMultiple"/>
<object type="image" sprite="statsBarShader" ghost="true"/>
</object>
</object>
<!-- Stamina bar -->
<object size="14 0 26 100%" type="image" name="staminaMultiple" tooltip="Stamina" tooltip_style="sessionToolTipBold">
<object type="image" sprite="staminaBackground" ghost="true"/>
<object type="image" sprite="staminaForeground" ghost="true" name="staminaBarMultiple"/>
<object type="image" sprite="statsBarShader" ghost="true"/>
</object>
</object>
<!-- Unit Commands -->
<object name="unitCommandPanel"
size="0 100%-36 100% 100%-4"
type="image"
z="30"
>
<object size="0 0 100% 100%">
<repeat count="6">
<object name="unitCommandButton[n]" hidden="true" style="iconButton" type="button" size="0 0 32 32" tooltip_style="sessionToolTipBottomBold">
<object name="unitCommandIcon[n]" ghost="true" type="image" size="0 0 100% 100%" style="commandIcon"/>
<object name="unitCommandCount[n]" ghost="true" style="groupIconsText" type="text" size="0 0 100% 100%"/>
</object>
</repeat>
</object>
</object>
</object>
</object> <!-- END OF SELECTION DETAILS -->
<!-- Unit Commands -->
<object name="unitCommandPanel"
size="0 100%-36 100% 100%-4"
type="image"
z="30"
>
<object size="0 0 100% 100%">
<repeat count="6">
<object name="unitCommandButton[n]" hidden="true" style="iconButton" type="button" size="0 0 32 32" tooltip_style="sessionToolTipBottomBold">
<object name="unitCommandIcon[n]" ghost="true" type="image" size="0 0 100% 100%" style="commandIcon"/>
<object name="unitCommandCount[n]" ghost="true" style="groupIconsText" type="text" size="0 0 100% 100%"/>
</object>
</repeat>
</object>
</object>
<!-- ================================ ================================ -->
<!--Commands Panel -->
<!-- ================================ ================================ -->
<object name="unitCommands"
type="image"
sprite="bottomRight"
size="622 100%-170 100% 100%"
hidden="false"
>
<object name="unitConstructionPanel"
size="14 12 100% 100%"
>
<!--<object size="-2 -2 54 54" type="image" sprite="snIconSheetTab" tooltip_style="sessionToolTip"
cell_id="0" tooltip="Construction"/>-->
</object> <!-- END OF SELECTION DETAILS -->
<object size="0 0 100% 100%">
<repeat count="24">
<object name="unitConstructionButton[n]" hidden="true" style="iconButton" type="button" size="0 0 46 46" tooltip_style="sessionToolTipBottom">
<object name="unitConstructionIcon[n]" type="image" ghost="true" size="3 3 43 43"/>
</object>
</repeat>
</object>
</object>
<!-- ================================ ================================ -->
<!--Commands Panel -->
<!-- ================================ ================================ -->
<object name="unitCommands"
type="image"
sprite="bottomRight"
size="622 100%-170 100% 100%"
hidden="false"
>
<object name="unitConstructionPanel"
size="14 12 100% 100%"
>
<!--<object size="-2 -2 54 54" type="image" sprite="snIconSheetTab" tooltip_style="sessionToolTip"
cell_id="0" tooltip="Construction"/>-->
<object name="unitResearchPanel"
style="TranslucentPanelThinBorder"
size="0 100%-56 100% 100%"
type="text"
>
<object size="-5 -2 59 62" type="image" sprite="snIconSheetTab" tooltip_style="sessionToolTipBottom"
cell_id="1" tooltip="Research"/>
<object size="0 0 100% 100%">
<repeat count="24">
<object name="unitConstructionButton[n]" hidden="true" style="iconButton" type="button" size="0 0 46 46" tooltip_style="sessionToolTipBottom">
<object name="unitConstructionIcon[n]" type="image" ghost="true" size="3 3 43 43"/>
</object>
</repeat>
</object>
</object>
[research commands]
</object>
<object name="unitResearchPanel"
style="TranslucentPanelThinBorder"
size="0 100%-56 100% 100%"
type="text"
>
<object size="-5 -2 59 62" type="image" sprite="snIconSheetTab" tooltip_style="sessionToolTipBottom"
cell_id="1" tooltip="Research"/>
<object name="unitTrainingPanel"
size="14 12 100% 100%"
>
<!--<object size="-2 -2 54 54" type="image" sprite="snIconSheetTab" tooltip_style="sessionToolTip"
cell_id="2" tooltip="Training"/>-->
[research commands]
</object>
<object size="0 0 100% 100%">
<repeat count="24">
<object name="unitTrainingButton[n]" hidden="true" style="iconButton" type="button" size="0 0 46 46" tooltip_style="sessionToolTipBottom">
<object name="unitTrainingIcon[n]" type="image" ghost="true" size="3 3 43 43"/>
</object>
</repeat>
</object>
</object>
<object name="unitTrainingPanel"
size="14 12 100% 100%"
>
<!--<object size="-2 -2 54 54" type="image" sprite="snIconSheetTab" tooltip_style="sessionToolTip"
cell_id="2" tooltip="Training"/>-->
<object name="unitQueuePanel"
size="4 -56 100% 0"
type="image"
style="TranslucentPanelThinBorder"
>
<object size="-4 -2 52 54" type="image" sprite="snIconSheetTab" tooltip_style="sessionToolTipBottom" cell_id="3" tooltip="Production queue">
<object name="queueProgress" ghost="true" style="iconButtonProgress" type="text"/>
</object>
<object size="0 0 100% 100%">
<repeat count="24">
<object name="unitTrainingButton[n]" hidden="true" style="iconButton" type="button" size="0 0 46 46" tooltip_style="sessionToolTipBottom">
<object name="unitTrainingIcon[n]" type="image" ghost="true" size="3 3 43 43"/>
</object>
</repeat>
</object>
</object>
<object size="48 6 100% 100%">
<repeat count="16">
<object name="unitQueueButton[n]" hidden="true" style="iconButton" type="button" size="0 0 40 40" tooltip_style="sessionToolTipBottom">
<object name="unitQueueIcon[n]" ghost="true" type="image" size="3 3 37 37"/>
<object name="unitQueueProgressSlider[n]" type="image" sprite="queueProgressSlider" ghost="true" size="1 1 100%-1 100%-1" z="20"/>
<object name="unitQueueCount[n]" ghost="true" style="groupIconsText" type="text" z="20"/>
</object>
</repeat>
</object>
</object>
<object name="unitQueuePanel"
size="4 -56 100% 0"
type="image"
style="TranslucentPanelThinBorder"
>
<object size="-4 -2 52 54" type="image" sprite="snIconSheetTab" tooltip_style="sessionToolTipBottom" cell_id="3" tooltip="Production queue">
<object name="queueProgress" ghost="true" style="iconButtonProgress" type="text"/>
</object>
</object> <!-- END OF UNIT COMMANDS -->
<object size="48 6 100% 100%">
<repeat count="16">
<object name="unitQueueButton[n]" hidden="true" style="iconButton" type="button" size="0 0 40 40" tooltip_style="sessionToolTipBottom">
<object name="unitQueueIcon[n]" ghost="true" type="image" size="3 3 37 37"/>
<object name="unitQueueProgressSlider[n]" type="image" sprite="queueProgressSlider" ghost="true" size="1 1 100%-1 100%-1" z="20"/>
<object name="unitQueueCount[n]" ghost="true" style="groupIconsText" type="text" z="20"/>
</object>
</repeat>
</object>
</object>
</object> <!-- END OF UNIT COMMANDS -->
</object><!-- END OF BOTTOM PANEL -->
</object><!-- END OF BOTTOM PANEL -->
</object> <!-- END OF SN OBJECT -->

View File

@ -35,7 +35,7 @@
size="0 0 100% 100%"
/>
</sprite>
<sprite name="commands">
<image
texture="session/icons/sheets/commands.png"
@ -50,14 +50,22 @@
<sprite name="menuButton">
<image
texture="session/icons/single/menu.png"
size="0 0 100% 100%"
real_texture_placement="6 10 60 23"
size="6 10 60 23"
/>
</sprite>
<sprite name="horizontalThinBorder">
<image
texture="global/border/line_horiz.png"
texture_size="0 0 64 4"
/>
</sprite>
<!-- ================================ ================================ -->
<!-- Panel Backgrounds -->
<!-- ================================ ================================ -->
<!-- Generic Panel -->
<sprite name="genericPanel">
<image
@ -221,7 +229,7 @@
texture_size="0 0 4 4"
size="0 0 4 4"
/>
<!-- background -->
<image texture="session/panel_left.png"
real_texture_placement="0 0 189 170"
@ -232,7 +240,7 @@
<!-- Bottom Middle Panel -->
<sprite name="bottomMiddle">
<!-- background -->
<image texture="session/panel_middle.png"
real_texture_placement="0 0 228 205"
@ -315,7 +323,7 @@
texture_size="0 0 4 4"
size="0 0 4 4"
/>
<!-- background -->
<image texture="session/panel_right.png"
real_texture_placement="0 0 398 170"
@ -395,24 +403,24 @@
<!-- Starting with top left corner continuing in a clockwise manner -->
<image texture="global/border/top_marble.dds"
texture_size="0 0 128 16"
size="-5 0%-5 100%+5 27"
size="-5 0%-5 100%+5 27"
/>
<image texture="global/border/right_marble.dds"
texture_size="0 0 16 128"
size="100%-27 0 100%+5 100%"
size="100%-27 0 100%+5 100%"
/>
<image texture="global/border/bottom_marble.dds"
texture_size="0 0 128 16"
size="-5 100%-27 100%+5 100%+5"
size="-5 100%-27 100%+5 100%+5"
/>
<image texture="global/border/left_marble.dds"
texture_size="0 0 16 128"
size="0%-5 0 0%+27 100%"
size="0%-5 0 0%+27 100%"
/>
<!-- middle -->
<image texture="global/tile/sandstone.dds"
texture_size="0 0 128 128"
size="0 0 100% 100%"
size="0 0 100% 100%"
/>
</sprite>
@ -443,12 +451,12 @@
size="100%-3 0 100% 100%"
/>
</sprite>
<sprite name="insetWheatWindow">
<!-- middle -->
<image texture="global/tile/sandstone.dds"
texture_size="0 0 128 128"
size="15 15 100%-15 100%-15"
size="15 15 100%-15 100%-15"
/>
<!-- Sides -->
@ -472,7 +480,7 @@
<!-- corners -->
<image texture="global/border/corner_bronze.dds"
real_texture_placement="0 0 15 15"
size="0 0 16 16"
size="0 0 16 16"
/>
<image texture="global/border/corner_bronze.dds"
real_texture_placement="0 0 15 15"
@ -480,7 +488,7 @@
/>
<image texture="global/border/corner_bronze.dds"
real_texture_placement="0 0 15 15"
size="100%-16 100%-16 100% 100%"
size="100%-16 100%-16 100% 100%"
/>
<image texture="global/border/corner_bronze.dds"
real_texture_placement="0 0 15 15"
@ -491,32 +499,32 @@
<sprite name="titleBar">
<image texture="global/titlebar/left_gold_fern.dds"
real_texture_placement="0 0 64 30"
size="0%+0 0% 64 0%+30"
size="0%+0 0% 64 0%+30"
/>
<image texture="global/titlebar/middle_gold_fern.dds"
real_texture_placement="0 0 64 30"
size="64 0% 100%-64 0%+30"
size="64 0% 100%-64 0%+30"
/>
<image texture="global/titlebar/right_gold_fern.dds"
real_texture_placement="0 0 64 30"
size="100%-64 0% 100%+0 0%+30"
size="100%-64 0% 100%+0 0%+30"
/>
</sprite>
<!-- ================================ ================================ -->
<!-- Shading -->
<!-- ================================ ================================ -->
<!-- ================================ ================================ -->
<sprite name="glassSquareMap">
<image backcolor="255 255 255 56" size="0 0 100% 1"/>
<image backcolor="255 255 255 56" size="100%-1 1 100% 100%"/>
<image backcolor="255 255 255 56" size="0 100%-1 100% 100%"/>
<image backcolor="255 255 255 56" size="0 1 1 100%-1"/>
<image backcolor="255 255 255 44" size="1 1 100%-1 2"/>
<image backcolor="255 255 255 44" size="100%-2 2 100%-1 100%-1"/>
<image backcolor="255 255 255 44" size="1 100%-2 100%-1 100%-1"/>
<image backcolor="255 255 255 44" size="1 2 2 100%-2"/>
<image backcolor="255 255 255 32" size="2 2 100%-2 3"/>
<image backcolor="255 255 255 32" size="100%-3 3 100%-2 100%-2"/>
<image backcolor="255 255 255 32" size="2 100%-3 100%-2 100%-2"/>
@ -528,12 +536,12 @@
<image backcolor="255 255 255 44" size="100%-1 1 100% 100%"/>
<image backcolor="255 255 255 44" size="0 100%-1 100% 100%"/>
<image backcolor="255 255 255 128" size="0 1 1 100%-1"/>
<image backcolor="255 255 255 96" size="1 1 100%-1 2"/>
<image backcolor="255 255 255 32" size="100%-2 2 100%-1 100%-1"/>
<image backcolor="255 255 255 32" size="1 100%-2 100%-1 100%-1"/>
<image backcolor="255 255 255 96" size="1 2 2 100%-2"/>
<image backcolor="255 255 255 64" size="2 2 100%-2 3"/>
<image backcolor="255 255 255 16" size="100%-3 3 100%-2 100%-2"/>
<image backcolor="255 255 255 16" size="2 100%-3 100%-2 100%-2"/>
@ -545,12 +553,12 @@
<image backcolor="0 0 0 192" size="100%-1 1 100% 100%-1"/>
<image backcolor="0 0 0 192" size="0 100%-1 100% 100%"/>
<image backcolor="0 0 0 192" size="0 1 1 100%-1"/>
<image backcolor="0 0 0 128" size="0 1 100% 2"/>
<image backcolor="0 0 0 128" size="100%-2 2 100%-1 100%-2"/>
<image backcolor="0 0 0 128" size="0 100%-2 100% 100%-1"/>
<image backcolor="0 0 0 128" size="1 2 2 100%-2"/>
<image backcolor="0 0 0 64" size="0 2 100% 3"/>
<image backcolor="0 0 0 64" size="100%-3 3 100%-2 100%-3"/>
<image backcolor="0 0 0 64" size="0 100%-3 100% 100%-2"/>
@ -579,7 +587,7 @@
<sprite name="resourceForeground">
<image backcolor="255 165 0"/>
</sprite>
<sprite name="staminaBackground">
<image backcolor="black"/>
</sprite>
@ -587,7 +595,7 @@
<sprite name="staminaForeground">
<image backcolor="blue"/>
</sprite>
<sprite name="experienceBackground">
<image backcolor="darkgray"/>
</sprite>
@ -604,20 +612,20 @@
<image backcolor="255 255 255 192" size="100%-1 1 100% 100%-1"/>
<image backcolor="255 255 255 192" size="0 100%-1 100% 100%"/>
<image backcolor="255 255 255 192" size="0 1 1 100%-1"/>
<image backcolor="255 255 255 128" size="0 1 100% 2"/>
<image backcolor="255 255 255 128" size="100%-2 2 100%-1 100%-2"/>
<image backcolor="255 255 255 128" size="0 100%-2 100% 100%-1"/>
<image backcolor="255 255 255 128" size="1 2 2 100%-2"/>
<image backcolor="255 255 255 64" size="0 2 100% 3"/>
<image backcolor="255 255 255 64" size="100%-3 3 100%-2 100%-3"/>
<image backcolor="255 255 255 64" size="0 100%-3 100% 100%-2"/>
<image backcolor="255 255 255 64" size="2 3 3 100%-3"/>
<image backcolor="0 0 0 144" size="3 3 100%-3 100%-3"/>
</sprite>
<sprite name="chatInputHighlight">
<image backcolor="255 165 0 192" size="-2 1 100% 100%+1"/>
</sprite>
@ -635,7 +643,7 @@
<image backcolor="white" size="1 100%-2 100%-1 100%-1"/>
<image backcolor="white" size="1 1 2 100%-1"/>
</sprite>
<sprite name="devCommandsBackground">
<image backcolor="0 0 0 85"/>
</sprite>

View File

@ -13,7 +13,7 @@
<object type="image"
style="StonePanelLight"
size="25 35 100%-25 100%-25"
size="24 24 100%-24 100%-24"
>
<object style="StoneDialogTitleBar" type="text" size="50%-128 0%-16 50%+128 16">
Summary