mirror of
https://github.com/godotengine/godot.git
synced 2025-10-27 03:34:17 +00:00
Merge pull request #28606 from bojidar-bg/25889-indexed-set-defaults
Fix default values not being read correctly in VS, take two
This commit is contained in:
commit
e3735a5d5a
2 changed files with 2 additions and 14 deletions
|
|
@ -46,15 +46,7 @@ bool VisualScriptNode::is_breakpoint() const {
|
|||
return breakpoint;
|
||||
}
|
||||
|
||||
void VisualScriptNode::_notification(int p_what) {
|
||||
|
||||
if (p_what == NOTIFICATION_POSTINITIALIZE) {
|
||||
validate_input_default_values();
|
||||
}
|
||||
}
|
||||
|
||||
void VisualScriptNode::ports_changed_notify() {
|
||||
validate_input_default_values();
|
||||
emit_signal("ports_changed");
|
||||
}
|
||||
|
||||
|
|
@ -273,11 +265,7 @@ void VisualScript::_node_ports_changed(int p_id) {
|
|||
Function &func = functions[function];
|
||||
Ref<VisualScriptNode> vsn = func.nodes[p_id].node;
|
||||
|
||||
if (OS::get_singleton()->get_main_loop() &&
|
||||
Object::cast_to<SceneTree>(OS::get_singleton()->get_main_loop()) &&
|
||||
Engine::get_singleton()->is_editor_hint()) {
|
||||
vsn->validate_input_default_values(); //force validate default values when editing on editor
|
||||
}
|
||||
vsn->validate_input_default_values();
|
||||
|
||||
//must revalidate all the functions
|
||||
|
||||
|
|
@ -353,6 +341,7 @@ void VisualScript::add_node(const StringName &p_func, int p_id, const Ref<Visual
|
|||
Ref<VisualScriptNode> vsn = p_node;
|
||||
vsn->connect("ports_changed", this, "_node_ports_changed", varray(p_id));
|
||||
vsn->scripts_used.insert(this);
|
||||
vsn->validate_input_default_values(); // Validate when fully loaded
|
||||
|
||||
func.nodes[p_id] = nd;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue