[Orxonox-commit 552] r2191 - in media: gui/scripts materials/textures

rgrieder at orxonox.net rgrieder at orxonox.net
Wed May 27 21:42:16 CEST 2009


Author: rgrieder
Date: 2009-05-27 21:42:15 +0200 (Wed, 27 May 2009)
New Revision: 2191

Added:
   media/materials/textures/tiled_floor.jpg
Modified:
   media/gui/scripts/mainmenu_2.lua
Log:
- Functionality for server, client and dedicated buttons
  (please note that in the code it's called startStandalone now but I left "startGame" for the lua script to avoid inconsistencies of the media repo)
- Added missing tiled_floor.jpg for presentation_dm.oxw

Modified: media/gui/scripts/mainmenu_2.lua
===================================================================
--- media/gui/scripts/mainmenu_2.lua	2009-05-27 12:39:35 UTC (rev 2190)
+++ media/gui/scripts/mainmenu_2.lua	2009-05-27 19:42:15 UTC (rev 2191)
@@ -39,18 +39,30 @@
 end
 
 function P.button_server_clicked(e)
-  orxonox.CommandExecutor:execute("echo Not yet supported!")
-  hideGUI()
+    choice = winMgr:getWindow("orxonox/LevelListbox"):getFirstSelectedItem()
+    if choice then
+        orxonox.Game:getInstance():setLevel(choice:getText() .. ".oxw")
+        orxonox.CommandExecutor:execute("startServer")
+        toggleGUI()
+    end
 end
 
 function P.button_dedicated_clicked(e)
-  orxonox.CommandExecutor:execute("echo Not yet supported!")
-  hideGUI()
+    choice = winMgr:getWindow("orxonox/LevelListbox"):getFirstSelectedItem()
+    if choice then
+        orxonox.Game:getInstance():setLevel(choice:getText() .. ".oxw")
+        orxonox.CommandExecutor:execute("startDedicated")
+        toggleGUI()
+    end
 end
 
 function P.button_client_clicked(e)
-  orxonox.CommandExecutor:execute("echo Not yet supported!")
-  hideGUI()
+    choice = winMgr:getWindow("orxonox/LevelListbox"):getFirstSelectedItem()
+    if choice then
+        orxonox.Game:getInstance():setLevel(choice:getText() .. ".oxw")
+        orxonox.CommandExecutor:execute("startClient")
+        toggleGUI()
+    end
 end
 
 function P.listbox_level_selectionchanged(e)

Copied: media/materials/textures/tiled_floor.jpg (from rev 2017, media/materials/textures/tiled_floor.jpg)
===================================================================
(Binary files differ)




More information about the Orxonox-commit mailing list