Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/usability/data/gui/scripts/SettingsMenu.lua @ 7924

Last change on this file since 7924 was 7924, checked in by landauf, 13 years ago
  • the "back" button of MultiplayerMenu and SettingsMenu now fills the whole row at the bottom, so it can be accessed from both columns by pressing 'down'
  • added keyboard support for KeyBindMenu, MiscConfigMenu, and MouseControlsMenu
  • Property svn:eol-style set to native
File size: 1.9 KB
Line 
1-- SettingsMenu.lua
2
3local P = createMenuSheet("SettingsMenu")
4P.loadAlong = { "ControlsMenu", "AudioMenu", "GraphicsMenu" }
5
6function P.onLoad()
7    --"Gameplay" and "Multiplayer Options" are not integrated in the list
8    --buttons are arranged in a 4x2 matrix. The lower-right element is not in the matrix!
9    P:initButtons(4, 2)
10
11    P:setButton(1, 2, {
12            ["button"] = winMgr:getWindow("orxonox/SettingsMenu/GraphicsButton"),
13            ["callback"]  = P.SettingsGraphicsButton_clicked
14    })
15
16    P:setButton(2, 2, {
17            ["button"] = winMgr:getWindow("orxonox/SettingsMenu/AudioButton"),
18            ["callback"]  = P.SettingsAudioButton_clicked
19    })
20
21    P:setButton(3, 1, {
22            ["button"] = winMgr:getWindow("orxonox/SettingsMenu/ControlsButton"),
23            ["callback"]  = P.SettingsControlsButton_clicked
24    })
25
26    P:setButton(3, 2, {
27            ["button"] = winMgr:getWindow("orxonox/SettingsMenu/MiscellaneousButton"),
28            ["callback"]  = P.SettingsMiscellaneousButton_clicked
29    })
30
31    P:setButton(4, 1, {
32            ["button"] = winMgr:getWindow("orxonox/SettingsMenu/SettingsBackButton"),
33            ["callback"]  = P.SettingsBackButton_clicked
34    })
35
36    P:setButton(4, 2, P:getButton(4, 1))
37end
38
39function P.SettingsGameplayButton_clicked(e)
40    showMenuSheet("GameplayMenu", true)
41end
42
43function P.SettingsMultiplayerOptionsButton_clicked(e)
44    showMenuSheet("MultiplayerOptionsMenu", true)
45end
46
47function P.SettingsControlsButton_clicked(e)
48    showMenuSheet("ControlsMenu", true)
49end
50
51function P.SettingsGraphicsButton_clicked(e)
52    showMenuSheet("GraphicsMenu", true)
53end
54
55function P.SettingsAudioButton_clicked(e)
56    showMenuSheet("AudioMenu", true)
57end
58
59function P.SettingsMiscellaneousButton_clicked(e)
60    showMenuSheet("MiscConfigMenu", true)
61end
62
63function P.SettingsBackButton_clicked(e)
64    hideMenuSheet(P.name)
65end
66
67return P
68
Note: See TracBrowser for help on using the repository browser.