Last change
on this file since 7957 was
7689,
checked in by dafrick, 14 years ago
|
Merging menu branch to trunk.
|
-
Property svn:eol-style set to
native
|
File size:
1.3 KB
|
Rev | Line | |
---|
[6363] | 1 | -- ControlsMenu.lua |
---|
| 2 | |
---|
[6746] | 3 | local P = createMenuSheet("ControlsMenu") |
---|
[7689] | 4 | P.buttonList = {} |
---|
[6748] | 5 | P.loadAlong = { "MouseControlsMenu", "KeyBindMenu" } |
---|
[6363] | 6 | |
---|
[7689] | 7 | function P.onLoad() |
---|
| 8 | P.multiplayerMode = "startClient" |
---|
| 9 | |
---|
| 10 | --buttons are arranged in a 3x1 matrix: |
---|
| 11 | local item = { |
---|
| 12 | ["button"] = winMgr:getWindow("orxonox/MouseControlsButton"), |
---|
| 13 | ["function"] = P.ControlsMouseControlsButton_clicked |
---|
| 14 | } |
---|
| 15 | P.buttonList[1] = item |
---|
| 16 | |
---|
| 17 | local item = { |
---|
| 18 | ["button"] = winMgr:getWindow("orxonox/KeybindingsButton"), |
---|
| 19 | ["function"] = P.ControlsKeyboardControlsButton_clicked |
---|
| 20 | } |
---|
| 21 | P.buttonList[2] = item |
---|
| 22 | |
---|
| 23 | local item = { |
---|
| 24 | ["button"] = winMgr:getWindow("orxonox/ControlsBackButton"), |
---|
| 25 | ["function"] = P.ControlsBackButton_clicked |
---|
| 26 | } |
---|
| 27 | P.buttonList[3] = item |
---|
| 28 | |
---|
| 29 | end |
---|
| 30 | |
---|
| 31 | function P.onShow() |
---|
| 32 | --indices to iterate through buttonlist |
---|
| 33 | P.oldindex = -2 |
---|
| 34 | P.index = -1 |
---|
| 35 | end |
---|
| 36 | |
---|
[6363] | 37 | function P.ControlsMouseControlsButton_clicked(e) |
---|
[6746] | 38 | showMenuSheet("MouseControlsMenu", true) |
---|
[6363] | 39 | end |
---|
| 40 | |
---|
| 41 | function P.ControlsKeyboardControlsButton_clicked(e) |
---|
[6746] | 42 | showMenuSheet("KeyBindMenu", true) |
---|
[6363] | 43 | end |
---|
| 44 | |
---|
| 45 | function P.ControlsBackButton_clicked(e) |
---|
[6746] | 46 | hideMenuSheet(P.name) |
---|
[6363] | 47 | end |
---|
| 48 | |
---|
[7689] | 49 | function P.onKeyPressed() |
---|
| 50 | buttonIteratorHelper(P.buttonList, code, P, 3, 1) |
---|
| 51 | end |
---|
| 52 | |
---|
[6363] | 53 | return P |
---|
| 54 | |
---|
Note: See
TracBrowser
for help on using the repository browser.