Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 2, 2009, 5:25:42 PM (15 years ago)
Author:
cmueri
Message:

The new menus (but not all functions of the menu) are now available.

Location:
code/branches/presentation2/data/gui
Files:
22 added
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation2/data/gui/layouts/MainMenu.layout

    r6150 r6206  
    1 <?xml version="1.0" ?>
    2 <GUILayout>
    3     <Window Type="DefaultWindow" Name="orxonox/MainMenuRootWindow">
    4     <Property Name="InheritsAlpha" Value="false"/>
    5         <Window Type="TaharezLook/Button" Name="orxonox/StandaloneButton">
    6             <Property Name="UnifiedPosition" Value="{{0.11,0},{0.3,0}}"/>
    7             <Property Name="UnifiedSize" Value="{{0.15,0},{0.05,0}}"/>
    8             <Property Name="Text" Value="Standalone"/>
    9             <Property Name="Disabled" Value="true"/>
    10             <Event Name="Clicked" Function="MainMenu.button_standalone_clicked"/>
     1<?xml version="1.0" encoding="UTF-8"?>
     2
     3<GUILayout >
     4    <Window Type="TaharezLook/StaticImage" Name="orxonox/MainMenuBackground" >
     5        <Property Name="FrameEnabled" Value="False" />
     6        <Property Name="InheritsAlpha" Value="False" />
     7        <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
     8        <Property Name="UnifiedAreaRect" Value="{{0,0},{0,0},{1.02125,0},{1.02167,0}}" />
     9        <Property Name="BackgroundEnabled" Value="False" />
     10        <Window Type="TaharezLook/Button" Name="orxonox/QuickGameTestButton" >
     11            <Property Name="Text" Value="QUICK GAME TEST" />
     12            <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
     13            <Property Name="UnifiedAreaRect" Value="{{0.4,0},{0.25,0},{0.6,0},{0.3,0}}" />
     14            <Event Name="Clicked" Function="MainMenu.QuickGameTestButton_clicked"/>
    1115        </Window>
    12        
    13         <Window Type="TaharezLook/Listbox" Name="orxonox/LevelListbox">
    14             <Property Name="UnifiedPosition" Value="{{0.4,0},{0.3,0}}"/>
     16        <Window Type="TaharezLook/Button" Name="orxonox/SingleplayerButton" >
     17            <Property Name="Text" Value="Singleplayer" />
    1518            <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
    16             <Property Name="UnifiedSize" Value="{{0.35,0},{0.33,0}}" />
    17             <Property Name="Tooltip" Value="Available Levels." />
    18             <Event Name="ItemSelectionChanged" Function="MainMenu.listbox_level_selectionchanged" />
     19            <Property Name="UnifiedAreaRect" Value="{{0.4,0},{0.325,0},{0.6,0},{0.375,0}}" />
     20            <Event Name="Clicked" Function="MainMenu.SingleplayerButton_clicked"/>
    1921        </Window>
    20        
    21         <Window Type="TaharezLook/Button" Name="orxonox/DedicatedButton">
    22             <Property Name="UnifiedPosition" Value="{{0.11,0},{0.376,0}}"/>
    23             <Property Name="UnifiedSize" Value="{{0.15,0},{0.05,0}}"/>
    24             <Property Name="Text" Value="Dedicated"/>
    25             <Event Name="Clicked" Function="MainMenu.button_dedicated_clicked"/>
     22        <Window Type="TaharezLook/Button" Name="orxonox/MultiplayerButton" >
     23            <Property Name="Text" Value="Multiplayer" />
     24            <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
     25            <Property Name="UnifiedAreaRect" Value="{{0.4,0},{0.4,0},{0.6,0},{0.45,0}}" />
     26            <Event Name="Clicked" Function="MainMenu.MultiplayerButton_clicked"/>
    2627        </Window>
    27        
    28         <Window Type="TaharezLook/Button" Name="orxonox/ServerButton">
    29             <Property Name="UnifiedPosition" Value="{{0.11,0},{0.452,0}}"/>
    30             <Property Name="UnifiedSize" Value="{{0.15,0},{0.05,0}}"/>
    31             <Property Name="Text" Value="Server"/>
    32             <Event Name="Clicked" Function="MainMenu.button_server_clicked"/>
     28        <Window Type="TaharezLook/Button" Name="orxonox/SettingsButton" >
     29            <Property Name="Text" Value="Settings" />
     30            <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
     31            <Property Name="UnifiedAreaRect" Value="{{0.4,0},{0.475,0},{0.6,0},{0.525,0}}" />
     32            <Event Name="Clicked" Function="MainMenu.SettingsButton_clicked"/>
    3333        </Window>
    34        
    35         <Window Type="TaharezLook/Button" Name="orxonox/ClientButton">
    36             <Property Name="UnifiedPosition" Value="{{0.11,0},{0.528,0}}"/>
    37             <Property Name="UnifiedSize" Value="{{0.15,0},{0.05,0}}"/>
    38             <Property Name="Text" Value="Client"/>
    39             <Event Name="Clicked" Function="MainMenu.button_client_clicked"/>
     34        <Window Type="TaharezLook/Button" Name="orxonox/CreditsButton" >
     35            <Property Name="Text" Value="Credits" />
     36            <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
     37            <Property Name="UnifiedAreaRect" Value="{{0.4,0},{0.55,0},{0.6,0},{0.6,0}}" />
     38            <Event Name="Clicked" Function="MainMenu.CreditsButton_clicked"/>
    4039        </Window>
    41        
    42         <Window Type="TaharezLook/Button" Name="orxonox/QuitButton">
    43             <Property Name="UnifiedPosition" Value="{{0.11,0},{0.604,0}}"/>
    44             <Property Name="UnifiedSize" Value="{{0.15,0},{0.05,0}}"/>
    45             <Property Name="Text" Value="Quit"/>
    46             <Event Name="Clicked" Function="MainMenu.button_quit_clicked"/>
     40        <Window Type="TaharezLook/Button" Name="orxonox/ExitButton" >
     41            <Property Name="Text" Value="Exit" />
     42            <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
     43            <Property Name="UnifiedAreaRect" Value="{{0.4,0},{0.625,0},{0.6,0},{0.675,0}}" />
     44            <Event Name="Clicked" Function="MainMenu.ExitButton_clicked"/>
    4745        </Window>
    4846    </Window>
  • code/branches/presentation2/data/gui/scripts/MainMenu.lua

    r6150 r6206  
    1212P.layoutString = "MainMenu.layout"
    1313
    14 function P:init()
    15     listbox = winMgr:getWindow("orxonox/LevelListbox")
    16     preselect = orxonox.LevelManager:getInstance():getDefaultLevel()
    17     orxonox.LevelManager:getInstance():compileAvailableLevelList()
    18     local levelList = {}
    19     local index = 0
    20     local level = ""
    21     while true do
    22       level = orxonox.LevelManager:getInstance():getAvailableLevelListItem(index)
    23       if level == "" then
    24         break
    25       end
    26       table.insert(levelList, level)
    27       index = index + 1
    28     end
    29     table.sort(levelList)
    30     for k,v in pairs(levelList) do
    31         item = CEGUI.createListboxTextItem(v)       
    32         item:setSelectionBrushImage("TaharezLook", "MultiListSelectionBrush")
    33         CEGUI.toListbox(listbox):addItem(item)
    34         if v .. ".oxw" == preselect then
    35             listbox:setItemSelectState(item, true)
    36         end
    37     end
     14-- events for MainMenu
     15function P.QuickGameTestButton_clicked(e)
     16    orxonox.CommandExecutor:execute("startGame")
    3817end
    3918
    40 
    41 -- events for mainmenu
    42 function P.button_quit_clicked(e)
    43     hideGUI()
    44     orxonox.CommandExecutor:execute("exit")
     19function P.SingleplayerButton_clicked(e)
     20    showGUI("SingleplayerMenu", true)
    4521end
    4622
    47 function P.button_standalone_clicked(e)
    48     choice = winMgr:getWindow("orxonox/LevelListbox"):getFirstSelectedItem()
    49     if choice then
    50         orxonox.LevelManager:getInstance():setDefaultLevel(choice:getText() .. ".oxw")
    51         orxonox.CommandExecutor:execute("startGame")
    52         hideGUI(P.filename)
    53     end
     23function P.MultiplayerButton_clicked(e)
     24    showGUI("MultiplayerMenu", true)
    5425end
    5526
    56 function P.button_server_clicked(e)
    57     choice = winMgr:getWindow("orxonox/LevelListbox"):getFirstSelectedItem()
    58     if choice then
    59         orxonox.LevelManager:getInstance():setDefaultLevel(choice:getText() .. ".oxw")
    60         orxonox.CommandExecutor:execute("startServer")
    61         hideGUI(P.filename)
    62     end
     27function P.SettingsButton_clicked(e)
     28    showGUI("SettingsMenu", true)
    6329end
    6430
    65 function P.button_dedicated_clicked(e)
    66     choice = winMgr:getWindow("orxonox/LevelListbox"):getFirstSelectedItem()
    67     if choice then
    68         orxonox.LevelManager:getInstance():setDefaultLevel(choice:getText() .. ".oxw")
    69         orxonox.CommandExecutor:execute("startDedicated")
    70         hideGUI(P.filename)
    71     end
     31function P.CreditsButton_clicked(e)
     32    showGUI("CreditsMenu", true)
    7233end
    7334
    74 function P.button_client_clicked(e)
    75     choice = winMgr:getWindow("orxonox/LevelListbox"):getFirstSelectedItem()
    76     if choice then
    77         orxonox.LevelManager:getInstance():setDefaultLevel(choice:getText() .. ".oxw")
    78         orxonox.CommandExecutor:execute("startClient")
    79         hideGUI(P.filename)
    80 
    81     end
    82 end
    83 
    84 function P.listbox_level_selectionchanged(e)
    85     if winMgr:getWindow("orxonox/LevelListbox"):getFirstSelectedItem() then
    86         winMgr:getWindow("orxonox/StandaloneButton"):enable()
    87     else
    88         winMgr:getWindow("orxonox/StandaloneButton"):disable()
    89     end
     35function P.ExitButton_clicked(e)
     36    orxonox.CommandExecutor:execute("exit")
    9037end
    9138
Note: See TracChangeset for help on using the changeset viewer.