Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/trunk/data/gui/scripts/SettingsMenu.lua @ 7760

Last change on this file since 7760 was 7689, checked in by dafrick, 14 years ago

Merging menu branch to trunk.

  • Property svn:eol-style set to native
File size: 2.1 KB
RevLine 
[6363]1-- SettingsMenu.lua
2
[6746]3local P = createMenuSheet("SettingsMenu")
[6748]4P.loadAlong = { "ControlsMenu", "AudioMenu", "GraphicsMenu" }
[6363]5
[7689]6P.buttonList = {}
7
8function P.onLoad()
9    --"Gameplay" and "Multiplayer Options" are not integrated in the list
10    --buttons are arranged in a 4x2 matrix. The lower-right element is not in the matrix!
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
42end
43
44function P.onShow()
45    --indices to iterate through buttonlist
46    P.oldindex = 3
47    P.index = 2
48end
49
[6363]50function P.SettingsGameplayButton_clicked(e)
[6746]51    showMenuSheet("GameplayMenu", true)
[6363]52end
53
54function P.SettingsMultiplayerOptionsButton_clicked(e)
[6746]55    showMenuSheet("MultiplayerOptionsMenu", true)
[6363]56end
57
58function P.SettingsControlsButton_clicked(e)
[6746]59    showMenuSheet("ControlsMenu", true)
[6363]60end
61
62function P.SettingsGraphicsButton_clicked(e)
[6746]63    showMenuSheet("GraphicsMenu", true)
[6363]64end
65
66function P.SettingsAudioButton_clicked(e)
[6746]67    showMenuSheet("AudioMenu", true)
[6363]68end
69
[7163]70function P.SettingsMiscellaneousButton_clicked(e)
71    showMenuSheet("MiscConfigMenu", true)
[6363]72end
73
74function P.SettingsBackButton_clicked(e)
[6746]75    hideMenuSheet(P.name)
[6363]76end
77
[7689]78function P.onKeyPressed() 
79    buttonIteratorHelper(P.buttonList, code, P, 4, 2)
80end
81
[6363]82return P
83
Note: See TracBrowser for help on using the repository browser.