[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [37059] branches/soc-2011-cucumber: ==UI==

Daniel Stokes kupomail at gmail.com
Wed Jun 1 04:11:40 CEST 2011


Revision: 37059
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=37059
Author:   kupoman
Date:     2011-06-01 02:11:39 +0000 (Wed, 01 Jun 2011)
Log Message:
-----------
==UI==
* Added the option to change the exit key for the BGE. The UI currently just sets a number, and this feature most likely does not work for blenderplayer yet. More work on this to come.
* Removed the physics settings from the scene panel for the BGE.
* Added an Add menu in the logic brick header.

Modified Paths:
--------------
    branches/soc-2011-cucumber/release/scripts/startup/bl_ui/properties_game.py
    branches/soc-2011-cucumber/release/scripts/startup/bl_ui/properties_scene.py
    branches/soc-2011-cucumber/release/scripts/startup/bl_ui/space_logic.py
    branches/soc-2011-cucumber/source/blender/blenloader/intern/readfile.c
    branches/soc-2011-cucumber/source/blender/makesdna/DNA_scene_types.h
    branches/soc-2011-cucumber/source/blender/makesrna/intern/rna_scene.c
    branches/soc-2011-cucumber/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp
    branches/soc-2011-cucumber/source/gameengine/BlenderRoutines/KX_BlenderKeyboardDevice.cpp
    branches/soc-2011-cucumber/source/gameengine/BlenderRoutines/KX_BlenderKeyboardDevice.h

Modified: branches/soc-2011-cucumber/release/scripts/startup/bl_ui/properties_game.py
===================================================================
--- branches/soc-2011-cucumber/release/scripts/startup/bl_ui/properties_game.py	2011-05-31 20:31:17 UTC (rev 37058)
+++ branches/soc-2011-cucumber/release/scripts/startup/bl_ui/properties_game.py	2011-06-01 02:11:39 UTC (rev 37059)
@@ -369,8 +369,8 @@
             col.prop(gs, "use_glsl_extra_textures", text="Extra Textures")
 
 
-class RENDER_PT_game_performance(RenderButtonsPanel, bpy.types.Panel):
-    bl_label = "Performance"
+class RENDER_PT_game_system(RenderButtonsPanel, bpy.types.Panel):
+    bl_label = "System"
     COMPAT_ENGINES = {'BLENDER_GAME'}
 
     def draw(self, context):
@@ -380,6 +380,9 @@
         row = layout.row()
         row.prop(gs, "use_frame_rate")
         row.prop(gs, "use_display_lists")
+        
+        row = layout.row()
+        row.prop(gs, "exitkey")
 
 
 class RENDER_PT_game_display(RenderButtonsPanel, bpy.types.Panel):

Modified: branches/soc-2011-cucumber/release/scripts/startup/bl_ui/properties_scene.py
===================================================================
--- branches/soc-2011-cucumber/release/scripts/startup/bl_ui/properties_scene.py	2011-05-31 20:31:17 UTC (rev 37058)
+++ branches/soc-2011-cucumber/release/scripts/startup/bl_ui/properties_scene.py	2011-06-01 02:11:39 UTC (rev 37059)
@@ -28,12 +28,12 @@
 
     @classmethod
     def poll(cls, context):
-        return context.scene
+        rd = context.scene.render
+        return context.scene and (rd.engine in cls.COMPAT_ENGINES)
 
 
 class SCENE_PT_scene(SceneButtonsPanel, bpy.types.Panel):
     bl_label = "Scene"
-    COMPAT_ENGINES = {'BLENDER_RENDER'}
 
     def draw(self, context):
         layout = self.layout
@@ -45,7 +45,6 @@
 
 class SCENE_PT_unit(SceneButtonsPanel, bpy.types.Panel):
     bl_label = "Units"
-    COMPAT_ENGINES = {'BLENDER_RENDER'}
 
     def draw(self, context):
         layout = self.layout
@@ -163,7 +162,6 @@
 
 class SCENE_PT_simplify(SceneButtonsPanel, bpy.types.Panel):
     bl_label = "Simplify"
-    COMPAT_ENGINES = {'BLENDER_RENDER'}
 
     def draw_header(self, context):
         scene = context.scene

Modified: branches/soc-2011-cucumber/release/scripts/startup/bl_ui/space_logic.py
===================================================================
--- branches/soc-2011-cucumber/release/scripts/startup/bl_ui/space_logic.py	2011-05-31 20:31:17 UTC (rev 37058)
+++ branches/soc-2011-cucumber/release/scripts/startup/bl_ui/space_logic.py	2011-06-01 02:11:39 UTC (rev 37059)
@@ -72,8 +72,7 @@
         if context.area.show_menus:
             sub = row.row(align=True)
             sub.menu("LOGIC_MT_view")
-            #sub.menu("LOGIC_MT_select")
-            #sub.menu("LOGIC_MT_add")
+            sub.menu("LOGIC_MT_logicbricks_add")
 
 
 class LOGIC_MT_view(bpy.types.Menu):

Modified: branches/soc-2011-cucumber/source/blender/blenloader/intern/readfile.c
===================================================================
--- branches/soc-2011-cucumber/source/blender/blenloader/intern/readfile.c	2011-05-31 20:31:17 UTC (rev 37058)
+++ branches/soc-2011-cucumber/source/blender/blenloader/intern/readfile.c	2011-06-01 02:11:39 UTC (rev 37059)
@@ -11658,6 +11658,13 @@
 				}
 			}
 		}
+		{
+			/* Initialize BGE exit key to esc key */
+			Scene *scene;
+			for(scene= main->scene.first; scene; scene= scene->id.next) {
+				scene->gm.exitkey = 130;
+			}
+		}
 	}
 	
 	/* WATCH IT!!!: pointers from libdata have not been converted yet here! */

Modified: branches/soc-2011-cucumber/source/blender/makesdna/DNA_scene_types.h
===================================================================
--- branches/soc-2011-cucumber/source/blender/makesdna/DNA_scene_types.h	2011-05-31 20:31:17 UTC (rev 37058)
+++ branches/soc-2011-cucumber/source/blender/makesdna/DNA_scene_types.h	2011-06-01 02:11:39 UTC (rev 37059)
@@ -445,10 +445,11 @@
 	 * bit 3: (gameengine): Activity culling is enabled.
 	 * bit 5: (gameengine) : enable Bullet DBVT tree for view frustrum culling
 	*/
-	short mode, flag, matmode, pad[3];
+	short mode, flag, matmode, pad[2];
 	short occlusionRes;		/* resolution of occlusion Z buffer in pixel */
 	short physicsEngine;
 	short ticrate, maxlogicstep, physubstep, maxphystep;
+	short exitkey;
 
 	/*  standalone player */
 	struct GameFraming framing;

Modified: branches/soc-2011-cucumber/source/blender/makesrna/intern/rna_scene.c
===================================================================
--- branches/soc-2011-cucumber/source/blender/makesrna/intern/rna_scene.c	2011-05-31 20:31:17 UTC (rev 37058)
+++ branches/soc-2011-cucumber/source/blender/makesrna/intern/rna_scene.c	2011-06-01 02:11:39 UTC (rev 37059)
@@ -1695,6 +1695,12 @@
 	RNA_def_property_range(prop, 8, 32);
 	RNA_def_property_ui_text(prop, "Bits", "Displays bit depth of full screen display");
 	RNA_def_property_update(prop, NC_SCENE, NULL);
+
+	prop= RNA_def_property(srna, "exitkey", PROP_INT, PROP_UNSIGNED);
+	RNA_def_property_int_sdna(prop, NULL, "exitkey");
+	RNA_def_property_range(prop, 0, 198);
+	RNA_def_property_ui_text(prop, "Exit Key", "The key used to exit the game engine");
+	RNA_def_property_update(prop, NC_SCENE, NULL);
 	
 	// Do we need it here ? (since we already have it in World
 	prop= RNA_def_property(srna, "frequency", PROP_INT, PROP_NONE);

Modified: branches/soc-2011-cucumber/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp
===================================================================
--- branches/soc-2011-cucumber/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp	2011-05-31 20:31:17 UTC (rev 37058)
+++ branches/soc-2011-cucumber/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp	2011-06-01 02:11:39 UTC (rev 37059)
@@ -211,6 +211,8 @@
 		
 		// create the inputdevices
 		KX_BlenderKeyboardDevice* keyboarddevice = new KX_BlenderKeyboardDevice();
+		keyboarddevice->SetExitKey((startscene->gm.exitkey) ? startscene->gm.exitkey : 130);
+
 		KX_BlenderMouseDevice* mousedevice = new KX_BlenderMouseDevice();
 		
 		// create a networkdevice

Modified: branches/soc-2011-cucumber/source/gameengine/BlenderRoutines/KX_BlenderKeyboardDevice.cpp
===================================================================
--- branches/soc-2011-cucumber/source/gameengine/BlenderRoutines/KX_BlenderKeyboardDevice.cpp	2011-05-31 20:31:17 UTC (rev 37058)
+++ branches/soc-2011-cucumber/source/gameengine/BlenderRoutines/KX_BlenderKeyboardDevice.cpp	2011-06-01 02:11:39 UTC (rev 37059)
@@ -41,7 +41,7 @@
 KX_BlenderKeyboardDevice::KX_BlenderKeyboardDevice()
 	: m_hookesc(false)
 {
-
+	m_exit_key = 130;
 }
 KX_BlenderKeyboardDevice::~KX_BlenderKeyboardDevice()
 {
@@ -107,7 +107,7 @@
 
 		if (val == KM_PRESS)
 		{
-			if (kxevent == KX_ESCKEY && val != 0 && !m_hookesc)
+			if (kxevent == m_exit_key && val != 0 && !m_hookesc)
 				result = true;
 			if (kxevent == KX_PAUSEKEY && val && (IsPressed(KX_LEFTCTRLKEY) || IsPressed(KX_RIGHTCTRLKEY)))
 				result = true;
@@ -168,3 +168,8 @@
 {
 	m_hookesc = true;
 }
+
+void KX_BlenderKeyboardDevice::SetExitKey(short key)
+{
+	m_exit_key = key;
+}

Modified: branches/soc-2011-cucumber/source/gameengine/BlenderRoutines/KX_BlenderKeyboardDevice.h
===================================================================
--- branches/soc-2011-cucumber/source/gameengine/BlenderRoutines/KX_BlenderKeyboardDevice.h	2011-05-31 20:31:17 UTC (rev 37058)
+++ branches/soc-2011-cucumber/source/gameengine/BlenderRoutines/KX_BlenderKeyboardDevice.h	2011-06-01 02:11:39 UTC (rev 37059)
@@ -53,7 +53,13 @@
 	virtual void	NextFrame();
 	virtual void	HookEscape();
 
+	void			SetExitKey(short key);
 
+	//virtual void	SetExitKey(short key);
+private:
+	short		m_exit_key;
+
+
 #ifdef WITH_CXX_GUARDEDALLOC
 public:
 	void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_BlenderKeyboardDevice"); }




More information about the Bf-blender-cvs mailing list