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


Ignore:
Timestamp:
08/28/11 00:44:08 (13 years ago)
Author:
brian
Message:

removed session dialog, updated ingame menu

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

Legend:

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

    r10112 r10114  
    187187                >
    188188                                        Learn To Play
    189                                         <action on="Press"><![CDATA[
    190                                                 // close submenu if left open
     189                                        <action on="Press">
    191190                                                getGUIObjectByName("submenu").hidden = true;
    192                                                 // open game manual dialog
    193                                                 Engine.PushGuiPage("page_manual.xml", { "page": "intro" });
    194                                         ]]></action>
     191                                                <![CDATA[
     192                                                        Engine.PushGuiPage("page_manual.xml", { "page": "intro" });
     193                                                ]]>
     194                                        </action>
    195195                               </object>
    196196                           
     
    203203                                       tooltip="Challenge the computer player to a single player match."
    204204                                >
    205                                     Single Player
    206                                     <action on="Press"><![CDATA[
    207                                             updateSubmenu("submenuSinglePlayer", (this.parent.size.top+this.size.top), (this.size.bottom-this.size.top), 2);
    208                                     ]]></action>
     205                                        Single Player
     206                                        <action on="Press">
     207                                                <![CDATA[
     208                                                        updateSubmenu("submenuSinglePlayer", (this.parent.size.top+this.size.top), (this.size.bottom-this.size.top), 2);
     209                                                ]]>
     210                                        </action>
    209211                                </object>
    210212                               
     
    218220                                >
    219221                                        Multiplayer
    220                                         <action on="Press"><![CDATA[
    221                                                 updateSubmenu("submenuMultiplayer", (this.parent.size.top+this.size.top), (this.size.bottom-this.size.top), 2);
    222                                         ]]></action>
     222                                        <action on="Press">
     223                                            <![CDATA[
     224                                                    updateSubmenu("submenuMultiplayer", (this.parent.size.top+this.size.top), (this.size.bottom-this.size.top), 2);
     225                                            ]]>
     226                                        </action>
    223227                                </object>
    224228                               
     
    232236                                >
    233237                                        Tools <![CDATA[&]]> Options
    234                                         <action on="Press"><![CDATA[
    235                                                 updateSubmenu("submenuToolsAndOptions", (this.parent.size.top+this.size.top), (this.size.bottom-this.size.top), 2);
    236                                         ]]></action>
     238                                        <action on="Press">
     239                                                <![CDATA[
     240                                                        updateSubmenu("submenuToolsAndOptions", (this.parent.size.top+this.size.top), (this.size.bottom-this.size.top), 2);
     241                                                ]]>
     242                                        </action>
    237243                                </object>
    238244                               
     
    246252                                >
    247253                                        History
    248                                         <action on="Press"><![CDATA[
    249                                                 // close submenu if left open
     254                                        <action on="Press">
    250255                                                getGUIObjectByName("submenu").hidden = true;
    251                                                 // open history dialog
    252                         Engine.PushGuiPage("page_civinfo.xml");
    253                     ]]></action>
     256                                                <![CDATA[
     257                                                        Engine.PushGuiPage("page_civinfo.xml");
     258                                                ]]>
     259                                        </action>
    254260                                </object>
    255261                               
     
    262268                                        tooltip="Exit Game"
    263269                                >
    264                                         Exit
    265                                         <action on="Press"><![CDATA[
    266                                                 // close submenu if left open
     270                                        Exit Game
     271                                        <action on="Press">
    267272                                                getGUIObjectByName("submenu").hidden = true;
    268                                                 // open exit dialog
    269                                                 var btCaptions = ["Yes", "No"];
    270                                                 var btCode = [exit, null];
    271                                                 messageBox(400, 200, "Are you sure you want to quit 0 A.D.?", "Confirmation", 0, btCaptions, btCode);
    272                                         ]]></action>
     273                                                <![CDATA[
     274                                                        var btCaptions = ["Yes", "No"];
     275                                                        var btCode = [exit, null];
     276                                                        messageBox(400, 200, "Are you sure you want to quit 0 A.D.?", "Confirmation", 0, btCaptions, btCode);
     277                                                ]]>
     278                                        </action>
    273279                                </object>
    274280                        </object>
  • ps/trunk/binaries/data/mods/public/gui/session/menu.js

    r10072 r10114  
    1 function toggleDeveloperOverlay()
     1function openMenu()
    22{
    3     var devCommands = getGUIObjectByName("devCommands");
    4     var text = devCommands.hidden? "opened." : "closed.";
    5     submitChatDirectly("The Developer Overlay was " + text);
    6     devCommands.hidden = !devCommands.hidden;
     3    getGUIObjectByName("menuScreen").hidden = false;
     4    getGUIObjectByName("menu").hidden = false;
    75}
    86
    9 function openMenuDialog()
     7function closeMenu()
    108{
    11     var menu = getGUIObjectByName("menuDialogPanel");
    12     g_SessionDialog.open("Menu", null, menu, 204, 224, null);
     9    getGUIObjectByName("menuScreen").hidden = true;
     10    getGUIObjectByName("menu").hidden = true;
    1311}
    1412
    15 function openSettingsDialog()
     13function openSettings()
    1614{
    17     var settings = getGUIObjectByName("settingsDialogPanel");
    18     g_SessionDialog.open("Settings", null, settings, 340, 252, null);
     15        closeMenu();
     16        closeChat();
     17        getGUIObjectByName("settingsDialogPanel").hidden = false;
     18}
     19
     20function closeSettings()
     21{
     22        getGUIObjectByName("settingsDialogPanel").hidden = true;
    1923}
    2024
    2125function openChat()
    2226{
     27        closeMenu();
     28        closeSettings();
    2329    getGUIObjectByName("chatInput").focus(); // Grant focus to the input area
    2430    getGUIObjectByName("chatDialogPanel").hidden = false;
    25     g_SessionDialog.close();
     31   
    2632}
    2733
     
    3036    getGUIObjectByName("chatInput").caption = ""; // Clear chat input
    3137    getGUIObjectByName("chatDialogPanel").hidden = true;
    32     g_SessionDialog.close();
    3338}
    3439
    3540function toggleChatWindow()
    3641{
     42        closeSettings();
     43   
    3744    var chatWindow = getGUIObjectByName("chatDialogPanel");
    3845    var chatInput = getGUIObjectByName("chatInput");
     
    4451
    4552    chatWindow.hidden = !chatWindow.hidden;
    46     g_SessionDialog.close();
    4753}
    4854
    4955function togglePause()
    5056{
     57        closeMenu();
     58        closeChat();
     59        closeSettings();
     60   
    5161    var pauseOverlay = getGUIObjectByName("pauseOverlay");
    5262
     
    6373
    6474    pauseOverlay.hidden = !pauseOverlay.hidden;
    65     g_SessionDialog.close();
    6675}
    6776
    68 function openExitGameDialog()
     77function toggleDeveloperOverlay()
    6978{
    70     g_SessionDialog.open("Exit Game", "Do you really want to quit?", null, 320, 140, leaveGame);
     79    var devCommands = getGUIObjectByName("devCommands");
     80    var text = devCommands.hidden? "opened." : "closed.";
     81    submitChatDirectly("The Developer Overlay was " + text);
     82    devCommands.hidden = !devCommands.hidden;
    7183}
    7284
    7385function escapeKeyAction()
    7486{
    75     var sessionDialog =  getGUIObjectByName("sessionDialog");
    76    
    77     if (!sessionDialog.hidden)
    78         g_SessionDialog.close();
    79     else
    80         getGUIObjectByName("chatDialogPanel").hidden = true;
     87        closeMenu();
     88        closeChat();
     89        closeSettings();
    8190}
  • ps/trunk/binaries/data/mods/public/gui/session/session.xml

    r10108 r10114  
    3131
    3232        <!-- ================================  ================================ -->
    33         <!-- ALPHA LABELS (alpha, build time, revision) -->
    34         <!-- ================================  ================================ -->
    35        
    36         <!-- Displays Alpha name and number -->
    37         <object size="100%-200 32 100% 52" name="alphaLabel" type="text" style="centeredText" font="serif-bold-16" textcolor="white" ghost="true">
    38             ALPHA VI : Fortuna
    39         </object>
    40 
    41         <!-- Displays build date and revision number-->
    42         <object size="100%-200 52 100% 72" name="buildTimeLabel" type="text" style="centeredText" font="serif-12" textcolor="white" ghost="true">
    43             <action on="Load"><![CDATA[this.caption = buildTime(0) + " (" + buildTime(2) + ")";]]></action>
    44         </object>
    45    
    46         <!-- ================================  ================================ -->
    4733        <!-- HOTKEYS (For some reason, they won't work properly unless outside menu) -->
    4834        <!-- ================================  ================================ -->
     
    10490
    10591        <!-- Dev/cheat commands -->
    106         <object name="devCommands" size="100%-156 72 100%-16 232" type="image" sprite="devCommandsBackground"
     92        <object name="devCommands" size="100%-156 100 100%-8 260" type="image" sprite="devCommandsBackground"
    10793                hidden="true" hotkey="session.devcommands.toggle">
    10894            <action on="Press">
     
    209195
    210196        </object>
    211 
    212         <!-- ================================  ================================ -->
    213         <!-- Session Dialog -->
    214         <!-- ================================  ================================ -->
    215         <object name="sessionDialog"
     197       
     198        <!-- ================================  ================================ -->
     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="TranslucentPanelThinBorder"
     212                                type="image"
     213                                size="100%-164 0 100% 200"
     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% 32"
     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% 64"
     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% 96"
     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% 128"
     262                                                tooltip_style="sessionToolTip"
     263                                        >
     264                                                Exit Game
     265                                                <action on="Press">escapeKeyAction();<![CDATA[
     266                                                        var btCaptions = ["Yes", "No"];
     267                                                        var btCode = [exit, null];
     268                                                        messageBox(400, 200, "Are you sure you want to quit?", "Confirmation", 0, btCaptions, btCode);
     269                                                ]]></action>
     270                                        </object>
     271                                       
     272                                        <!-- Close button -->
     273                                        <object type="button"
     274                                                style="StoneButtonFancy"
     275                                                size="0 128 100% 160"
     276                                                tooltip_style="sessionToolTip"
     277                                        >
     278                                                Close
     279                                                <action on="Press">closeMenu();</action>
     280                                        </object>
     281                                </object>
     282                        </object>
     283                </object>
     284
     285        <!-- ================================  ================================ -->
     286        <!-- Settings Window -->
     287        <!-- ================================  ================================ -->
     288                <object name="settingsDialogPanel"
    216289            style="StonePanelLight"
    217290            type="image"
    218291            size="50%-180 50%-200 50%+180 50%+50"
    219292            hidden="true"
    220             z="30"
    221293        >
    222             <object name="sessionDialogTitleBar" size="50%-96 -16 50%+96 16" type="image" style="StoneDialogTitleBar">
    223                 <object name="sessionDialogTitle" type="text" style="TitleText" size="0 -2 100% 100%">Title</object>
    224             </object>
    225            
    226             <object name="sessionDialogMessage" size="20 10 100%-20 100%-48" type="text" style="dialogText"/>
    227 
    228             <object size="0 100%-48 100% 100%">
    229                 <object name="sessionDialogConfirm" size="32 100%-64 144 100%-32" type="button" style="StoneButton">
    230                     OK
    231                 <action on="Press"></action>
    232                 </object>
    233 
    234                 <object name="sessionDialogCancel" size="100%-144 100%-64 100%-32 100%-32" type="button" style="StoneButton">
    235                     Cancel
    236                 <action on="Press">g_SessionDialog.close();</action>
    237                 </object>
    238             </object>
    239         </object>
    240        
    241         <!-- ================================  ================================ -->
    242         <!-- Menu -->
    243         <!-- ================================  ================================ -->
    244         <object name="menuDialogPanel"
    245             size="0 50%-180 100% 50%+20"
    246             type="image"
    247             hidden="true"
    248             z="30"
    249         >
    250             <!-- Settings button -->
    251             <object type="button"
    252                 name="settingsButton"
    253                 style="StoneButtonFancy"
    254                 size="0 0 100% 32"
    255                 tooltip_style="sessionToolTip"
    256             >
    257                 Settings
    258                 <action on="Press">openSettingsDialog();</action>
    259             </object>
    260 
    261                 <!-- Chat button -->
    262                 <object type="button"
    263                     name="chatButton"
    264                     style="StoneButtonFancy"
    265                     size="0 32 100% 64"
    266                     tooltip_style="sessionToolTip"
    267                 >
    268                     Chat
    269                     <action on="Press">openChat();</action>
    270                 </object>
    271 
    272                 <!-- Pause Button -->
    273                 <object type="button"
    274                     name="pauseButton"
    275                     style="StoneButtonFancy"
    276                     size="0 64 100% 96"
    277                     tooltip_style="sessionToolTip"
    278                 >
    279                     <object name="pauseButtonText" type="text" style="CenteredButtonText" ghost="true">Pause</object>
    280                     <action on="Press">togglePause();</action>
    281                 </object>
    282 
    283                 <!-- Exit button -->
    284                 <object type="button"
    285                     name="menuExitButton"
    286                     style="StoneButtonFancy"
    287                     size="0 96 100% 128"
    288                     tooltip_style="sessionToolTip"
    289                 >
    290                     Quit
    291                     <action on="Press">
    292                         openExitGameDialog();
    293                     </action>
    294                 </object>
    295         </object>
    296 
    297         <!-- ================================  ================================ -->
    298         <!-- Settings Window -->
    299         <!-- ================================  ================================ -->
    300         <object name="settingsDialogPanel"
    301             style="TranslucentPanelThinBorder"
    302             type="image"
    303             size="80%-180 50%-200 50%+180 50%+50"
    304             hidden="true"
    305             z="30"
    306         >
    307             <!-- Settings / shadows -->
    308             <object size="0 10 100%-80 35" type="text" style="settingsText" ghost="true">Enable Shadows</object>
    309             <object name="shadowsCheckbox" size="100%-56 15 100%-30 40" type="checkbox" style="wheatCrossBox" checked="true">
    310                 <action on="Load">if (renderer.shadows) this.checked = true; else this.checked = false;</action>
    311                 <action on="Press">renderer.shadows = this.checked;</action>
    312             </object>   
    313            
    314             <!-- Settings / Shadow PCF -->
    315             <object size="0 35 100%-80 60" type="text" style="settingsText" ghost="true">Enable Shadow Filtering</object>
    316             <object name="shadowPCFCheckbox" size="100%-56 40 100%-30 65" type="checkbox" style="wheatCrossBox" checked="true">
    317                 <action on="Load">if (renderer.shadowPCF) this.checked = true; else this.checked = false;</action>
    318                 <action on="Press">renderer.shadowPCF = this.checked;</action>
    319             </object>
    320    
    321             <!-- Settings / Water -->
    322             <object size="0 60 100%-80 85" type="text" style="settingsText" ghost="true">Enable Water Reflections</object>
    323             <object name="fancyWaterCheckbox" size="100%-56 65 100%-30 90"  type="checkbox" style="wheatCrossBox" checked="true">
    324                 <action on="Load">if (renderer.fancyWater) this.checked = true; else this.checked = false;</action>
    325                 <action on="Press">renderer.fancyWater = this.checked;</action>
    326             </object>
    327                
    328             <!-- Settings / Music-->
    329             <object size="0 85 100%-80 110" type="text" style="settingsText" ghost="true">Enable Music</object>
    330             <object size="100%-56 90 100%-30 115" type="checkbox" style="wheatCrossBox" checked="true">
    331                 <action on="Press">if (this.checked) startMusic(); else stopMusic();</action>
    332             </object>
    333                
    334             <!-- Settings / Dev Overlay -->
    335             <object size="0 110 100%-80 135" type="text" style="settingsText" ghost="true">Developer Overlay</object>
    336                 <object size="100%-56 115 100%-30 140" type="checkbox" style="wheatCrossBox" checked="false">
    337                 <action on="Press">toggleDeveloperOverlay();</action>
    338             </object>
    339         </object>
     294                        <object name="sessionDialogTitleBar" size="50%-96 -16 50%+96 16" type="image" style="StoneDialogTitleBar">
     295                <object name="sessionDialogTitle" type="text" style="TitleText" size="0 -2 100% 100%">Settings</object>
     296            </object>
     297                       
     298                        <object style="TranslucentPanelThinBorder"
     299                                type="image"
     300                                size="32 32 100%-32 100%-64"
     301                        >
     302                                <!-- Settings / shadows -->
     303                                <object size="0 10 100%-80 35" type="text" style="RightLabelText" ghost="true">Enable Shadows</object>
     304                                <object name="shadowsCheckbox" size="100%-56 15 100%-30 40" type="checkbox" style="wheatCrossBox" checked="true">
     305                                        <action on="Load">if (renderer.shadows) this.checked = true; else this.checked = false;</action>
     306                                        <action on="Press">renderer.shadows = this.checked;</action>
     307                                </object>   
     308
     309                                <!-- Settings / Shadow PCF -->
     310                                <object size="0 35 100%-80 60" type="text" style="RightLabelText" ghost="true">Enable Shadow Filtering</object>
     311                                <object name="shadowPCFCheckbox" size="100%-56 40 100%-30 65" type="checkbox" style="wheatCrossBox" checked="true">
     312                                        <action on="Load">if (renderer.shadowPCF) this.checked = true; else this.checked = false;</action>
     313                                        <action on="Press">renderer.shadowPCF = this.checked;</action>
     314                                </object>
     315
     316                                <!-- Settings / Water -->
     317                                <object size="0 60 100%-80 85" type="text" style="RightLabelText" ghost="true">Enable Water Reflections</object>
     318                                <object name="fancyWaterCheckbox" size="100%-56 65 100%-30 90"  type="checkbox" style="wheatCrossBox" checked="true">
     319                                        <action on="Load">if (renderer.fancyWater) this.checked = true; else this.checked = false;</action>
     320                                        <action on="Press">renderer.fancyWater = this.checked;</action>
     321                                </object>
     322
     323                                <!-- Settings / Music-->
     324                                <object size="0 85 100%-80 110" type="text" style="RightLabelText" ghost="true">Enable Music</object>
     325                                <object size="100%-56 90 100%-30 115" type="checkbox" style="wheatCrossBox" checked="true">
     326                                        <action on="Press">if (this.checked) startMusic(); else stopMusic();</action>
     327                                </object>
     328
     329                                <!-- Settings / Dev Overlay -->
     330                                <object size="0 110 100%-80 135" type="text" style="RightLabelText" ghost="true">Developer Overlay</object>
     331                                        <object size="100%-56 115 100%-30 140" type="checkbox" style="wheatCrossBox" checked="false">
     332                                        <action on="Press">toggleDeveloperOverlay();</action>
     333                                </object>
     334                        </object>
     335                       
     336                        <!-- Close button -->
     337                        <object type="button"
     338                                style="StoneButton"
     339                                size="50%-64 100%-56 50%+64 100%-24"
     340                                tooltip_style="sessionToolTip"
     341                        >
     342                                Close
     343                                <action on="Press">this.parent.hidden = true</action>
     344                        </object>
     345                </object>
    340346
    341347    <!-- ================================  ================================ -->
     
    345351        type="image"
    346352        sprite="topPanel"
    347         size="-3 0 100%+3 32"
     353        size="-3 0 100%+3 40"
    348354    >
    349355        <!-- ================================  ================================ -->
     
    354360        >   
    355361            <!-- Food -->
    356             <object size="6 0 96 100%" type="image" style="resourceCounter" tooltip="Food" tooltip_style="sessionToolTipBold">
    357                 <object size="0 0 34 30" type="image" style="resourceIcon" cell_id="0"/>
    358                 <object size="32 0 100% 100%-2" type="text" style="resourceText" name="resourceFood"/>
     362            <object size="0 0 80 100%" type="image" style="resourceCounter" tooltip="Food" tooltip_style="sessionToolTipBold">
     363                <object size="0 -6 48 42" type="image" style="resourceIcon" cell_id="0"/>
     364                <object size="36 0 100% 100%-2" type="text" style="resourceText" name="resourceFood"/>
    359365            </object>
    360366
    361367            <!-- Wood -->
    362             <object size="98 0 188 100%" type="image" style="resourceCounter" tooltip="Wood" tooltip_style="sessionToolTipBold">
    363                 <object size="0 0 34 30" type="image" style="resourceIcon" cell_id="1"/>
    364                 <object size="32 0 100% 100%-2" type="text" style="resourceText" name="resourceWood"/>
     368            <object size="90 0 180 100%" type="image" style="resourceCounter" tooltip="Wood" tooltip_style="sessionToolTipBold">
     369                <object size="0 -6 48 42" type="image" style="resourceIcon" cell_id="1"/>
     370                <object size="36 0 100% 100%-2" type="text" style="resourceText" name="resourceWood"/>
    365371            </object>
    366372
    367373            <!-- Stone -->
    368             <object size="190 0 280 100%" type="image" style="resourceCounter" tooltip="Stone" tooltip_style="sessionToolTipBold">
    369                 <object size="0 2 34 30" type="image" style="resourceIcon" cell_id="2"/>
    370                 <object size="32 0 100% 100%-2" type="text" style="resourceText" name="resourceStone"/>
     374            <object size="180 0 270 100%" type="image" style="resourceCounter" tooltip="Stone" tooltip_style="sessionToolTipBold">
     375                <object size="0 -2 48 42" type="image" style="resourceIcon" cell_id="2"/>
     376                <object size="36 0 100% 100%-2" type="text" style="resourceText" name="resourceStone"/>
    371377            </object>
    372378
    373379            <!-- Metal -->
    374             <object size="282 0 372 100%"  type="image" style="resourceCounter" tooltip="Metal" tooltip_style="sessionToolTipBold">
    375                 <object size="0 0 34 30" type="image" style="resourceIcon" cell_id="3"/>
    376                 <object size="32 0 100% 100%-2" type="text" style="resourceText" name="resourceMetal"/>
     380            <object size="270 0 360 100%"  type="image" style="resourceCounter" tooltip="Metal" tooltip_style="sessionToolTipBold">
     381                <object size="0 -6 48 42" type="image" style="resourceIcon" cell_id="3"/>
     382                <object size="36 0 100% 100%-2" type="text" style="resourceText" name="resourceMetal"/>
    377383            </object>
    378384
    379385            <!-- Population -->
    380             <object size="374 0 464 100%" type="image" style="resourceCounter" tooltip="Population (current / limit)" tooltip_style="sessionToolTipBold">
    381                 <object size="-2 0 30 28" type="image" style="resourceIcon" cell_id="4"/>
    382                 <object size="32 0 100% 100%-2" type="text" style="resourceText" name="resourcePop"/>
     386            <object size="360 0 450 100%" type="image" style="resourceCounter" tooltip="Population (current / limit)" tooltip_style="sessionToolTipBold">
     387                <object size="0 -6 44 38" type="image" style="resourceIcon" cell_id="4"/>
     388                <object size="42 0 100% 100%-2" type="text" style="resourceText" name="resourcePop"/>
    383389            </object>
    384390        </object>
     
    394400        <!--<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>-->
    395401       
    396 
     402               
     403                <!-- ================================  ================================ -->
     404        <!-- ALPHA LABELS (alpha, build time, revision) -->
     405        <!-- ================================  ================================ -->
     406       
     407        <!-- Displays Alpha name and number -->
     408        <object size="70%-128 1 70%+128 100%" name="alphaLabel" type="text" style="CenteredLabelText" text_valign="top" ghost="true">
     409            ALPHA VI : Fortuna
     410                       
     411                        <!-- Displays build date and revision number-->
     412                        <object size="50%-128 0 50%+128 100%-3" name="buildTimeLabel" type="text" text_align="center" text_valign="bottom" font="serif-12" textcolor="white" ghost="true">
     413                                <action on="Load"><![CDATA[this.caption = buildTime(0) + " (" + buildTime(2) + ")";]]></action>
     414                        </object>
     415        </object>
     416
     417       
     418               
    397419        <!-- ================================  ================================ -->
    398420        <!-- Menu Button -->
     
    400422        <object type="button"
    401423            name="menuButton"
    402             size="100%-80 0 100%-4 100%"
     424            size="100%-164 4 100%-8 36"
     425                        style="StoneButtonFancy"
    403426            tooltip_style="sessionToolTip"
    404427        >
    405             <object size="0 0 100% 100%" type="image" sprite="menuButton" name="menuButtonText" ghost="true">MENU</object>
    406             <action on="Press">openMenuDialog();</action>
    407         </object> <!-- END OF MENU -->
     428                        <object size="50%-32 50%-16 50%+32 50%+16" type="image" sprite="menuButton" name="menuButtonText" ghost="true">MENU</object>
     429            <action on="Press">openMenu();</action>
     430        </object> <!-- END OF MENU BUTTON -->
    408431       
    409432    </object> <!-- END OF TOP PANEL -->
     
    669692
    670693            <object name="unitResearchPanel"
    671                 style="TranslucentPanel"
     694                style="TranslucentPanelThinBorder"
    672695                size="0 100%-56 100% 100%"
    673696                type="text"
     
    697720                size="4 -56 100% 0"
    698721                type="image"
    699                 style="TranslucentPanel"
     722                style="TranslucentPanelThinBorder"
    700723            >
    701724                <object size="-4 -2 52 54" type="image" sprite="snIconSheetTab" tooltip_style="sessionToolTipBottom" cell_id="3" tooltip="Production queue">
  • ps/trunk/binaries/data/mods/public/gui/session/utility_functions.js

    r10072 r10114  
    33const FAUNA = "fauna";
    44const SPECIAL = "special";
    5 
    6 //-------------------------------- -------------------------------- --------------------------------
    7 // Session Dialog (only one at a time)
    8 //-------------------------------- -------------------------------- --------------------------------
    9 var g_SessionDialog = new SessionDialog();
    10 
    11 function SessionDialog()
    12 {
    13     this.referencedPanel = {};
    14 }
    15 
    16 SessionDialog.prototype.open = function(title, message, referencedPanel, x, y, confirmFunction)
    17 {
    18     // hide previous panel referencedPanel if applicable
    19     if (this.referencedPanel)
    20         this.referencedPanel.hidden = true
    21 
    22     // set dialog title if applicable
    23     getGUIObjectByName("sessionDialogTitle").caption = title? title : "";
    24 
    25     // set dialog message if applicable
    26     getGUIObjectByName("sessionDialogMessage").caption = message? message : "";
    27 
    28     // set panel reference if applicable
    29     if(referencedPanel)
    30     {
    31         referencedPanel.size =  "50%-" + ((x/2)-30) + " 50%-" + ((y/2)-30) + " 50%+" + ((x/2)-30) + " 50%+" + ((y/2)-72);
    32         referencedPanel.hidden = false;
    33         this.referencedPanel = referencedPanel;
    34     }
    35 
    36     // set confirm function if applicable
    37     if (confirmFunction)
    38     {
    39         var buttonFunction = function () {
    40             this.close(referencedPanel); // "this" is defined as SessionDialog in this context
    41             confirmFunction();
    42         };
    43 
    44         var dialog = this;
    45         var confirmButton = getGUIObjectByName("sessionDialogConfirm");
    46         confirmButton.onpress = function() { buttonFunction.call(dialog); };
    47         confirmButton.hidden = false;
    48         confirmButton.size = "32 100%-56 144 100%-24";
    49         getGUIObjectByName("sessionDialogCancel").size = "100%-144 100%-56 100%-32 100%-24";
    50         getGUIObjectByName("sessionDialogCancel").caption = "Cancel";
    51     }
    52     else
    53     {
    54         getGUIObjectByName("sessionDialogConfirm").hidden = true;
    55         getGUIObjectByName("sessionDialogCancel").size = "50%-72 100%-56 50%+72 100%-24";
    56         getGUIObjectByName("sessionDialogCancel").caption = "Close";
    57     }
    58 
    59     getGUIObjectByName("sessionDialog").size = "50%-" + x/2 + " 50%-" + y/2 + " 50%+" + x/2 + " 50%+" + y/2;
    60     getGUIObjectByName("sessionDialog").hidden = false;
    61 };
    62 
    63 
    64 SessionDialog.prototype.close = function()
    65 {
    66     getGUIObjectByName("sessionDialog").hidden = true;
    67     if (this.referencedPanel)
    68         this.referencedPanel.hidden = true;
    69 };
    705
    716//-------------------------------- -------------------------------- --------------------------------
     
    9732            "state": playerState.state,
    9833            "guid": undefined, // network guid for players controlled by hosts
    99             "disconnected": false, // flag for host-controlled players who have left the game
     34            "disconnected": false // flag for host-controlled players who have left the game
    10035        };
    10136        players.push(player);
Note: See TracChangeset for help on using the changeset viewer.