Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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
Note: See TracChangeset for help on using the changeset viewer.