/*************************************************************************/ /* visual_script.h */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ /* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2021 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2021 Godot Engine contributors (cf. AUTHORS.md). */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ /* "Software"), to deal in the Software without restriction, including */ /* without limitation the rights to use, copy, modify, merge, publish, */ /* distribute, sublicense, and/or sell copies of the Software, and to */ /* permit persons to whom the Software is furnished to do so, subject to */ /* the following conditions: */ /* */ /* The above copyright notice and this permission notice shall be */ /* included in all copies or substantial portions of the Software. */ /* */ /* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ /* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ /* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ /* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ #ifndef VISUAL_SCRIPT_H #define VISUAL_SCRIPT_H #include "core/debugger/engine_debugger.h" #include "core/debugger/script_debugger.h" #include "core/doc_data.h" #include "core/object/script_language.h" #include "core/os/thread.h" class VisualScriptInstance; class VisualScriptNodeInstance; class VisualScript; class VisualScriptNode : public Resource { GDCLASS(VisualScriptNode, Resource); friend class VisualScript; Ref script_used; Array default_input_values; bool breakpoint = false; void _set_default_input_values(Array p_values); Array _get_default_input_values() const; void validate_input_default_values(); protected: void ports_changed_notify(); static void _bind_methods(); public: Ref get_visual_script() const; virtual int get_output_sequence_port_count() const = 0; virtual bool has_input_sequence_port() const = 0; virtual String get_output_sequence_port_text(int p_port) const = 0; virtual bool has_mixed_input_and_sequence_ports() const { return false; } virtual int get_input_value_port_count() const = 0; virtual int get_output_value_port_count() const = 0; virtual PropertyInfo get_input_value_port_info(int p_idx) const = 0; virtual PropertyInfo get_output_value_port_info(int p_idx) const = 0; void set_default_input_value(int p_port, const Variant &p_value); Variant get_default_input_value(int p_port) const; virtual String get_caption() const = 0; virtual String get_text() const; virtual String get_category() const = 0; // Used by editor, this is not really saved. void set_breakpoint(bool p_breakpoint); bool is_breakpoint() const; virtual VisualScriptNodeInstance *instantiate(VisualScriptInstance *p_instance) = 0; struct TypeGuess { Variant::Type type = Variant::NIL; StringName gdclass; Ref