This Trac instance is not used for development anymore!

We migrated our development workflow to git and Gitea.
To test the future redirection, replace trac by ariadne in the page URL.

Changeset 10146 for ps


Ignore:
Timestamp:
08/31/11 04:41:21 (13 years ago)
Author:
brian
Message:

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

Location:
ps/trunk/binaries/data/mods/public/gui
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • ps/trunk/binaries/data/mods/public/gui/aiconfig/aiconfig.xml

    r8998 r10146  
    66
    77    <!-- Add a translucent black background to fade out the menu page -->
    8     <object type="image" z="0" sprite="bkTranslucent"/>
     8    <object type="image" z="0" sprite="BackgroundTranslucent"/>
    99
    10     <object type="image" style="wheatWindow" size="50%-250 50%-100 50%+250 50%+100">
     10    <object type="image" style="StonePanelLight" size="50%-250 50%-100 50%+250 50%+100">
    1111
    12         <object style="wheatWindowTitleBar" type="text">AI configuration</object>
     12        <object style="StoneDialogTitleBar" type="text" size="50%-128 -16 50%+128 16">AI Configuration</object>
    1313
    14         <object type="button" style="wheatExit" tooltip_style="snToolTip">
     14        <object type="button" style="StoneExit" tooltip_style="snToolTip">
    1515            <action on="Press"><![CDATA[
    1616                Engine.PopGuiPage();
     
    1818        </object>
    1919
    20         <object size="25 10 100%-25 40">
    21             <object
    22                 type="text"
    23                 font="serif-bold-18"
    24                 text_align="right"
    25                 size="0 0 100 100%">
     20        <object size="50%-128 46 50%+128 66">
     21            <object type="text" style="RightLabelText" size="0 0 100 100%">
    2622                AI Player
    2723            </object>
    2824
    29             <object name="aiSelection" type="dropdown" style="wheatDropDown" size="110 0 310 30">
     25            <object name="aiSelection" type="dropdown" style="StoneDropDown" size="110 0 310 28">
    3026                <action on="SelectionChange">selectAI(this.selected);</action>
    3127            </object>
    3228        </object>
    3329
    34         <object size="25 50 100%-25 65%-5">
     30        <object size="50%-192 66 50%+192 100%-52">
    3531
    36             <object name="aiDescription" type="text" size="0 0 100% 100%"/>
     32            <object name="aiDescription" type="text" style="CenteredLabelText" size="0 0 100% 100%"/>
    3733
    3834            <!-- TODO: we might want to add things like difficulty controls into here -->
     
    4036        </object>
    4137
    42         <object type="button" style="wheatButton" size="100%-203 100%-33 100%-103 100%-3">
    43             OK
    44             <action on="Press"><![CDATA[
    45                 returnAI();
    46             ]]></action>
    47         </object>
    48 
    49         <object type="button" style="wheatButton" size="100%-103 100%-33 100%-3 100%-3">
     38        <object type="button" style="StoneButton" size="100%-280 100%-48 100%-154 100%-20">
    5039            Cancel
    5140            <action on="Press"><![CDATA[
     
    5443        </object>
    5544
     45        <object type="button" style="StoneButton" size="100%-146 100%-48 100%-20 100%-20">
     46                        OK
     47            <action on="Press"><![CDATA[
     48                returnAI();
     49            ]]></action>
     50        </object>
     51
    5652    </object>
    5753
  • ps/trunk/binaries/data/mods/public/gui/gamesetup/gamesetup.xml

    r10130 r10146  
    2424    </object>
    2525
    26     <object type="image" style="StonePanelLight" size="0 16 100% 100%" hidden="true" name="setupWindow">
     26    <object type="image" style="StonePanelLight" size="24 24 100%-24 100%-24" hidden="true" name="setupWindow">
    2727
    2828        <action on="Tick">
     
    3535
    3636        <!-- Map selection -->
    37         <object size="20 64 250 100%-20">
     37        <object size="20 64 300 100%-20">
    3838
    3939                        <object size="0 0 40% 100%">
     
    7777
    7878        <!-- Player assignments -->
    79         <object name="numPlayersBox" size="260 28 100% 30" hidden="true">
     79        <object name="numPlayersBox" size="320 28 100% 30" hidden="true">
    8080            <object name="numPlayersSelectionHeading" type="text" style="LeftLabelText" size="160 0 100% 32">Number of Players</object>
    8181            <object name="numPlayersSelection"
     
    8989        </object>
    9090
    91         <object size="260 64 100%-20 100%-260" type="image" sprite="BackgroundIndentFillDark">
     91        <object size="320 64 100%-20 100%-260" type="image" sprite="BackgroundIndentFillDark">
    9292            <object size="0 6 100% 30">
    9393                <object name="playerNameHeading" type="text" style="CenteredLabelText" size="100 0 250 100%">Player Name</object>
     
    128128
    129129        <!-- Options -->
    130         <object name="gameOptionsBox" size="260 100%-260 100% 100%-190">
     130        <object name="gameOptionsBox" size="320 100%-260 100% 100%-190">
    131131            <object size="2 2 100% 50%-2">  <!-- Top row -->
    132132                <object name="mapSizeText" size="0 0 175 100%" type="text" style="LeftLabelText">Map size:</object>
     
    145145
    146146        <!-- Chat window -->
    147         <object name="chatPanel" size="260 100%-190 100%-20 100%-58" type="image" sprite="BackgroundIndentFillDark">
     147        <object name="chatPanel" size="320 100%-190 100%-20 100%-64" type="image" sprite="BackgroundIndentFillDark">
    148148
    149149            <object name="chatText" size="3 1 100%-1 100%-25" type="text" style="chatPanel"/>
     
    161161
    162162
    163         <!-- Other things -->
     163                <!-- Tooltip -->
    164164        <object name="onscreenToolTip"
    165165            type="text"
     
    168168            sprite="BackgroundTranslucent"
    169169            hidden="true"
    170             size="260 100%-64 100%-310 100%-16"
     170            size="100%-656 100%-64 100%-304 100%-16"
    171171        >[Tooltip text]</object>
    172172
     173                <!-- Cancel Button -->
    173174        <object
    174175            name="cancelGame"
     
    185186        </object>
    186187
     188                <!-- Start Button -->
    187189        <object
    188190            name="startGame"
  • ps/trunk/binaries/data/mods/public/gui/page_aiconfig.xml

    r8865 r10146  
    44    <include>common/sprite1.xml</include>
    55    <include>common/styles.xml</include>
     6
     7<include>common/common_sprites.xml</include>
     8<include>common/common_styles.xml</include>
     9
    610    <include>aiconfig/aiconfig.xml</include>
    711</page>
  • ps/trunk/binaries/data/mods/public/gui/pregame/mainmenu.js

    r10122 r10146  
    8484function onTick()
    8585{
     86        // Animate backgrounds
    8687    scrollBackgrounds();
     88
     89        // Animate submenu
     90        updateMenuPosition();
    8791
    8892    if (Engine.IsUserReportEnabled())
     
    102106}
    103107
    104 // Sizes right border on main menu panel to match the submenu
    105 function blendSubmenuIntoMain(topPosition, bottomPosition)
    106 {
    107     var topSprite = getGUIObjectByName("MainMenuPanelRightBorderTop");
    108     topSprite.size = "100%-2 0 100% " + (topPosition + MARGIN);
    109     console.write(topSprite.size);
    110    
    111     var bottomSprite = getGUIObjectByName("MainMenuPanelRightBorderBottom");
    112     bottomSprite.size = "100%-2 " + (bottomPosition) + " 100% 100%";
    113 }
    114 
    115 // Update the submenu
    116 function updateSubmenu(newSubmenu, position, buttonHeight, numButtons)
     108
     109/*
     110 * MENU FUNCTIONS
     111 */
     112
     113// Slide menu
     114function updateMenuPosition()
     115{
     116        if (getGUIObjectByName("submenuScreen").hidden == false)
     117        {
     118                var submenu = getGUIObjectByName("submenu");
     119
     120                // The offset is the increment or number of units/pixels to move
     121                // the menu. An offset of one is always accurate, but it is too
     122                // slow. The offset must divide into the travel distance evenly
     123                // in order for the menu to end up at the right spot. The travel
     124                // distance is the max-initial. The travel distance in this
     125                // example is 300-60 = 240. We choose an offset of 5 because it
     126                // divides into 240 evenly and provided the speed we wanted.
     127                var OFFSET = 5;
     128
     129                if (submenu.size.left < getGUIObjectByName("mainMenu").size.right)
     130                {
     131                        submenu.size = (submenu.size.left + OFFSET) + " " + submenu.size.top + " " + (submenu.size.right + OFFSET) + " " + submenu.size.bottom;
     132                }
     133        }
     134}
     135
     136// Opens the menu by revealing the screen which contains the menu
     137function openMenu(newSubmenu, position, buttonHeight, numButtons)
    117138{
    118139        // remove old submenu
    119140        getGUIObjectByName(currentSubmenu).hidden = true;
    120        
     141
    121142        // switch to new submenu
    122143        currentSubmenu = newSubmenu;
     
    128149        var bottom = position + ((buttonHeight + MARGIN) * numButtons);
    129150        submenu.size = submenu.size.left + " " + top + " " + submenu.size.right + " " + bottom;
    130         submenu.hidden = false;
    131        
     151
    132152        // Blend in right border of main menu into the left border of the submenu
    133153        blendSubmenuIntoMain(top, bottom);
    134        
     154
    135155        // prepare to hide the submenu when the mouse moves off of the submenu
    136156        getGUIObjectByName("submenuScreen").hidden = false;
    137 }
    138 
    139 // Helper function that enables the dark background mask, then reveals a given subwindow object.
     157        getGUIObjectByName("secondarySubmenuScreen").hidden = false;
     158}
     159
     160// Closes the menu and resets position
     161function closeMenu()
     162{
     163        getGUIObjectByName("submenuScreen").hidden = true;
     164        getGUIObjectByName("secondarySubmenuScreen").hidden = true;
     165        getGUIObjectByName("submenu").size = getGUIObjectByName("mainMenu").size;
     166        getGUIObjectByName("MainMenuPanelRightBorderTop").size = "100%-2 0 100% 100%";
     167}
     168
     169// Sizes right border on main menu panel to match the submenu
     170function blendSubmenuIntoMain(topPosition, bottomPosition)
     171{
     172    var topSprite = getGUIObjectByName("MainMenuPanelRightBorderTop");
     173    topSprite.size = "100%-2 0 100% " + (topPosition + MARGIN);
     174
     175    var bottomSprite = getGUIObjectByName("MainMenuPanelRightBorderBottom");
     176    bottomSprite.size = "100%-2 " + (bottomPosition) + " 100% 100%";
     177}
     178
     179// Reveals submenu
    140180function openMainMenuSubWindow (windowName)
    141181{
     
    144184}
    145185
    146 // Helper function that disables the dark background mask, then hides a given subwindow object.
     186// Hides submenu
    147187function closeMainMenuSubWindow (windowName)
    148188{
     
    150190    guiHide(windowName);
    151191}
     192
     193
     194
     195/*
     196 * FUNCTIONS BELOW DO NOT WORK YET
     197 */
    152198
    153199// Switch to a given options tab window.
  • ps/trunk/binaries/data/mods/public/gui/pregame/mainmenu.xml

    r10130 r10146  
    147147        </object>
    148148
    149 
    150         <!--
    151         ==========================================
    152         - MAIN MENU PANEL
    153         ==========================================
    154         -->
    155         <object type="image"
    156             style="MainMenuPanel"
    157             size="60 -2 300 100%+2"
    158                 >
    159                         <!-- These are used to make the right side blend in with the submenu -->
    160                         <object name="MainMenuPanelRightBorderTop"
    161                                 type="image"
    162                                 sprite="MainMenuPanelRightBorder"
    163                                 ghost="true"
    164                                 size="100%-2 0 100% 100%"
    165                         />
    166                         <object name="MainMenuPanelRightBorderBottom"
    167                                 type="image"
    168                                 sprite="MainMenuPanelRightBorder"
    169                                 ghost="true"
    170                                 size="100%-2 0 100% 100%"
    171                         />
    172 
    173                         <object name="productLogo"
    174                                 type="image"
    175                                 sprite="productLogo"
    176                                 ghost="true"
    177                                 size="50%-110 30 50%+110 130"
    178                         />
    179 
    180                         <object name="mainMenuButtons"
    181                                 type="image"
    182                                 size="8 156 100%-8 356"
    183                                 ghost="false"
    184                         >
    185                                 <!-- Allows sliding the mouse over to submenu without it closing automatically -->
    186                                 <object
    187                                         type="image"
    188                                         size="100% 0 100%+8 100%"
    189                                         ghost="false"
    190                                 />
    191 
    192                                 <!-- LEARN TO PLAY BUTTON -->
    193                 <object name="menuLearnToPlayButton"
    194                                       type="button"
    195                                       style="StoneButtonFancy"
    196                                       size="4 4 100%-4 32"
    197                                       tooltip_style="pgToolTip"
    198                                       tooltip="The 0 A.D. Game Manual"
    199                 >
    200                                         Learn To Play
    201                                         <action on="Press">
    202                                                 getGUIObjectByName("submenu").hidden = true;
    203                                                 <![CDATA[
    204                                                         Engine.PushGuiPage("page_manual.xml", { "page": "intro" });
    205                                                 ]]>
    206                                         </action>
    207                                </object>
    208 
    209                                <!-- SINGLEPLAYER BUTTON -->
    210                                <object name="menuSinglePlayerButton"
    211                                        style="StoneButtonFancy"
    212                                        type="button"
    213                                        size="4 36 100%-4 64"
    214                                        tooltip_style="pgToolTip"
    215                                        tooltip="Challenge the computer player to a single player match."
    216                                 >
    217                                         Single Player
    218                                         <action on="Press">
    219                                                 <![CDATA[
    220                                                         updateSubmenu("submenuSinglePlayer", (this.parent.size.top+this.size.top), (this.size.bottom-this.size.top), 2);
    221                                                 ]]>
    222                                         </action>
    223                                 </object>
    224 
    225                                 <!-- MULTIPLAYER BUTTON -->
    226                                 <object name="menuMultiplayerButton"
    227                                         style="StoneButtonFancy"
    228                                         type="button"
    229                                         size="4 68 100%-4 96"
    230                                         tooltip_style="pgToolTip"
    231                                         tooltip="Fight against one or more human players in a multiplayer game."
    232                                 >
    233                                         Multiplayer
    234                                         <action on="Press">
    235                                             <![CDATA[
    236                                                     updateSubmenu("submenuMultiplayer", (this.parent.size.top+this.size.top), (this.size.bottom-this.size.top), 2);
    237                                             ]]>
    238                                         </action>
    239                                 </object>
    240 
    241                                 <!-- TOOLS AND OPTIONS BUTTON -->
    242                                 <object name="menuToolsAndOptionsButton"
    243                                         style="StoneButtonFancy"
    244                                         type="button"
    245                                         size="4 100 100%-4 128"
    246                                         tooltip_style="pgToolTip"
    247                                         tooltip="Game options and scenario design tools."
    248                                 >
    249                                         Tools <![CDATA[&]]> Options
    250                                         <action on="Press">
    251                                                 <![CDATA[
    252                                                         updateSubmenu("submenuToolsAndOptions", (this.parent.size.top+this.size.top), (this.size.bottom-this.size.top), 2);
    253                                                 ]]>
    254                                         </action>
    255                                 </object>
    256 
    257                                 <!-- HISTORY BUTTON -->
    258                                 <object name="menuHistoryButton"
    259                                         style="StoneButtonFancy"
    260                                         type="button"
    261                                         size="4 132 100%-4 160"
    262                                         tooltip_style="pgToolTip"
    263                                         tooltip="Learn about the six civilizations featured in 0 A.D."
    264                                 >
    265                                         History
    266                                         <action on="Press">
    267                                                 getGUIObjectByName("submenu").hidden = true;
    268                                                 <![CDATA[
    269                                                         Engine.PushGuiPage("page_civinfo.xml");
    270                                                 ]]>
    271                                         </action>
    272                                 </object>
    273 
    274                                 <!-- EXIT BUTTON -->
    275                                 <object name="menuExitButton"
    276                                         type="button"
    277                                         style="StoneButtonFancy"
    278                                         size="4 164 100%-4 192"
    279                                         tooltip_style="pgToolTip"
    280                                         tooltip="Exit Game"
    281                                 >
    282                                         Exit
    283                                         <action on="Press">
    284                                                 getGUIObjectByName("submenu").hidden = true;
    285                                                 <![CDATA[
    286                                                         var btCaptions = ["Yes", "No"];
    287                                                         var btCode = [exit, null];
    288                                                         messageBox(400, 200, "Are you sure you want to quit 0 A.D.?", "Confirmation", 0, btCaptions, btCode);
    289                                                 ]]>
    290                                         </action>
    291                                 </object>
    292                         </object>
    293 
    294             <!-- PRE-RELEASE INFO -->
    295             <object size="8 100%-340 100%-8 100%-100"
    296                 type="image"
    297                 style="TranslucentPanelThinBorder"
    298             >
    299 
    300                 <!-- PRE-RELEASE WARNING -->
    301                 <object
    302                     font="serif-14"
    303                     type="text"
    304                     textcolor="white"
    305                     size="8 8 100%-8 100%-36"
    306                                         ghost="true"
    307                 >
    308 [font="serif-bold-18"]Alpha Version[/font]
    309 
    310 WARNING: This is an early development version of the game. Many features have not been added yet.
    311 
    312 Get involved at: wildfiregames.com/0ad
    313                 </object>
    314 
    315                 <!-- CONTACT METHODS -->
    316                 <object type="button"
    317                     style="StoneButton"
    318                                         tooltip_style="pgToolTip"
    319                                         tooltip="Click to open wildfiregames.com/0ad in your web browser."
    320                     size="8 100%-36 50%-4 100%-8"
    321                 >
    322                     Website
    323                     <action on="Press"><![CDATA[
    324                         var url = "http://wildfiregames.com/0ad/";
    325                         Engine.OpenURL(url);
    326                         messageBox(400, 200, "Opening "+url+" in default web browser. Please wait...", "Opening page", 2);
    327                     ]]></action>
    328                 </object>
    329 
    330                 <object type="button"
    331                     style="StoneButton"
    332                                         tooltip_style="pgToolTip"
    333                                         tooltip="Click to chat in IRC. (#0ad at webchat.quakenet.org)"
    334                     size="50%+4 100%-36 100%-8 100%-8"
    335                 >
    336                     IRC
    337                     <action on="Press"><![CDATA[
    338                         var url = "http://webchat.quakenet.org/?channels=0ad";
    339                         Engine.OpenURL(url);
    340                         messageBox(400, 200, "Opening "+url+" in default web browser. Please wait...", "Opening page", 2);
    341                     ]]></action>
    342                 </object>
    343             </object>
    344 
    345             <!-- LOGO AND BUILD VERSION -->
    346             <object
    347                 size="4 100%-84 100%-4 100%-56"
    348                                 ghost="true"
    349             >
    350 
    351                 <!-- COMPANY LOGO -->
    352                 <object name="companyLogo"
    353                     type="image"
    354                     sprite="companyLogo"
    355                                         ghost="true"
    356                                         size="50%-16 0 50%+16 32"
    357                 />
    358 
    359                 <!-- COMPANY NAME -->
    360                 <object type="text"
    361                         style="SmallTitleText"
    362                                         ghost="true"
    363                                         size="50%-128 32 50%+128 48"
    364                 >WILDFIRE GAMES</object>
    365             </object>
    366 
    367                 <!-- VERSION -->
    368             <object name="versionNumber"
    369                 type="text"
    370                     style="SmallTitleText"
    371                     ghost="true"
    372                 size="50%-128 100%-36 50%+128 100%"
    373             >
    374                 <action on="Load"><![CDATA[
    375                     this.caption = "Build: " + buildTime(0) + " - " + buildTime(2);
    376                 ]]></action>
    377             </object>
    378 
    379                 </object>
    380 
    381 
    382149                <!--
    383150        ==========================================
     
    385152        ==========================================
    386153        -->
    387 
    388154                <object name="submenuScreen"
    389155            type="image"
     
    392158                        <!-- hides the submenu when the mouse leaves the mainMenuButtons or submenu -->
    393159                        <action on="MouseEnter">
    394                                 getGUIObjectByName("submenu").hidden = true;
    395                                 getGUIObjectByName("MainMenuPanelRightBorderTop").size = "100%-2 0 100% 100%";
     160                                closeMenu();
    396161            </action>
    397162
     
    400165                                type="image"
    401166                                style="SubmenuPanel"
    402                                 size="300 50%-100 536 50%+100"
     167                                size="60 50%-100 300 50%+100"
    403168                        >
    404169                                <!-- submenuSinglePlayer -->
     
    418183                                        >
    419184                                                Matches
    420                                                 <action on="Press"><![CDATA[
    421                                                         // Hide submenu
    422                                                         this.parent.parent.hidden = true;
    423                                                         // Open Session Setup window.
     185                                                <action on="Press">
     186                                                        closeMenu();
    424187                                                        Engine.PushGuiPage("page_gamesetup.xml", { type: "offline" });
    425                                                 ]]></action>
     188                                                </action>
    426189                                        </object>
    427190
     
    435198                                        >
    436199                                                Campaigns
    437                                                 <action on="Press"><![CDATA[
    438                                                         // Hide submenu
    439                                                         this.parent.parent.hidden = true;
    440                                                         // Open Campaigns window.
    441                                                         // NOT IMPLEMENTED YET
    442                                                 ]]></action>
     200                                                <action on="Press">
     201                                                        closeMenu();
     202                                                        <![CDATA[
     203                                                                // Open Campaigns window.
     204                                                                // NOT IMPLEMENTED YET
     205                                                        ]]>
     206                                                </action>
    443207                                        </object>
    444208                                </object>
     
    460224                                        >
    461225                                                Join Game
    462                                                 <action on="Press"><![CDATA[
    463                                                         // Hide submenu
    464                                                         this.parent.parent.hidden = true;
     226                                                <action on="Press">
     227                                                        closeMenu();
    465228                                                        // Open Multiplayer connection window with join option.
    466229                                                        Engine.PushGuiPage("page_gamesetup_mp.xml", "join");
    467                                                 ]]></action>
     230                                                </action>
    468231                                        </object>
    469232
     
    476239                                        >
    477240                                                Host Game
    478                                                 <action on="Press"><![CDATA[
    479                                                         // Hide submenu
    480                                                         this.parent.parent.hidden = true;
     241                                                <action on="Press">
     242                                                        closeMenu();
    481243                                                        // Open Multiplayer connection window with host option.
    482244                                                        Engine.PushGuiPage("page_gamesetup_mp.xml", "host");
    483                                                 ]]></action>
     245                                                </action>
    484246                                        </object>
    485247
     
    492254                                        tooltip_style="pgToolTip"
    493255                                        tooltip="The 0 A.D. Game Manual"
    494                                               hidden="true"
     256                                        hidden="true"
    495257                                >
    496258                                        <object name="submenuOptionsButton"
     
    503265                                        >
    504266                                                Options
    505                                                 <action on="Press"><![CDATA[
    506                                                         // Hide submenu
    507                                                         this.parent.parent.hidden = true;
    508                                                         // Open Options window.
    509                                                         Engine.PushGuiPage("page_options.xml");
    510                                                 ]]></action>
     267                                                <action on="Press">
     268                                                        closeMenu();
     269                                                        <![CDATA[
     270                                                                // Open Options window.
     271                                                                Engine.PushGuiPage("page_options.xml");
     272                                                        ]]>
     273                                                </action>
    511274                                        </object>
    512275
     
    519282                                        >
    520283                                                Scenario Editor
    521                                                 <action on="Press"><![CDATA[
    522                                                         // Hide submenu
    523                                                         this.parent.parent.hidden = true;
     284                                                <action on="Press">
     285                                                        closeMenu();
     286                                                        <![CDATA[
    524287                                                        // Start Atlas
    525                                                         if (Engine.AtlasIsAvailable())
    526                                                                 Engine.RestartInAtlas();
    527                                                         else
    528                                                                 messageBox(400, 200, "The scenario editor is not available or failed to load.", "Error", 2);
    529                                                 ]]></action>
     288                                                                if (Engine.AtlasIsAvailable())
     289                                                                        Engine.RestartInAtlas();
     290                                                                else
     291                                                                        messageBox(400, 200, "The scenario editor is not available or failed to load.", "Error", 2);
     292                                                        ]]>
     293                                                </action>
    530294                                        </object>
    531295                                </object>
    532296                        </object><!-- end of submenu -->
    533297                </object><!-- end of submenu screen -->
     298
     299
     300        <!--
     301        ==========================================
     302        - MAIN MENU PANEL
     303        ==========================================
     304        -->
     305        <object name="mainMenu"
     306                        type="image"
     307            style="MainMenuPanel"
     308            size="60 -2 300 100%+2"
     309                        z="50"
     310                >
     311                        <!-- These hides the submenu if you move the mouse over
     312                        the main menu panel. The regular submenu screen canot
     313                        handle this because it must be below the main menu panel
     314                        in order for the submenu to slide out from behind the
     315                        main menu panel. -->
     316                        <object name="secondarySubmenuScreen"
     317                                type="image"
     318                                hidden="true"
     319                                size="0 0 100% 100%"
     320                        >
     321                                <!-- hides the submenu when the mouse leaves the mainMenuButtons or submenu -->
     322                                <action on="MouseEnter">
     323                                        closeMenu();
     324                                </action>
     325                        </object>
     326
     327                        <!-- These are used to make the right side blend in with the submenu -->
     328                        <object name="MainMenuPanelRightBorderTop"
     329                                type="image"
     330                                sprite="MainMenuPanelRightBorder"
     331                                ghost="true"
     332                                size="100%-2 0 100% 100%"
     333                        />
     334                        <object name="MainMenuPanelRightBorderBottom"
     335                                type="image"
     336                                sprite="MainMenuPanelRightBorder"
     337                                ghost="true"
     338                                size="100%-2 0 100% 100%"
     339                        />
     340
     341                        <object name="productLogo"
     342                                type="image"
     343                                sprite="productLogo"
     344                                ghost="true"
     345                                size="50%-110 30 50%+110 130"
     346                        />
     347
     348                        <object name="mainMenuButtons"
     349                                type="image"
     350                                size="8 156 100%-8 356"
     351                                ghost="false"
     352                        >
     353                                <!-- Allows sliding the mouse over to the submenu.
     354                                Without this, the submenu will close automatically
     355                                when the mouse encounters the "secondarySubmenuScreen"
     356                                in the thin space between the main menu buttons
     357                                and the submenu buttons. -->
     358                                <object
     359                                        type="image"
     360                                        size="100% 0 100%+8 100%"
     361                                        ghost="false"
     362                                />
     363
     364                                <!-- LEARN TO PLAY BUTTON -->
     365                <object name="menuLearnToPlayButton"
     366                                      type="button"
     367                                      style="StoneButtonFancy"
     368                                      size="4 4 100%-4 32"
     369                                      tooltip_style="pgToolTip"
     370                                      tooltip="The 0 A.D. Game Manual"
     371                >
     372                                        Learn To Play
     373                                        <action on="Press">
     374                                                closeMenu();
     375                                                <![CDATA[
     376                                                        Engine.PushGuiPage("page_manual.xml", { "page": "intro" });
     377                                                ]]>
     378                                        </action>
     379                               </object>
     380
     381                               <!-- SINGLEPLAYER BUTTON -->
     382                               <object name="menuSinglePlayerButton"
     383                                       style="StoneButtonFancy"
     384                                       type="button"
     385                                       size="4 36 100%-4 64"
     386                                       tooltip_style="pgToolTip"
     387                                       tooltip="Challenge the computer player to a single player match."
     388                                >
     389                                        Single Player
     390                                        <action on="Press">
     391                                                closeMenu();
     392                                                openMenu("submenuSinglePlayer", (this.parent.size.top+this.size.top), (this.size.bottom-this.size.top), 2);
     393                                        </action>
     394                                </object>
     395
     396                                <!-- MULTIPLAYER BUTTON -->
     397                                <object name="menuMultiplayerButton"
     398                                        style="StoneButtonFancy"
     399                                        type="button"
     400                                        size="4 68 100%-4 96"
     401                                        tooltip_style="pgToolTip"
     402                                        tooltip="Fight against one or more human players in a multiplayer game."
     403                                >
     404                                        Multiplayer
     405                                        <action on="Press">
     406                                                closeMenu();
     407                                                openMenu("submenuMultiplayer", (this.parent.size.top+this.size.top), (this.size.bottom-this.size.top), 2);
     408                                        </action>
     409                                </object>
     410
     411                                <!-- TOOLS AND OPTIONS BUTTON -->
     412                                <object name="menuToolsAndOptionsButton"
     413                                        style="StoneButtonFancy"
     414                                        type="button"
     415                                        size="4 100 100%-4 128"
     416                                        tooltip_style="pgToolTip"
     417                                        tooltip="Game options and scenario design tools."
     418                                >
     419                                        Tools <![CDATA[&]]> Options
     420                                        <action on="Press">
     421                                                closeMenu();
     422                                                openMenu("submenuToolsAndOptions", (this.parent.size.top+this.size.top), (this.size.bottom-this.size.top), 2);
     423                                        </action>
     424                                </object>
     425
     426                                <!-- HISTORY BUTTON -->
     427                                <object name="menuHistoryButton"
     428                                        style="StoneButtonFancy"
     429                                        type="button"
     430                                        size="4 132 100%-4 160"
     431                                        tooltip_style="pgToolTip"
     432                                        tooltip="Learn about the six civilizations featured in 0 A.D."
     433                                >
     434                                        History
     435                                        <action on="Press">
     436                                                closeMenu();
     437                                                <![CDATA[
     438                                                        Engine.PushGuiPage("page_civinfo.xml");
     439                                                ]]>
     440                                        </action>
     441                                </object>
     442
     443                                <!-- EXIT BUTTON -->
     444                                <object name="menuExitButton"
     445                                        type="button"
     446                                        style="StoneButtonFancy"
     447                                        size="4 164 100%-4 192"
     448                                        tooltip_style="pgToolTip"
     449                                        tooltip="Exit Game"
     450                                >
     451                                        Exit
     452                                        <action on="Press">
     453                                                closeMenu();
     454                                                <![CDATA[
     455                                                        var btCaptions = ["Yes", "No"];
     456                                                        var btCode = [exit, null];
     457                                                        messageBox(400, 200, "Are you sure you want to quit 0 A.D.?", "Confirmation", 0, btCaptions, btCode);
     458                                                ]]>
     459                                        </action>
     460                                </object>
     461                        </object>
     462
     463            <!-- PRE-RELEASE INFO -->
     464            <object size="8 100%-340 100%-8 100%-100"
     465                type="image"
     466                style="TranslucentPanelThinBorder"
     467            >
     468
     469                <!-- PRE-RELEASE WARNING -->
     470                <object
     471                    font="serif-14"
     472                    type="text"
     473                    textcolor="white"
     474                    size="8 8 100%-8 100%-36"
     475                                        ghost="true"
     476                >
     477[font="serif-bold-18"]Alpha Version[/font]
     478
     479WARNING: This is an early development version of the game. Many features have not been added yet.
     480
     481Get involved at: wildfiregames.com/0ad
     482                </object>
     483
     484                <!-- CONTACT METHODS -->
     485                <object type="button"
     486                    style="StoneButton"
     487                                        tooltip_style="pgToolTip"
     488                                        tooltip="Click to open wildfiregames.com/0ad in your web browser."
     489                    size="8 100%-36 50%-4 100%-8"
     490                >
     491                    Website
     492                    <action on="Press"><![CDATA[
     493                        var url = "http://wildfiregames.com/0ad/";
     494                        Engine.OpenURL(url);
     495                        messageBox(400, 200, "Opening "+url+" in default web browser. Please wait...", "Opening page", 2);
     496                    ]]></action>
     497                </object>
     498
     499                <object type="button"
     500                    style="StoneButton"
     501                                        tooltip_style="pgToolTip"
     502                                        tooltip="Click to chat in IRC. (#0ad at webchat.quakenet.org)"
     503                    size="50%+4 100%-36 100%-8 100%-8"
     504                >
     505                    IRC
     506                    <action on="Press"><![CDATA[
     507                        var url = "http://webchat.quakenet.org/?channels=0ad";
     508                        Engine.OpenURL(url);
     509                        messageBox(400, 200, "Opening "+url+" in default web browser. Please wait...", "Opening page", 2);
     510                    ]]></action>
     511                </object>
     512            </object>
     513
     514            <!-- LOGO AND BUILD VERSION -->
     515            <object
     516                size="4 100%-84 100%-4 100%-56"
     517                                ghost="true"
     518            >
     519
     520                <!-- COMPANY LOGO -->
     521                <object name="companyLogo"
     522                    type="image"
     523                    sprite="companyLogo"
     524                                        ghost="true"
     525                                        size="50%-16 0 50%+16 32"
     526                />
     527
     528                <!-- COMPANY NAME -->
     529                <object type="text"
     530                        style="SmallTitleText"
     531                                        ghost="true"
     532                                        size="50%-128 32 50%+128 48"
     533                >WILDFIRE GAMES</object>
     534            </object>
     535
     536                <!-- VERSION -->
     537            <object name="versionNumber"
     538                type="text"
     539                    style="SmallTitleText"
     540                    ghost="true"
     541                size="50%-128 100%-36 50%+128 100%"
     542            >
     543                <action on="Load"><![CDATA[
     544                    this.caption = "Build: " + buildTime(0) + " - " + buildTime(2);
     545                ]]></action>
     546            </object>
     547
     548                </object>
     549
     550
     551
    534552
    535553
  • ps/trunk/binaries/data/mods/public/gui/session/menu.js

    r10114 r10146  
     1/*
     2 * MENU POSITION CONSTANTS
     3*/
     4
     5// Menu / panel border size
     6const MARGIN = 4;
     7
     8// Includes the main menu button
     9const NUM_BUTTONS = 5;
     10
     11// Regular menu buttons
     12const BUTTON_HEIGHT = 32;
     13
     14// The position where the bottom of the menu will end up (currently 164)
     15const END_MENU_POSITION = (BUTTON_HEIGHT * NUM_BUTTONS) + MARGIN;
     16
     17// Menu starting position - bottom
     18const MENU_BOTTOM  = 36;
     19
     20// Menu starting position - top
     21const MENU_TOP = MENU_BOTTOM - END_MENU_POSITION;
     22
     23// Menu starting position - overall
     24const INITIAL_MENU_POSITION = "100%-" + END_MENU_POSITION + " " + MENU_TOP + " 100% " + MENU_BOTTOM;
     25
     26
     27// Slide menu
     28function updateMenuPosition()
     29{
     30        if (getGUIObjectByName("menuScreen").hidden == false)
     31        {
     32                var menu = getGUIObjectByName("menu");
     33
     34                // The offset is the increment or number of units/pixels to move
     35                // the menu. An offset of one is always accurate, but it is too
     36                // slow. The offset must divide into the travel distance evenly
     37                // in order for the menu to end up at the right spot. The travel
     38                // distance is the max-initial. The travel distance in this
     39                // example is 164-36 = 128. We choose an offset of 8 because it
     40                // divides into 128 evenly and provided the speed we wanted.
     41                var OFFSET = 8;
     42
     43                if (menu.size.bottom < END_MENU_POSITION)
     44                {
     45                        menu.size = "100%-" + END_MENU_POSITION + " " + (menu.size.top + OFFSET) + " 100% " + (menu.size.bottom + OFFSET);
     46                }
     47        }
     48}
     49
     50// Opens the menu by revealing the screen which contains the menu
    151function openMenu()
    252{
    3     getGUIObjectByName("menuScreen").hidden = false;
    4     getGUIObjectByName("menu").hidden = false;
     53        getGUIObjectByName("menuScreen").hidden = false;
    554}
    655
     56// Closes the menu and resets position
    757function closeMenu()
    858{
    9     getGUIObjectByName("menuScreen").hidden = true;
    10     getGUIObjectByName("menu").hidden = true;
     59        getGUIObjectByName("menuScreen").hidden = true;
     60        getGUIObjectByName("menu").size = INITIAL_MENU_POSITION;
    1161}
    1262
     
    2979    getGUIObjectByName("chatInput").focus(); // Grant focus to the input area
    3080    getGUIObjectByName("chatDialogPanel").hidden = false;
    31    
     81
    3282}
    3383
     
    4191{
    4292        closeSettings();
    43    
     93
    4494    var chatWindow = getGUIObjectByName("chatDialogPanel");
    4595    var chatInput = getGUIObjectByName("chatInput");
     
    58108        closeChat();
    59109        closeSettings();
    60    
     110
    61111    var pauseOverlay = getGUIObjectByName("pauseOverlay");
    62112
  • ps/trunk/binaries/data/mods/public/gui/session/messages.js

    r9193 r10146  
    127127        addChatMessage({ "type": "message", "guid": message.guid, "text": message.text });
    128128        break;
    129        
     129
    130130    // To prevent errors, ignore these message types that occur during autostart
    131131    case "gamesetup":
     
    164164
    165165    input.blur(); // Remove focus
    166    
     166
    167167    toggleChatWindow();
    168168}
     
    184184
    185185    var message = escapeText(msg.text);
    186    
     186
    187187    var formatted;
    188188
  • ps/trunk/binaries/data/mods/public/gui/session/session.js

    r10140 r10146  
    6464    else // Needed for autostart loading option
    6565    {
    66         g_Players = getPlayerData(null); 
    67     }
    68    
     66        g_Players = getPlayerData(null);
     67    }
     68
    6969    // Cache civ data
    7070    g_CivData = loadCivData();
     
    7777        g_Selection.selected = hotloadData.selection;
    7878    }
    79     else 
     79    else
    8080    {
    8181        startMusic(g_CivData[g_Players[Engine.GetPlayerID()].civ].Music); // Starting for the first time:
     
    102102        profiler: Engine.GetProfilerState()
    103103    };
    104    
     104
    105105    Engine.SubmitUserReport("profile", 3, JSON.stringify(data));
    106106}
     
    130130            "playerId": Engine.GetPlayerID()
    131131        });
    132    
     132
    133133    }
    134134
    135135    stopMusic();
    136136    endGame();
    137    
    138     Engine.SwitchGuiPage("page_summary.xml", 
    139                             { "gameResult"  : gameResult, 
    140                               "timeElapsed" : extendedSimState.timeElapsed, 
    141                               "playerStates": extendedSimState.players 
     137
     138    Engine.SwitchGuiPage("page_summary.xml",
     139                            { "gameResult"  : gameResult,
     140                              "timeElapsed" : extendedSimState.timeElapsed,
     141                              "playerStates": extendedSimState.players
    142142                            });
    143143}
     
    174174    // Run timers
    175175    updateTimers();
     176
     177        // Animate menu
     178        updateMenuPosition();
    176179
    177180    // When training is blocked, flash population (alternates colour every 500msec)
     
    180183    else
    181184        getGUIObjectByName("resourcePop").textcolor = "white";
    182        
     185
    183186    // Clear renamed entities list
    184187    Engine.GuiInterfaceCall("ClearRenamedEntities", {});
     
    189192    var simState = Engine.GuiInterfaceCall("GetSimulationState");
    190193    var playerState = simState.players[Engine.GetPlayerID()];
    191    
     194
    192195    if (!g_GameEnded)
    193196    {
     
    202205            g_GameEnded = true;
    203206            switchMusic("win_1", 0.0);
    204            
     207
    205208            if (!getGUIObjectByName("devCommandsRevealMap").checked)
    206209                getGUIObjectByName("devCommandsRevealMap").checked = true;
    207            
     210
    208211            g_SessionDialog.open("Victory", "You have won the battle!\nDo you want to leave the game now?", null, 320, 160, leaveGame);
    209212        }
     
    216219    g_EntityStates = {};
    217220    g_TemplateData = {};
    218    
     221
    219222    var simState = Engine.GuiInterfaceCall("GetSimulationState");
    220223
     
    273276    conciseSimState.players = "<<<omitted>>>";
    274277    var text = "simulation: " + uneval(conciseSimState);
    275    
     278
    276279    var selection = g_Selection.toList();
    277280    if (selection.length)
     
    302305    getGUIObjectByName("resourceMetal").caption = playerState.resourceCounts.metal;
    303306    getGUIObjectByName("resourcePop").caption = playerState.popCount + "/" + playerState.popLimit;
    304    
     307
    305308    g_IsTrainingQueueBlocked = playerState.trainingQueueBlocked;
    306309}
  • ps/trunk/binaries/data/mods/public/gui/session/session.xml

    r10130 r10146  
    5353        <!-- Menu -->
    5454        <object hotkey="menu.toggle">
    55             <action on="Press">openMenuDialog();</action>
     55            <action on="Press">openMenu();</action>
    5656        </object>
    5757
     
    197197
    198198        <!-- ================================  ================================ -->
    199         <!-- Menu -->
    200         <!-- ================================  ================================ -->
    201                 <object name="menuScreen"
    202             type="image"
    203                         hidden="true"
    204                 >
    205                         <!-- hides the submenu when the mouse leaves the mainMenuButtons or submenu -->
    206                         <action on="MouseEnter">
    207                                 closeMenu();
    208             </action>
    209 
    210                         <object name="menu"
    211                                 style="StonePanelThinBorder"
    212                                 type="image"
    213                                 size="100%-164 0 100% 164"
    214                                 hidden="true"
    215                         >
    216                                 <object size="4 36 100%-4 50%+20">
    217 
    218                                         <!-- Settings button -->
    219                                         <object type="button"
    220                                                 name="settingsButton"
    221                                                 style="StoneButtonFancy"
    222                                                 size="0 0 100% 28"
    223                                                 tooltip_style="sessionToolTip"
    224                                         >
    225                                                 Settings
    226                                                 <action on="Press">
    227                                                         openSettings();
    228                                                 </action>
    229                                         </object>
    230 
    231                                         <!-- Chat button -->
    232                                         <object type="button"
    233                                                 name="chatButton"
    234                                                 style="StoneButtonFancy"
    235                                                 size="0 32 100% 60"
    236                                                 tooltip_style="sessionToolTip"
    237                                         >
    238                                                 Chat
    239                                                 <action on="Press">
    240                                                         openChat();
    241                                                 </action>
    242                                         </object>
    243 
    244                                         <!-- Pause Button -->
    245                                         <object type="button"
    246                                                 name="pauseButton"
    247                                                 style="StoneButtonFancy"
    248                                                 size="0 64 100% 92"
    249                                                 tooltip_style="sessionToolTip"
    250                                         >
    251                                                 <object name="pauseButtonText" type="text" style="CenteredButtonText" ghost="true">Pause</object>
    252                                                 <action on="Press">
    253                                                         togglePause();
    254                                                 </action>
    255                                         </object>
    256 
    257                                         <!-- Exit button -->
    258                                         <object type="button"
    259                                                 name="menuExitButton"
    260                                                 style="StoneButtonFancy"
    261                                                 size="0 96 100% 124"
    262                                                 tooltip_style="sessionToolTip"
    263                                         >
    264                                                 Exit
    265                                                 <action on="Press">escapeKeyAction();<![CDATA[
    266                                                         var btCaptions = ["Yes", "No"];
    267                                                         var btCode = [leaveGame, null];
    268                                                         messageBox(400, 200, "Are you sure you want to quit?", "Confirmation", 0, btCaptions, btCode);
    269                                                 ]]></action>
    270                                         </object>
    271                                 </object>
    272                         </object>
    273                 </object>
    274 
    275         <!-- ================================  ================================ -->
    276199        <!-- Settings Window -->
    277200        <!-- ================================  ================================ -->
     
    335258                </object>
    336259
    337     <!-- ================================  ================================ -->
    338     <!-- Top Panel  -->
    339     <!-- ================================  ================================ -->
    340     <object name="topPanel"
    341         type="image"
    342         sprite="topPanel"
    343         size="-3 0 100%+3 36"
    344     >
    345         <!-- ================================  ================================ -->
    346         <!-- Player resource bar -->
    347         <!-- ================================  ================================ -->
    348         <object
    349             size="10 0 45% 100%"
    350         >
    351             <!-- Food -->
    352             <object size="0 0 90 100%" type="image" style="resourceCounter" tooltip="Food" tooltip_style="sessionToolTipBold">
    353                 <object size="0 -4 40 36" type="image" style="resourceIcon" cell_id="0"/>
    354                 <object size="32 0 100% 100%-2" type="text" style="resourceText" name="resourceFood"/>
    355             </object>
    356 
    357             <!-- Wood -->
    358             <object size="90 0 180 100%" type="image" style="resourceCounter" tooltip="Wood" tooltip_style="sessionToolTipBold">
    359                 <object size="0 -4 40 36" type="image" style="resourceIcon" cell_id="1"/>
    360                 <object size="32 0 100% 100%-2" type="text" style="resourceText" name="resourceWood"/>
    361             </object>
    362 
    363             <!-- Stone -->
    364             <object size="180 0 270 100%" type="image" style="resourceCounter" tooltip="Stone" tooltip_style="sessionToolTipBold">
    365                 <object size="0 -4 40 36" type="image" style="resourceIcon" cell_id="2"/>
    366                 <object size="32 0 100% 100%-2" type="text" style="resourceText" name="resourceStone"/>
    367             </object>
    368 
    369             <!-- Metal -->
    370             <object size="270 0 360 100%"  type="image" style="resourceCounter" tooltip="Metal" tooltip_style="sessionToolTipBold">
    371                 <object size="0 -4 40 36" type="image" style="resourceIcon" cell_id="3"/>
    372                 <object size="32 0 100% 100%-2" type="text" style="resourceText" name="resourceMetal"/>
    373             </object>
    374 
    375             <!-- Population -->
    376             <object size="360 0 450 100%" type="image" style="resourceCounter" tooltip="Population (current / limit)" tooltip_style="sessionToolTipBold">
    377                 <object size="0 -4 40 34" type="image" style="resourceIcon" cell_id="4"/>
    378                 <object size="32 0 100% 100%-2" type="text" style="resourceText" name="resourcePop"/>
    379             </object>
    380         </object>
    381 
    382         <!-- ================================  ================================ -->
    383         <!-- Civ Icon -->
    384         <!-- ================================  ================================ -->
    385         <object size="50%-48 -26 50%+48 70" name="civIcon" type="image"/>
    386 
    387         <!-- ================================  ================================ -->
    388         <!-- Phase -->
    389         <!-- ================================  ================================ -->
    390         <!--<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>-->
    391 
    392 
    393260                <!-- ================================  ================================ -->
    394         <!-- ALPHA LABELS (alpha, build time, revision) -->
    395         <!-- ================================  ================================ -->
    396 
    397         <!-- Displays Alpha name and number -->
    398         <object size="70%-128 0 70%+128 100%" name="alphaLabel" type="text" style="CenteredLabelText" text_valign="top" ghost="true">
    399             ALPHA VI : Fortuna
    400 
    401                         <!-- Displays build date and revision number-->
    402                         <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">
    403                                 <action on="Load"><![CDATA[this.caption = buildTime(0) + " (" + buildTime(2) + ")";]]></action>
     261                <!-- Top Panel  -->
     262                <!-- ================================  ================================ -->
     263                <object name="topPanel"
     264                        type="image"
     265                        sprite="topPanel"
     266                        size="-3 0 100%+3 36"
     267                >
     268                        <!-- ================================  ================================ -->
     269                        <!-- Player resource bar -->
     270                        <!-- ================================  ================================ -->
     271                        <object
     272                                size="10 0 45% 100%"
     273                        >
     274                                <!-- Food -->
     275                                <object size="0 0 90 100%" type="image" style="resourceCounter" tooltip="Food" tooltip_style="sessionToolTipBold">
     276                                        <object size="0 -4 40 36" type="image" style="resourceIcon" cell_id="0"/>
     277                                        <object size="32 0 100% 100%-2" type="text" style="resourceText" name="resourceFood"/>
     278                                </object>
     279
     280                                <!-- Wood -->
     281                                <object size="90 0 180 100%" type="image" style="resourceCounter" tooltip="Wood" tooltip_style="sessionToolTipBold">
     282                                        <object size="0 -4 40 36" type="image" style="resourceIcon" cell_id="1"/>
     283                                        <object size="32 0 100% 100%-2" type="text" style="resourceText" name="resourceWood"/>
     284                                </object>
     285
     286                                <!-- Stone -->
     287                                <object size="180 0 270 100%" type="image" style="resourceCounter" tooltip="Stone" tooltip_style="sessionToolTipBold">
     288                                        <object size="0 -4 40 36" type="image" style="resourceIcon" cell_id="2"/>
     289                                        <object size="32 0 100% 100%-2" type="text" style="resourceText" name="resourceStone"/>
     290                                </object>
     291
     292                                <!-- Metal -->
     293                                <object size="270 0 360 100%"  type="image" style="resourceCounter" tooltip="Metal" tooltip_style="sessionToolTipBold">
     294                                        <object size="0 -4 40 36" type="image" style="resourceIcon" cell_id="3"/>
     295                                        <object size="32 0 100% 100%-2" type="text" style="resourceText" name="resourceMetal"/>
     296                                </object>
     297
     298                                <!-- Population -->
     299                                <object size="360 0 450 100%" type="image" style="resourceCounter" tooltip="Population (current / limit)" tooltip_style="sessionToolTipBold">
     300                                        <object size="0 -4 40 34" type="image" style="resourceIcon" cell_id="4"/>
     301                                        <object size="32 0 100% 100%-2" type="text" style="resourceText" name="resourcePop"/>
     302                                </object>
    404303                        </object>
    405         </object>
    406 
    407         <!-- ================================  ================================ -->
    408         <!-- Menu Button -->
    409         <!-- ================================  ================================ -->
    410         <object type="button"
    411             name="menuButton"
    412             size="100%-164 4 100%-8 32"
    413                         style="StoneButtonFancy"
    414             tooltip_style="sessionToolTip"
    415         >
    416                         <object size="50%-32 50%-16 50%+32 50%+16" type="image" sprite="menuButton" name="menuButtonText" ghost="true">MENU</object>
    417             <action on="Press">openMenu();</action>
    418         </object> <!-- END OF MENU BUTTON -->
    419 
    420     </object> <!-- END OF TOP PANEL -->
    421 
    422     <!-- ================================  ================================ -->
    423     <!-- Unit Selection Groups -->
    424     <!-- ================================  ================================ -->
    425     <object
    426         name="unitGroupPanel"
    427         size="0% 50%-216 0%+36 50%+144"
    428     >
    429         <repeat count="10">
    430             <object name="unitGroupButton[n]" size="0 0 36 36" type="button" hidden="false" style="iconButton" tooltip_style="sessionToolTipBottomBold"
    431                 tooltip="Click to select grouped units.">
    432                 <object name="unitGroupIcon[n]" size="3 3 33 33" type="image" sprite="groupsIcon" ghost="true"/>
    433                 <object name="unitGroupLabel[n]" type="text" style="largeCenteredOutlinedText" ghost="true"/>
    434             </object>
    435         </repeat>
    436     </object>
    437 
    438     <!-- ================================  ================================ -->
    439     <!-- START of BOTTOM PANEL -->
    440     <!-- ================================  ================================ -->
    441 
    442     <object size="50%-512 100%-180 50%+512 100%">
    443 
    444         <!-- ================================  ================================ -->
    445         <!-- Minimap -->
    446         <!-- ================================  ================================ -->
    447         <object
    448             name="minimapPanel"
    449             size="0 100%-212 212 100%"
     304
     305                        <!-- ================================  ================================ -->
     306                        <!-- Civ Icon -->
     307                        <!-- ================================  ================================ -->
     308                        <object size="50%-48 -26 50%+48 70" name="civIcon" type="image"/>
     309
     310                        <!-- ================================  ================================ -->
     311                        <!-- Phase -->
     312                        <!-- ================================  ================================ -->
     313                        <!--<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>-->
     314
     315
     316                        <!-- ================================  ================================ -->
     317                        <!-- ALPHA LABELS (alpha, build time, revision) -->
     318                        <!-- ================================  ================================ -->
     319
     320                        <!-- Displays Alpha name and number -->
     321                        <object size="70%-128 0 70%+128 100%" name="alphaLabel" type="text" style="CenteredLabelText" text_valign="top" ghost="true">
     322                                ALPHA VI : Fortuna
     323
     324                                <!-- Displays build date and revision number-->
     325                                <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">
     326                                        <action on="Load"><![CDATA[this.caption = buildTime(0) + " (" + buildTime(2) + ")";]]></action>
     327                                </object>
     328                        </object>
     329
     330                        <!-- ================================  ================================ -->
     331                        <!-- Menu Button -->
     332                        <!-- ================================  ================================ -->
     333                        <object type="button"
     334                                name="menuButton"
     335                                size="100%-164 4 100%-8 32"
     336                                style="StoneButtonFancy"
     337                                tooltip_style="sessionToolTip"
     338                                z="50"
     339                        >
     340                                <!-- This object covers up the text on the menu
     341                                buttons as they slide by so that you don't see
     342                                them on top of the main menu button -->
     343                                <object size="0 -4 100% 0" type="image" sprite="horizontalThinBorder" ghost="true"/>
     344
     345                                <object size="50%-32 50%-16 50%+32 50%+16" type="image" sprite="menuButton" ghost="true">MENU</object>
     346                                <action on="Press">
     347                                        openMenu();
     348                                </action>
     349                        </object> <!-- END OF MENU BUTTON -->
     350                </object> <!-- END OF TOP PANEL -->
     351
     352                <!-- ================================  ================================ -->
     353        <!-- Menu -->
     354        <!-- ================================  ================================ -->
     355                <object name="menuScreen"
    450356            type="image"
    451             sprite="mapPanel"
    452             z="20"
    453         >
    454             <object name="minimap"
    455                 type="minimap"
    456                 size="14 14 100%-14 100%-14"
    457             >
    458                 <action on="WorldClick">handleMinimapEvent(arguments[0]);</action>
    459             </object>
    460 
    461             <object name="minimapOverlay" size="10 10 100%-10 100%-10" type="image" sprite="stretched:session/minimap_circle.png" ghost="true"/>
    462 
    463             <!-- Idle Worker Button -->
    464             <object type="image"
    465                 size="100%-36 4 100%-4 36"
    466             >
    467                 <object type="button"
    468                     style="iconButton"
    469                     tooltip_style="sessionToolTip"
    470                     tooltip="Find idle worker"
    471                     hotkey="selection.idleworker"
    472                 >
    473                     <!-- TODO: should highlight the button if there's non-zero idle workers -->
    474                     <object size="0 0 100% 100%" type="image" sprite="idleWorker" ghost="true" />
    475                     <action on="Press">findIdleUnit(["Worker", "Trade", "CitizenSoldier"]);</action>
    476                 </object>
    477             </object>
    478         </object>
    479 
    480         <!-- ================================  ================================ -->
    481         <!-- Supplemental Details Panel on Left -->
    482         <!-- ================================  ================================ -->
    483         <object size="208 100%-170 50%-110 100%" name="supplementalSelectionDetails" type="image" sprite="bottomLeft" z="30">
    484 
    485             <object name="unitFormationPanel"
    486                 size="24 12 100% 100%"
    487             >
    488                 <object size="0 0 100% 100%">
    489                     <repeat count="16">
    490                         <object name="unitFormationButton[n]" hidden="true" style="iconButton" type="button" size="0 0 36 36" tooltip_style="sessionToolTipBottomBold" z="100">
    491                             <object name="unitFormationIcon[n]" type="image" style="formationIcon" ghost="true" size="3 3 33 33"/>
    492                         </object>
    493                     </repeat>
    494                 </object>
    495             </object>
    496 
    497             <object name="unitGarrisonPanel"
    498                 size="24 12 100% 100%"
    499             >
    500                 <object size="0 0 100% 100%">
    501                     <repeat count="16">
    502                         <object name="unitGarrisonButton[n]" hidden="true" style="iconButton" type="button" size="0 0 36 36" tooltip_style="sessionToolTipBottomBold" z="100">
    503                             <object name="unitGarrisonIcon[n]" type="image" ghost="true" size="3 3 33 33"/>
    504                             <object name="unitGarrisonCount[n]" ghost="true" style="groupIconsText" type="text" size="0 0 100% 100%"/>
    505                         </object>
    506                     </repeat>
    507                 </object>
    508             </object>
    509 
    510             <!-- Stance Selection -->
    511             <object name="unitStancePanel"
    512                 style="TranslucentPanel"
    513                 size="0 100%-43 100% 100%"
    514                 type="text"
    515             >
    516                 <object size="5 3 100% 100%">
    517                     <repeat count="5">
    518                         <object name="unitStanceButton[n]" hidden="true" style="iconButton" type="button" size="0 0 36 36" tooltip_style="sessionToolTipBottomBold" z="100">
    519                             <object name="unitStanceIcon[n]" type="image" ghost="true" size="3 3 33 33"/>
    520                         </object>
    521                     </repeat>
    522                 </object>
    523             </object>
    524         </object>
    525 
    526         <!-- ================================  ================================ -->
    527         <!-- Details Panel -->
    528         <!-- ================================  ================================ -->
    529         <object name="selectionDetails"
    530             type="image"
    531             sprite="bottomMiddle"
    532             size="50%-114 100%-205 50%+114 100%"
    533             hidden="false"
    534         >
    535             <!-- Unit details for Single Unit -->
    536             <object size="50%-112 0 50%+112 100%" name="detailsAreaSingle">
    537 
    538                 <!-- Player Name -->
    539                 <object size="0 0 100% 40" name="player" type="text" style="largeCenteredOutlinedText" tooltip_style="sessionToolTipBold"/>
    540 
    541                 <!-- Stats -->
    542                 <object size="8 36 50%-48 100%" name="statsArea" type="image">
    543                     <!-- Attack icon -->
    544                     <object hidden="true" size="0 0 48 48" type="image" name="attackIcon" sprite="snIconSheetStance" cell_id="1" tooltip_style="sessionToolTip"/>
    545 
    546                     <!-- Armour icon "0 48 48 96"-->
    547                     <object size="0 0 48 48" type="image" name="armourIcon" sprite="snIconSheetStance" cell_id="3" tooltip_style="sessionToolTip"/>
    548 
    549                     <!-- Resource carrying icon/counter -->
    550                     <object size="0 40 48 88" type="image" name="resourceCarryingIcon" style="resourceIcon"/>
    551                     <object size="0 80 48 100" type="text" name="resourceCarryingText" style="statsText"/>
    552 
    553                 </object>
    554 
    555                 <!-- Big unit icon -->
    556                 <object size= "50%-48 40 50%+48 136" type="image" name="iconBorder" tooltip_style="sessionToolTip">
    557                     <object size="2 2 100%-2 100%-2" type="image" name="icon" ghost="true"/>
    558                     <object size="100%-20 4 100%-4 20" name="rankIcon" type="image" sprite="" ghost="true"/>
    559                     <object type="image" sprite="glassSquareIcon" ghost="true"/>
    560                 </object>
    561 
    562                 <!-- Stats Bars -->
    563                 <object size= "50%+48 40 100% 136" type="image" tooltip_style="sessionToolTip">
    564                     <!-- Health bar -->
    565                     <object size="18 0 30 100%" type="image" name="health" tooltip="Health" tooltip_style="sessionToolTip">
    566                         <object type="image" sprite="healthBackground" ghost="true"/>
    567                         <object type="image" sprite="healthForeground" ghost="true" name="healthBar"/>
    568                         <object type="image" sprite="statsBarShader" ghost="true"/>
    569                     </object>
    570 
    571                     <!-- Stamina bar -->
    572                     <object size="32 0 44 100%" type="image" name="stamina" tooltip="Stamina" tooltip_style="sessionToolTip">
    573                         <object type="image" sprite="staminaBackground" ghost="true"/>
    574                         <object type="image" sprite="staminaForeground" ghost="true" name="staminaBar"/>
    575                         <object type="image" sprite="statsBarShader" ghost="true"/>
    576                     </object>
    577 
    578                     <!-- Resource bar -->
    579                     <object size="18 0 30 100%" type="image" name="resources" tooltip="Resources" tooltip_style="sessionToolTip">
    580                         <object type="image" sprite="resourceBackground" ghost="true"/>
    581                         <object type="image" sprite="resourceForeground" ghost="true" name="resourceBar"/>
    582                         <object type="image" sprite="statsBarShader" ghost="true"/>
    583                     </object>
    584 
    585                     <!-- Experience bar -->
    586                     <object size="46 0 58 100%" type="image" name="experience" tooltip="Experience" tooltip_style="sessionToolTip">
    587                         <object type="image" sprite="experienceBackground" ghost="true"/>
    588                         <object type="image" sprite="experienceForeground" ghost="true" name="experienceBar"/>
    589                         <object type="image" sprite="statsBarShader" ghost="true"/>
    590                     </object>
    591                 </object>
    592 
    593                 <!-- Specific Name -->
    594                 <object size="0 142 100% 162" name="specific" type="text" style="largeCenteredOutlinedText" tooltip_style="sessionToolTipBold"/>
    595             </object>
    596 
    597             <!-- Unit details for Multiple Units -->
    598             <object size="50%-112 0 50%+112 100%" name="detailsAreaMultiple">
    599 
    600                 <object name="unitSelectionPanel"
    601                     size="20 12 100%-20 100%"
    602                 >
    603                     <object size="0 0 100% 100%">
    604                         <repeat count="16">
    605                             <object name="unitSelectionButton[n]" hidden="true" style="iconButton" type="button" size="0 0 36 36" tooltip_style="sessionToolTipBold" z="100">
    606                                 <object name="unitSelectionIcon[n]" type="image" ghost="true" size="3 3 33 33"/>
    607                                 <object name="unitSelectionCount[n]" ghost="true" style="groupIconsText" type="text" size="0 0 100% 100%"/>
    608                                 <object size="0 100%-3 100% 100%" name="unitSelectionHealth[n]" ghost="true">
    609                                 </object>
    610                             </object>
    611                         </repeat>
    612                     </object>
    613                 </object>
    614 
    615                 <!-- Total -->
    616                 <object size="100%-42 12 100%-8 46" type="image" sprite="groupsIcon">
    617                     <object size="0 0 100% 100%" type="text" style="largeCenteredOutlinedText" name="numberOfUnits"/>
    618                 </object>
    619 
    620                 <!-- Stats Bars -->
    621                 <object size= "100%-38 52 100%-18 100%-40" type="image" tooltip_style="sessionToolTip">
    622                     <!-- Health bar -->
    623                     <object size="0 0 12 100%" type="image" name="healthMultiple" tooltip="Hitpoints" tooltip_style="sessionToolTip">
    624                         <object type="image" sprite="healthBackground" ghost="true"/>
    625                         <object type="image" sprite="healthForeground" ghost="true" name="healthBarMultiple"/>
    626                         <object type="image" sprite="statsBarShader" ghost="true"/>
    627                     </object>
    628 
    629                     <!-- Stamina bar -->
    630                     <object size="14 0 26 100%" type="image" name="staminaMultiple" tooltip="Stamina" tooltip_style="sessionToolTipBold">
    631                         <object type="image" sprite="staminaBackground" ghost="true"/>
    632                         <object type="image" sprite="staminaForeground" ghost="true" name="staminaBarMultiple"/>
    633                         <object type="image" sprite="statsBarShader" ghost="true"/>
    634                     </object>
    635                 </object>
    636 
    637             </object>
    638 
    639             <!-- Unit Commands -->
    640             <object name="unitCommandPanel"
    641                 size="0 100%-36 100% 100%-4"
    642                 type="image"
    643                 z="30"
    644             >
    645                 <object size="0 0 100% 100%">
    646                     <repeat count="6">
    647                         <object name="unitCommandButton[n]" hidden="true" style="iconButton" type="button" size="0 0 32 32" tooltip_style="sessionToolTipBottomBold">
    648                             <object name="unitCommandIcon[n]" ghost="true" type="image" size="0 0 100% 100%" style="commandIcon"/>
    649                             <object name="unitCommandCount[n]" ghost="true" style="groupIconsText" type="text" size="0 0 100% 100%"/>
    650                         </object>
    651                     </repeat>
    652                 </object>
    653             </object>
    654 
    655         </object> <!-- END OF SELECTION DETAILS -->
    656 
    657         <!-- ================================  ================================ -->
    658         <!--Commands Panel -->
    659         <!-- ================================  ================================ -->
    660         <object name="unitCommands"
    661             type="image"
    662             sprite="bottomRight"
    663             size="622 100%-170 100% 100%"
    664             hidden="false"
    665         >
    666             <object name="unitConstructionPanel"
    667                 size="14 12 100% 100%"
    668             >
    669                 <!--<object size="-2 -2 54 54" type="image" sprite="snIconSheetTab" tooltip_style="sessionToolTip"
    670                      cell_id="0" tooltip="Construction"/>-->
    671 
    672                 <object size="0 0 100% 100%">
    673                     <repeat count="24">
    674                         <object name="unitConstructionButton[n]" hidden="true" style="iconButton" type="button" size="0 0 46 46" tooltip_style="sessionToolTipBottom">
    675                             <object name="unitConstructionIcon[n]" type="image" ghost="true" size="3 3 43 43"/>
    676                         </object>
    677                     </repeat>
    678                 </object>
    679             </object>
    680 
    681             <object name="unitResearchPanel"
    682                 style="TranslucentPanelThinBorder"
    683                 size="0 100%-56 100% 100%"
    684                 type="text"
    685             >
    686                 <object size="-5 -2 59 62" type="image" sprite="snIconSheetTab" tooltip_style="sessionToolTipBottom"
    687                      cell_id="1" tooltip="Research"/>
    688 
    689                 [research commands]
    690             </object>
    691 
    692             <object name="unitTrainingPanel"
    693                 size="14 12 100% 100%"
    694             >
    695                 <!--<object size="-2 -2 54 54" type="image" sprite="snIconSheetTab" tooltip_style="sessionToolTip"
    696                      cell_id="2" tooltip="Training"/>-->
    697 
    698                 <object size="0 0 100% 100%">
    699                     <repeat count="24">
    700                         <object name="unitTrainingButton[n]" hidden="true" style="iconButton" type="button" size="0 0 46 46" tooltip_style="sessionToolTipBottom">
    701                             <object name="unitTrainingIcon[n]" type="image" ghost="true" size="3 3 43 43"/>
    702                         </object>
    703                     </repeat>
    704                 </object>
    705             </object>
    706 
    707             <object name="unitQueuePanel"
    708                 size="4 -56 100% 0"
    709                 type="image"
    710                 style="TranslucentPanelThinBorder"
    711             >
    712                 <object size="-4 -2 52 54" type="image" sprite="snIconSheetTab" tooltip_style="sessionToolTipBottom" cell_id="3" tooltip="Production queue">
    713                         <object name="queueProgress" ghost="true" style="iconButtonProgress" type="text"/>
    714                 </object>
    715 
    716                 <object size="48 6 100% 100%">
    717                     <repeat count="16">
    718                         <object name="unitQueueButton[n]" hidden="true" style="iconButton" type="button" size="0 0 40 40" tooltip_style="sessionToolTipBottom">
    719                             <object name="unitQueueIcon[n]" ghost="true" type="image" size="3 3 37 37"/>
    720                             <object name="unitQueueProgressSlider[n]" type="image" sprite="queueProgressSlider" ghost="true" size="1 1 100%-1 100%-1" z="20"/>
    721                             <object name="unitQueueCount[n]" ghost="true" style="groupIconsText" type="text" z="20"/>
    722                         </object>
    723                     </repeat>
    724                 </object>
    725             </object>
    726 
    727         </object> <!-- END OF UNIT COMMANDS -->
    728 
    729     </object><!-- END OF BOTTOM PANEL -->
     357                        hidden="true"
     358                        size="0 0 100% 100%"
     359                >
     360                        <!-- hides the menu when the mouse leaves the menu -->
     361                        <action on="MouseEnter">
     362                                closeMenu();
     363            </action>
     364
     365                        <object name="menu"
     366                                style="StonePanelThinBorder"
     367                                type="image"
     368                                size="100%-164 -128 100% 36"
     369                        >
     370                                <object size="4 36 100%-4 50%+20">
     371
     372                                        <!-- Settings button -->
     373                                        <object type="button"
     374                                                name="settingsButton"
     375                                                style="StoneButtonFancy"
     376                                                size="0 0 100% 28"
     377                                                tooltip_style="sessionToolTip"
     378                                        >
     379                                                Settings
     380                                                <action on="Press">
     381                                                        closeMenu();
     382                                                        openSettings();
     383                                                </action>
     384                                        </object>
     385
     386                                        <!-- Chat button -->
     387                                        <object type="button"
     388                                                name="chatButton"
     389                                                style="StoneButtonFancy"
     390                                                size="0 32 100% 60"
     391                                                tooltip_style="sessionToolTip"
     392                                        >
     393                                                Chat
     394                                                <action on="Press">
     395                                                        closeMenu();
     396                                                        openChat();
     397                                                </action>
     398                                        </object>
     399
     400                                        <!-- Pause Button -->
     401                                        <object type="button"
     402                                                name="pauseButton"
     403                                                style="StoneButtonFancy"
     404                                                size="0 64 100% 92"
     405                                                tooltip_style="sessionToolTip"
     406                                        >
     407                                                <object name="pauseButtonText" type="text" style="CenteredButtonText" ghost="true">Pause</object>
     408                                                <action on="Press">
     409                                                        closeMenu();
     410                                                        togglePause();
     411                                                </action>
     412                                        </object>
     413
     414                                        <!-- Exit button -->
     415                                        <object type="button"
     416                                                name="menuExitButton"
     417                                                style="StoneButtonFancy"
     418                                                size="0 96 100% 124"
     419                                                tooltip_style="sessionToolTip"
     420                                        >
     421                                                Exit
     422                                                <action on="Press">
     423                                                        closeMenu();
     424                                                        escapeKeyAction();
     425                                                        <![CDATA[
     426                                                                var btCaptions = ["Yes", "No"];
     427                                                                var btCode = [leaveGame, null];
     428                                                                messageBox(400, 200, "Are you sure you want to quit?", "Confirmation", 0, btCaptions, btCode);
     429                                                        ]]>
     430                                                </action>
     431                                        </object>
     432                                </object>
     433                        </object>
     434                </object>
     435
     436                <!-- ================================  ================================ -->
     437                <!-- Unit Selection Groups -->
     438                <!-- ================================  ================================ -->
     439                <object
     440                        name="unitGroupPanel"
     441                        size="0% 50%-216 0%+36 50%+144"
     442                >
     443                        <repeat count="10">
     444                                <object name="unitGroupButton[n]" size="0 0 36 36" type="button" hidden="false" style="iconButton" tooltip_style="sessionToolTipBottomBold"
     445                                        tooltip="Click to select grouped units.">
     446                                        <object name="unitGroupIcon[n]" size="3 3 33 33" type="image" sprite="groupsIcon" ghost="true"/>
     447                                        <object name="unitGroupLabel[n]" type="text" style="largeCenteredOutlinedText" ghost="true"/>
     448                                </object>
     449                        </repeat>
     450                </object>
     451
     452                <!-- ================================  ================================ -->
     453                <!-- START of BOTTOM PANEL -->
     454                <!-- ================================  ================================ -->
     455
     456                <object size="50%-512 100%-180 50%+512 100%">
     457
     458                        <!-- ================================  ================================ -->
     459                        <!-- Minimap -->
     460                        <!-- ================================  ================================ -->
     461                        <object
     462                                name="minimapPanel"
     463                                size="0 100%-212 212 100%"
     464                                type="image"
     465                                sprite="mapPanel"
     466                                z="20"
     467                        >
     468                                <object name="minimap"
     469                                        type="minimap"
     470                                        size="14 14 100%-14 100%-14"
     471                                >
     472                                        <action on="WorldClick">handleMinimapEvent(arguments[0]);</action>
     473                                </object>
     474
     475                                <object name="minimapOverlay" size="10 10 100%-10 100%-10" type="image" sprite="stretched:session/minimap_circle.png" ghost="true"/>
     476
     477                                <!-- Idle Worker Button -->
     478                                <object type="image"
     479                                        size="100%-36 4 100%-4 36"
     480                                >
     481                                        <object type="button"
     482                                                style="iconButton"
     483                                                tooltip_style="sessionToolTip"
     484                                                tooltip="Find idle worker"
     485                                                hotkey="selection.idleworker"
     486                                        >
     487                                                <!-- TODO: should highlight the button if there's non-zero idle workers -->
     488                                                <object size="0 0 100% 100%" type="image" sprite="idleWorker" ghost="true" />
     489                                                <action on="Press">findIdleUnit(["Worker", "Trade", "CitizenSoldier"]);</action>
     490                                        </object>
     491                                </object>
     492                        </object>
     493
     494                        <!-- ================================  ================================ -->
     495                        <!-- Supplemental Details Panel on Left -->
     496                        <!-- ================================  ================================ -->
     497                        <object size="208 100%-170 50%-110 100%" name="supplementalSelectionDetails" type="image" sprite="bottomLeft" z="30">
     498
     499                                <object name="unitFormationPanel"
     500                                        size="24 12 100% 100%"
     501                                >
     502                                        <object size="0 0 100% 100%">
     503                                                <repeat count="16">
     504                                                        <object name="unitFormationButton[n]" hidden="true" style="iconButton" type="button" size="0 0 36 36" tooltip_style="sessionToolTipBottomBold" z="100">
     505                                                                <object name="unitFormationIcon[n]" type="image" style="formationIcon" ghost="true" size="3 3 33 33"/>
     506                                                        </object>
     507                                                </repeat>
     508                                        </object>
     509                                </object>
     510
     511                                <object name="unitGarrisonPanel"
     512                                        size="24 12 100% 100%"
     513                                >
     514                                        <object size="0 0 100% 100%">
     515                                                <repeat count="16">
     516                                                        <object name="unitGarrisonButton[n]" hidden="true" style="iconButton" type="button" size="0 0 36 36" tooltip_style="sessionToolTipBottomBold" z="100">
     517                                                                <object name="unitGarrisonIcon[n]" type="image" ghost="true" size="3 3 33 33"/>
     518                                                                <object name="unitGarrisonCount[n]" ghost="true" style="groupIconsText" type="text" size="0 0 100% 100%"/>
     519                                                        </object>
     520                                                </repeat>
     521                                        </object>
     522                                </object>
     523
     524                                <!-- Stance Selection -->
     525                                <object name="unitStancePanel"
     526                                        style="TranslucentPanel"
     527                                        size="0 100%-43 100% 100%"
     528                                        type="text"
     529                                >
     530                                        <object size="5 3 100% 100%">
     531                                                <repeat count="5">
     532                                                        <object name="unitStanceButton[n]" hidden="true" style="iconButton" type="button" size="0 0 36 36" tooltip_style="sessionToolTipBottomBold" z="100">
     533                                                                <object name="unitStanceIcon[n]" type="image" ghost="true" size="3 3 33 33"/>
     534                                                        </object>
     535                                                </repeat>
     536                                        </object>
     537                                </object>
     538                        </object>
     539
     540                        <!-- ================================  ================================ -->
     541                        <!-- Details Panel -->
     542                        <!-- ================================  ================================ -->
     543                        <object name="selectionDetails"
     544                                type="image"
     545                                sprite="bottomMiddle"
     546                                size="50%-114 100%-205 50%+114 100%"
     547                                hidden="false"
     548                        >
     549                                <!-- Unit details for Single Unit -->
     550                                <object size="50%-112 0 50%+112 100%" name="detailsAreaSingle">
     551
     552                                        <!-- Player Name -->
     553                                        <object size="0 0 100% 40" name="player" type="text" style="largeCenteredOutlinedText" tooltip_style="sessionToolTipBold"/>
     554
     555                                        <!-- Stats -->
     556                                        <object size="8 36 50%-48 100%" name="statsArea" type="image">
     557                                                <!-- Attack icon -->
     558                                                <object hidden="true" size="0 0 48 48" type="image" name="attackIcon" sprite="snIconSheetStance" cell_id="1" tooltip_style="sessionToolTip"/>
     559
     560                                                <!-- Armour icon "0 48 48 96"-->
     561                                                <object size="0 0 48 48" type="image" name="armourIcon" sprite="snIconSheetStance" cell_id="3" tooltip_style="sessionToolTip"/>
     562
     563                                                <!-- Resource carrying icon/counter -->
     564                                                <object size="0 40 48 88" type="image" name="resourceCarryingIcon" style="resourceIcon"/>
     565                                                <object size="0 80 48 100" type="text" name="resourceCarryingText" style="statsText"/>
     566
     567                                        </object>
     568
     569                                        <!-- Big unit icon -->
     570                                        <object size= "50%-48 40 50%+48 136" type="image" name="iconBorder" tooltip_style="sessionToolTip">
     571                                                <object size="2 2 100%-2 100%-2" type="image" name="icon" ghost="true"/>
     572                                                <object size="100%-20 4 100%-4 20" name="rankIcon" type="image" sprite="" ghost="true"/>
     573                                                <object type="image" sprite="glassSquareIcon" ghost="true"/>
     574                                        </object>
     575
     576                                        <!-- Stats Bars -->
     577                                        <object size= "50%+48 40 100% 136" type="image" tooltip_style="sessionToolTip">
     578                                                <!-- Health bar -->
     579                                                <object size="18 0 30 100%" type="image" name="health" tooltip="Health" tooltip_style="sessionToolTip">
     580                                                        <object type="image" sprite="healthBackground" ghost="true"/>
     581                                                        <object type="image" sprite="healthForeground" ghost="true" name="healthBar"/>
     582                                                        <object type="image" sprite="statsBarShader" ghost="true"/>
     583                                                </object>
     584
     585                                                <!-- Stamina bar -->
     586                                                <object size="32 0 44 100%" type="image" name="stamina" tooltip="Stamina" tooltip_style="sessionToolTip">
     587                                                        <object type="image" sprite="staminaBackground" ghost="true"/>
     588                                                        <object type="image" sprite="staminaForeground" ghost="true" name="staminaBar"/>
     589                                                        <object type="image" sprite="statsBarShader" ghost="true"/>
     590                                                </object>
     591
     592                                                <!-- Resource bar -->
     593                                                <object size="18 0 30 100%" type="image" name="resources" tooltip="Resources" tooltip_style="sessionToolTip">
     594                                                        <object type="image" sprite="resourceBackground" ghost="true"/>
     595                                                        <object type="image" sprite="resourceForeground" ghost="true" name="resourceBar"/>
     596                                                        <object type="image" sprite="statsBarShader" ghost="true"/>
     597                                                </object>
     598
     599                                                <!-- Experience bar -->
     600                                                <object size="46 0 58 100%" type="image" name="experience" tooltip="Experience" tooltip_style="sessionToolTip">
     601                                                        <object type="image" sprite="experienceBackground" ghost="true"/>
     602                                                        <object type="image" sprite="experienceForeground" ghost="true" name="experienceBar"/>
     603                                                        <object type="image" sprite="statsBarShader" ghost="true"/>
     604                                                </object>
     605                                        </object>
     606
     607                                        <!-- Specific Name -->
     608                                        <object size="0 142 100% 162" name="specific" type="text" style="largeCenteredOutlinedText" tooltip_style="sessionToolTipBold"/>
     609                                </object>
     610
     611                                <!-- Unit details for Multiple Units -->
     612                                <object size="50%-112 0 50%+112 100%" name="detailsAreaMultiple">
     613
     614                                        <object name="unitSelectionPanel"
     615                                                size="20 12 100%-20 100%"
     616                                        >
     617                                                <object size="0 0 100% 100%">
     618                                                        <repeat count="16">
     619                                                                <object name="unitSelectionButton[n]" hidden="true" style="iconButton" type="button" size="0 0 36 36" tooltip_style="sessionToolTipBold" z="100">
     620                                                                        <object name="unitSelectionIcon[n]" type="image" ghost="true" size="3 3 33 33"/>
     621                                                                        <object name="unitSelectionCount[n]" ghost="true" style="groupIconsText" type="text" size="0 0 100% 100%"/>
     622                                                                        <object size="0 100%-3 100% 100%" name="unitSelectionHealth[n]" ghost="true">
     623                                                                        </object>
     624                                                                </object>
     625                                                        </repeat>
     626                                                </object>
     627                                        </object>
     628
     629                                        <!-- Total -->
     630                                        <object size="100%-42 12 100%-8 46" type="image" sprite="groupsIcon">
     631                                                <object size="0 0 100% 100%" type="text" style="largeCenteredOutlinedText" name="numberOfUnits"/>
     632                                        </object>
     633
     634                                        <!-- Stats Bars -->
     635                                        <object size= "100%-38 52 100%-18 100%-40" type="image" tooltip_style="sessionToolTip">
     636                                                <!-- Health bar -->
     637                                                <object size="0 0 12 100%" type="image" name="healthMultiple" tooltip="Hitpoints" tooltip_style="sessionToolTip">
     638                                                        <object type="image" sprite="healthBackground" ghost="true"/>
     639                                                        <object type="image" sprite="healthForeground" ghost="true" name="healthBarMultiple"/>
     640                                                        <object type="image" sprite="statsBarShader" ghost="true"/>
     641                                                </object>
     642
     643                                                <!-- Stamina bar -->
     644                                                <object size="14 0 26 100%" type="image" name="staminaMultiple" tooltip="Stamina" tooltip_style="sessionToolTipBold">
     645                                                        <object type="image" sprite="staminaBackground" ghost="true"/>
     646                                                        <object type="image" sprite="staminaForeground" ghost="true" name="staminaBarMultiple"/>
     647                                                        <object type="image" sprite="statsBarShader" ghost="true"/>
     648                                                </object>
     649                                        </object>
     650
     651                                </object>
     652
     653                                <!-- Unit Commands -->
     654                                <object name="unitCommandPanel"
     655                                        size="0 100%-36 100% 100%-4"
     656                                        type="image"
     657                                        z="30"
     658                                >
     659                                        <object size="0 0 100% 100%">
     660                                                <repeat count="6">
     661                                                        <object name="unitCommandButton[n]" hidden="true" style="iconButton" type="button" size="0 0 32 32" tooltip_style="sessionToolTipBottomBold">
     662                                                                <object name="unitCommandIcon[n]" ghost="true" type="image" size="0 0 100% 100%" style="commandIcon"/>
     663                                                                <object name="unitCommandCount[n]" ghost="true" style="groupIconsText" type="text" size="0 0 100% 100%"/>
     664                                                        </object>
     665                                                </repeat>
     666                                        </object>
     667                                </object>
     668
     669                        </object> <!-- END OF SELECTION DETAILS -->
     670
     671                        <!-- ================================  ================================ -->
     672                        <!--Commands Panel -->
     673                        <!-- ================================  ================================ -->
     674                        <object name="unitCommands"
     675                                type="image"
     676                                sprite="bottomRight"
     677                                size="622 100%-170 100% 100%"
     678                                hidden="false"
     679                        >
     680                                <object name="unitConstructionPanel"
     681                                        size="14 12 100% 100%"
     682                                >
     683                                        <!--<object size="-2 -2 54 54" type="image" sprite="snIconSheetTab" tooltip_style="sessionToolTip"
     684                                                 cell_id="0" tooltip="Construction"/>-->
     685
     686                                        <object size="0 0 100% 100%">
     687                                                <repeat count="24">
     688                                                        <object name="unitConstructionButton[n]" hidden="true" style="iconButton" type="button" size="0 0 46 46" tooltip_style="sessionToolTipBottom">
     689                                                                <object name="unitConstructionIcon[n]" type="image" ghost="true" size="3 3 43 43"/>
     690                                                        </object>
     691                                                </repeat>
     692                                        </object>
     693                                </object>
     694
     695                                <object name="unitResearchPanel"
     696                                        style="TranslucentPanelThinBorder"
     697                                        size="0 100%-56 100% 100%"
     698                                        type="text"
     699                                >
     700                                        <object size="-5 -2 59 62" type="image" sprite="snIconSheetTab" tooltip_style="sessionToolTipBottom"
     701                                                 cell_id="1" tooltip="Research"/>
     702
     703                                        [research commands]
     704                                </object>
     705
     706                                <object name="unitTrainingPanel"
     707                                        size="14 12 100% 100%"
     708                                >
     709                                        <!--<object size="-2 -2 54 54" type="image" sprite="snIconSheetTab" tooltip_style="sessionToolTip"
     710                                                 cell_id="2" tooltip="Training"/>-->
     711
     712                                        <object size="0 0 100% 100%">
     713                                                <repeat count="24">
     714                                                        <object name="unitTrainingButton[n]" hidden="true" style="iconButton" type="button" size="0 0 46 46" tooltip_style="sessionToolTipBottom">
     715                                                                <object name="unitTrainingIcon[n]" type="image" ghost="true" size="3 3 43 43"/>
     716                                                        </object>
     717                                                </repeat>
     718                                        </object>
     719                                </object>
     720
     721                                <object name="unitQueuePanel"
     722                                        size="4 -56 100% 0"
     723                                        type="image"
     724                                        style="TranslucentPanelThinBorder"
     725                                >
     726                                        <object size="-4 -2 52 54" type="image" sprite="snIconSheetTab" tooltip_style="sessionToolTipBottom" cell_id="3" tooltip="Production queue">
     727                                                        <object name="queueProgress" ghost="true" style="iconButtonProgress" type="text"/>
     728                                        </object>
     729
     730                                        <object size="48 6 100% 100%">
     731                                                <repeat count="16">
     732                                                        <object name="unitQueueButton[n]" hidden="true" style="iconButton" type="button" size="0 0 40 40" tooltip_style="sessionToolTipBottom">
     733                                                                <object name="unitQueueIcon[n]" ghost="true" type="image" size="3 3 37 37"/>
     734                                                                <object name="unitQueueProgressSlider[n]" type="image" sprite="queueProgressSlider" ghost="true" size="1 1 100%-1 100%-1" z="20"/>
     735                                                                <object name="unitQueueCount[n]" ghost="true" style="groupIconsText" type="text" z="20"/>
     736                                                        </object>
     737                                                </repeat>
     738                                        </object>
     739                                </object>
     740
     741                        </object> <!-- END OF UNIT COMMANDS -->
     742
     743                </object><!-- END OF BOTTOM PANEL -->
    730744
    731745    </object> <!-- END OF SN OBJECT -->
  • ps/trunk/binaries/data/mods/public/gui/session/sprites.xml

    r10115 r10146  
    3636        />
    3737    </sprite>
    38    
     38
    3939    <sprite name="commands">
    4040        <image
     
    5151        <image
    5252            texture="session/icons/single/menu.png"
    53             size="0 0 100% 100%"
     53                        real_texture_placement="6 10 60 23"
     54            size="6 10 60 23"
     55        />
     56    </sprite>
     57
     58        <sprite name="horizontalThinBorder">
     59        <image
     60            texture="global/border/line_horiz.png"
     61            texture_size="0 0 64 4"
    5462        />
    5563    </sprite>
     
    5866    <!-- Panel Backgrounds -->
    5967    <!-- ================================  ================================ -->
    60    
     68
    6169    <!-- Generic Panel -->
    6270    <sprite name="genericPanel">
     
    222230            size="0 0 4 4"
    223231        />
    224                
     232
    225233                <!-- background -->
    226234                <image  texture="session/panel_left.png"
     
    233241    <!-- Bottom Middle Panel -->
    234242    <sprite name="bottomMiddle">
    235            
     243
    236244                <!-- background -->
    237245        <image  texture="session/panel_middle.png"
     
    316324            size="0 0 4 4"
    317325        />
    318                
     326
    319327                <!-- background -->
    320328                <image  texture="session/panel_right.png"
     
    396404        <image  texture="global/border/top_marble.dds"
    397405            texture_size="0 0 128 16"
    398             size="-5 0%-5 100%+5 27" 
     406            size="-5 0%-5 100%+5 27"
    399407        />
    400408        <image  texture="global/border/right_marble.dds"
    401409            texture_size="0 0 16 128"
    402             size="100%-27 0 100%+5 100%" 
     410            size="100%-27 0 100%+5 100%"
    403411        />
    404412        <image  texture="global/border/bottom_marble.dds"
    405413            texture_size="0 0 128 16"
    406             size="-5 100%-27 100%+5 100%+5" 
     414            size="-5 100%-27 100%+5 100%+5"
    407415        />
    408416        <image  texture="global/border/left_marble.dds"
    409417            texture_size="0 0 16 128"
    410             size="0%-5 0 0%+27 100%" 
     418            size="0%-5 0 0%+27 100%"
    411419        />
    412420        <!-- middle -->
    413421        <image  texture="global/tile/sandstone.dds"
    414422            texture_size="0 0 128 128"
    415             size="0 0 100% 100%" 
     423            size="0 0 100% 100%"
    416424        />
    417425    </sprite>
     
    444452        />
    445453    </sprite>
    446    
     454
    447455    <sprite name="insetWheatWindow">
    448456        <!-- middle -->
    449457        <image  texture="global/tile/sandstone.dds"
    450458            texture_size="0 0 128 128"
    451             size="15 15 100%-15 100%-15" 
     459            size="15 15 100%-15 100%-15"
    452460        />
    453461
     
    473481        <image  texture="global/border/corner_bronze.dds"
    474482            real_texture_placement="0 0 15 15"
    475             size="0 0 16 16" 
     483            size="0 0 16 16"
    476484        />
    477485        <image  texture="global/border/corner_bronze.dds"
     
    481489        <image  texture="global/border/corner_bronze.dds"
    482490            real_texture_placement="0 0 15 15"
    483             size="100%-16 100%-16 100% 100%" 
     491            size="100%-16 100%-16 100% 100%"
    484492        />
    485493        <image  texture="global/border/corner_bronze.dds"
     
    492500        <image  texture="global/titlebar/left_gold_fern.dds"
    493501            real_texture_placement="0 0 64 30"
    494             size="0%+0 0% 64 0%+30" 
     502            size="0%+0 0% 64 0%+30"
    495503        />
    496504                <image  texture="global/titlebar/middle_gold_fern.dds"
    497505            real_texture_placement="0 0 64 30"
    498             size="64 0% 100%-64 0%+30" 
     506            size="64 0% 100%-64 0%+30"
    499507        />
    500508                <image  texture="global/titlebar/right_gold_fern.dds"
    501509            real_texture_placement="0 0 64 30"
    502             size="100%-64 0% 100%+0 0%+30" 
     510            size="100%-64 0% 100%+0 0%+30"
    503511        />
    504512    </sprite>
     
    506514    <!-- ================================  ================================ -->
    507515    <!-- Shading -->
    508     <!-- ================================  ================================ --> 
     516    <!-- ================================  ================================ -->
    509517    <sprite name="glassSquareMap">
    510518        <image backcolor="255 255 255 56" size="0 0 100% 1"/>
     
    512520        <image backcolor="255 255 255 56" size="0 100%-1 100% 100%"/>
    513521        <image backcolor="255 255 255 56" size="0 1 1 100%-1"/>
    514        
     522
    515523        <image backcolor="255 255 255 44" size="1 1 100%-1 2"/>
    516524        <image backcolor="255 255 255 44" size="100%-2 2 100%-1 100%-1"/>
    517525        <image backcolor="255 255 255 44" size="1 100%-2 100%-1 100%-1"/>
    518526        <image backcolor="255 255 255 44" size="1 2 2 100%-2"/>
    519        
     527
    520528        <image backcolor="255 255 255 32" size="2 2 100%-2 3"/>
    521529        <image backcolor="255 255 255 32" size="100%-3 3 100%-2 100%-2"/>
     
    529537        <image backcolor="255 255 255 44" size="0 100%-1 100% 100%"/>
    530538        <image backcolor="255 255 255 128" size="0 1 1 100%-1"/>
    531        
     539
    532540        <image backcolor="255 255 255 96" size="1 1 100%-1 2"/>
    533541        <image backcolor="255 255 255 32" size="100%-2 2 100%-1 100%-1"/>
    534542        <image backcolor="255 255 255 32" size="1 100%-2 100%-1 100%-1"/>
    535543        <image backcolor="255 255 255 96" size="1 2 2 100%-2"/>
    536        
     544
    537545        <image backcolor="255 255 255 64" size="2 2 100%-2 3"/>
    538546        <image backcolor="255 255 255 16" size="100%-3 3 100%-2 100%-2"/>
     
    546554        <image backcolor="0 0 0 192" size="0 100%-1 100% 100%"/>
    547555        <image backcolor="0 0 0 192" size="0 1 1 100%-1"/>
    548        
     556
    549557        <image backcolor="0 0 0 128" size="0 1 100% 2"/>
    550558        <image backcolor="0 0 0 128" size="100%-2 2 100%-1 100%-2"/>
    551559        <image backcolor="0 0 0 128" size="0 100%-2 100% 100%-1"/>
    552560        <image backcolor="0 0 0 128" size="1 2 2 100%-2"/>
    553        
     561
    554562        <image backcolor="0 0 0 64" size="0 2 100% 3"/>
    555563        <image backcolor="0 0 0 64" size="100%-3 3 100%-2 100%-3"/>
     
    580588        <image backcolor="255 165 0"/>
    581589    </sprite>
    582    
     590
    583591    <sprite name="staminaBackground">
    584592        <image backcolor="black"/>
     
    588596        <image backcolor="blue"/>
    589597    </sprite>
    590    
     598
    591599    <sprite name="experienceBackground">
    592600        <image backcolor="darkgray"/>
     
    605613        <image backcolor="255 255 255 192" size="0 100%-1 100% 100%"/>
    606614        <image backcolor="255 255 255 192" size="0 1 1 100%-1"/>
    607        
     615
    608616        <image backcolor="255 255 255 128" size="0 1 100% 2"/>
    609617        <image backcolor="255 255 255 128" size="100%-2 2 100%-1 100%-2"/>
    610618        <image backcolor="255 255 255 128" size="0 100%-2 100% 100%-1"/>
    611619        <image backcolor="255 255 255 128" size="1 2 2 100%-2"/>
    612        
     620
    613621        <image backcolor="255 255 255 64" size="0 2 100% 3"/>
    614622        <image backcolor="255 255 255 64" size="100%-3 3 100%-2 100%-3"/>
    615623        <image backcolor="255 255 255 64" size="0 100%-3 100% 100%-2"/>
    616624        <image backcolor="255 255 255 64" size="2 3 3 100%-3"/>
    617        
     625
    618626        <image backcolor="0 0 0 144" size="3 3 100%-3 100%-3"/>
    619627    </sprite>
    620    
     628
    621629    <sprite name="chatInputHighlight">
    622630        <image backcolor="255 165 0 192" size="-2 1 100% 100%+1"/>
     
    636644        <image backcolor="white" size="1 1 2 100%-1"/>
    637645    </sprite>
    638    
     646
    639647    <sprite name="devCommandsBackground">
    640648        <image backcolor="0 0 0 85"/>
  • ps/trunk/binaries/data/mods/public/gui/summary/summary.xml

    r10130 r10146  
    1414        <object type="image"
    1515            style="StonePanelLight"
    16             size="25 35 100%-25 100%-25"
     16            size="24 24 100%-24 100%-24"
    1717        >
    1818            <object style="StoneDialogTitleBar" type="text" size="50%-128 0%-16 50%+128 16">
Note: See TracChangeset for help on using the changeset viewer.