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


Ignore:
Timestamp:
08/26/11 06:25:41 (13 years ago)
Author:
brian
Message:

Beginning of the submenu

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

Legend:

Unmodified
Added
Removed
  • ps/trunk/binaries/data/mods/public/gui/pregame/mainmenu.js

    r10042 r10097  
    9999}
    100100
     101// Update the submenu
     102var margin = 4;
     103var currentSubmenu;
     104function updateSubmenu(buttonName, newSubmenu)
     105{
     106        // hide old submenu if possible
     107        if (null != currentSubmenu)
     108        {
     109                getGUIObjectByName(currentSubmenu).hidden = true;
     110        }
     111       
     112        // save new submenu
     113        currentSubmenu = newSubmenu;
     114       
     115        // unhide new submenu
     116        getGUIObjectByName(currentSubmenu).hidden = false;
     117       
     118        // find  position of new submenu
     119        var mainMenubutton = getGUIObjectByName(buttonName);
     120        var verticalOffset = getGUIObjectByName("mainMenuButtons").size.top;
     121        var top = verticalOffset + mainMenubutton.size.top - margin;
     122        var bottom = verticalOffset + mainMenubutton.size.bottom + margin;
     123       
     124        // set position of new submenu
     125        var submenu = getGUIObjectByName("submenu");
     126        submenu.size = submenu.size.left + " " + top + " " + submenu.size.right + " " + bottom;
     127        submenu.hidden = false;
     128       
     129        // prepare to hide the submenu when the mouse moves off of the submenu
     130        getGUIObjectByName("submenuScreen").hidden = false;
     131}
     132
    101133// Helper function that enables the dark background mask, then reveals a given subwindow object.
    102134function openMainMenuSubWindow (windowName)
  • ps/trunk/binaries/data/mods/public/gui/pregame/mainmenu.xml

    r10096 r10097  
    6666        </object>
    6767
     68
     69        <!--
     70        ==========================================
     71        - MAIN MENU - USER REPORT
     72        ==========================================
     73        -->
     74
     75        <object
     76            name="userReportDisabled"
     77            size="100%-304 100%-154 100%-4 100%-4"
     78            type="image"
     79            style="userReportPanel"
     80        >
     81            <object
     82                type="text"
     83                style="userReportText"
     84>[font="serif-bold-16"]Help improve 0 A.D.![/font]
     85
     86You can automatically send us anonymous feedback that will help us fix bugs, and improve performance and compatibility.
     87            </object>
     88            <object type="button" style="wheatButton" size="4 100%-36 150 100%-4">
     89                [font="serif-bold-16"]Enable feedback
     90                <action on="Press">Engine.SetUserReportEnabled(true);</action>
     91            </object>
     92            <object type="button" style="wheatButton" size="100%-150 100%-36 100%-4 100%-4">
     93                Technical details
     94                <action on="Press">Engine.PushGuiPage("page_manual.xml", { "page": "userreport" });</action>
     95            </object>
     96        </object>
     97
     98        <object
     99            name="userReportEnabled"
     100            size="100%-304 100%-294 100%-4 100%-4"
     101            type="image"
     102            style="userReportPanel"
     103        >
     104            <object
     105                name="userReportEnabledText"
     106                type="text"
     107                style="userReportText"
     108>[font="serif-bold-16"]Thank you for helping improve 0 A.D.![/font]
     109
     110Anonymous feedback is currently enabled.
     111Status: $status.
     112                        </object>
     113            <!--
     114                 Put the rest of the text in a separate box, so that
     115                 very long $status messages don't mess up the layout
     116                 quite so badly:
     117            -->
     118            <object
     119                type="text"
     120                style="userReportText"
     121                size="0 90 100% 100%"
     122>If you want to send a message to the developers, you can enter one here:
     123            </object>
     124
     125            <object
     126                name="userReportMessageInput"
     127                size="4 130 100%-4 200"
     128                type="input"
     129                style="wheatInput"
     130                multiline="true"
     131                scrollbar="true"
     132                scrollbar_style="wheatScrollBar"
     133            />
     134
     135            <object size="100%-124 204 100%-4 236" type="button" style="wheatButton">
     136                Send Message
     137                <action on="Press">submitUserReportMessage();</action>
     138            </object>
     139
     140            <object type="button" style="wheatButton" size="4 100%-36 150 100%-4">
     141                Disable feedback
     142                <action on="Press">Engine.SetUserReportEnabled(false);</action>
     143            </object>
     144            <object type="button" style="wheatButton" size="100%-150 100%-36 100%-4 100%-4">
     145                Technical details
     146                <action on="Press">Engine.PushGuiPage("page_manual.xml", { "page": "userreport" });</action>
     147            </object>
     148        </object>
     149 
     150
     151             
     152
    68153        <!--
    69154        ==========================================
     
    75160            style="MainMenuPanel"
    76161            size="60 -2 300 100%+2"
     162                       
    77163                >
    78            
    79 
    80164                        <object name="productLogo"
    81165                                type="image"
     166                                sprite="productLogo"
    82167                                ghost="true"
    83168                                size="50%-110 30 50%+110 130"
    84                                 sprite="productLogo"
    85169                        />
    86170                       
    87                         <object
     171                        <object name="mainMenuButtons"
     172                                type="image"
    88173                                size="8 156 100%-8 356"
     174                                ghost="false"
    89175                        >
     176                                <!-- Allows sliding the mouse over to submenu without it closing automatically -->
     177                                <object
     178                                        type="image"
     179                                        size="100% 0 100%+8 100%"
     180                                        ghost="false"
     181                                />
     182                           
    90183                <object name="menuLearnToPlayButton"
    91184                                      type="button"
     
    110203                                    Single Player
    111204                                    <action on="Press"><![CDATA[
    112                                             // Open Session Setup window.
    113                                             Engine.PushGuiPage("page_gamesetup.xml", { type: "offline" });
     205                                            updateSubmenu("menuSinglePlayerButton", "submenuSinglePlayer");
    114206                                    ]]></action>
    115207                                </object>
    116208                               
    117                                 <object name="menuMultiPlayerButton"
     209                                <object name="menuMultiplayerButton"
    118210                                        style="StoneButtonFancy"
    119211                                        type="button"
     
    124216                                        Multiplayer
    125217                                        <action on="Press"><![CDATA[
    126                                                 // Open Multiplayer connection window.
    127                                                 Engine.PushGuiPage("page_gamesetup_mp.xml");
     218                                                updateSubmenu("menuMultiplayerButton", "submenuMultiplayer");
    128219                                        ]]></action>
    129220                                </object>
     
    209300            <object size="8 50%+40 100%-8 50%+280"
    210301                type="image"
    211                 style="stoneTooltip"
     302                style="stoneTooltip"
     303                                ghost="true"
    212304            >
    213305
     
    219311                    textcolor="white"
    220312                    size="8 8 100%-8 100%-36"
     313                                        ghost="true"
    221314                >
    222315[font="serif-bold-18"]Alpha Version[/font]
     
    232325                                        tooltip_style="pgToolTip"
    233326                                        tooltip="Click to open wildfiregames.com/0ad in your web browser."
    234                     size="8 100%-40 50%-2 100%-8"
     327                    size="8 100%-40 50%-4 100%-8"
    235328                >
    236329                    Website
     
    246339                                        tooltip_style="pgToolTip"
    247340                                        tooltip="Click to chat in IRC. (#0ad at webchat.quakenet.org)"
    248                     size="50%+2 100%-40 100%-8 100%-8"
     341                    size="50%+4 100%-40 100%-8 100%-8"
    249342                >
    250343                    IRC
     
    260353            <object
    261354                size="4 100%-84 100%-4 100%-56"
     355                                ghost="true"
    262356            >
    263357
     
    265359                <object name="companyLogo"
    266360                    type="image"
    267                     ghost="true"
    268                     size="50%-16 0 50%+16 32"
    269361                    sprite="companyLogo"
     362                                        ghost="true"
     363                                        size="50%-16 0 50%+16 32"
    270364                />
    271365
    272366                <!-- COMPANY NAME -->
    273                 <object
    274                     type="text"
     367                <object type="text"
    275368                        style="SmallTitleText"
    276                     size="50%-128 32 50%+128 48"
     369                                        ghost="true"
     370                                        size="50%-128 32 50%+128 48"
    277371                >WILDFIRE GAMES</object>
    278372            </object>
     
    291385                       
    292386                </object>
    293 
     387               
     388               
     389               
     390               
     391                <!--
     392        ==========================================
     393        - MAIN MENU SIDE PANEL
     394        ==========================================
     395        -->
     396               
     397                <object
     398                        name="submenuScreen"
     399            type="image"
     400                >
     401                        <action on="MouseEnter">
     402                            <![CDATA[getGUIObjectByName("submenu").hidden = true;;]]>
     403            </action>
     404                <object
     405                        name="submenu"
     406            type="image"
     407            style="MainMenuPanel"
     408            size="298 50%-100 538 50%+100"
     409                >
     410                        <object name="submenuSinglePlayer"
     411                                      type="image"
     412                                      size="4 4 100%-4 100%-4"
     413                                      tooltip_style="pgToolTip"
     414                                      tooltip="The 0 A.D. Game Manual"
     415                                      hidden="true"
     416            >
     417                                <object name="subMenuSinglePlayerButton"
     418                                              type="button"
     419                                              style="StoneButtonFancy"
     420                                              size="0 0 100% 32"
     421                                              tooltip_style="pgToolTip"
     422                                              tooltip="Click here to start a new single player game. (A very basic computer opponent is available for testing purposes.)"
     423                                >
     424                                        Single Player
     425                                        <action on="Press"><![CDATA[
     426                                                // Open Session Setup window.
     427                                                Engine.PushGuiPage("page_gamesetup.xml", { type: "offline" });
     428                                        ]]></action>
     429                                </object>
     430                        </object>
     431                   
     432                   
     433                        <object name="submenuMultiplayer"
     434                                      type="image"
     435                                      size="4 4 100%-4 100%-4"
     436                                      tooltip_style="pgToolTip"
     437                                      tooltip="The 0 A.D. Game Manual"
     438                                      hidden="true"
     439            >
     440                                <object name="subMenuMultiplayerJoinGameButton"
     441                                              type="button"
     442                                              style="StoneButtonFancy"
     443                                              size="0 0 100% 32"
     444                                              tooltip_style="pgToolTip"
     445                                              tooltip="Tired of playing with yourself? Fight against one or more human players in a multiplayer game."
     446                                >
     447                                        Multiplayer
     448                                        <action on="Press"><![CDATA[
     449                                                // Open Multiplayer connection window.
     450                                                Engine.PushGuiPage("page_gamesetup_mp.xml");
     451                                        ]]></action>
     452                                </object>
     453                        </object>
     454                </object>
     455               
     456                </object> <!-- end of screen -->
     457               
     458               
     459               
     460               
     461               
     462               
     463               
     464               
     465               
     466               
     467               
     468               
     469               
    294470<!--
    295471        <object name="pgCampaignsBt"
     
    469645        </object>
    470646-->
    471         <!--
    472         ==========================================
    473         - MAIN MENU - USER REPORT
    474         ==========================================
    475         -->
    476 
    477         <object
    478             name="userReportDisabled"
    479             size="100%-304 100%-154 100%-4 100%-4"
    480             type="image"
    481             style="userReportPanel"
    482         >
    483             <object
    484                 type="text"
    485                 style="userReportText"
    486 >[font="serif-bold-16"]Help improve 0 A.D.![/font]
    487 
    488 You can automatically send us anonymous feedback that will help us fix bugs, and improve performance and compatibility.
    489             </object>
    490             <object type="button" style="wheatButton" size="4 100%-36 150 100%-4">
    491                 [font="serif-bold-16"]Enable feedback
    492                 <action on="Press">Engine.SetUserReportEnabled(true);</action>
    493             </object>
    494             <object type="button" style="wheatButton" size="100%-150 100%-36 100%-4 100%-4">
    495                 Technical details
    496                 <action on="Press">Engine.PushGuiPage("page_manual.xml", { "page": "userreport" });</action>
    497             </object>
    498         </object>
    499 
    500         <object
    501             name="userReportEnabled"
    502             size="100%-304 100%-294 100%-4 100%-4"
    503             type="image"
    504             style="userReportPanel"
    505         >
    506             <object
    507                 name="userReportEnabledText"
    508                 type="text"
    509                 style="userReportText"
    510 >[font="serif-bold-16"]Thank you for helping improve 0 A.D.![/font]
    511 
    512 Anonymous feedback is currently enabled.
    513 Status: $status.</object>
    514             <!--
    515                  Put the rest of the text in a separate box, so that
    516                  very long $status messages don't mess up the layout
    517                  quite so badly:
    518             -->
    519             <object
    520                 type="text"
    521                 style="userReportText"
    522                 size="0 90 100% 100%"
    523 >If you want to send a message to the developers, you can enter one here:
    524             </object>
    525 
    526             <object
    527                 name="userReportMessageInput"
    528                 size="4 130 100%-4 200"
    529                 type="input"
    530                 style="wheatInput"
    531                 multiline="true"
    532                 scrollbar="true"
    533                 scrollbar_style="wheatScrollBar"
    534             />
    535 
    536             <object size="100%-124 204 100%-4 236" type="button" style="wheatButton">
    537                 Send Message
    538                 <action on="Press">submitUserReportMessage();</action>
    539             </object>
    540 
    541             <object type="button" style="wheatButton" size="4 100%-36 150 100%-4">
    542                 Disable feedback
    543                 <action on="Press">Engine.SetUserReportEnabled(false);</action>
    544             </object>
    545             <object type="button" style="wheatButton" size="100%-150 100%-36 100%-4 100%-4">
    546                 Technical details
    547                 <action on="Press">Engine.PushGuiPage("page_manual.xml", { "page": "userreport" });</action>
    548             </object>
    549         </object>
     647
    550648
    551649    </object>
     
    557655    -->
    558656
    559     <object name="pgSubWindow"
     657<!--    <object name="pgSubWindow"
    560658        type="image"
    561659        z="90"
    562660        hidden="true"
    563661        sprite="bkTranslucent"
    564     >
     662    >-->
    565663
    566664        <!--
     
    15021600        </object>
    15031601-->
    1504     </object>
     1602
     1603<!--END OF pgSubWindow-->
     1604<!--    </object>-->
     1605       
    15051606</objects>
Note: See TracChangeset for help on using the changeset viewer.