Last change
on this file since 6519 was
6459,
checked in by rgrieder, 15 years ago
|
Simplified BasicGUI construction. Just give the name of the GUI as argument. The rest will be deduced.
|
-
Property svn:eol-style set to
native
|
File size:
666 bytes
|
Rev | Line | |
---|
[6145] | 1 | -- DecisionPopup.lua |
---|
| 2 | |
---|
| 3 | BasicGUI = require("BasicGUI") |
---|
[6459] | 4 | local P = BasicGUI:new("DecisionPopup") |
---|
[6145] | 5 | if _REQUIREDNAME == nil then |
---|
| 6 | DecisionPopup = P |
---|
| 7 | else |
---|
| 8 | _G[_REQUIREDNAME] = P |
---|
| 9 | end |
---|
| 10 | |
---|
| 11 | function P:init() |
---|
| 12 | end |
---|
| 13 | |
---|
| 14 | function P.setCallback(functionPtr) |
---|
| 15 | P.functionPtr = functionPtr |
---|
| 16 | end |
---|
| 17 | |
---|
| 18 | function P.setText( text ) |
---|
| 19 | winMgr:getWindow("orxonox/DecisionPopup_text"):setText( text ) |
---|
| 20 | end |
---|
| 21 | |
---|
| 22 | -- events for ingamemenu |
---|
| 23 | function P.button_yes(e) |
---|
| 24 | if P.functionPtr ~= nil then |
---|
| 25 | P.functionPtr(true) |
---|
| 26 | end |
---|
[6266] | 27 | hideGUI("DecisionPopup") |
---|
[6145] | 28 | end |
---|
| 29 | |
---|
| 30 | function P.button_no(e) |
---|
| 31 | if P.functionPtr ~= nil then |
---|
| 32 | P.functionPtr(false) |
---|
| 33 | end |
---|
[6266] | 34 | hideGUI("DecisionPopup") |
---|
[6145] | 35 | end |
---|
| 36 | |
---|
| 37 | return P |
---|
| 38 | |
---|
Note: See
TracBrowser
for help on using the repository browser.