Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/trunk/data/gui/scripts/MainMenu.lua @ 12209

Last change on this file since 12209 was 11795, checked in by landauf, 7 years ago

merged ogre1.9 (including cegui0.8) into new branch

  • Property svn:eol-style set to native
File size: 1.9 KB
RevLine 
[5661]1-- MainMenu.lua
[5491]2
[6746]3local P = createMenuSheet("MainMenu")
[11356]4P.loadAlong = { "SingleplayerMenu", "MultiplayerMenu", "HighscoreMenu", "SettingsMenu", "CreditsMenu" }
[5491]5
[7689]6function P.onLoad()
7    --buttons are arranged in a 6x1 Matrix (list)
[8079]8    P:setButton(1, 1, {
[11795]9            ["button"] = P.window:getChild("QuickGameTestButton"),
[8079]10            ["callback"]  = P.QuickGameTestButton_clicked
11    })
[7689]12
[8079]13    P:setButton(2, 1, {
[11795]14            ["button"] = P.window:getChild("SingleplayerButton"),
[8079]15            ["callback"]  = P.SingleplayerButton_clicked
16    })
[7689]17
[8079]18    P:setButton(3, 1, {
[11795]19            ["button"] = P.window:getChild("MultiplayerButton"),
[8079]20            ["callback"]  = P.MultiplayerButton_clicked
21    })
[7689]22
[8079]23    P:setButton(4, 1, {
[11795]24            ["button"] = P.window:getChild("HighscoreButton"),
[11356]25            ["callback"]  = P.MultiplayerButton_clicked
26    })
27
28    P:setButton(5, 1, {
[11795]29            ["button"] = P.window:getChild("SettingsButton"),
[8079]30            ["callback"]  = P.SettingsButton_clicked
31    })
[7689]32
[11356]33    P:setButton(6, 1, {
[11795]34            ["button"] = P.window:getChild("CreditsButton"),
[8079]35            ["callback"]  = P.CreditsButton_clicked
36    })
[7689]37
[11356]38    P:setButton(7, 1, {
[11795]39            ["button"] = P.window:getChild("ExitButton"),
[8079]40            ["callback"]  = P.ExitButton_clicked
41    })
[7689]42end
43
[6417]44-- events for MainMenu
45function P.QuickGameTestButton_clicked(e)
[7163]46    hideAllMenuSheets()
[6417]47    orxonox.execute("startGame")
[5491]48end
49
[6417]50function P.SingleplayerButton_clicked(e)
[6746]51    showMenuSheet("SingleplayerMenu", true)
[5491]52end
53
[6417]54function P.MultiplayerButton_clicked(e)
[6746]55    showMenuSheet("MultiplayerMenu", true)
[5491]56end
57
[11356]58function P.HighscoreButton_clicked(e)
59    showMenuSheet("HighscoreMenu", true)
60end
61
[6417]62function P.SettingsButton_clicked(e)
[6746]63    showMenuSheet("SettingsMenu", true)
[5491]64end
65
[6417]66function P.CreditsButton_clicked(e)
[6746]67    showMenuSheet("CreditsMenu", true)
[5491]68end
69
[6417]70function P.ExitButton_clicked(e)
71    orxonox.execute("exit")
[5491]72end
73
[5661]74return P
[5491]75
Note: See TracBrowser for help on using the repository browser.