Update the entity field list for blender 2.65a+

More api changes :/ However, the new version certainly seems more powerful.
This commit is contained in:
Bill Currie 2013-01-03 17:57:11 +09:00
parent f25fbfe0bc
commit 66ecf9eba0

View file

@ -100,6 +100,12 @@ class QFEntityRelations(bpy.types.Panel):
def draw(self, context):
pass
class EntityField_list(bpy.types.UIList):
def draw_item(self, context, layout, data, item, icon, active_data,
active_propname, index):
layout.label(item.name)
layout.label(item.value)
def qfentity_items(self, context):
qfmap = context.scene.qfmap
entclasses = qfmap.entity_classes
@ -192,8 +198,8 @@ class EntityPanel(bpy.types.Panel):
sub.prop(qfentity, "flags", text=flags[idx], index=idx)
row = layout.row()
col = row.column()
col.template_list(qfentity, "fields", qfentity, "field_idx",
prop_list="template_list_controls", rows=3)
col.template_list("EntityField_list", "", qfentity, "fields",
qfentity, "field_idx", rows=3)
col = row.column(align=True)
col.operator("object.entprop_add", icon='ZOOMIN', text="")
col.operator("object.entprop_remove", icon='ZOOMOUT', text="")