Don't show binding/mapping for hidden variables
This commit is contained in:
parent
51878e4b6e
commit
08d8fcdf92
|
@ -200,7 +200,7 @@ void BlackboardPlan::_get_property_list(List<PropertyInfo> *p_list) const {
|
||||||
|
|
||||||
#ifdef TOOLS_ENABLED
|
#ifdef TOOLS_ENABLED
|
||||||
// * Editor
|
// * Editor
|
||||||
if (var.get_type() != Variant::NIL && (!is_derived() || !var_name.begins_with("_"))) {
|
if (!_is_var_hidden(var_name, var)) {
|
||||||
if (has_mapping(var_name) || has_property_binding(var_name)) {
|
if (has_mapping(var_name) || has_property_binding(var_name)) {
|
||||||
p_list->push_back(PropertyInfo(Variant::STRING, var_name, PROPERTY_HINT_NONE, "", PROPERTY_USAGE_EDITOR | PROPERTY_USAGE_READ_ONLY));
|
p_list->push_back(PropertyInfo(Variant::STRING, var_name, PROPERTY_HINT_NONE, "", PROPERTY_USAGE_EDITOR | PROPERTY_USAGE_READ_ONLY));
|
||||||
} else {
|
} else {
|
||||||
|
@ -226,6 +226,9 @@ void BlackboardPlan::_get_property_list(List<PropertyInfo> *p_list) const {
|
||||||
if (is_mapping_enabled()) {
|
if (is_mapping_enabled()) {
|
||||||
p_list->push_back(PropertyInfo(Variant::NIL, "Mapping", PROPERTY_HINT_NONE, "mapping/", PROPERTY_USAGE_GROUP));
|
p_list->push_back(PropertyInfo(Variant::NIL, "Mapping", PROPERTY_HINT_NONE, "mapping/", PROPERTY_USAGE_GROUP));
|
||||||
for (const Pair<StringName, BBVariable> &p : var_list) {
|
for (const Pair<StringName, BBVariable> &p : var_list) {
|
||||||
|
if (_is_var_hidden(p.first, p.second)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if (unlikely(has_property_binding(p.first))) {
|
if (unlikely(has_property_binding(p.first))) {
|
||||||
p_list->push_back(PropertyInfo(Variant::STRING, "mapping/" + p.first, PROPERTY_HINT_NONE, "", PROPERTY_USAGE_EDITOR | PROPERTY_USAGE_READ_ONLY));
|
p_list->push_back(PropertyInfo(Variant::STRING, "mapping/" + p.first, PROPERTY_HINT_NONE, "", PROPERTY_USAGE_EDITOR | PROPERTY_USAGE_READ_ONLY));
|
||||||
} else {
|
} else {
|
||||||
|
@ -239,6 +242,9 @@ void BlackboardPlan::_get_property_list(List<PropertyInfo> *p_list) const {
|
||||||
// * Binding
|
// * Binding
|
||||||
p_list->push_back(PropertyInfo(Variant::NIL, "Binding", PROPERTY_HINT_NONE, "binding/", PROPERTY_USAGE_GROUP));
|
p_list->push_back(PropertyInfo(Variant::NIL, "Binding", PROPERTY_HINT_NONE, "binding/", PROPERTY_USAGE_GROUP));
|
||||||
for (const Pair<StringName, BBVariable> &p : var_list) {
|
for (const Pair<StringName, BBVariable> &p : var_list) {
|
||||||
|
if (_is_var_hidden(p.first, p.second)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if (unlikely(has_mapping(p.first))) {
|
if (unlikely(has_mapping(p.first))) {
|
||||||
p_list->push_back(PropertyInfo(Variant::STRING, "binding/" + p.first, PROPERTY_HINT_NONE, "", PROPERTY_USAGE_EDITOR | PROPERTY_USAGE_READ_ONLY));
|
p_list->push_back(PropertyInfo(Variant::STRING, "binding/" + p.first, PROPERTY_HINT_NONE, "", PROPERTY_USAGE_EDITOR | PROPERTY_USAGE_READ_ONLY));
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -51,6 +51,8 @@ private:
|
||||||
// If true, NodePath variables will be prefetched, so that the vars will contain node pointers instead (upon BB creation/population).
|
// If true, NodePath variables will be prefetched, so that the vars will contain node pointers instead (upon BB creation/population).
|
||||||
bool prefetch_nodepath_vars = true;
|
bool prefetch_nodepath_vars = true;
|
||||||
|
|
||||||
|
_FORCE_INLINE_ bool _is_var_hidden(const String &p_name, const BBVariable &p_var) const { return p_var.get_type() == Variant::NIL || (is_derived() && p_name.begins_with("_")); }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
static void _bind_methods();
|
static void _bind_methods();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue