2009-06-20 06:06:13 +00:00
|
|
|
import bpy
|
|
|
|
|
2009-07-20 20:28:29 +00:00
|
|
|
class LOGIC_PT_properties(bpy.types.Panel):
|
2009-08-22 08:48:01 +00:00
|
|
|
__space_type__ = 'LOGIC_EDITOR'
|
|
|
|
__region_type__ = 'UI'
|
2009-07-20 20:28:29 +00:00
|
|
|
__label__ = "Properties"
|
2009-06-20 06:06:13 +00:00
|
|
|
|
2009-06-23 12:36:15 +00:00
|
|
|
def poll(self, context):
|
|
|
|
ob = context.active_object
|
|
|
|
return ob and ob.game
|
|
|
|
|
2009-06-20 06:06:13 +00:00
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2009-08-27 19:10:53 +00:00
|
|
|
|
2009-06-20 06:06:13 +00:00
|
|
|
ob = context.active_object
|
|
|
|
game = ob.game
|
|
|
|
|
2009-08-27 08:46:39 +00:00
|
|
|
layout.itemO("object.game_property_new", text="Add Game Property")
|
2009-08-27 19:10:53 +00:00
|
|
|
|
2009-08-26 12:51:27 +00:00
|
|
|
for i, prop in enumerate(game.properties):
|
|
|
|
|
2009-08-27 19:10:53 +00:00
|
|
|
row = layout.row(align=True)
|
|
|
|
row.itemR(prop, "name", text="")
|
|
|
|
row.itemR(prop, "type", text="")
|
|
|
|
row.itemR(prop, "value", text="", toggle=True) # we dont care about the type. rna will display correctly
|
|
|
|
row.itemR(prop, "debug", text="", toggle=True, icon='ICON_INFO')
|
2009-08-27 08:46:39 +00:00
|
|
|
row.item_intO("object.game_property_remove", "index", i, text="", icon='ICON_X')
|
|
|
|
|
2009-07-20 16:21:55 +00:00
|
|
|
bpy.types.register(LOGIC_PT_properties)
|