diff options
author | Hamed Zaghaghi <hamed.zaghaghi@gmail.com> | 2008-12-02 04:05:23 +0300 |
---|---|---|
committer | Hamed Zaghaghi <hamed.zaghaghi@gmail.com> | 2008-12-02 04:05:23 +0300 |
commit | 6780c0b12a63ac1395d97f199e25c4f692244efb (patch) | |
tree | 7821f5a2626fc96a4dd82ba3fa63ad22dcbe33f0 /source/blender/makesrna/intern/rna_property.c | |
parent | accfa06ede3231fe74e3e49858eb0d44ff0431e6 (diff) |
* rna_property completed
CAUTION: some defines like PROP_INT in DNA_property_types.h are the same
as enums in RNA_types.h, and may be encounter hidden errors in future.
Diffstat (limited to 'source/blender/makesrna/intern/rna_property.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_property.c | 49 |
1 files changed, 48 insertions, 1 deletions
diff --git a/source/blender/makesrna/intern/rna_property.c b/source/blender/makesrna/intern/rna_property.c index 2414d91bfe2..94a16eaf9b9 100644 --- a/source/blender/makesrna/intern/rna_property.c +++ b/source/blender/makesrna/intern/rna_property.c @@ -49,6 +49,7 @@ void RNA_def_gameproperty(BlenderRNA *brna) {PROP_TIME, "TIME", "Time", ""}, {0, NULL, NULL, NULL}}; + /* Base Struct for GameProperty */ srna= RNA_def_struct(brna, "GameProperty", NULL , "GameProperty"); RNA_def_struct_sdna(srna, "bProperty"); @@ -57,12 +58,58 @@ void RNA_def_gameproperty(BlenderRNA *brna) RNA_def_property_string_maxlength(prop, 31); RNA_def_property_ui_text(prop, "Name", "Game Property name."); - /* type is not editable, would need to do proper data free/alloc */ prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); RNA_def_property_flag(prop, PROP_NOT_EDITABLE); RNA_def_property_enum_items(prop, gameproperty_types_items); RNA_def_property_ui_text(prop, "Game Property Types", "Game Property types."); + prop= RNA_def_property(srna, "debug", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", PROP_DEBUG); + RNA_def_property_ui_text(prop, "Debug", "Show debug information for this property."); + + /* GameBooleanProperty */ + srna= RNA_def_struct(brna, "GameBooleanProperty", "GameProperty" , "GameBooleanProperty"); + RNA_def_struct_sdna(srna, "bProperty"); + + prop= RNA_def_property(srna, "boolean_value", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "data", 1); + RNA_def_property_ui_text(prop, "Value", "Property value."); + + /* GameIntProperty */ + srna= RNA_def_struct(brna, "GameIntProperty", "GameProperty" , "GameIntProperty"); + RNA_def_struct_sdna(srna, "bProperty"); + + prop= RNA_def_property(srna, "int_value", PROP_INT, PROP_NONE); + RNA_def_property_int_sdna(prop, NULL, "data"); + RNA_def_property_ui_text(prop, "Value", "Property value."); + RNA_def_property_range(prop, -10000, 10000); + + /* GameFloatProperty */ + srna= RNA_def_struct(brna, "GameFloatProperty", "GameProperty" , "GameFloatProperty"); + RNA_def_struct_sdna(srna, "bProperty"); + + prop= RNA_def_property(srna, "float_value", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "data"); + RNA_def_property_ui_text(prop, "Value", "Property value."); + RNA_def_property_range(prop, -10000, 10000); + + /* GameTimerProperty */ + srna= RNA_def_struct(brna, "GameTimeProperty", "GameProperty" , "GameTimeProperty"); + RNA_def_struct_sdna(srna, "bProperty"); + + prop= RNA_def_property(srna, "timer_value", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "data"); + RNA_def_property_ui_text(prop, "Value", "Property value."); + RNA_def_property_range(prop, -10000, 10000); + + /* GameStringProperty */ + srna= RNA_def_struct(brna, "GameStringProperty", "GameProperty" , "GameStringProperty"); + RNA_def_struct_sdna(srna, "bProperty"); + + prop= RNA_def_property(srna, "string_value", PROP_STRING, PROP_NONE); + RNA_def_property_string_sdna(prop, NULL, "poin"); + RNA_def_property_string_maxlength(prop, MAX_PROPSTRING-1); + RNA_def_property_ui_text(prop, "Value", "Property value."); } #endif |