[Orxonox-commit 1300] r6018 - in code/branches/ingamemenu/data/gui: layouts scripts

scheusso at orxonox.net scheusso at orxonox.net
Mon Nov 2 23:46:58 CET 2009


Author: scheusso
Date: 2009-11-02 23:46:58 +0100 (Mon, 02 Nov 2009)
New Revision: 6018

Added:
   code/branches/ingamemenu/data/gui/layouts/InGameMenu.layout
   code/branches/ingamemenu/data/gui/scripts/InGameMenu.lua
Log:
first version of the InGameMenu (return to main menu doesn't include level unloading yet)


Added: code/branches/ingamemenu/data/gui/layouts/InGameMenu.layout
===================================================================
--- code/branches/ingamemenu/data/gui/layouts/InGameMenu.layout	                        (rev 0)
+++ code/branches/ingamemenu/data/gui/layouts/InGameMenu.layout	2009-11-02 22:46:58 UTC (rev 6018)
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<GUILayout >
+    <Window Type="DefaultWindow" Name="orxonox/InGameMenu_RootWindow" >
+        <Property Name="InheritsAlpha" Value="False" />
+        <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+        <Property Name="UnifiedAreaRect" Value="{{0,0},{0,0},{1,0},{1,0}}" />
+        <Window Type="TaharezLook/Button" Name="orxonox/InGameMenu_MainMenuButton" >
+            <Property Name="Font" Value="BlueHighway-12" />
+            <Property Name="Text" Value="MainMenu" />
+            <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+            <Property Name="UnifiedAreaRect" Value="{{0.2,0},{0.45,0},{0.4,0},{0.55,0}}" />
+            <Property Name="Alpha" Value="0.7" />
+            <Event Name="Clicked" Function="InGameMenu.button_mainmenu_clicked"/>
+        </Window>
+        <Window Type="TaharezLook/Button" Name="orxonox/InGameMenu_QuitButton" >
+            <Property Name="Font" Value="BlueHighway-12" />
+            <Property Name="Text" Value="Quit" />
+            <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+            <Property Name="UnifiedAreaRect" Value="{{0.6,0},{0.45,0},{0.8,0},{0.55,0}}" />
+            <Property Name="Alpha" Value="0.7" />
+            <Event Name="Clicked" Function="InGameMenu.button_quit_clicked"/>
+        </Window>
+    </Window>
+</GUILayout>

Added: code/branches/ingamemenu/data/gui/scripts/InGameMenu.lua
===================================================================
--- code/branches/ingamemenu/data/gui/scripts/InGameMenu.lua	                        (rev 0)
+++ code/branches/ingamemenu/data/gui/scripts/InGameMenu.lua	2009-11-02 22:46:58 UTC (rev 6018)
@@ -0,0 +1,30 @@
+-- InGameMenu.lua
+
+BasicGUI = require("BasicGUI")
+local P = BasicGUI:new() --inherit everything from the gui package
+if _REQUIREDNAME == nil then
+    InGameMenu = P
+else
+    _G[_REQUIREDNAME] = P
+end
+
+P.filename = "InGameMenu"
+P.layoutString = "InGameMenu.layout"
+
+function P:init()
+end
+
+
+-- events for ingamemenu
+function P.button_quit_clicked(e)
+    orxonox.CommandExecutor:execute("hideGUI InGameMenu")
+    orxonox.CommandExecutor:execute("exit")
+end
+
+function P.button_mainmenu_clicked(e)
+    orxonox.CommandExecutor:execute("showGUI MainMenu")
+    orxonox.CommandExecutor:execute("hideGUI InGameMenu")
+end
+
+return P
+




More information about the Orxonox-commit mailing list