[Orxonox-commit 1427] r6145 - in code/branches/menu/data/gui: layouts scripts

scheusso at orxonox.net scheusso at orxonox.net
Wed Nov 25 14:12:23 CET 2009


Author: scheusso
Date: 2009-11-25 14:12:22 +0100 (Wed, 25 Nov 2009)
New Revision: 6145

Added:
   code/branches/menu/data/gui/layouts/DecisionPopup.layout
   code/branches/menu/data/gui/layouts/MainMenuBackground.layout
   code/branches/menu/data/gui/scripts/DecisionPopup.lua
   code/branches/menu/data/gui/scripts/GUITools.lua
Log:
seems like i forgot to add some files. sorry about that ;)


Added: code/branches/menu/data/gui/layouts/DecisionPopup.layout
===================================================================
--- code/branches/menu/data/gui/layouts/DecisionPopup.layout	                        (rev 0)
+++ code/branches/menu/data/gui/layouts/DecisionPopup.layout	2009-11-25 13:12:22 UTC (rev 6145)
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<GUILayout >
+    <Window Type="DefaultWindow" Name="orxonox/DecisionPopup_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/StaticImage" Name="orxonox/DecisionPopup_Background" >
+            <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+            <Property Name="UnifiedAreaRect" Value="{{0,0},{0,0},{1,0},{1,0}}" />
+            <Property Name="Alpha" Value="0.5" />
+            <Window Type="TaharezLook/Button" Name="orxonox/DecisionPopup_button_yes" >
+                <Property Name="Font" Value="BlueHighway-12" />
+                <Property Name="Text" Value="Yes" />
+                <Property Name="Alpha" Value="0.7" />
+                <Property Name="InheritsAlpha" Value="False" /> 
+                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                <Property Name="UnifiedAreaRect" Value="{{0.3,0},{0.55,0},{0.45,0},{0.6,0}}" />
+                <Event Name="Clicked" Function="DecisionPopup.button_yes"/>
+            </Window>
+            <Window Type="TaharezLook/Button" Name="orxonox/DecisionPopup_button_no" >
+                <Property Name="Font" Value="BlueHighway-12" />
+                <Property Name="Text" Value="No" />
+                <Property Name="Alpha" Value="0.8" />
+                <Property Name="InheritsAlpha" Value="False" /> 
+                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                <Property Name="UnifiedAreaRect" Value="{{0.55,0},{0.55,0},{0.7,0},{0.6,0}}" />
+                <Event Name="Clicked" Function="DecisionPopup.button_no"/>
+            </Window>
+            <Window Type="TaharezLook/StaticText" Name="orxonox/DecisionPopup_text" >
+                <Property Name="Text" Value="Template text" />
+                <Property Name="HorzFormatting" Value="WordWrapCentred" />
+                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                <Property Name="UnifiedAreaRect" Value="{{0.2,0},{0.4,0},{0.8,0},{0.5,0}}" />
+                <Property Name="InheritsAlpha" Value="False" /> 
+                <Property Name="Alpha" Value="0.8" />
+            </Window>
+        </Window>
+    </Window>
+</GUILayout>

Added: code/branches/menu/data/gui/layouts/MainMenuBackground.layout
===================================================================
--- code/branches/menu/data/gui/layouts/MainMenuBackground.layout	                        (rev 0)
+++ code/branches/menu/data/gui/layouts/MainMenuBackground.layout	2009-11-25 13:12:22 UTC (rev 6145)
@@ -0,0 +1,10 @@
+<?xml version="1.0" ?>
+<GUILayout>
+    <Window Type="TaharezLook/StaticImage" Name="orxonox/Background">
+    <Property Name="UnifiedSize" Value="{{1.0,0},{1.0,0}}"/>
+    <Property Name="Image" Value="set:MainMenuBackground image:Background"/>
+    <Property Name="FrameEnabled" Value="set:true"/>
+    <Property Name="BackgroundEnabled" Value="set:false"/>
+    <Property Name="InheritsAlpha" Value="False" />
+    </Window>
+</GUILayout>

Added: code/branches/menu/data/gui/scripts/DecisionPopup.lua
===================================================================
--- code/branches/menu/data/gui/scripts/DecisionPopup.lua	                        (rev 0)
+++ code/branches/menu/data/gui/scripts/DecisionPopup.lua	2009-11-25 13:12:22 UTC (rev 6145)
@@ -0,0 +1,41 @@
+-- DecisionPopup.lua
+
+BasicGUI = require("BasicGUI")
+local P = BasicGUI:new() --inherit everything from the gui package
+if _REQUIREDNAME == nil then
+    DecisionPopup = P
+else
+    _G[_REQUIREDNAME] = P
+end
+
+P.filename = "DecisionPopup"
+P.layoutString = "DecisionPopup.layout"
+
+function P:init()
+end
+
+function P.setCallback(functionPtr)
+    P.functionPtr = functionPtr
+end
+
+function P.setText( text )
+    winMgr:getWindow("orxonox/DecisionPopup_text"):setText( text )
+end
+
+-- events for ingamemenu
+function P.button_yes(e)
+    if P.functionPtr ~= nil then
+        P.functionPtr(true)
+    end
+    orxonox.CommandExecutor:execute("hideGUI DecisionPopup")
+end
+
+function P.button_no(e)
+    if P.functionPtr ~= nil then
+        P.functionPtr(false)
+    end
+    orxonox.CommandExecutor:execute("hideGUI DecisionPopup")
+end
+
+return P
+

Added: code/branches/menu/data/gui/scripts/GUITools.lua
===================================================================
--- code/branches/menu/data/gui/scripts/GUITools.lua	                        (rev 0)
+++ code/branches/menu/data/gui/scripts/GUITools.lua	2009-11-25 13:12:22 UTC (rev 6145)
@@ -0,0 +1,6 @@
+function openDecisionPopup( text, callbackPtr )
+    orxonox.CommandExecutor:execute("showGUI DecisionPopup false true")
+--     showGUI("DecisionPopup", false, true)
+    DecisionPopup.setCallback(InGameMenu.callback)
+    DecisionPopup.setText(text)
+end
\ No newline at end of file




More information about the Orxonox-commit mailing list