[Orxonox-commit 171] r2055 - media/gui/scripts
rgrieder at orxonox.net
rgrieder at orxonox.net
Wed Mar 25 22:57:19 CET 2009
Author: rgrieder
Date: 2009-03-25 21:57:19 +0000 (Wed, 25 Mar 2009)
New Revision: 2055
Modified:
media/gui/scripts/IConsole.lua
media/gui/scripts/InstancedInit.lua
media/gui/scripts/demo8.lua
media/gui/scripts/loadGUI.lua
media/gui/scripts/loadGUI_2.lua
media/gui/scripts/mainmenu.lua
Log:
svn:eol-style "native" for the gui scripts.
Modified: media/gui/scripts/IConsole.lua
===================================================================
--- media/gui/scripts/IConsole.lua 2009-03-25 21:42:30 UTC (rev 2054)
+++ media/gui/scripts/IConsole.lua 2009-03-25 21:57:19 UTC (rev 2055)
@@ -1,50 +1,50 @@
---- Event Handlers ---
-
----------------------------------------------------------
---- Event to handle when "Return" is hit in the edit box
---- Input Window: Console/Frame/Input
----------------------------------------------------------
-function handleEntryAccepted(args)
- -- Get a pointer to the input editbox
- local input = this:getWindow()
- -- Get a pointer to the output MLEditbox
- local output = this:getWindow("Console/Frame/ConsoleText")
-
- -- Retrieve the Text from the edit box
- local instr = input:getText()
-
- -- Set the Editbox text to an empty string to clear out the entry
- input:setText("")
-
- -- set the text in the output box to its current text + the new text.
- output:setText(string.format("%s%s",output:getText(),instr))
-
- --Done!
-end
-
-function update(args)
- --Yatta! -- this is called every frame -- Put somthing interesting here!
-end
-
---- End Event Handlers ---
-
---- Entry Point ---
-local winMgr = CEGUI.WindowManager:getSingleton()
-
---- Load the xml for the instanced window we want, specifying true
---- indicates that we are making an instanced window and the system will
---- autogenerate a prefix for us.
-local root = winMgr:loadWindowLayout("Console.wnd",true)
-
---- Since we are just now creating this window, there is no 'this' pointer
---- for us to use. Instead since now we want to set the events we will use
---- the getChild function which will recursivly search from the given node down
---- until it find the window... it will throw an exception.
-root:getChild("Console/Frame/Input"):subscribeEvent("TextAccepted",handleEntryAccepted)
-
---- This event is the window update event, it is called every frame
-root:subscribeEvent("WindowUpdate",update)
-
--- Add it to the default GUI sheet
-CEGUI.System:getSingleton():getGUISheet():addChildWindow(root)
+--- Event Handlers ---
+
+---------------------------------------------------------
+--- Event to handle when "Return" is hit in the edit box
+--- Input Window: Console/Frame/Input
+---------------------------------------------------------
+function handleEntryAccepted(args)
+ -- Get a pointer to the input editbox
+ local input = this:getWindow()
+ -- Get a pointer to the output MLEditbox
+ local output = this:getWindow("Console/Frame/ConsoleText")
+
+ -- Retrieve the Text from the edit box
+ local instr = input:getText()
+
+ -- Set the Editbox text to an empty string to clear out the entry
+ input:setText("")
+
+ -- set the text in the output box to its current text + the new text.
+ output:setText(string.format("%s%s",output:getText(),instr))
+
+ --Done!
+end
+
+function update(args)
+ --Yatta! -- this is called every frame -- Put somthing interesting here!
+end
+
+--- End Event Handlers ---
+
+--- Entry Point ---
+local winMgr = CEGUI.WindowManager:getSingleton()
+
+--- Load the xml for the instanced window we want, specifying true
+--- indicates that we are making an instanced window and the system will
+--- autogenerate a prefix for us.
+local root = winMgr:loadWindowLayout("Console.wnd",true)
+
+--- Since we are just now creating this window, there is no 'this' pointer
+--- for us to use. Instead since now we want to set the events we will use
+--- the getChild function which will recursivly search from the given node down
+--- until it find the window... it will throw an exception.
+root:getChild("Console/Frame/Input"):subscribeEvent("TextAccepted",handleEntryAccepted)
+
+--- This event is the window update event, it is called every frame
+root:subscribeEvent("WindowUpdate",update)
+
+-- Add it to the default GUI sheet
+CEGUI.System:getSingleton():getGUISheet():addChildWindow(root)
\ No newline at end of file
Property changes on: media/gui/scripts/IConsole.lua
___________________________________________________________________
Added: svn:eol-style
+ native
Modified: media/gui/scripts/InstancedInit.lua
===================================================================
--- media/gui/scripts/InstancedInit.lua 2009-03-25 21:42:30 UTC (rev 2054)
+++ media/gui/scripts/InstancedInit.lua 2009-03-25 21:57:19 UTC (rev 2055)
@@ -1,19 +1,19 @@
---- Init Script for Instanced Windows Demo ---
-local guiSystem = CEGUI.System:getSingleton()
-local schemeMgr = CEGUI.SchemeManager:getSingleton()
-local winMgr = CEGUI.WindowManager:getSingleton()
-
--- Load a Scheme File
-schemeMgr:loadScheme("TaharezLook.scheme")
--- Setup Mouse Pointer
-guiSystem:setDefaultMouseCursor("TaharezLook", "MouseArrow")
--- Setup a DefaultSheet
-local root = winMgr:createWindow("DefaultWindow","RootNode")
-local xx = CEGUI.UDim(1,0)
-local yy = CEGUI.UDim(1,0)
-local zz = CEGUI.UVector2(xx,yy)
-root:setSize(zz)
-guiSystem:setGUISheet(root)
--- set the Tooltip type
-guiSystem:setDefaultTooltip("TaharezLook/Tooltip")
+--- Init Script for Instanced Windows Demo ---
+local guiSystem = CEGUI.System:getSingleton()
+local schemeMgr = CEGUI.SchemeManager:getSingleton()
+local winMgr = CEGUI.WindowManager:getSingleton()
+
+-- Load a Scheme File
+schemeMgr:loadScheme("TaharezLook.scheme")
+-- Setup Mouse Pointer
+guiSystem:setDefaultMouseCursor("TaharezLook", "MouseArrow")
+-- Setup a DefaultSheet
+local root = winMgr:createWindow("DefaultWindow","RootNode")
+local xx = CEGUI.UDim(1,0)
+local yy = CEGUI.UDim(1,0)
+local zz = CEGUI.UVector2(xx,yy)
+root:setSize(zz)
+guiSystem:setGUISheet(root)
+-- set the Tooltip type
+guiSystem:setDefaultTooltip("TaharezLook/Tooltip")
-- Done!
\ No newline at end of file
Property changes on: media/gui/scripts/InstancedInit.lua
___________________________________________________________________
Added: svn:eol-style
+ native
Modified: media/gui/scripts/demo8.lua
===================================================================
--- media/gui/scripts/demo8.lua 2009-03-25 21:42:30 UTC (rev 2054)
+++ media/gui/scripts/demo8.lua 2009-03-25 21:57:19 UTC (rev 2055)
@@ -1,83 +1,83 @@
------------------------------------------
--- Start of handler functions
------------------------------------------
------------------------------------------
--- Alpha slider handler (not used!)
------------------------------------------
-function sliderHandler(args)
- CEGUI.System:getSingleton():getGUISheet():setAlpha(CEGUI.toSlider(CEGUI.toWindowEventArgs(args).window):getCurrentValue())
-end
-
------------------------------------------
--- Handler to slide pane
---
--- Here we move the 'Demo8' sheet window
--- and re-position the scrollbar
------------------------------------------
-function panelSlideHandler(args)
- local scroller = CEGUI.toScrollbar(CEGUI.toWindowEventArgs(args).window)
- local demoWnd = CEGUI.WindowManager:getSingleton():getWindow("Demo8")
-
- local relHeight = demoWnd:getHeight():asRelative(demoWnd:getParentPixelHeight())
-
- scroller:setPosition(CEGUI.UVector2(CEGUI.UDim(0,0), CEGUI.UDim(scroller:getScrollPosition() / relHeight,0)))
- demoWnd:setPosition(CEGUI.UVector2(CEGUI.UDim(0,0), CEGUI.UDim(-scroller:getScrollPosition(),0)))
-end
-
------------------------------------------
--- Handler to set preview colour when
--- colour selector scrollers change
------------------------------------------
-function colourChangeHandler(args)
- local winMgr = CEGUI.WindowManager:getSingleton()
-
- local r = CEGUI.toScrollbar(winMgr:getWindow("Demo8/Window1/Controls/Red")):getScrollPosition()
- local g = CEGUI.toScrollbar(winMgr:getWindow("Demo8/Window1/Controls/Green")):getScrollPosition()
- local b = CEGUI.toScrollbar(winMgr:getWindow("Demo8/Window1/Controls/Blue")):getScrollPosition()
- local col = CEGUI.colour:new_local(r, g, b, 1)
- local crect = CEGUI.ColourRect(col)
-
- winMgr:getWindow("Demo8/Window1/Controls/ColourSample"):setProperty("ImageColours", CEGUI.PropertyHelper:colourRectToString(crect))
-end
-
-
------------------------------------------
--- Handler to add an item to the box
------------------------------------------
-function addItemHandler(args)
- local winMgr = CEGUI.WindowManager:getSingleton()
-
- local text = winMgr:getWindow("Demo8/Window1/Controls/Editbox"):getText()
- local cols = CEGUI.PropertyHelper:stringToColourRect(winMgr:getWindow("Demo8/Window1/Controls/ColourSample"):getProperty("ImageColours"))
-
- local newItem = CEGUI.createListboxTextItem(text, 0, nil, false, true)
- newItem:setSelectionBrushImage("TaharezLook", "MultiListSelectionBrush")
- newItem:setSelectionColours(cols)
-
- CEGUI.toListbox(winMgr:getWindow("Demo8/Window1/Listbox")):addItem(newItem)
-end
-
------------------------------------------
--- Script Entry Point
------------------------------------------
-local guiSystem = CEGUI.System:getSingleton()
-local schemeMgr = CEGUI.SchemeManager:getSingleton()
-local winMgr = CEGUI.WindowManager:getSingleton()
-
--- load our demo8 scheme
-schemeMgr:loadScheme("Demo8.scheme");
--- load our demo8 window layout
-local root = winMgr:loadWindowLayout("Demo8.layout")
--- set the layout as the root
-guiSystem:setGUISheet(root)
--- set default mouse cursor
-guiSystem:setDefaultMouseCursor("TaharezLook", "MouseArrow")
--- set the Tooltip type
-guiSystem:setDefaultTooltip("TaharezLook/Tooltip")
-
--- subscribe required events
-winMgr:getWindow("Demo8/ViewScroll"):subscribeEvent("ScrollPosChanged", "panelSlideHandler")
-winMgr:getWindow("Demo8/Window1/Controls/Blue"):subscribeEvent("ScrollPosChanged", "colourChangeHandler")
-winMgr:getWindow("Demo8/Window1/Controls/Red"):subscribeEvent("ScrollPosChanged", "colourChangeHandler")
-winMgr:getWindow("Demo8/Window1/Controls/Green"):subscribeEvent("ScrollPosChanged", "colourChangeHandler")
-winMgr:getWindow("Demo8/Window1/Controls/Add"):subscribeEvent("Clicked", "addItemHandler")
+-----------------------------------------
+-- Start of handler functions
+-----------------------------------------
+-----------------------------------------
+-- Alpha slider handler (not used!)
+-----------------------------------------
+function sliderHandler(args)
+ CEGUI.System:getSingleton():getGUISheet():setAlpha(CEGUI.toSlider(CEGUI.toWindowEventArgs(args).window):getCurrentValue())
+end
+
+-----------------------------------------
+-- Handler to slide pane
+--
+-- Here we move the 'Demo8' sheet window
+-- and re-position the scrollbar
+-----------------------------------------
+function panelSlideHandler(args)
+ local scroller = CEGUI.toScrollbar(CEGUI.toWindowEventArgs(args).window)
+ local demoWnd = CEGUI.WindowManager:getSingleton():getWindow("Demo8")
+
+ local relHeight = demoWnd:getHeight():asRelative(demoWnd:getParentPixelHeight())
+
+ scroller:setPosition(CEGUI.UVector2(CEGUI.UDim(0,0), CEGUI.UDim(scroller:getScrollPosition() / relHeight,0)))
+ demoWnd:setPosition(CEGUI.UVector2(CEGUI.UDim(0,0), CEGUI.UDim(-scroller:getScrollPosition(),0)))
+end
+
+-----------------------------------------
+-- Handler to set preview colour when
+-- colour selector scrollers change
+-----------------------------------------
+function colourChangeHandler(args)
+ local winMgr = CEGUI.WindowManager:getSingleton()
+
+ local r = CEGUI.toScrollbar(winMgr:getWindow("Demo8/Window1/Controls/Red")):getScrollPosition()
+ local g = CEGUI.toScrollbar(winMgr:getWindow("Demo8/Window1/Controls/Green")):getScrollPosition()
+ local b = CEGUI.toScrollbar(winMgr:getWindow("Demo8/Window1/Controls/Blue")):getScrollPosition()
+ local col = CEGUI.colour:new_local(r, g, b, 1)
+ local crect = CEGUI.ColourRect(col)
+
+ winMgr:getWindow("Demo8/Window1/Controls/ColourSample"):setProperty("ImageColours", CEGUI.PropertyHelper:colourRectToString(crect))
+end
+
+
+-----------------------------------------
+-- Handler to add an item to the box
+-----------------------------------------
+function addItemHandler(args)
+ local winMgr = CEGUI.WindowManager:getSingleton()
+
+ local text = winMgr:getWindow("Demo8/Window1/Controls/Editbox"):getText()
+ local cols = CEGUI.PropertyHelper:stringToColourRect(winMgr:getWindow("Demo8/Window1/Controls/ColourSample"):getProperty("ImageColours"))
+
+ local newItem = CEGUI.createListboxTextItem(text, 0, nil, false, true)
+ newItem:setSelectionBrushImage("TaharezLook", "MultiListSelectionBrush")
+ newItem:setSelectionColours(cols)
+
+ CEGUI.toListbox(winMgr:getWindow("Demo8/Window1/Listbox")):addItem(newItem)
+end
+
+-----------------------------------------
+-- Script Entry Point
+-----------------------------------------
+local guiSystem = CEGUI.System:getSingleton()
+local schemeMgr = CEGUI.SchemeManager:getSingleton()
+local winMgr = CEGUI.WindowManager:getSingleton()
+
+-- load our demo8 scheme
+schemeMgr:loadScheme("Demo8.scheme");
+-- load our demo8 window layout
+local root = winMgr:loadWindowLayout("Demo8.layout")
+-- set the layout as the root
+guiSystem:setGUISheet(root)
+-- set default mouse cursor
+guiSystem:setDefaultMouseCursor("TaharezLook", "MouseArrow")
+-- set the Tooltip type
+guiSystem:setDefaultTooltip("TaharezLook/Tooltip")
+
+-- subscribe required events
+winMgr:getWindow("Demo8/ViewScroll"):subscribeEvent("ScrollPosChanged", "panelSlideHandler")
+winMgr:getWindow("Demo8/Window1/Controls/Blue"):subscribeEvent("ScrollPosChanged", "colourChangeHandler")
+winMgr:getWindow("Demo8/Window1/Controls/Red"):subscribeEvent("ScrollPosChanged", "colourChangeHandler")
+winMgr:getWindow("Demo8/Window1/Controls/Green"):subscribeEvent("ScrollPosChanged", "colourChangeHandler")
+winMgr:getWindow("Demo8/Window1/Controls/Add"):subscribeEvent("Clicked", "addItemHandler")
Property changes on: media/gui/scripts/demo8.lua
___________________________________________________________________
Added: svn:eol-style
+ native
Modified: media/gui/scripts/loadGUI.lua
===================================================================
--- media/gui/scripts/loadGUI.lua 2009-03-25 21:42:30 UTC (rev 2054)
+++ media/gui/scripts/loadGUI.lua 2009-03-25 21:57:19 UTC (rev 2055)
@@ -1,106 +1,106 @@
-local schemeMgr = CEGUI.SchemeManager:getSingleton()
-local winMgr = CEGUI.WindowManager:getSingleton()
-local logger = CEGUI.Logger:getSingleton()
-local system = CEGUI.System:getSingleton()
-
-schemeMgr:loadScheme("TaharezLookSkin.scheme")
-system:setDefaultMouseCursor("TaharezLook", "MouseArrow")
-system:setDefaultFont("BlueHighway-12")
-
-
-local rootSheet = winMgr:createWindow("DefaultGUISheet", "orxonox/Sheet")
-
-local leftOffset = 0.11
-local topOffset = 0.3
-local distance = 0.076
-local index = 0
-
-local standalone = winMgr:createWindow("TaharezLook/Button", "orxonox/StandaloneButton")
-standalone:setText("Standalone")
-standalone:setSize(CEGUI.UVector2(CEGUI.UDim(0.15, 0), CEGUI.UDim(0.05, 0)))
-standalone:setPosition(CEGUI.UVector2(CEGUI.UDim(leftOffset, 0), CEGUI.UDim(topOffset + index * distance, 0)))
-standalone:subscribeEvent("Clicked","button_standalone_clicked")
-index = index + 1
-
-local dedicated = winMgr:createWindow("TaharezLook/Button", "orxonox/DedicatedButton")
-dedicated:setText("Dedicated")
-dedicated:setSize(CEGUI.UVector2(CEGUI.UDim(0.15, 0), CEGUI.UDim(0.05, 0)))
-dedicated:setPosition(CEGUI.UVector2(CEGUI.UDim(leftOffset, 0), CEGUI.UDim(topOffset + index * distance, 0)))
-dedicated:subscribeEvent("Clicked","button_dedicated_clicked")
-index = index + 1
-
-local server = winMgr:createWindow("TaharezLook/Button", "orxonox/ServerButton")
-server:setText("Server")
-server:setSize(CEGUI.UVector2(CEGUI.UDim(0.15, 0), CEGUI.UDim(0.05, 0)))
-server:setPosition(CEGUI.UVector2(CEGUI.UDim(leftOffset, 0), CEGUI.UDim(topOffset + index * distance, 0)))
-server:subscribeEvent("Clicked","button_server_clicked")
-index = index + 1
-
-local client = winMgr:createWindow("TaharezLook/Button", "orxonox/ClientButton")
-client:setText("Client")
-client:setSize(CEGUI.UVector2(CEGUI.UDim(0.15, 0), CEGUI.UDim(0.05, 0)))
-client:setPosition(CEGUI.UVector2(CEGUI.UDim(leftOffset, 0), CEGUI.UDim(topOffset + index * distance, 0)))
-client:subscribeEvent("Clicked","button_client_clicked")
-index = index + 1
-
-local quit = winMgr:createWindow("TaharezLook/Button", "orxonox/QuitButton")
-quit:setText("Quit")
-quit:setSize(CEGUI.UVector2(CEGUI.UDim(0.15, 0), CEGUI.UDim(0.05, 0)))
-quit:setPosition(CEGUI.UVector2(CEGUI.UDim(leftOffset, 0), CEGUI.UDim(topOffset + index * distance, 0)))
-quit:subscribeEvent("Clicked","button_quit_clicked")
-index = index + 1
-
-local backgroundImage = CEGUI.ImagesetManager:getSingleton():createImagesetFromImageFile("GUI/Background", "main_menu_1.jpg")
-local background = winMgr:createWindow("TaharezLook/StaticImage", "orxonox/Background")
-background:setProperty("FrameEnabled", "set: true")
-background:setProperty("BackgroundEnabled", "set: false")
-background:setProperty("Image", "set: GUI/Background image:full_image")
-
-rootSheet:addChildWindow(quit)
-rootSheet:addChildWindow(standalone)
-rootSheet:addChildWindow(server)
-rootSheet:addChildWindow(dedicated)
-rootSheet:addChildWindow(client)
-background:addChildWindow(rootSheet)
-
-
-function button_quit_clicked(e)
- hideGUI()
- orxonox.CommandExecutor:execute("exit")
-end
-
-function button_standalone_clicked(e)
- orxonox.CommandExecutor:execute("selectGameState standalone")
- hideGUI()
-end
-
-function button_server_clicked(e)
- orxonox.CommandExecutor:execute("selectGameState server")
- hideGUI()
-end
-
-function button_dedicated_clicked(e)
- orxonox.CommandExecutor:execute("selectGameState dedicated")
- hideGUI()
-end
-
-function button_client_clicked(e)
- orxonox.CommandExecutor:execute("selectGameState client")
- hideGUI()
-end
-
-showBackground = false
-
-function showMainMenu()
- if showBackground == true then
- system:setGUISheet(background)
- else
- system:setGUISheet(rootSheet)
- end
- return 0;
-end
-
-function hideGUI()
- system:setGUISheet(nil)
- orxonox.GUIManager:getInstance():hideGUI()
-end
+local schemeMgr = CEGUI.SchemeManager:getSingleton()
+local winMgr = CEGUI.WindowManager:getSingleton()
+local logger = CEGUI.Logger:getSingleton()
+local system = CEGUI.System:getSingleton()
+
+schemeMgr:loadScheme("TaharezLookSkin.scheme")
+system:setDefaultMouseCursor("TaharezLook", "MouseArrow")
+system:setDefaultFont("BlueHighway-12")
+
+
+local rootSheet = winMgr:createWindow("DefaultGUISheet", "orxonox/Sheet")
+
+local leftOffset = 0.11
+local topOffset = 0.3
+local distance = 0.076
+local index = 0
+
+local standalone = winMgr:createWindow("TaharezLook/Button", "orxonox/StandaloneButton")
+standalone:setText("Standalone")
+standalone:setSize(CEGUI.UVector2(CEGUI.UDim(0.15, 0), CEGUI.UDim(0.05, 0)))
+standalone:setPosition(CEGUI.UVector2(CEGUI.UDim(leftOffset, 0), CEGUI.UDim(topOffset + index * distance, 0)))
+standalone:subscribeEvent("Clicked","button_standalone_clicked")
+index = index + 1
+
+local dedicated = winMgr:createWindow("TaharezLook/Button", "orxonox/DedicatedButton")
+dedicated:setText("Dedicated")
+dedicated:setSize(CEGUI.UVector2(CEGUI.UDim(0.15, 0), CEGUI.UDim(0.05, 0)))
+dedicated:setPosition(CEGUI.UVector2(CEGUI.UDim(leftOffset, 0), CEGUI.UDim(topOffset + index * distance, 0)))
+dedicated:subscribeEvent("Clicked","button_dedicated_clicked")
+index = index + 1
+
+local server = winMgr:createWindow("TaharezLook/Button", "orxonox/ServerButton")
+server:setText("Server")
+server:setSize(CEGUI.UVector2(CEGUI.UDim(0.15, 0), CEGUI.UDim(0.05, 0)))
+server:setPosition(CEGUI.UVector2(CEGUI.UDim(leftOffset, 0), CEGUI.UDim(topOffset + index * distance, 0)))
+server:subscribeEvent("Clicked","button_server_clicked")
+index = index + 1
+
+local client = winMgr:createWindow("TaharezLook/Button", "orxonox/ClientButton")
+client:setText("Client")
+client:setSize(CEGUI.UVector2(CEGUI.UDim(0.15, 0), CEGUI.UDim(0.05, 0)))
+client:setPosition(CEGUI.UVector2(CEGUI.UDim(leftOffset, 0), CEGUI.UDim(topOffset + index * distance, 0)))
+client:subscribeEvent("Clicked","button_client_clicked")
+index = index + 1
+
+local quit = winMgr:createWindow("TaharezLook/Button", "orxonox/QuitButton")
+quit:setText("Quit")
+quit:setSize(CEGUI.UVector2(CEGUI.UDim(0.15, 0), CEGUI.UDim(0.05, 0)))
+quit:setPosition(CEGUI.UVector2(CEGUI.UDim(leftOffset, 0), CEGUI.UDim(topOffset + index * distance, 0)))
+quit:subscribeEvent("Clicked","button_quit_clicked")
+index = index + 1
+
+local backgroundImage = CEGUI.ImagesetManager:getSingleton():createImagesetFromImageFile("GUI/Background", "main_menu_1.jpg")
+local background = winMgr:createWindow("TaharezLook/StaticImage", "orxonox/Background")
+background:setProperty("FrameEnabled", "set: true")
+background:setProperty("BackgroundEnabled", "set: false")
+background:setProperty("Image", "set: GUI/Background image:full_image")
+
+rootSheet:addChildWindow(quit)
+rootSheet:addChildWindow(standalone)
+rootSheet:addChildWindow(server)
+rootSheet:addChildWindow(dedicated)
+rootSheet:addChildWindow(client)
+background:addChildWindow(rootSheet)
+
+
+function button_quit_clicked(e)
+ hideGUI()
+ orxonox.CommandExecutor:execute("exit")
+end
+
+function button_standalone_clicked(e)
+ orxonox.CommandExecutor:execute("selectGameState standalone")
+ hideGUI()
+end
+
+function button_server_clicked(e)
+ orxonox.CommandExecutor:execute("selectGameState server")
+ hideGUI()
+end
+
+function button_dedicated_clicked(e)
+ orxonox.CommandExecutor:execute("selectGameState dedicated")
+ hideGUI()
+end
+
+function button_client_clicked(e)
+ orxonox.CommandExecutor:execute("selectGameState client")
+ hideGUI()
+end
+
+showBackground = false
+
+function showMainMenu()
+ if showBackground == true then
+ system:setGUISheet(background)
+ else
+ system:setGUISheet(rootSheet)
+ end
+ return 0;
+end
+
+function hideGUI()
+ system:setGUISheet(nil)
+ orxonox.GUIManager:getInstance():hideGUI()
+end
Property changes on: media/gui/scripts/loadGUI.lua
___________________________________________________________________
Added: svn:eol-style
+ native
Modified: media/gui/scripts/loadGUI_2.lua
===================================================================
--- media/gui/scripts/loadGUI_2.lua 2009-03-25 21:42:30 UTC (rev 2054)
+++ media/gui/scripts/loadGUI_2.lua 2009-03-25 21:57:19 UTC (rev 2055)
@@ -1,15 +1,15 @@
-local schemeMgr = CEGUI.SchemeManager:getSingleton()
-local winMgr = CEGUI.WindowManager:getSingleton()
-local logger = CEGUI.Logger:getSingleton()
+local schemeMgr = CEGUI.SchemeManager:getSingleton()
+local winMgr = CEGUI.WindowManager:getSingleton()
+local logger = CEGUI.Logger:getSingleton()
local system = CEGUI.System:getSingleton()
-local cursor = CEGUI.MouseCursor:getSingleton()
-
+local cursor = CEGUI.MouseCursor:getSingleton()
+
schemeMgr:loadScheme("TaharezLookSkin.scheme")
-- load scheme with our own images
schemeMgr:loadScheme("OrxonoxGUIScheme.scheme")
-system:setDefaultMouseCursor("TaharezLook", "MouseArrow")
-system:setDefaultFont("BlueHighway-12")
+system:setDefaultMouseCursor("TaharezLook", "MouseArrow")
+system:setDefaultFont("BlueHighway-12")
local current = nil
local loadedGUIs = {}
@@ -31,10 +31,10 @@
end
end
return nil
-end
+end
-- loads the GUI with the specified filename
--- be sure to set the global variable "filename" before calling this function
+-- be sure to set the global variable "filename" before calling this function
function loadGUI()
-- check if it already exists
newlyLoaded = loadedGUIs:getGUIbyName(filename)
@@ -51,7 +51,7 @@
-- hide new GUI as we do not want to show it accidentially
newlyLoaded:hide()
end
- return newlyLoaded
+ return newlyLoaded
end
-- shows the specified and loads it if not loaded already
@@ -80,9 +80,9 @@
showing = true
end
return showing
-end
-
+end
+
function hideGUI()
current:hide()
- showing = false
-end
+ showing = false
+end
Property changes on: media/gui/scripts/loadGUI_2.lua
___________________________________________________________________
Added: svn:eol-style
+ native
Modified: media/gui/scripts/mainmenu.lua
===================================================================
--- media/gui/scripts/mainmenu.lua 2009-03-25 21:42:30 UTC (rev 2054)
+++ media/gui/scripts/mainmenu.lua 2009-03-25 21:57:19 UTC (rev 2055)
@@ -1,27 +1,27 @@
layoutPath = "MainMenu.layout"
--- events for mainmenu
-function button_quit_clicked(e)
- hideGUI()
- orxonox.CommandExecutor:execute("exit")
-end
-
-function button_standalone_clicked(e)
- orxonox.CommandExecutor:execute("startGame")
- toggleGUI()
-end
-
-function button_server_clicked(e)
- orxonox.CommandExecutor:execute("echo Not yet supported!")
- hideGUI()
-end
-
-function button_dedicated_clicked(e)
- orxonox.CommandExecutor:execute("echo Not yet supported!")
- hideGUI()
-end
-
-function button_client_clicked(e)
- orxonox.CommandExecutor:execute("echo Not yet supported!")
- hideGUI()
+-- events for mainmenu
+function button_quit_clicked(e)
+ hideGUI()
+ orxonox.CommandExecutor:execute("exit")
end
+
+function button_standalone_clicked(e)
+ orxonox.CommandExecutor:execute("startGame")
+ toggleGUI()
+end
+
+function button_server_clicked(e)
+ orxonox.CommandExecutor:execute("echo Not yet supported!")
+ hideGUI()
+end
+
+function button_dedicated_clicked(e)
+ orxonox.CommandExecutor:execute("echo Not yet supported!")
+ hideGUI()
+end
+
+function button_client_clicked(e)
+ orxonox.CommandExecutor:execute("echo Not yet supported!")
+ hideGUI()
+end
Property changes on: media/gui/scripts/mainmenu.lua
___________________________________________________________________
Added: svn:eol-style
+ native
More information about the Orxonox-commit
mailing list