summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2016-05-14 23:48:23 -0300
committerJuan Linietsky <reduzio@gmail.com>2016-05-14 23:48:45 -0300
commitbed3efb17ede58a2bfc177b47cb3a49091aea30a (patch)
tree81708b952559e76d38902afac2663a77f8974688 /core
parent7913e792acd656469b29fb90be1dbb7c06a855ba (diff)
New reworked AnimatedSprite!
-New SpriteFrames editor, with support for drag&drop, multiple animation sets, animation speed and loop. -New AnimatedSprite, with support for all the new features! AnimatedSprite3D has not been updated yet. -Added support for drag&drop to other editors, such as resourcepreload, sample library, etc.
Diffstat (limited to 'core')
-rw-r--r--core/object.cpp5
-rw-r--r--core/object.h7
-rw-r--r--core/object_type_db.cpp12
-rw-r--r--core/object_type_db.h2
4 files changed, 21 insertions, 5 deletions
diff --git a/core/object.cpp b/core/object.cpp
index 7bdec06c1b..ee4b5e288c 100644
--- a/core/object.cpp
+++ b/core/object.cpp
@@ -463,6 +463,11 @@ void Object::get_property_list(List<PropertyInfo> *p_list,bool p_reversed) const
}
}
+
+void Object::_validate_property(PropertyInfo& property) const {
+
+}
+
void Object::get_method_list(List<MethodInfo> *p_list) const {
ObjectTypeDB::get_method_list(get_type_name(),p_list);
diff --git a/core/object.h b/core/object.h
index dcebf9b2a2..c34440100f 100644
--- a/core/object.h
+++ b/core/object.h
@@ -274,12 +274,12 @@ virtual void _get_property_listv(List<PropertyInfo> *p_list,bool p_reversed) con
}\
p_list->push_back( PropertyInfo(Variant::NIL,get_type_static(),PROPERTY_HINT_NONE,String(),PROPERTY_USAGE_CATEGORY));\
if (!_is_gpl_reversed())\
- ObjectTypeDB::get_property_list(#m_type,p_list,true);\
+ ObjectTypeDB::get_property_list(#m_type,p_list,true,this);\
if (m_type::_get_get_property_list() != m_inherits::_get_get_property_list()) {\
_get_property_list(p_list);\
}\
if (_is_gpl_reversed())\
- ObjectTypeDB::get_property_list(#m_type,p_list,true);\
+ ObjectTypeDB::get_property_list(#m_type,p_list,true,this);\
if (p_reversed) {\
m_inherits::_get_property_listv(p_list,p_reversed);\
}\
@@ -462,6 +462,9 @@ protected:
void _clear_internal_resource_paths(const Variant &p_var);
+friend class ObjectTypeDB;
+ virtual void _validate_property(PropertyInfo& property) const;
+
public: //should be protected, but bug in clang++
static void initialize_type();
_FORCE_INLINE_ static void register_custom_data_to_otdb() {};
diff --git a/core/object_type_db.cpp b/core/object_type_db.cpp
index 14b595d61b..5f97df39a6 100644
--- a/core/object_type_db.cpp
+++ b/core/object_type_db.cpp
@@ -619,14 +619,22 @@ void ObjectTypeDB::add_property(StringName p_type,const PropertyInfo& p_pinfo, c
}
-void ObjectTypeDB::get_property_list(StringName p_type,List<PropertyInfo> *p_list,bool p_no_inheritance) {
+void ObjectTypeDB::get_property_list(StringName p_type, List<PropertyInfo> *p_list, bool p_no_inheritance,const Object *p_validator) {
TypeInfo *type=types.getptr(p_type);
TypeInfo *check=type;
while(check) {
for(List<PropertyInfo>::Element *E=type->property_list.front();E;E=E->next()) {
- p_list->push_back(E->get());
+
+
+ if (p_validator) {
+ PropertyInfo pi = E->get();
+ p_validator->_validate_property(pi);
+ p_list->push_back(pi);
+ } else {
+ p_list->push_back(E->get());
+ }
}
if (p_no_inheritance)
diff --git a/core/object_type_db.h b/core/object_type_db.h
index a4896fff81..8313091acd 100644
--- a/core/object_type_db.h
+++ b/core/object_type_db.h
@@ -456,7 +456,7 @@ public:
static void get_signal_list(StringName p_type,List<MethodInfo> *p_signals,bool p_no_inheritance=false);
static void add_property(StringName p_type,const PropertyInfo& p_pinfo, const StringName& p_setter, const StringName& p_getter, int p_index=-1);
- static void get_property_list(StringName p_type,List<PropertyInfo> *p_list,bool p_no_inheritance=false);
+ static void get_property_list(StringName p_type, List<PropertyInfo> *p_list, bool p_no_inheritance=false, const Object *p_validator=NULL);
static bool set_property(Object* p_object, const StringName& p_property, const Variant& p_value, bool *r_valid=NULL);
static bool get_property(Object* p_object,const StringName& p_property, Variant& r_value);
static Variant::Type get_property_type(const StringName& p_type, const StringName& p_property,bool *r_is_valid=NULL);