svn merge https://svn.blender.org/svnroot/bf-blender/trunk/blender -r22717:22875
[blender.git] / release / ui / space_logic.py
1 import bpy
2
3 class LOGIC_PT_properties(bpy.types.Panel):
4         __space_type__ = 'LOGIC_EDITOR'
5         __region_type__ = 'UI'
6         __label__ = "Properties"
7
8         def poll(self, context):
9                 ob = context.active_object
10                 return ob and ob.game
11
12         def draw(self, context):
13                 layout = self.layout
14                 
15                 ob = context.active_object
16                 game = ob.game
17                 
18                 layout.itemO("object.game_property_new", text="Add Game Property")
19         
20                 for i, prop in enumerate(game.properties):
21                 
22                         row = layout.row(align=True)     
23                         row.itemR(prop, "name", text="")         
24                         row.itemR(prop, "type", text="")         
25                         row.itemR(prop, "value", text="", toggle=True) # we dont care about the type. rna will display correctly         
26                         row.itemR(prop, "debug", text="", toggle=True, icon='ICON_INFO')         
27                         row.item_intO("object.game_property_remove", "index", i, text="", icon='ICON_X')
28                 
29 bpy.types.register(LOGIC_PT_properties)