Last change
on this file since 10855 was
8079,
checked in by landauf, 14 years ago
|
merged usability branch back to trunk
incomplete summary of the changes in this branch:
- enhanced keyboard navigation in GUIs
- implemented new graphics menu and changeable window size at runtime
- added developer mode
- HUD shows if game is paused, game pauses if ingame menu is opened
- removed a few obsolete commands and hid some that are more for internal use
- numpad works in console and gui
- faster loading of level info
- enhanced usage of compositors (Shader class)
- improved camera handling, configurable FOV and aspect ratio
|
-
Property svn:eol-style set to
native
|
File size:
960 bytes
|
Line | |
---|
1 | -- DecisionPopup.lua |
---|
2 | |
---|
3 | local P = createMenuSheet("DecisionPopup") |
---|
4 | |
---|
5 | function P.onLoad() |
---|
6 | |
---|
7 | --button are arranged in a 1x2 matrix |
---|
8 | P:setButton(1, 1, { |
---|
9 | ["button"] = winMgr:getWindow("orxonox/DecisionPopup_button_yes"), |
---|
10 | ["callback"] = P.button_yes |
---|
11 | }) |
---|
12 | |
---|
13 | P:setButton(1, 2, { |
---|
14 | ["button"] = winMgr:getWindow("orxonox/DecisionPopup_button_no"), |
---|
15 | ["callback"] = P.button_no |
---|
16 | }) |
---|
17 | end |
---|
18 | |
---|
19 | function P.onShow() |
---|
20 | P:setSelection(1, 1) |
---|
21 | end |
---|
22 | |
---|
23 | function P.setCallback(functionPtr) |
---|
24 | P.functionPtr = functionPtr |
---|
25 | end |
---|
26 | |
---|
27 | function P.setText( text ) |
---|
28 | winMgr:getWindow("orxonox/DecisionPopup_text"):setText( text ) |
---|
29 | end |
---|
30 | |
---|
31 | -- events for ingamemenu |
---|
32 | function P.button_yes(e) |
---|
33 | if P.functionPtr ~= nil then |
---|
34 | P.functionPtr(true) |
---|
35 | end |
---|
36 | hideMenuSheet("DecisionPopup") |
---|
37 | end |
---|
38 | |
---|
39 | function P.button_no(e) |
---|
40 | if P.functionPtr ~= nil then |
---|
41 | P.functionPtr(false) |
---|
42 | end |
---|
43 | hideMenuSheet("DecisionPopup") |
---|
44 | end |
---|
45 | |
---|
46 | return P |
---|
47 | |
---|
Note: See
TracBrowser
for help on using the repository browser.