diff options
Diffstat (limited to 'core/object.h')
-rw-r--r-- | core/object.h | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/core/object.h b/core/object.h index dc7d49f534..b40aef2a42 100644 --- a/core/object.h +++ b/core/object.h @@ -60,7 +60,6 @@ enum PropertyHint { PROPERTY_HINT_ENUM, ///< hint_text= "val1,val2,val3,etc" PROPERTY_HINT_EXP_EASING, /// exponential easing function (Math::ease) use "attenuation" hint string to revert (flip h), "full" to also include in/out. (ie: "attenuation,inout") PROPERTY_HINT_LENGTH, ///< hint_text= "length" (as integer) - PROPERTY_HINT_SPRITE_FRAME, // FIXME: Obsolete: drop whenever we can break compat. Keeping now for GDNative compat. PROPERTY_HINT_KEY_ACCEL, ///< hint_text= "length" (as integer) PROPERTY_HINT_FLAGS, ///< hint_text= "flag1,flag2,etc" (as bit flags) PROPERTY_HINT_LAYERS_2D_RENDER, @@ -92,6 +91,7 @@ enum PropertyHint { PROPERTY_HINT_NODE_PATH_VALID_TYPES, PROPERTY_HINT_SAVE_FILE, ///< a file path must be passed, hint_text (optionally) is a filter "*.png,*.wav,*.doc,". This opens a save dialog PROPERTY_HINT_INT_IS_OBJECTID, + PROPERTY_HINT_ARRAY_TYPE, PROPERTY_HINT_MAX, // When updating PropertyHint, also sync the hardcoded list in VisualScriptEditorVariableEdit }; @@ -107,10 +107,7 @@ enum PropertyUsageFlags { PROPERTY_USAGE_INTERNATIONALIZED = 64, //hint for internationalized strings PROPERTY_USAGE_GROUP = 128, //used for grouping props in the editor PROPERTY_USAGE_CATEGORY = 256, - // FIXME: Drop in 4.0, possibly reorder other flags? - // Those below are deprecated thanks to ClassDB's now class value cache - //PROPERTY_USAGE_STORE_IF_NONZERO = 512, //only store if nonzero - //PROPERTY_USAGE_STORE_IF_NONONE = 1024, //only store if false + PROPERTY_USAGE_SUBGROUP = 512, PROPERTY_USAGE_NO_INSTANCE_STATE = 2048, PROPERTY_USAGE_RESTART_IF_CHANGED = 4096, PROPERTY_USAGE_SCRIPT_VARIABLE = 8192, @@ -126,6 +123,7 @@ enum PropertyUsageFlags { PROPERTY_USAGE_NODE_PATH_FROM_SCENE_ROOT = 1 << 23, PROPERTY_USAGE_RESOURCE_NOT_PERSISTENT = 1 << 24, PROPERTY_USAGE_KEYING_INCREMENTS = 1 << 25, // Used in inspector to increment property when keyed in animation player + PROPERTY_USAGE_DEFERRED_SET_RESOURCE = 1 << 26, // when loading, the resource for this property can be set at the end of loading PROPERTY_USAGE_DEFAULT = PROPERTY_USAGE_STORAGE | PROPERTY_USAGE_EDITOR | PROPERTY_USAGE_NETWORK, PROPERTY_USAGE_DEFAULT_INTL = PROPERTY_USAGE_STORAGE | PROPERTY_USAGE_EDITOR | PROPERTY_USAGE_NETWORK | PROPERTY_USAGE_INTERNATIONALIZED, @@ -137,6 +135,7 @@ enum PropertyUsageFlags { #define ADD_PROPERTYI(m_property, m_setter, m_getter, m_index) ClassDB::add_property(get_class_static(), m_property, _scs_create(m_setter), _scs_create(m_getter), m_index) #define ADD_PROPERTY_DEFAULT(m_property, m_default) ClassDB::set_property_default_value(get_class_static(), m_property, m_default) #define ADD_GROUP(m_name, m_prefix) ClassDB::add_property_group(get_class_static(), m_name, m_prefix) +#define ADD_SUBGROUP(m_name, m_prefix) ClassDB::add_property_subgroup(get_class_static(), m_name, m_prefix) struct PropertyInfo { @@ -241,7 +240,7 @@ struct MethodInfo { //if ( is_type(T::get_class_static()) ) //return static_cast<T*>(this); ////else -//return NULL; +//return nullptr; /* the following is an incomprehensible blob of hacks and workarounds to compensate for many of the fallencies in C++. As a plus, this macro pretty much alone defines the object model. @@ -590,11 +589,11 @@ public: return dynamic_cast<T *>(p_object); #else if (!p_object) - return NULL; + return nullptr; if (p_object->is_class_ptr(T::get_class_ptr_static())) return static_cast<T *>(p_object); else - return NULL; + return nullptr; #endif } @@ -604,11 +603,11 @@ public: return dynamic_cast<const T *>(p_object); #else if (!p_object) - return NULL; + return nullptr; if (p_object->is_class_ptr(T::get_class_ptr_static())) return static_cast<const T *>(p_object); else - return NULL; + return nullptr; #endif } @@ -643,10 +642,10 @@ public: //void set(const String& p_name, const Variant& p_value); //Variant get(const String& p_name) const; - void set(const StringName &p_name, const Variant &p_value, bool *r_valid = NULL); - Variant get(const StringName &p_name, bool *r_valid = NULL) const; - void set_indexed(const Vector<StringName> &p_names, const Variant &p_value, bool *r_valid = NULL); - Variant get_indexed(const Vector<StringName> &p_names, bool *r_valid = NULL) const; + void set(const StringName &p_name, const Variant &p_value, bool *r_valid = nullptr); + Variant get(const StringName &p_name, bool *r_valid = nullptr) const; + void set_indexed(const Vector<StringName> &p_names, const Variant &p_value, bool *r_valid = nullptr); + Variant get_indexed(const Vector<StringName> &p_names, bool *r_valid = nullptr) const; void get_property_list(List<PropertyInfo> *p_list, bool p_reversed = false) const; @@ -663,8 +662,8 @@ public: String to_string(); //used mainly by script, get and set all INCLUDING string - virtual Variant getvar(const Variant &p_key, bool *r_valid = NULL) const; - virtual void setvar(const Variant &p_key, const Variant &p_value, bool *r_valid = NULL); + virtual Variant getvar(const Variant &p_key, bool *r_valid = nullptr) const; + virtual void setvar(const Variant &p_key, const Variant &p_value, bool *r_valid = nullptr); /* SCRIPT */ @@ -693,6 +692,7 @@ public: void add_user_signal(const MethodInfo &p_signal); Error emit_signal(const StringName &p_name, VARIANT_ARG_LIST); Error emit_signal(const StringName &p_name, const Variant **p_args, int p_argcount); + bool has_signal(const StringName &p_name) const; void get_signal_list(List<MethodInfo> *p_signals) const; void get_signal_connection_list(const StringName &p_signal, List<Connection> *p_connections) const; void get_all_signal_connections(List<Connection> *p_connections) const; @@ -713,8 +713,8 @@ public: void set_block_signals(bool p_block); bool is_blocking_signals() const; - Variant::Type get_static_property_type(const StringName &p_property, bool *r_valid = NULL) const; - Variant::Type get_static_property_type_indexed(const Vector<StringName> &p_path, bool *r_valid = NULL) const; + Variant::Type get_static_property_type(const StringName &p_property, bool *r_valid = nullptr) const; + Variant::Type get_static_property_type_indexed(const Vector<StringName> &p_path, bool *r_valid = nullptr) const; virtual void get_translatable_strings(List<String> *p_strings) const; @@ -815,4 +815,4 @@ public: //needed by macros #include "core/class_db.h" -#endif +#endif // OBJECT_H |