StringName VisualScriptYieldSignal::_get_base_type() const { if (call_mode == CALL_MODE_SELF && get_visual_script().is_valid()) return get_visual_script()->get_instance_base_type(); else if (call_mode == CALL_MODE_NODE_PATH && get_visual_script().is_valid()) { Node *path = _get_base_node(); if (path) return path->get_class(); } return base_type; }
void VisualScriptYieldSignal::_validate_property(PropertyInfo& property) const { if (property.name=="signal/base_type") { if (call_mode!=CALL_MODE_INSTANCE) { property.usage=PROPERTY_USAGE_NOEDITOR; } } if (property.name=="signal/node_path") { if (call_mode!=CALL_MODE_NODE_PATH) { property.usage=0; } else { Node *bnode = _get_base_node(); if (bnode) { property.hint_string=bnode->get_path(); //convert to loong string } else { } } } if (property.name=="signal/signal") { property.hint=PROPERTY_HINT_ENUM; List<MethodInfo> methods; ObjectTypeDB::get_signal_list(_get_base_type(),&methods); List<String> mstring; for (List<MethodInfo>::Element *E=methods.front();E;E=E->next()) { if (E->get().name.begins_with("_")) continue; mstring.push_back(E->get().name.get_slice(":",0)); } mstring.sort(); String ml; for (List<String>::Element *E=mstring.front();E;E=E->next()) { if (ml!=String()) ml+=","; ml+=E->get(); } property.hint_string=ml; } }