Last change
on this file since 6202 was
6150,
checked in by scheusso, 15 years ago
|
merged menu branch to presentation2 branch with some additional fixes and features
|
-
Property svn:executable set to
*
|
File size:
1.5 KB
|
Line | |
---|
1 | -- NewGameplayMenu.lua |
---|
2 | |
---|
3 | BasicGUI = require("BasicGUI") |
---|
4 | local P = BasicGUI:new() --inherit everything from the gui package |
---|
5 | if _REQUIREDNAME == nil then |
---|
6 | NewGameplayMenu = P |
---|
7 | else |
---|
8 | _G[_REQUIREDNAME] = P |
---|
9 | end |
---|
10 | |
---|
11 | P.filename = "NewGameplayMenu" |
---|
12 | P.layoutString = "NewGameplayMenu.layout" |
---|
13 | |
---|
14 | function P:init() |
---|
15 | dropdown = winMgr:getWindow("orxonox/ThemeCombobox") |
---|
16 | preselect = orxonox.LevelManager:getInstance():getDefaultLevel() |
---|
17 | orxonox.LevelManager:getInstance():compileAvailableLevelList() |
---|
18 | local levelList = {} |
---|
19 | local index = 0 |
---|
20 | local level = "" |
---|
21 | while true do |
---|
22 | level = orxonox.LevelManager:getInstance():getAvailableLevelListItem(index) |
---|
23 | if level == "" then |
---|
24 | break |
---|
25 | end |
---|
26 | table.insert(levelList, level) |
---|
27 | index = index + 1 |
---|
28 | end |
---|
29 | table.sort(levelList) |
---|
30 | for k,v in pairs(levelList) do |
---|
31 | item = CEGUI.createListboxTextItem(v) |
---|
32 | item:setSelectionBrushImage("TaharezLook", "MultiListSelectionBrush") |
---|
33 | CEGUI.toCombobox(dropdown):addItem(item) |
---|
34 | if v .. ".oxw" == preselect then |
---|
35 | dropdown:setItemSelectState(item, true) |
---|
36 | end |
---|
37 | end |
---|
38 | end |
---|
39 | |
---|
40 | function P.GameplayDifficultyEasyButton_clicked(e) |
---|
41 | -- difficulty easy |
---|
42 | debug("event: easy") |
---|
43 | end |
---|
44 | |
---|
45 | function P.GameplayDifficultyNormalButton_clicked(e) |
---|
46 | -- difficulty normal |
---|
47 | debug("event: normal") |
---|
48 | end |
---|
49 | |
---|
50 | function P.GameplayDifficultyHardButton_clicked(e) |
---|
51 | -- difficulty hard |
---|
52 | debug("event: hard") |
---|
53 | end |
---|
54 | |
---|
55 | function P.GameplayBackButton_clicked(e) |
---|
56 | hideGUI("NewGameplayMenu") |
---|
57 | debug("event: back") |
---|
58 | end |
---|
59 | |
---|
60 | return P |
---|
61 | |
---|
Note: See
TracBrowser
for help on using the repository browser.