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 10155 for ps


Ignore:
Timestamp:
09/01/11 04:36:38 (13 years ago)
Author:
brian
Message:

Menu: removed autohiding, doubled speed, added sound effects. GUI art: changed gold titlebar back to bronze, made progressbar consistent with titlebar. Repositioned start game button.

Location:
ps/trunk/binaries/data/mods/public
Files:
19 edited

Legend:

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

    r10122 r10155  
    88    ==========================================
    99    -->
    10        
     10
    1111    <sprite name="productLogo">
    1212        <image  texture="pregame/shell/logo/0ad_logo.png"
     
    1515        />
    1616    </sprite>
    17        
     17
    1818    <sprite name="companyLogo">
    1919        <image  texture="pregame/shell/logo/wfg_logo_white.png"
     
    6666        <!-- Top border -->
    6767        <image  backcolor="60 60 40"
    68             size="0 0 100%-1 1" 
     68            size="0 0 100%-1 1"
    6969        />
    7070        <!-- Right border -->
     
    7878        <!-- Left border -->
    7979        <image  backcolor="60 60 40"
    80             size="0 0 1 100%-1" 
     80            size="0 0 1 100%-1"
    8181        />
    8282        <!-- middle -->
     
    118118            size="0 0 2 100%"
    119119        />-->
    120                
     120
    121121                <!-- top -->
    122122        <image  backcolor="230 190 80"
    123123            size="2 0 100%-2 2"
    124124        />
    125                
     125
    126126                <!-- bottom -->
    127127        <image  backcolor="230 190 80"
    128128            size="2 100%-2 100%-2 100%"
    129129        />
    130                
     130
    131131                <!-- left -->
    132132        <image  backcolor="230 190 80"
     
    134134        />
    135135    </sprite>
    136        
     136
    137137        <!-- MainMenuPanelRightBorder -->
    138138        <sprite name="MainMenuPanelRightBorder">
     
    142142        />
    143143        </sprite>
    144        
     144
    145145    <!-- SubmenuPanel -->
    146146    <sprite name="SubmenuPanel">
     
    217217            real_texture_placement="0 0 312 312"
    218218            texture_size="0 0 256 256"
    219             size="4 4 100%-4 100%-4" 
     219            size="4 4 100%-4 100%-4"
    220220        />
    221221
     
    263263        <image  texture="global/tile/stone_background.png"
    264264            texture_size="0 0 512 512"
    265             size="4 4 100%-4 100%-4" 
     265            size="4 4 100%-4 100%-4"
    266266        />
    267267
     
    309309        <image  texture="global/tile/stone_background.png"
    310310            texture_size="0 0 512 512"
    311             size="4 4 100%-4 100%-4" 
     311            size="4 4 100%-4 100%-4"
    312312        />
    313313
     
    354354        <image  texture="global/tile/stone_background_light.png"
    355355            texture_size="0 0 512 512"
    356             size="4 4 100%-4 100%-4"
    357         />
    358                
     356            size="4 4 100%-4 100%-4"
     357        />
     358
     359                <!-- shading -->
     360        <image
     361            texture="global/shading/gradient_wide.png"
     362            size="0 0 100% 100%"
     363        />
     364
    359365                <!-- thin sides -->
    360366        <image  texture="global/border/line_horiz.png"
     
    374380            size="16 20 20 100%-20"
    375381        />
    376                
     382
    377383        <!-- thin corners -->
    378384        <image
     
    392398            texture_size="0 0 4 4"
    393399            size="16 16 20 20"
    394         />
    395                
    396                 <!-- shading -->
    397         <image
    398             texture="global/shading/gradient_wide.png"
    399             size="0 0 100% 100%"
    400400        />
    401401
     
    445445                <image  texture="global/titlebar/titlebar_middle.png"
    446446            real_texture_placement="0 0 64 32"
    447             size="50%-64 0 50%+64 32" 
     447            size="50%-64 0 50%+64 32"
    448448        />
    449449                <image  texture="global/titlebar/titlebar_right.png"
     
    458458    ==========================================
    459459    -->
    460    
     460
    461461    <sprite name="StoneButton">
    462462        <image  texture="global/button/button_stone_unselected.png"
    463463            real_texture_placement="0 0 256 28"
    464             size="0 0 100% 100%" 
    465         />
    466     </sprite>
    467        
     464            size="0 0 100% 100%"
     465        />
     466    </sprite>
     467
    468468    <sprite name="StoneButtonOver">
    469469        <image  texture="global/button/button_stone_selected.png"
    470470            real_texture_placement="0 0 256 28"
    471             size="0 0 100% 100%" 
     471            size="0 0 100% 100%"
    472472        />
    473473        </sprite>
     
    477477        <image  texture="global/button/button_stone_selected.png"
    478478            real_texture_placement="0 0 256 28"
    479             size="0 0 100% 100%" 
     479            size="0 0 100% 100%"
    480480        />
    481481        </sprite>
     
    484484        <image  texture="global/button/button_stone_selected.png"
    485485            real_texture_placement="0 0 256 28"
    486             size="0 0 100% 100%" 
     486            size="0 0 100% 100%"
    487487        />
    488488        <image  texture="global/button/button_stone_selected_left_trim.png"
    489489            real_texture_placement="0 0 32 28"
    490             size="0 0 32 28" 
     490            size="0 0 32 28"
    491491        />
    492492        <image  texture="global/button/button_stone_selected_right_trim.png"
    493493            real_texture_placement="0 0 32 28"
    494             size="100%-32 0 100% 28" 
     494            size="100%-32 0 100% 28"
    495495        />
    496496        </sprite>
     
    500500        <image  texture="global/button/button_stone_selected.png"
    501501            real_texture_placement="0 0 256 28"
    502             size="0 0 100% 100%" 
     502            size="0 0 100% 100%"
    503503        />
    504504        <image  texture="global/button/button_stone_selected_left_trim.png"
    505505            real_texture_placement="0 0 32 28"
    506             size="0 0 32 28" 
     506            size="0 0 32 28"
    507507        />
    508508        <image  texture="global/button/button_stone_selected_right_trim.png"
    509509            real_texture_placement="0 0 32 28"
    510             size="100%-32 0 100% 28" 
     510            size="100%-32 0 100% 28"
    511511        />
    512512        </sprite>
     
    516516        <image  texture="global/button/button_stone_unselected.png"
    517517            real_texture_placement="0 0 256 28"
    518             size="0 0 100% 100%" 
     518            size="0 0 100% 100%"
    519519        />
    520520        </sprite>
     
    522522    <sprite name="StoneCheckBoxOpen">
    523523        <image  texture="global/button/checkbox_open_gray.dds"
    524             size="0 0 100% 100%" 
     524            size="0 0 100% 100%"
    525525        />
    526526        </sprite>
     
    528528    <sprite name="StoneCheckBoxTick">
    529529        <image  texture="global/button/checkbox_tick_gray.dds"
    530             size="0 0 100% 100%" 
     530            size="0 0 100% 100%"
    531531        />
    532532        </sprite>
     
    534534    <sprite name="StoneCheckBoxCross">
    535535        <image  texture="global/button/checkbox_cross_gray.dds"
    536             size="0 0 100% 100%" 
     536            size="0 0 100% 100%"
    537537        />
    538538        </sprite>
     
    540540    <sprite name="StoneCheckBoxCrossOver">
    541541        <image  texture="global/button/checkbox_cross_over_gray.dds"
    542             size="0 0 100% 100%" 
     542            size="0 0 100% 100%"
    543543        />
    544544        </sprite>
     
    546546    <sprite name="StoneArrowLeft">
    547547        <image  texture="global/button/arrowbox_lt.png"
    548             size="0 0 100% 100%" 
     548            size="0 0 100% 100%"
    549549        />
    550550        </sprite>
     
    552552    <sprite name="StoneArrowLeftOver">
    553553        <image  texture="global/button/arrowbox_lt_over.png"
    554             size="0 0 100% 100%" 
     554            size="0 0 100% 100%"
    555555        />
    556556        </sprite>
     
    558558    <sprite name="StoneArrowRight">
    559559        <image  texture="global/button/arrowbox_rt.png"
    560             size="0 0 100% 100%" 
     560            size="0 0 100% 100%"
    561561        />
    562562        </sprite>
     
    564564    <sprite name="StoneArrowRightOver">
    565565        <image  texture="global/button/arrowbox_rt_over.png"
    566             size="0 0 100% 100%" 
     566            size="0 0 100% 100%"
    567567        />
    568568        </sprite>
     
    570570    <sprite name="StoneArrowUp">
    571571        <image  texture="global/button/arrowbox_up.dds"
    572             size="0 0 100% 100%" 
     572            size="0 0 100% 100%"
    573573        />
    574574        </sprite>
     
    576576    <sprite name="StoneArrowUpOver">
    577577        <image  texture="global/button/arrowbox_up_over.dds"
    578             size="0 0 100% 100%" 
     578            size="0 0 100% 100%"
    579579        />
    580580        </sprite>
     
    582582    <sprite name="StoneArrowDn">
    583583        <image  texture="global/button/arrowbox_dn.dds"
    584             size="0 0 100% 100%" 
     584            size="0 0 100% 100%"
    585585        />
    586586        </sprite>
     
    588588    <sprite name="StoneArrowDnOver">
    589589        <image  texture="global/button/arrowbox_dn_over.dds"
    590             size="0 0 100% 100%" 
    591         />
    592         </sprite>
    593    
     590            size="0 0 100% 100%"
     591        />
     592        </sprite>
     593
    594594    <sprite name="StoneScrollSpriteBar">
    595595        <image  texture="global/border/scrollbar.dds"
    596596            real_texture_placement="0 0 16 128"
    597             size="0 0 100% 100%" 
     597            size="0 0 100% 100%"
    598598        />
    599599    </sprite>
  • ps/trunk/binaries/data/mods/public/gui/common/common_styles.xml

    r10130 r10155  
    8888    />
    8989
    90     <style name="SmallTitleText"
    91         font="serif-9"
     90       <style name="MediumTitleText"
     91        font="serif-bold-12"
    9292        textcolor="white"
    9393        text_align="center"
  • ps/trunk/binaries/data/mods/public/gui/gamesetup/gamesetup.xml

    r10150 r10155  
    171171        >[Tooltip text]</object>
    172172
     173                <!-- Start Button -->
     174        <object
     175            name="startGame"
     176            type="button"
     177            style="StoneButton"
     178            size="100%-304 100%-48 100%-164 100%-20"
     179            tooltip_style="onscreenToolTip"
     180            tooltip="Click this button to start a new game with the current settings."
     181        >Start game!
     182            <action on="Press">launchGame();</action>
     183        </object>
     184
    173185                <!-- Cancel Button -->
    174186        <object
     
    176188            type="button"
    177189            style="StoneButton"
    178             size="100%-304 100%-48 100%-164 100%-20"
     190                        size="100%-160 100%-48 100%-20 100%-20"
    179191            tooltip_style="onscreenToolTip"
    180192            tooltip="Click this button to return to the main menu."
     
    186198        </object>
    187199
    188                 <!-- Start Button -->
    189         <object
    190             name="startGame"
    191             type="button"
    192             style="StoneButton"
    193             size="100%-160 100%-48 100%-20 100%-20"
    194             tooltip_style="onscreenToolTip"
    195             tooltip="Click this button to start a new game with the current settings."
    196         >Start game!
    197             <action on="Press">launchGame();</action>
    198         </object>
    199 
    200200    </object>
    201201
  • ps/trunk/binaries/data/mods/public/gui/loading/loading.js

    r9336 r10155  
    44{
    55    g_Data = data;
    6    
     6
    77    // Set to "hourglass" cursor.
    88    setCursor("cursor-wait");
     
    1616        var tipTextFilePath = tipTextLoadingArray[getRandom (0, tipTextLoadingArray.length-1)];
    1717        var tipText = readFile(tipTextFilePath);
    18        
     18
    1919        if (tipText)
    2020        {
     
    4040    // happen until the first timeslice completes, so set initial values.
    4141    var loadingMapName = getGUIObjectByName ("loadingMapName");
    42    
     42
    4343    if (data)
    4444    {
     
    7070function displayProgress()
    7171{
     72        const END_PIECE_WIDTH = 16;
     73
    7274    getGUIObjectByName("progressbar").caption = g_Progress; // display current progress
    7375    getGUIObjectByName("progressText").caption = g_LoadDescription; // display current progess details
    74    
     76
    7577    // Keep curved right edge of progress bar in sync with the rest of the progress bar
    7678    var middle = getGUIObjectByName("progressbar");
    7779    var rightSide = getGUIObjectByName("progressbar_right");
    78    
    79     var middleLength = middle.size.right - middle.size.left;
     80
     81    var middleLength = (middle.size.right - middle.size.left) - (END_PIECE_WIDTH / 2);
    8082    var increment = Math.round(g_Progress*middleLength/100);
    8183
    8284    var size = rightSide.size;
    8385    size.left = increment;
    84     size.right = increment+12;
     86    size.right = increment + END_PIECE_WIDTH;
    8587    rightSide.size = size;
    8688}
     
    98100    // Switch GUI from loading screen to game session.
    99101    Engine.SwitchGuiPage("page_session.xml", g_Data);
    100    
     102
    101103    // Restore default cursor.
    102104    setCursor("arrow-default");
  • ps/trunk/binaries/data/mods/public/gui/loading/loading.xml

    r10108 r10155  
    1313    <!-- LOADING SCREEN BACKGROUND -->
    1414    <object type="image" style="StonePanelLight"/>
    15    
     15
    1616    <object size="50%-400 30 50%+400 150">
    1717        <object name="loadingMapName" size="0 0 100% 32" type="text" style="loadingPageTitleText"/>
    18            
     18
    1919        <!-- LOADING SCREEN progressbar -->
    2020        <object size="50%-256 48 50%+256 80" type="image" sprite="loadingProgressBarBackground">
     
    2424                size="56 5 456 100%-5"
    2525            >
    26                 <object name="progressbar_left" size="0%-12 0 0 100%" type="image" sprite="loadingProgressbar_left"/>
    27                 <object name="progressbar_right" size="0 0 12 100%" type="image" sprite="loadingProgressbar_right"/>
     26                <object name="progressbar_left" size="-8 0 8 100%" type="image" sprite="loadingProgressbar_left"/>
     27                <object name="progressbar_right" size="8 0 24 100%" type="image" sprite="loadingProgressbar_right"/>
    2828                <action on="Progress">displayProgress();</action>
    2929            </object>
    3030        </object>
    31            
     31
    3232        <!-- LOADING SCREEN TEXT -->
    3333        <object name="progressText" size="0 64 100% 100%" type="text" style="loadingBarText"/>
    3434    </object>
    35        
     35
    3636    <!-- LOADING SCREEN TIP IMAGE-->
    3737    <object size="50%-452 50%-196 50%+68 50%+196" type="image" sprite="loadingTipImage">
  • ps/trunk/binaries/data/mods/public/gui/loading/sprites.xml

    r10085 r10155  
    6161        <image
    6262            texture="loading/progressbar/progressbar_background_left.png"
    63             size="0%+0 0% 64 0%+32" 
     63            size="0%+0 0% 64 0%+32"
    6464        />
    6565        <image
    6666            texture="loading/progressbar/progressbar_background_middle.png"
    67             size="64 0% 100%-64 0%+32" 
     67            size="64 0% 100%-64 0%+32"
    6868        />
    6969        <image
    7070            texture="loading/progressbar/progressbar_background_right.png"
    71             size="100%-64 0% 100%+0 0%+32" 
     71            size="100%-64 0% 100%+0 0%+32"
    7272        />
    7373    </sprite>
     
    7777        <image
    7878            texture="loading/progressbar/progressbar_left.png"
    79             real_texture_placement="0 0 12 20"
    80             size="0 0 100% 100%" 
     79            real_texture_placement="16 6 32 26"
     80            size="0 0 100% 100%"
    8181        />
    8282    </sprite>
     
    8484        <image
    8585            texture="loading/progressbar/progressbar_middle.png"
    86             real_texture_placement="0 0 1 20"
     86            real_texture_placement="0 6 1 26"
    8787            size="0 0 100% 100%"
    8888        />
     
    9191        <image
    9292            texture="loading/progressbar/progressbar_right.png"
    93             real_texture_placement="4 0 16 20"
    94             size="0 0 100% 100%" 
     93            real_texture_placement="0 6 16 26"
     94            size="0 0 100% 100%"
    9595        />
    9696    </sprite>
     
    142142        />
    143143    </sprite>
    144    
     144
    145145    <!-- TIP IMAGE GRADIENT -->
    146146    <sprite name="loadingTipImageCover">
  • ps/trunk/binaries/data/mods/public/gui/pregame/mainmenu.js

    r10146 r10155  
    114114function updateMenuPosition()
    115115{
    116         if (getGUIObjectByName("submenuScreen").hidden == false)
     116        var submenu = getGUIObjectByName("submenu");
     117
     118        if (submenu.hidden == false)
    117119        {
    118                 var submenu = getGUIObjectByName("submenu");
    119 
    120120                // The offset is the increment or number of units/pixels to move
    121121                // the menu. An offset of one is always accurate, but it is too
     
    125125                // example is 300-60 = 240. We choose an offset of 5 because it
    126126                // divides into 240 evenly and provided the speed we wanted.
    127                 var OFFSET = 5;
     127                var OFFSET = 10;
    128128
    129129                if (submenu.size.left < getGUIObjectByName("mainMenu").size.right)
     
    137137function openMenu(newSubmenu, position, buttonHeight, numButtons)
    138138{
    139         // remove old submenu
    140         getGUIObjectByName(currentSubmenu).hidden = true;
    141 
    142         // switch to new submenu
     139        var menuSound = new Sound("audio/attack/weapon/arrowfly_24.ogg");
     140    if (menuSound)
     141    {
     142        menuSound.play(0);
     143    }
     144
     145        // switch to new submenu type
    143146        currentSubmenu = newSubmenu;
    144147        getGUIObjectByName(currentSubmenu).hidden = false;
     
    154157
    155158        // prepare to hide the submenu when the mouse moves off of the submenu
    156         getGUIObjectByName("submenuScreen").hidden = false;
    157         getGUIObjectByName("secondarySubmenuScreen").hidden = false;
     159        getGUIObjectByName("submenu").hidden = false;
    158160}
    159161
     
    161163function closeMenu()
    162164{
    163         getGUIObjectByName("submenuScreen").hidden = true;
    164         getGUIObjectByName("secondarySubmenuScreen").hidden = true;
     165        // remove old submenu type
     166        getGUIObjectByName(currentSubmenu).hidden = true;
     167
     168        // hide submenu
     169        getGUIObjectByName("submenu").hidden = true;
     170
     171        // reset submenu position
    165172        getGUIObjectByName("submenu").size = getGUIObjectByName("mainMenu").size;
     173
     174        // reset main menu panel right border
    166175        getGUIObjectByName("MainMenuPanelRightBorderTop").size = "100%-2 0 100% 100%";
    167176}
  • ps/trunk/binaries/data/mods/public/gui/pregame/mainmenu.xml

    r10146 r10155  
    152152        ==========================================
    153153        -->
    154                 <object name="submenuScreen"
    155             type="image"
     154
     155                <!-- submenu -->
     156                <object name="submenu"
     157                        type="image"
     158                        style="SubmenuPanel"
     159                        size="60 50%-100 300 50%+100"
    156160                        hidden="true"
    157161                >
    158                         <!-- hides the submenu when the mouse leaves the mainMenuButtons or submenu -->
    159                         <action on="MouseEnter">
    160                                 closeMenu();
    161             </action>
    162 
    163                         <!-- submenu -->
    164                         <object name="submenu"
     162                        <!-- submenuSinglePlayer -->
     163                        <object name="submenuSinglePlayer"
    165164                                type="image"
    166                                 style="SubmenuPanel"
    167                                 size="60 50%-100 300 50%+100"
     165                                size="0 4 100%-4 100%-4"
     166                                tooltip_style="pgToolTip"
     167                                tooltip="The 0 A.D. Game Manual."
     168                                hidden="true"
    168169                        >
    169                                 <!-- submenuSinglePlayer -->
    170                                 <object name="submenuSinglePlayer"
    171                                         type="image"
    172                                         size="0 4 100%-4 100%-4"
     170                                <object name="subMenuSinglePlayerButton"
     171                                        type="button"
     172                                        style="StoneButtonFancy"
     173                                        size="0 0 100% 28"
    173174                                        tooltip_style="pgToolTip"
    174                                         tooltip="The 0 A.D. Game Manual."
    175                                         hidden="true"
     175                                        tooltip="Click here to start a new single player game."
    176176                                >
    177                                         <object name="subMenuSinglePlayerButton"
    178                                                 type="button"
    179                                                 style="StoneButtonFancy"
    180                                                 size="0 0 100% 28"
    181                                                 tooltip_style="pgToolTip"
    182                                                 tooltip="Click here to start a new single player game."
    183                                         >
    184                                                 Matches
    185                                                 <action on="Press">
    186                                                         closeMenu();
    187                                                         Engine.PushGuiPage("page_gamesetup.xml", { type: "offline" });
    188                                                 </action>
    189                                         </object>
    190 
    191                                         <object name="subMenuCampaignButton"
    192                                                 type="button"
    193                                                 style="StoneButtonFancy"
    194                                                 size="0 32 100% 60"
    195                                                 tooltip_style="pgToolTip"
    196                                                 tooltip="Relive history through historical military campaigns. [NOT YET IMPLEMENTED]"
    197                                                 enabled="false"
    198                                         >
    199                                                 Campaigns
    200                                                 <action on="Press">
    201                                                         closeMenu();
    202                                                         <![CDATA[
    203                                                                 // Open Campaigns window.
    204                                                                 // NOT IMPLEMENTED YET
    205                                                         ]]>
    206                                                 </action>
    207                                         </object>
     177                                        Matches
     178                                        <action on="Press">
     179                                                closeMenu();
     180                                                Engine.PushGuiPage("page_gamesetup.xml", { type: "offline" });
     181                                        </action>
    208182                                </object>
    209183
    210                                 <!-- submenuMultiplayer -->
    211                                 <object name="submenuMultiplayer"
    212                                               type="image"
    213                                               size="0 4 100%-4 100%-4"
    214                                               tooltip_style="pgToolTip"
    215                                               tooltip="The 0 A.D. Game Manual"
    216                                               hidden="true"
     184                                <object name="subMenuCampaignButton"
     185                                        type="button"
     186                                        style="StoneButtonFancy"
     187                                        size="0 32 100% 60"
     188                                        tooltip_style="pgToolTip"
     189                                        tooltip="Relive history through historical military campaigns. [NOT YET IMPLEMENTED]"
     190                                        enabled="false"
    217191                                >
    218                                         <object name="subMenuMultiplayerJoinButton"
    219                                                 type="button"
    220                                                 style="StoneButtonFancy"
    221                                                 size="0 0 100% 28"
    222                                                 tooltip_style="pgToolTip"
    223                                                 tooltip="Joining an existing multiplayer game."
    224                                         >
    225                                                 Join Game
    226                                                 <action on="Press">
    227                                                         closeMenu();
    228                                                         // Open Multiplayer connection window with join option.
    229                                                         Engine.PushGuiPage("page_gamesetup_mp.xml", "join");
    230                                                 </action>
    231                                         </object>
    232 
    233                                         <object name="subMenuMultiplayerHostButton"
    234                                                 type="button"
    235                                                 style="StoneButtonFancy"
    236                                                 size="0 32 100% 60"
    237                                                 tooltip_style="pgToolTip"
    238                                                 tooltip="Host a multiplayer game."
    239                                         >
    240                                                 Host Game
    241                                                 <action on="Press">
    242                                                         closeMenu();
    243                                                         // Open Multiplayer connection window with host option.
    244                                                         Engine.PushGuiPage("page_gamesetup_mp.xml", "host");
    245                                                 </action>
    246                                         </object>
    247 
     192                                        Campaigns
     193                                        <action on="Press">
     194                                                closeMenu();
     195                                                <![CDATA[
     196                                                        // Open Campaigns window.
     197                                                        // NOT IMPLEMENTED YET
     198                                                ]]>
     199                                        </action>
    248200                                </object>
    249 
    250                                 <!-- submenuToolsAndOptions -->
    251                                 <object name="submenuToolsAndOptions"
    252                                         type="image"
    253                                         size="0 4 100%-4 100%-4"
     201                        </object>
     202
     203                        <!-- submenuMultiplayer -->
     204                        <object name="submenuMultiplayer"
     205                                      type="image"
     206                                      size="0 4 100%-4 100%-4"
     207                                      tooltip_style="pgToolTip"
     208                                      tooltip="The 0 A.D. Game Manual"
     209                                      hidden="true"
     210                        >
     211                                <object name="subMenuMultiplayerJoinButton"
     212                                        type="button"
     213                                        style="StoneButtonFancy"
     214                                        size="0 0 100% 28"
    254215                                        tooltip_style="pgToolTip"
    255                                         tooltip="The 0 A.D. Game Manual"
    256                                         hidden="true"
     216                                        tooltip="Joining an existing multiplayer game."
    257217                                >
    258                                         <object name="submenuOptionsButton"
    259                                                 style="StoneButtonFancy"
    260                                                 type="button"
    261                                                 size="0 0 100% 28"
    262                                                 tooltip_style="pgToolTip"
    263                                                 tooltip="Adjust game settings. [NOT YET IMPLEMENTED]"
    264                                                 enabled="false"
    265                                         >
    266                                                 Options
    267                                                 <action on="Press">
    268                                                         closeMenu();
    269                                                         <![CDATA[
    270                                                                 // Open Options window.
    271                                                                 Engine.PushGuiPage("page_options.xml");
    272                                                         ]]>
    273                                                 </action>
    274                                         </object>
    275 
    276                                         <object name="submenuEditorButton"
    277                                                 style="StoneButtonFancy"
    278                                                 type="button"
    279                                                 size="0 32 100% 60"
    280                                                 tooltip_style="pgToolTip"
    281                                                 tooltip="Open the Atlas Scenario Editor in a new window. You can run this more reliably by starting the game with the command-line argument &quot;-editor&quot;."
    282                                         >
    283                                                 Scenario Editor
    284                                                 <action on="Press">
    285                                                         closeMenu();
    286                                                         <![CDATA[
    287                                                         // Start Atlas
    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>
    294                                         </object>
     218                                        Join Game
     219                                        <action on="Press">
     220                                                closeMenu();
     221                                                // Open Multiplayer connection window with join option.
     222                                                Engine.PushGuiPage("page_gamesetup_mp.xml", "join");
     223                                        </action>
    295224                                </object>
    296                         </object><!-- end of submenu -->
    297                 </object><!-- end of submenu screen -->
     225
     226                                <object name="subMenuMultiplayerHostButton"
     227                                        type="button"
     228                                        style="StoneButtonFancy"
     229                                        size="0 32 100% 60"
     230                                        tooltip_style="pgToolTip"
     231                                        tooltip="Host a multiplayer game."
     232                                >
     233                                        Host Game
     234                                        <action on="Press">
     235                                                closeMenu();
     236                                                // Open Multiplayer connection window with host option.
     237                                                Engine.PushGuiPage("page_gamesetup_mp.xml", "host");
     238                                        </action>
     239                                </object>
     240
     241                        </object>
     242
     243                        <!-- submenuToolsAndOptions -->
     244                        <object name="submenuToolsAndOptions"
     245                                type="image"
     246                                size="0 4 100%-4 100%-4"
     247                                tooltip_style="pgToolTip"
     248                                tooltip="The 0 A.D. Game Manual"
     249                                hidden="true"
     250                        >
     251                                <object name="submenuOptionsButton"
     252                                        style="StoneButtonFancy"
     253                                        type="button"
     254                                        size="0 0 100% 28"
     255                                        tooltip_style="pgToolTip"
     256                                        tooltip="Adjust game settings. [NOT YET IMPLEMENTED]"
     257                                        enabled="false"
     258                                >
     259                                        Options
     260                                        <action on="Press">
     261                                                closeMenu();
     262                                                <![CDATA[
     263                                                        // Open Options window.
     264                                                        Engine.PushGuiPage("page_options.xml");
     265                                                ]]>
     266                                        </action>
     267                                </object>
     268
     269                                <object name="submenuEditorButton"
     270                                        style="StoneButtonFancy"
     271                                        type="button"
     272                                        size="0 32 100% 60"
     273                                        tooltip_style="pgToolTip"
     274                                        tooltip="Open the Atlas Scenario Editor in a new window. You can run this more reliably by starting the game with the command-line argument &quot;-editor&quot;."
     275                                >
     276                                        Scenario Editor
     277                                        <action on="Press">
     278                                                closeMenu();
     279                                                <![CDATA[
     280                                                // Start Atlas
     281                                                        if (Engine.AtlasIsAvailable())
     282                                                                Engine.RestartInAtlas();
     283                                                        else
     284                                                                messageBox(400, 200, "The scenario editor is not available or failed to load.", "Error", 2);
     285                                                ]]>
     286                                        </action>
     287                                </object>
     288                        </object>
     289                </object><!-- end of submenu -->
    298290
    299291
     
    309301                        z="50"
    310302                >
    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 
    327303                        <!-- These are used to make the right side blend in with the submenu -->
    328304                        <object name="MainMenuPanelRightBorderTop"
     
    351327                                ghost="false"
    352328                        >
    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 
    364329                                <!-- LEARN TO PLAY BUTTON -->
    365330                <object name="menuLearnToPlayButton"
     
    528493                <!-- COMPANY NAME -->
    529494                <object type="text"
    530                         style="SmallTitleText"
     495                        style="MediumTitleText"
    531496                                        ghost="true"
    532497                                        size="50%-128 32 50%+128 48"
     
    537502            <object name="versionNumber"
    538503                type="text"
    539                     style="SmallTitleText"
     504                    style="MediumTitleText"
    540505                    ghost="true"
    541506                size="50%-128 100%-36 50%+128 100%"
  • ps/trunk/binaries/data/mods/public/gui/session/menu.js

    r10147 r10155  
    77
    88// Includes the main menu button
    9 const NUM_BUTTONS = 5;
     9const NUM_BUTTONS = 6;
    1010
    1111// Regular menu buttons
     
    1616
    1717// Menu starting position - bottom
    18 const MENU_BOTTOM  = 36;
     18const MENU_BOTTOM = 36;
    1919
    2020// Menu starting position - top
     
    2222
    2323// Menu starting position - overall
    24 const INITIAL_MENU_POSITION = "100%-" + END_MENU_POSITION + " " + MENU_TOP + " 100% " + MENU_BOTTOM;
     24const INITIAL_MENU_POSITION = "100%-164 " + MENU_TOP + " 100% " + MENU_BOTTOM;
    2525
    2626
     
    2828function updateMenuPosition()
    2929{
    30         if (getGUIObjectByName("menuScreen").hidden == false)
     30        if (getGUIObjectByName("menu").hidden == false)
    3131        {
    3232                var menu = getGUIObjectByName("menu");
     
    3737                // in order for the menu to end up at the right spot. The travel
    3838                // 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;
     39                // example is 196-36 = 160. We choose an offset of 16 because it
     40                // divides into 160 evenly and provided the speed we wanted.
     41                var OFFSET = 16;
    4242
    4343                if (menu.size.bottom < END_MENU_POSITION)
    4444                {
    45                         menu.size = "100%-" + END_MENU_POSITION + " " + (menu.size.top + OFFSET) + " 100% " + (menu.size.bottom + OFFSET);
     45                        menu.size = "100%-164 " + (menu.size.top + OFFSET) + " 100% " + (menu.size.bottom + OFFSET);
    4646                }
    4747        }
     
    5151function openMenu()
    5252{
    53         getGUIObjectByName("menuScreen").hidden = false;
     53        var menuSound = new Sound("audio/interface/ui/ui_button_longclick.ogg");
     54    if (menuSound)
     55    {
     56        menuSound.play(0);
     57    }
     58
     59        getGUIObjectByName("menu").hidden = false;
    5460}
    5561
     
    5763function closeMenu()
    5864{
    59         getGUIObjectByName("menuScreen").hidden = true;
     65        getGUIObjectByName("menu").hidden = true;
    6066        getGUIObjectByName("menu").size = INITIAL_MENU_POSITION;
    6167}
  • ps/trunk/binaries/data/mods/public/gui/session/session.xml

    r10147 r10155  
    353353        <!-- Menu -->
    354354        <!-- ================================  ================================ -->
    355                 <object name="menuScreen"
    356             type="image"
     355                <object name="menu"
     356                        style="StonePanelThinBorder"
     357                        type="image"
     358                        size="100%-164 -160 100% 36"
    357359                        hidden="true"
    358                         size="0 0 100% 100%"
    359360                >
    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                                                         closeOpenDialogs();
    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>
     361                        <object size="4 36 100%-4 50%+20">
     362
     363                                <!-- Settings button -->
     364                                <object type="button"
     365                                        name="settingsButton"
     366                                        style="StoneButtonFancy"
     367                                        size="0 0 100% 28"
     368                                        tooltip_style="sessionToolTip"
     369                                >
     370                                        Settings
     371                                        <action on="Press">
     372                                                closeMenu();
     373                                                openSettings();
     374                                        </action>
     375                                </object>
     376
     377                                <!-- Chat button -->
     378                                <object type="button"
     379                                        name="chatButton"
     380                                        style="StoneButtonFancy"
     381                                        size="0 32 100% 60"
     382                                        tooltip_style="sessionToolTip"
     383                                >
     384                                        Chat
     385                                        <action on="Press">
     386                                                closeMenu();
     387                                                openChat();
     388                                        </action>
     389                                </object>
     390
     391                                <!-- Pause Button -->
     392                                <object type="button"
     393                                        name="pauseButton"
     394                                        style="StoneButtonFancy"
     395                                        size="0 64 100% 92"
     396                                        tooltip_style="sessionToolTip"
     397                                >
     398                                        <object name="pauseButtonText" type="text" style="CenteredButtonText" ghost="true">Pause</object>
     399                                        <action on="Press">
     400                                                closeMenu();
     401                                                togglePause();
     402                                        </action>
     403                                </object>
     404
     405                                <!-- Exit button -->
     406                                <object type="button"
     407                                        name="menuExitButton"
     408                                        style="StoneButtonFancy"
     409                                        size="0 96 100% 124"
     410                                        tooltip_style="sessionToolTip"
     411                                >
     412                                        Exit
     413                                        <action on="Press">
     414                                                closeMenu();
     415                                                closeOpenDialogs();
     416                                                <![CDATA[
     417                                                        var btCaptions = ["Yes", "No"];
     418                                                        var btCode = [leaveGame, null];
     419                                                        messageBox(400, 200, "Are you sure you want to quit?", "Confirmation", 0, btCaptions, btCode);
     420                                                ]]>
     421                                        </action>
     422                                </object>
     423
     424                                <!-- Exit button -->
     425                                <object type="button"
     426                                        name="menuCloseButton"
     427                                        style="StoneButtonFancy"
     428                                        size="0 128 100% 156"
     429                                        tooltip_style="sessionToolTip"
     430                                >
     431                                        Close
     432                                        <action on="Press">
     433                                                closeMenu();
     434                                        </action>
    432435                                </object>
    433436                        </object>
Note: See TracChangeset for help on using the changeset viewer.