[6363] | 1 | -- SettingsMenu.lua |
---|
| 2 | |
---|
[6746] | 3 | local P = createMenuSheet("SettingsMenu") |
---|
[6748] | 4 | P.loadAlong = { "ControlsMenu", "AudioMenu", "GraphicsMenu" } |
---|
[6363] | 5 | |
---|
[7663] | 6 | P.buttonList = {} |
---|
| 7 | |
---|
| 8 | function P.onLoad() |
---|
| 9 | --"Gameplay" and "Multiplayer Options" are not integrated in the list |
---|
| 10 | |
---|
| 11 | local item = { |
---|
| 12 | ["button"] = winMgr:getWindow("orxonox/SettingsMenu/GraphicsButton"), |
---|
| 13 | ["function"] = P.SettingsGraphicsButton_clicked |
---|
| 14 | } |
---|
| 15 | P.buttonList[2] = item |
---|
| 16 | |
---|
| 17 | local item = { |
---|
| 18 | ["button"] = winMgr:getWindow("orxonox/SettingsMenu/AudioButton"), |
---|
| 19 | ["function"] = P.SettingsAudioButton_clicked |
---|
| 20 | } |
---|
| 21 | P.buttonList[4] = item |
---|
| 22 | |
---|
| 23 | |
---|
| 24 | local item = { |
---|
| 25 | ["button"] = winMgr:getWindow("orxonox/SettingsMenu/ControlsButton"), |
---|
| 26 | ["function"] = P.SettingsControlsButton_clicked |
---|
| 27 | } |
---|
| 28 | P.buttonList[5] = item |
---|
| 29 | |
---|
| 30 | local item = { |
---|
| 31 | ["button"] = winMgr:getWindow("orxonox/SettingsMenu/MiscellaneousButton"), |
---|
| 32 | ["function"] = P.SettingsMiscellaneousButton_clicked |
---|
| 33 | } |
---|
| 34 | P.buttonList[6] = item |
---|
| 35 | |
---|
| 36 | local item = { |
---|
| 37 | ["button"] = winMgr:getWindow("orxonox/SettingsMenu/SettingsBackButton"), |
---|
| 38 | ["function"] = P.SettingsBackButton_clicked |
---|
| 39 | } |
---|
| 40 | P.buttonList[7] = item |
---|
| 41 | |
---|
| 42 | end |
---|
| 43 | |
---|
| 44 | function P.onShow() |
---|
| 45 | P.oldindex = 3 |
---|
| 46 | P.index = 2 |
---|
| 47 | end |
---|
| 48 | |
---|
[6363] | 49 | function P.SettingsGameplayButton_clicked(e) |
---|
[6746] | 50 | showMenuSheet("GameplayMenu", true) |
---|
[6363] | 51 | end |
---|
| 52 | |
---|
| 53 | function P.SettingsMultiplayerOptionsButton_clicked(e) |
---|
[6746] | 54 | showMenuSheet("MultiplayerOptionsMenu", true) |
---|
[6363] | 55 | end |
---|
| 56 | |
---|
| 57 | function P.SettingsControlsButton_clicked(e) |
---|
[6746] | 58 | showMenuSheet("ControlsMenu", true) |
---|
[6363] | 59 | end |
---|
| 60 | |
---|
| 61 | function P.SettingsGraphicsButton_clicked(e) |
---|
[6746] | 62 | showMenuSheet("GraphicsMenu", true) |
---|
[6363] | 63 | end |
---|
| 64 | |
---|
| 65 | function P.SettingsAudioButton_clicked(e) |
---|
[6746] | 66 | showMenuSheet("AudioMenu", true) |
---|
[6363] | 67 | end |
---|
| 68 | |
---|
[7163] | 69 | function P.SettingsMiscellaneousButton_clicked(e) |
---|
| 70 | showMenuSheet("MiscConfigMenu", true) |
---|
[6363] | 71 | end |
---|
| 72 | |
---|
| 73 | function P.SettingsBackButton_clicked(e) |
---|
[6746] | 74 | hideMenuSheet(P.name) |
---|
[6363] | 75 | end |
---|
| 76 | |
---|
[7663] | 77 | function P.onKeyPressed() |
---|
| 78 | cout(0,code) |
---|
| 79 | buttonIteratorHelper(P.buttonList, code, P, 4, 2) |
---|
| 80 | --indexTester(P.buttonList,code,P,4,2) |
---|
| 81 | end |
---|
| 82 | |
---|
[6363] | 83 | return P |
---|
| 84 | |
---|