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,
|
2010-02-12 13:34:04 +00:00
|
|
|
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2009-11-01 15:21:20 +00:00
|
|
|
#
|
|
|
|
# ##### 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"
|
|
|
|
|
2010-08-09 01:37:09 +00:00
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
2009-10-31 19:31:45 +00:00
|
|
|
ob = context.active_object
|
|
|
|
return ob and ob.game
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
ob = context.active_object
|
|
|
|
game = ob.game
|
|
|
|
|
2010-06-26 21:40:11 +00:00
|
|
|
layout.operator("object.game_property_new", text="Add Game Property", icon='ZOOMIN')
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
for i, prop in enumerate(game.properties):
|
2010-07-05 22:22:22 +00:00
|
|
|
|
2010-06-26 21:40:11 +00:00
|
|
|
box = layout.box()
|
|
|
|
row = box.row()
|
2009-11-23 00:27:30 +00:00
|
|
|
row.prop(prop, "name", text="")
|
|
|
|
row.prop(prop, "type", text="")
|
2010-09-07 15:17:42 +00:00
|
|
|
row.prop(prop, "value", text="", toggle=True) # we dont care about the type. rna will display correctly
|
2010-08-21 04:51:00 +00:00
|
|
|
row.prop(prop, "show_debug", text="", toggle=True, icon='INFO')
|
2010-06-26 21:40:11 +00:00
|
|
|
row.operator("object.game_property_remove", text="", icon='X', emboss=False).index = i
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2010-06-09 19:12:03 +00:00
|
|
|
|
2010-05-16 16:28:50 +00:00
|
|
|
class LOGIC_MT_logicbricks_add(bpy.types.Menu):
|
|
|
|
bl_label = "Add"
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
layout.operator_menu_enum("logic.sensor_add", "type", text="Sensor")
|
|
|
|
layout.operator_menu_enum("logic.controller_add", "type", text="Controller")
|
|
|
|
layout.operator_menu_enum("logic.actuator_add", "type", text="Actuator")
|
2010-09-07 15:17:42 +00:00
|
|
|
|
2010-07-30 15:44:26 +00:00
|
|
|
|
|
|
|
class LOGIC_HT_header(bpy.types.Header):
|
|
|
|
bl_space_type = 'LOGIC_EDITOR'
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
st = context.space_data
|
|
|
|
|
|
|
|
row = layout.row(align=True)
|
|
|
|
row.template_header()
|
|
|
|
|
|
|
|
if context.area.show_menus:
|
|
|
|
sub = row.row(align=True)
|
|
|
|
sub.menu("LOGIC_MT_view")
|
|
|
|
#sub.menu("LOGIC_MT_select")
|
|
|
|
#sub.menu("LOGIC_MT_add")
|
2010-09-07 15:17:42 +00:00
|
|
|
|
2010-07-30 15:44:26 +00:00
|
|
|
|
|
|
|
class LOGIC_MT_view(bpy.types.Menu):
|
|
|
|
bl_label = "View"
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
layout.column()
|
2010-09-07 15:17:42 +00:00
|
|
|
|
2010-07-30 15:44:26 +00:00
|
|
|
layout.operator("logic.properties", icon='MENU_PANEL')
|
|
|
|
|
2010-02-14 11:21:21 +00:00
|
|
|
|
|
|
|
def register():
|
2010-08-02 02:55:12 +00:00
|
|
|
pass
|
2010-02-14 11:21:21 +00:00
|
|
|
|
2010-02-22 23:32:58 +00:00
|
|
|
|
2010-02-14 11:21:21 +00:00
|
|
|
def unregister():
|
2010-08-02 02:55:12 +00:00
|
|
|
pass
|
2010-02-16 09:55:07 +00:00
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
register()
|