| 
                Last change
                  on this file since 6476 was
                  6403,
                  checked in by rgrieder, 16 years ago
           | 
        
        
          | 
               
Added lua convenience function for console commmands: orxonox.execute(cmd) 
Also replaced the config commands with the actual orxonox.config function. 
 
           | 
        
        
          
            
              - 
                  Property svn:eol-style set to
                  
native
               
             
           | 
        
        | 
            File size:
            752 bytes
           | 
      
      
        
  | Line |   | 
|---|
| 1 | -- MainMenu.lua | 
|---|
| 2 |  | 
|---|
| 3 | BasicGUI = require("BasicGUI") | 
|---|
| 4 | local P = BasicGUI:new() --inherit everything from the gui package | 
|---|
| 5 | if _REQUIREDNAME == nil then | 
|---|
| 6 |     MainMenu = P | 
|---|
| 7 | else | 
|---|
| 8 |     _G[_REQUIREDNAME] = P | 
|---|
| 9 | end | 
|---|
| 10 |  | 
|---|
| 11 | P.filename = "MainMenu" | 
|---|
| 12 | P.layoutString = "MainMenu.layout" | 
|---|
| 13 |  | 
|---|
| 14 | -- events for MainMenu | 
|---|
| 15 | function P.QuickGameTestButton_clicked(e) | 
|---|
| 16 |     orxonox.execute("startGame") | 
|---|
| 17 | end | 
|---|
| 18 |  | 
|---|
| 19 | function P.SingleplayerButton_clicked(e) | 
|---|
| 20 |     showGUI("SingleplayerMenu", true) | 
|---|
| 21 | end | 
|---|
| 22 |  | 
|---|
| 23 | function P.MultiplayerButton_clicked(e) | 
|---|
| 24 |     showGUI("MultiplayerMenu", true) | 
|---|
| 25 | end | 
|---|
| 26 |  | 
|---|
| 27 | function P.SettingsButton_clicked(e) | 
|---|
| 28 |     showGUI("SettingsMenu", true) | 
|---|
| 29 | end | 
|---|
| 30 |  | 
|---|
| 31 | function P.CreditsButton_clicked(e) | 
|---|
| 32 |     showGUI("CreditsMenu", true) | 
|---|
| 33 | end | 
|---|
| 34 |  | 
|---|
| 35 | function P.ExitButton_clicked(e) | 
|---|
| 36 |     orxonox.execute("exit") | 
|---|
| 37 | end | 
|---|
| 38 |  | 
|---|
| 39 | return P | 
|---|
| 40 |  | 
|---|
       
      
      Note: See 
TracBrowser
        for help on using the repository browser.