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:
authorDalai Felinto <dfelinto@gmail.com>2012-01-05 01:40:00 +0400
committerDalai Felinto <dfelinto@gmail.com>2012-01-05 01:40:00 +0400
commitbe025ea31985f7614106b47a519d6e678a19fb95 (patch)
tree369a126b807ff727a7faf624314e0389e5a9e5c5 /source/blender/makesrna/intern/rna_property.c
parent049ab984697aa277c476833670275624c4385257 (diff)
This patch creates an interface for ["Text"] properties in Font objects.
Interface: http://www.pasteall.org/pic/show.php?id=23785 Simple test file: http://www.pasteall.org/blend/10616 (I'll commit this to the text suite later) Code Explanation: --------------- (1) it adds a toggle to add/remove a "Text" gameproperty. - internally this property is just another game property (so we can find it within the game.properties lookup). - the property itself has no 'value', the interface shows the content of ob.data.body instead (why? because gameproperties are per object, while the text is per data). (2) at BGE converter time it sets the current value of the object.data.body to the ["Text"] property. (3) if you change object.text (bge text property) it automatically convert ["Text"] to a CStringValue. *** that means if the original property was a CIntegerValue, it will be converted to CStringValue forever *** * the only to do I can think of is to add a warning at doversion time if user has ["Text"] property for a Font object * * when that happens we print a warning in console/popup.*
Diffstat (limited to 'source/blender/makesrna/intern/rna_property.c')
-rw-r--r--source/blender/makesrna/intern/rna_property.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/source/blender/makesrna/intern/rna_property.c b/source/blender/makesrna/intern/rna_property.c
index e8ef61b6d74..dfdc175d18b 100644
--- a/source/blender/makesrna/intern/rna_property.c
+++ b/source/blender/makesrna/intern/rna_property.c
@@ -35,6 +35,15 @@
#include "WM_types.h"
+EnumPropertyItem gameproperty_type_items[] ={
+ {GPROP_BOOL, "BOOL", 0, "Boolean", "Boolean Property"},
+ {GPROP_INT, "INT", 0, "Integer", "Integer Property"},
+ {GPROP_FLOAT, "FLOAT", 0, "Float", "Floating-Point Property"},
+ {GPROP_STRING, "STRING", 0, "String", "String Property"},
+ {GPROP_TIME, "TIMER", 0, "Timer", "Timer Property"},
+ {0, NULL, 0, NULL, NULL}};
+
+
#ifdef RNA_RUNTIME
#include "BKE_property.h"
@@ -98,14 +107,6 @@ void RNA_def_gameproperty(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- static EnumPropertyItem gameproperty_type_items[] ={
- {GPROP_BOOL, "BOOL", 0, "Boolean", "Boolean Property"},
- {GPROP_INT, "INT", 0, "Integer", "Integer Property"},
- {GPROP_FLOAT, "FLOAT", 0, "Float", "Floating-Point Property"},
- {GPROP_STRING, "STRING", 0, "String", "String Property"},
- {GPROP_TIME, "TIMER", 0, "Timer", "Timer Property"},
- {0, NULL, 0, NULL, NULL}};
-
/* Base Struct for GameProperty */
srna= RNA_def_struct(brna, "GameProperty", NULL);
RNA_def_struct_ui_text(srna , "Game Property", "Game engine user defined object property");