Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7588


Ignore:
Timestamp:
Oct 27, 2010, 1:15:28 PM (14 years ago)
Author:
dafrick
Message:

Adjustments to allow key input in MainMenu and first steps towards "tab"-behavior.

Location:
code/branches/menu
Files:
4 edited

Legend:

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

    r7587 r7588  
    4343            <Event Name="Clicked" Function="MainMenu.ExitButton_clicked"/>
    4444        </Window>
     45        <Event Name="KeyDown" Function="MainMenu.Key_clicked"/>
    4546    </Window>
    4647</GUILayout>
  • code/branches/menu/data/gui/layouts/MainMenuBackground.layout

    r6746 r7588  
    22<GUILayout>
    33    <Window Type="MenuWidgets/StaticImage" Name="orxonox/Background">
    4     <Property Name="UnifiedSize" Value="{{1.0,0},{1.0,0}}"/>
    5     <Property Name="Image" Value="set:MainMenuBackground image:Background"/>
    6     <Property Name="FrameEnabled" Value="set:true"/>
    7     <Property Name="BackgroundEnabled" Value="set:false"/>
    8     <Property Name="InheritsAlpha" Value="False" />
     4        <Property Name="UnifiedSize" Value="{{1.0,0},{1.0,0}}"/>
     5        <Property Name="Image" Value="set:MainMenuBackground image:Background"/>
     6        <Property Name="FrameEnabled" Value="set:true"/>
     7        <Property Name="BackgroundEnabled" Value="set:false"/>
     8        <Property Name="InheritsAlpha" Value="False" />
    99    </Window>
    1010</GUILayout>
  • code/branches/menu/data/gui/scripts/MainMenu.lua

    r7163 r7588  
    33local P = createMenuSheet("MainMenu")
    44P.loadAlong = { "SingleplayerMenu", "MultiplayerMenu", "SettingsMenu", "CreditsMenu" }
     5
     6P.index = 0
    57
    68-- events for MainMenu
     
    3032end
    3133
     34function P.Key_clicked(e)
     35    local we = tolua.cast(e, "CEGUI::KeyEventArgs")
     36    cout(0, tostring(we.scancode))
     37    if tostring(we.scancode) == "15" then
     38        P.index = P.index + 1
     39        local window = winMgr:getWindow("orxonox/MainMenuBackground")
     40        if P.index == window:getChildCount() then
     41            P.index = 1
     42        end
     43        local child = window:getChildAtIdx(P.index-1)
     44    elseif tostring(we.scancode) == "28" and P.index ~= 0 then
     45        if P.index == 1 then
     46            P.QuickGameTestButton_clicked()
     47        elseif P.index == 2 then
     48            P.SingleplayerButton_clicked()
     49        elseif P.index == 3 then
     50            P.MultiplayerButton_clicked()
     51        elseif P.index == 4 then
     52            P.SettingsButton_clicked()
     53        elseif P.index == 5 then
     54            P.CreditsButton_clicked()
     55        elseif P.index == 6 then
     56            P.ExitButton_clicked()
     57        end
     58    end
     59end
     60
    3261return P
    3362
  • code/branches/menu/src/orxonox/gamestates/GSMainMenu.cc

    r7284 r7588  
    6767        RegisterRootObject(GSMainMenu);
    6868
    69         InputManager::getInstance().createInputState("MainMenuHackery")->setKeyHandler(KeyBinderManager::getInstance().getDefaultAsHandler());
     69        InputManager::getInstance().createInputState("MainMenuHackery", true, true)->setKeyHandler(KeyBinderManager::getInstance().getDefaultAsHandler());
    7070
    7171        // create an empty Scene
Note: See TracChangeset for help on using the changeset viewer.