In a derived BB plan, hide variables with names that begin with "_"

This commit is contained in:
Serhii Snitsaruk 2024-01-25 11:51:35 +01:00
parent 06052332b2
commit fb1ab16682
2 changed files with 4 additions and 2 deletions

View File

@ -81,7 +81,9 @@ void BlackboardPlan::_get_property_list(List<PropertyInfo> *p_list) const {
BBVariable var = kv.value; BBVariable var = kv.value;
// * Editor // * Editor
if (!is_derived() || !var_name.begins_with("_")) {
p_list->push_back(PropertyInfo(var.get_type(), var_name, var.get_hint(), var.get_hint_string(), PROPERTY_USAGE_EDITOR)); p_list->push_back(PropertyInfo(var.get_type(), var_name, var.get_hint(), var.get_hint_string(), PROPERTY_USAGE_EDITOR));
}
// * Storage // * Storage
p_list->push_back(PropertyInfo(Variant::STRING, "var/" + var_name + "/name", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NO_EDITOR | PROPERTY_USAGE_INTERNAL)); p_list->push_back(PropertyInfo(Variant::STRING, "var/" + var_name + "/name", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NO_EDITOR | PROPERTY_USAGE_INTERNAL));

View File

@ -56,7 +56,7 @@ public:
void swap_vars(int idx_a, int idx_b); void swap_vars(int idx_a, int idx_b);
void sync_with_base_plan(); void sync_with_base_plan();
bool is_derived() { return base.is_valid(); } bool is_derived() const { return base.is_valid(); }
Ref<Blackboard> create_blackboard(); Ref<Blackboard> create_blackboard();
void populate_blackboard(const Ref<Blackboard> &p_blackboard, bool overwrite); void populate_blackboard(const Ref<Blackboard> &p_blackboard, bool overwrite);