Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Ebb <matt@mke3.net>2010-05-05 04:12:31 +0400
committerMatt Ebb <matt@mke3.net>2010-05-05 04:12:31 +0400
commit96aa9f7002aa2d87b815a73f8aa86cc9b1fdf9e7 (patch)
tree940307f45d4761f9c3233c0173410cdff9dff486 /source/blender/makesrna/intern/rna_sensor.c
parentc3cd8175c1c542ea9478a87c921f64adf1add9c1 (diff)
Logic Editor UI work
* Re-structured code (can delete the old function entirely when this is done) * Fixed links/inlinks * Fixed some bugs in add and remove controller/actuator * Cleaned up some ui layouts * Use key event types in keyboard sensor * Implemented object controller 'state' in RNA/layout engine (still needs tweaks)
Diffstat (limited to 'source/blender/makesrna/intern/rna_sensor.c')
-rw-r--r--source/blender/makesrna/intern/rna_sensor.c28
1 files changed, 17 insertions, 11 deletions
diff --git a/source/blender/makesrna/intern/rna_sensor.c b/source/blender/makesrna/intern/rna_sensor.c
index dba17531165..93eec4cbbdd 100644
--- a/source/blender/makesrna/intern/rna_sensor.c
+++ b/source/blender/makesrna/intern/rna_sensor.c
@@ -25,6 +25,7 @@
#include <stdlib.h>
#include "RNA_define.h"
+#include "RNA_enum_types.h"
#include "rna_internal.h"
@@ -232,22 +233,27 @@ static void rna_def_keyboard_sensor(BlenderRNA *brna)
RNA_def_struct_ui_text(srna, "Keyboard Sensor", "Sensor to detect keyboard events");
RNA_def_struct_sdna_from(srna, "bKeyboardSensor", "data");
+ /*
prop= RNA_def_property(srna, "key", PROP_INT, PROP_NONE);//XXX need to use another input template
- RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* need better range or enum check */
+ //RNA_def_property_clear_flag(prop, PROP_EDITABLE); // need better range or enum check
RNA_def_property_ui_text(prop, "Key", "Input key code");
RNA_def_property_range(prop, 0, 255);
-
- prop= RNA_def_property(srna, "modifier_key", PROP_INT, PROP_NONE);
- RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* need better range or enum check */
- RNA_def_property_int_sdna(prop, NULL, "qual");
+ */
+
+ prop= RNA_def_property(srna, "key", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "key");
+ RNA_def_property_enum_items(prop, event_type_items);
+ RNA_def_property_ui_text(prop, "Key", "");
+
+ prop= RNA_def_property(srna, "modifier_key", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "qual");
+ RNA_def_property_enum_items(prop, event_type_items);
RNA_def_property_ui_text(prop, "Modifier Key", "Modifier key code");
- RNA_def_property_range(prop, 0, 255);
-
- prop= RNA_def_property(srna, "second_modifier_key", PROP_INT, PROP_NONE);
- RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* need better range or enum check */
- RNA_def_property_int_sdna(prop, NULL, "qual2");
+
+ prop= RNA_def_property(srna, "second_modifier_key", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "qual2");
+ RNA_def_property_enum_items(prop, event_type_items);
RNA_def_property_ui_text(prop, "Second Modifier Key", "Modifier key code");
- RNA_def_property_range(prop, 0, 255);
prop= RNA_def_property(srna, "target", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "targetName");