BGE Button types panel, can edit existing buttons but not add new ones yet.
[blender-staging.git] / release / ui / space_logic.py
index f862f6e26675232a3b5f6490d8d434ffedba82f7..bb7f22c7c5e669c69bdfb95023fb4a57b621a61b 100644 (file)
@@ -75,7 +75,7 @@ class LOGIC_PT_collision_bounds(bpy.types.Panel):
        def draw(self, context):
                layout = self.layout
                
-               ob = context.scene.objects[0]
+               ob = context.active_object
                game = ob.game
                
                flow = layout.column_flow()
@@ -84,5 +84,28 @@ class LOGIC_PT_collision_bounds(bpy.types.Panel):
                flow.itemR(game, "collision_compound")
                flow.itemR(game, "collision_margin")
 
+class LOGIC_PT_properties(bpy.types.Panel):
+       __space_type__ = "LOGIC_EDITOR"
+       __region_type__ = "UI"
+       __label__ = "Properties"
+
+       def poll(self, context):
+               ob = context.active_object
+               return ob and ob.game
+       
+       def draw(self, context):
+               layout = self.layout
+               
+               ob = context.active_object
+               game = ob.game
+               
+               for prop in game.properties:
+                       flow = layout.row()
+                       flow.itemR(prop, "name", text="")
+                       flow.itemR(prop, "type", text="")
+                       flow.itemR(prop, "value", text="") # we dont care about the type. rna will display correctly
+                       flow.itemR(prop, "debug")
+
 bpy.types.register(LOGIC_PT_physics)
 bpy.types.register(LOGIC_PT_collision_bounds)
+bpy.types.register(LOGIC_PT_properties)