Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 27, 2010, 1:11:24 PM (14 years ago)
Author:
konrad
Message:

changes in the multiplayer menu, 2 buttons instead of 3: host and join separated.

Location:
code/branches/menu/data/gui
Files:
2 added
4 edited

Legend:

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

    r6746 r7587  
    1010        <Window Type="MenuWidgets/Button" Name="orxonox/QuickGameTestButton" >
    1111            <Property Name="Text" Value="Quickstart" />
    12             <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
    1312            <Property Name="UnifiedAreaRect" Value="{{0.4,0},{0.2875,0},{0.6,0},{0.3375,0}}" />
    1413            <Event Name="Clicked" Function="MainMenu.QuickGameTestButton_clicked"/>
  • code/branches/menu/data/gui/layouts/MultiplayerMenu.layout

    r7163 r7587  
    88        <Property Name="UnifiedAreaRect" Value="{{0,0},{0,0},{1,0},{1,0}}" />
    99        <Property Name="BackgroundEnabled" Value="False" />
     10
     11
    1012        <Window Type="MenuWidgets/StaticText" Name="orxonox/MultiplayerWindow" >
    1113            <Property Name="Text" Value="Multiplayer" />
     
    2022                <Property Name="UnifiedAreaRect" Value="{{0.05,0},{0.15,0},{0.95,0},{0.8,0}}" />
    2123            </Window>
     24
     25        </Window>
     26            <!--
     27                Die Radiobuttons brauchen wir nicht mehr, dafuer ihre Funktionen.
     28                Neue Buttons:
     29                >join<          >host<     
     30       
     31
    2232            <Window Type="MenuWidgets/RadioButton" Name="orxonox/MultiplayerJoinButton" >
    2333                <Property Name="Text" Value="Join" />
    2434                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
    25                 <Property Name="UnifiedAreaRect" Value="{{0.1,0},{0.85,0},{0.3,0},{0.95,0}}" />
     35                <Property Name="UnifiedAreaRect" Value="{{0.2,0},{0.85,0},{0.4,0},{0.95,0}}" />
    2636                <Event Name="SelectStateChanged" Function="MultiplayerMenu.MultiplayerJoinButton_clicked"/>
    2737            </Window>
    2838            <Window Type="MenuWidgets/RadioButton" Name="orxonox/MultiplayerHostButton" >
    29                 <Property Name="Text" Value="Host" />
     39                <Property Name="Text" Value="Build Server"/>
    3040                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
    31                 <Property Name="UnifiedAreaRect" Value="{{0.4,0},{0.85,0},{0.6,0},{0.95,0}}" />
     41                <Property Name="UnifiedAreaRect" Value="{{0.6,0},{0.85,0},{0.8,0},{0.95,0}}" />
    3242                <Event Name="SelectStateChanged" Function="MultiplayerMenu.MultiplayerHostButton_clicked"/>
    3343            </Window>
     
    3848                <Event Name="SelectStateChanged" Function="MultiplayerMenu.MultiplayerDedicatedButton_clicked"/>
    3949            </Window>
    40         </Window>
     50
     51             -->
     52
     53                 <Window Type="MenuWidgets/Button" Name="orxonox/MultiplayerBackButton" >
     54                    <Property Name="Text" Value="Back" />
     55                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
     56                    <Property Name="UnifiedAreaRect" Value="{{0.7125,0},{0.8625,0},{0.9125,0},{0.9125,0}}" />
     57                    <Event Name="Clicked" Function="MultiplayerMenu.MultiplayerBackButton_clicked"/>
     58                </Window>
     59
     60                <Window Type="MenuWidgets/Button" Name="orxonox/MultiplayerJoinButton2" >
     61                    <Property Name="Text" Value="Join" />
     62                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
     63                    <Property Name="UnifiedAreaRect" Value="{{0.2875,0},{0.6625,0},{0.4875,0},{0.7125,0}}" />
     64                    <Event Name="Clicked" Function="MultiplayerMenu.MultiplayerJoinButton2_clicked"/>
     65                </Window>
     66
     67                <Window Type="MenuWidgets/Button" Name="orxonox/MultiplayerHostButton2" >
     68                    <Property Name="Text" Value="Host" />
     69                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
     70                    <Property Name="UnifiedAreaRect" Value="{{0.5125,0},{0.6625,0},{0.7125,0},{0.7125,0}}" />
     71                    <Event Name="Clicked" Function="MultiplayerMenu.MultiplayerHostButton2_clicked"/>
     72                </Window>
     73
     74        <!--
     75
    4176        <Window Type="MenuWidgets/Button" Name="orxonox/MultiplayerStartButton" >
    4277            <Property Name="Text" Value="Start" />
     
    5186            <Event Name="Clicked" Function="MultiplayerMenu.MultiplayerBackButton_clicked"/>
    5287        </Window>
     88       
     89        -->
     90
    5391    </Window>
    5492</GUILayout>
     93
  • code/branches/menu/data/gui/scripts/MenuSheet.lua

    r7163 r7587  
    1616    newSheet.bHidePrevious  = handleDefArg(_bHidePrevious,  true)
    1717    newSheet.tShowCursor    = handleDefArg(_tShowCusor,     TriBool.True)
    18     newSheet.tUseKeyboard   = handleDefArg(_tUseKeyboard,   TriBool.Dontcare)
     18    newSheet.tUseKeyboard   = handleDefArg(_tUseKeyboard,   TriBool.True)
    1919    newSheet.bBlockJoyStick = handleDefArg(_bBlockJoyStick, false)
    2020
  • code/branches/menu/data/gui/scripts/MultiplayerMenu.lua

    r7163 r7587  
    88
    99function P.onShow()
    10     if P.multiplayerMode == "startClient" then
    11         local window = winMgr:getWindow("orxonox/MultiplayerJoinButton")
    12         local button = tolua.cast(window,"CEGUI::RadioButton")
    13         button:setSelected(true)
    14         P.showServerList()
    15     end
    16     if P.multiplayerMode == "startServer" then
    17         local window = winMgr:getWindow("orxonox/MultiplayerHostButton")
    18         local button = tolua.cast(window,"CEGUI::RadioButton")
    19         button:setSelected(true)
    20         P.showLevelList()
    21     end
    22     if P.multiplayerMode == "startDedicated" then
    23         local window = winMgr:getWindow("orxonox/MultiplayerDedicatedButton")
    24         local button = tolua.cast(window,"CEGUI::RadioButton")
    25         button:setSelected(true)
    26         P.showLevelList()
    27     end
     10    P.showServerList()
    2811end
    2912
     
    4326end
    4427
    45 function P.MultiplayerStartButton_clicked(e)
     28function P.MultiplayerHostButton2_clicked(e)
     29    showMenuSheet("HostMenu", true)
     30end
     31
     32
     33function P.MultiplayerJoinButton2_clicked(e)
    4634    local choice = winMgr:getWindow("orxonox/MultiplayerListbox"):getFirstSelectedItem()
    47     if P.multiplayerMode == "startClient" then
    48         if choice then
    49             local client = orxonox.Client:getInstance()
    50             local index = tolua.cast(choice, "CEGUI::ListboxItem"):getID()
    51             client:setDestination( P.serverList[index][2], 55556 )
    52         else
    53             return
    54         end
     35    if choice then
     36        local client = orxonox.Client:getInstance()
     37        local index = tolua.cast(choice, "CEGUI::ListboxItem"):getID()
     38        client:setDestination( P.serverList[index][2], 55556 )
    5539    else
    56         if choice then
    57             orxonox.LevelManager:getInstance():setDefaultLevel(choice:getText() .. ".oxw")
    58         else
    59             return
    60         end
     40        return
    6141    end
    62     orxonox.execute(P.multiplayerMode)
     42    orxonox.execute("startClient")
    6343    hideAllMenuSheets()
    6444end
Note: See TracChangeset for help on using the changeset viewer.