/*************************************************************************/ /* visual_script.h */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* 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 VSCRIPT_H #define VSCRIPT_H #include "script_language.h" #include "os/thread.h" class VisualScriptInstance; class VisualScriptNodeInstance; class VisualScript; class VisualScriptNode : public Resource { GDCLASS(VisualScriptNode,Resource) friend class VisualScript; Set scripts_used; Array default_input_values; bool breakpoint; void _set_default_input_values(Array p_values); Array _get_default_input_values() const; void validate_input_default_values(); protected: void _notification(int p_what); 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=0; 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* instance(VisualScriptInstance* p_instance)=0; struct TypeGuess { Variant::Type type; InputEvent::Type ev_type; StringName GDCLASS; Ref