2009-11-01 15:21:20 +00:00
|
|
|
# ##### BEGIN GPL LICENSE BLOCK #####
|
|
|
|
#
|
|
|
|
# This program is free software; you can redistribute it and/or
|
|
|
|
# modify it under the terms of the GNU General Public License
|
|
|
|
# as published by the Free Software Foundation; either version 2
|
|
|
|
# of the License, or (at your option) any later version.
|
2009-11-03 07:23:02 +00:00
|
|
|
#
|
2009-11-01 15:21:20 +00:00
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
2009-11-03 07:23:02 +00:00
|
|
|
#
|
2009-11-01 15:21:20 +00:00
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program; if not, write to the Free Software Foundation,
|
|
|
|
# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
#
|
|
|
|
# ##### END GPL LICENSE BLOCK #####
|
2009-10-31 20:16:59 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
# <pep8 compliant>
|
2009-06-20 06:06:13 +00:00
|
|
|
import bpy
|
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2009-07-20 20:28:29 +00:00
|
|
|
class LOGIC_PT_properties(bpy.types.Panel):
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_space_type = 'LOGIC_EDITOR'
|
|
|
|
bl_region_type = 'UI'
|
|
|
|
bl_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
|
|
|
|
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.operator("object.game_property_new", text="Add Game Property")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
for i, prop in enumerate(game.properties):
|
|
|
|
|
|
|
|
row = layout.row(align=True)
|
2009-11-23 00:27:30 +00:00
|
|
|
row.prop(prop, "name", text="")
|
|
|
|
row.prop(prop, "type", text="")
|
|
|
|
row.prop(prop, "value", text="", toggle=True) # we dont care about the type. rna will display correctly
|
2009-12-10 10:23:53 +00:00
|
|
|
row.prop(prop, "debug", text="", toggle=True, icon='INFO')
|
|
|
|
row.operator("object.game_property_remove", text="", icon='X').index = i
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-07-20 16:21:55 +00:00
|
|
|
bpy.types.register(LOGIC_PT_properties)
|