Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/gamestate/data/gui/scripts/DecisionPopup.lua @ 6518

Last change on this file since 6518 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
Line 
1-- DecisionPopup.lua
2
3BasicGUI = require("BasicGUI")
4local P = BasicGUI:new("DecisionPopup")
5if _REQUIREDNAME == nil then
6    DecisionPopup = P
7else
8    _G[_REQUIREDNAME] = P
9end
10
11function P:init()
12end
13
14function P.setCallback(functionPtr)
15    P.functionPtr = functionPtr
16end
17
18function P.setText( text )
19    winMgr:getWindow("orxonox/DecisionPopup_text"):setText( text )
20end
21
22-- events for ingamemenu
23function P.button_yes(e)
24    if P.functionPtr ~= nil then
25        P.functionPtr(true)
26    end
27    hideGUI("DecisionPopup")
28end
29
30function P.button_no(e)
31    if P.functionPtr ~= nil then
32        P.functionPtr(false)
33    end
34    hideGUI("DecisionPopup")
35end
36
37return P
38
Note: See TracBrowser for help on using the repository browser.