Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/cegui0.8_ogre1.9/data/gui/scripts/DecisionPopup.lua @ 12105

Last change on this file since 12105 was 11800, checked in by landauf, 7 years ago

updated Settings.lua and all sub-menus to cegui 0.8

  • Property svn:eol-style set to native
File size: 1014 bytes
RevLine 
[6145]1-- DecisionPopup.lua
2
[6746]3local P = createMenuSheet("DecisionPopup")
[6145]4
[7726]5function P.onLoad()
6
7    --button are arranged in a 1x2 matrix
[8079]8    P:setButton(1, 1, {
[11800]9            ["button"] = P.window:getChild("DecisionPopup_Background/DecisionPopup_button_yes"),
[8079]10            ["callback"]  = P.button_yes
11    })
[7726]12
[8079]13    P:setButton(1, 2, {
[11800]14            ["button"] = P.window:getChild("DecisionPopup_Background/DecisionPopup_button_no"),
[8079]15            ["callback"]  = P.button_no
16    })
17end
[7726]18
[8079]19function P.onShow()
20    P:setSelection(1, 1)
[7726]21end
22
[6145]23function P.setCallback(functionPtr)
24    P.functionPtr = functionPtr
25end
26
27function P.setText( text )
[11800]28    P.window:getChild("DecisionPopup_Background/DecisionPopup_text"):setText( text )
[6145]29end
30
31-- events for ingamemenu
32function P.button_yes(e)
33    if P.functionPtr ~= nil then
34        P.functionPtr(true)
35    end
[6746]36    hideMenuSheet("DecisionPopup")
[6145]37end
38
39function P.button_no(e)
40    if P.functionPtr ~= nil then
41        P.functionPtr(false)
42    end
[6746]43    hideMenuSheet("DecisionPopup")
[6145]44end
45
46return P
47
Note: See TracBrowser for help on using the repository browser.