2017-03-05 15:47:28 +01:00
|
|
|
/*************************************************************************/
|
2017-09-01 16:07:55 +02:00
|
|
|
/* visual_script_nodes.h */
|
2017-03-05 15:47:28 +01:00
|
|
|
/*************************************************************************/
|
|
|
|
/* This file is part of: */
|
|
|
|
/* GODOT ENGINE */
|
2017-08-27 14:16:55 +02:00
|
|
|
/* https://godotengine.org */
|
2017-03-05 15:47:28 +01:00
|
|
|
/*************************************************************************/
|
2020-01-01 11:16:22 +01:00
|
|
|
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
|
|
|
|
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
|
2017-03-05 15:47:28 +01:00
|
|
|
/* */
|
|
|
|
/* 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. */
|
|
|
|
/*************************************************************************/
|
2018-01-05 00:50:27 +01:00
|
|
|
|
2016-08-03 00:11:05 +02:00
|
|
|
#ifndef VISUAL_SCRIPT_NODES_H
|
|
|
|
#define VISUAL_SCRIPT_NODES_H
|
|
|
|
|
|
|
|
#include "visual_script.h"
|
|
|
|
|
|
|
|
class VisualScriptFunction : public VisualScriptNode {
|
|
|
|
|
2019-03-19 19:35:57 +01:00
|
|
|
GDCLASS(VisualScriptFunction, VisualScriptNode);
|
2016-08-03 00:11:05 +02:00
|
|
|
|
|
|
|
struct Argument {
|
|
|
|
String name;
|
|
|
|
Variant::Type type;
|
2018-07-25 23:23:26 +02:00
|
|
|
PropertyHint hint;
|
|
|
|
String hint_string;
|
2016-08-03 00:11:05 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
Vector<Argument> arguments;
|
2016-08-06 03:46:45 +02:00
|
|
|
|
|
|
|
bool stack_less;
|
|
|
|
int stack_size;
|
2018-05-13 07:07:56 +02:00
|
|
|
MultiplayerAPI::RPCMode rpc_mode;
|
2017-08-08 18:14:36 +02:00
|
|
|
bool sequenced;
|
2016-08-06 03:46:45 +02:00
|
|
|
|
2016-08-03 00:11:05 +02:00
|
|
|
protected:
|
2017-03-05 16:44:50 +01:00
|
|
|
bool _set(const StringName &p_name, const Variant &p_value);
|
|
|
|
bool _get(const StringName &p_name, Variant &r_ret) const;
|
|
|
|
void _get_property_list(List<PropertyInfo> *p_list) const;
|
2016-08-03 00:11:05 +02:00
|
|
|
|
|
|
|
public:
|
|
|
|
virtual int get_output_sequence_port_count() const;
|
|
|
|
virtual bool has_input_sequence_port() const;
|
|
|
|
|
|
|
|
virtual String get_output_sequence_port_text(int p_port) const;
|
|
|
|
|
|
|
|
virtual int get_input_value_port_count() const;
|
|
|
|
virtual int get_output_value_port_count() const;
|
|
|
|
|
|
|
|
virtual PropertyInfo get_input_value_port_info(int p_idx) const;
|
|
|
|
virtual PropertyInfo get_output_value_port_info(int p_idx) const;
|
|
|
|
|
|
|
|
virtual String get_caption() const;
|
|
|
|
virtual String get_text() const;
|
2016-08-06 03:46:45 +02:00
|
|
|
virtual String get_category() const { return "flow_control"; }
|
2016-08-03 00:11:05 +02:00
|
|
|
|
2018-07-25 23:23:26 +02:00
|
|
|
void add_argument(Variant::Type p_type, const String &p_name, int p_index = -1, const PropertyHint p_hint = PROPERTY_HINT_NONE, const String &p_hint_string = String(""));
|
2017-03-05 16:44:50 +01:00
|
|
|
void set_argument_type(int p_argidx, Variant::Type p_type);
|
2016-08-03 00:11:05 +02:00
|
|
|
Variant::Type get_argument_type(int p_argidx) const;
|
2017-03-05 16:44:50 +01:00
|
|
|
void set_argument_name(int p_argidx, const String &p_name);
|
2016-08-03 00:11:05 +02:00
|
|
|
String get_argument_name(int p_argidx) const;
|
|
|
|
void remove_argument(int p_argidx);
|
|
|
|
int get_argument_count() const;
|
|
|
|
|
2016-08-06 03:46:45 +02:00
|
|
|
void set_stack_less(bool p_enable);
|
|
|
|
bool is_stack_less() const;
|
|
|
|
|
2017-08-08 18:14:36 +02:00
|
|
|
void set_sequenced(bool p_enable);
|
|
|
|
bool is_sequenced() const;
|
|
|
|
|
2016-08-06 03:46:45 +02:00
|
|
|
void set_stack_size(int p_size);
|
|
|
|
int get_stack_size() const;
|
|
|
|
|
2017-08-08 18:14:36 +02:00
|
|
|
void set_return_type_enabled(bool p_returns);
|
|
|
|
bool is_return_type_enabled() const;
|
|
|
|
|
|
|
|
void set_return_type(Variant::Type p_type);
|
|
|
|
Variant::Type get_return_type() const;
|
|
|
|
|
2018-05-13 07:07:56 +02:00
|
|
|
void set_rpc_mode(MultiplayerAPI::RPCMode p_mode);
|
|
|
|
MultiplayerAPI::RPCMode get_rpc_mode() const;
|
2016-08-25 22:45:20 +02:00
|
|
|
|
2017-03-05 16:44:50 +01:00
|
|
|
virtual VisualScriptNodeInstance *instance(VisualScriptInstance *p_instance);
|
2016-08-03 00:11:05 +02:00
|
|
|
|
|
|
|
VisualScriptFunction();
|
|
|
|
};
|
|
|
|
|
2019-09-13 21:14:12 +02:00
|
|
|
class VisualScriptLists : public VisualScriptNode {
|
|
|
|
|
|
|
|
GDCLASS(VisualScriptLists, VisualScriptNode)
|
|
|
|
|
|
|
|
struct Port {
|
|
|
|
String name;
|
|
|
|
Variant::Type type;
|
|
|
|
};
|
|
|
|
|
|
|
|
protected:
|
|
|
|
Vector<Port> inputports;
|
|
|
|
Vector<Port> outputports;
|
|
|
|
|
|
|
|
enum {
|
|
|
|
OUTPUT_EDITABLE = 0x0001,
|
|
|
|
OUTPUT_NAME_EDITABLE = 0x0002,
|
|
|
|
OUTPUT_TYPE_EDITABLE = 0x0004,
|
|
|
|
INPUT_EDITABLE = 0x0008,
|
|
|
|
INPUT_NAME_EDITABLE = 0x000F,
|
|
|
|
INPUT_TYPE_EDITABLE = 0x0010,
|
|
|
|
};
|
|
|
|
|
|
|
|
int flags;
|
|
|
|
|
|
|
|
bool sequenced;
|
|
|
|
|
|
|
|
bool _set(const StringName &p_name, const Variant &p_value);
|
|
|
|
bool _get(const StringName &p_name, Variant &r_ret) const;
|
|
|
|
void _get_property_list(List<PropertyInfo> *p_list) const;
|
|
|
|
|
|
|
|
static void _bind_methods();
|
|
|
|
|
|
|
|
public:
|
|
|
|
virtual bool is_output_port_editable() const;
|
|
|
|
virtual bool is_output_port_name_editable() const;
|
|
|
|
virtual bool is_output_port_type_editable() const;
|
|
|
|
|
|
|
|
virtual bool is_input_port_editable() const;
|
|
|
|
virtual bool is_input_port_name_editable() const;
|
|
|
|
virtual bool is_input_port_type_editable() const;
|
|
|
|
|
|
|
|
virtual int get_output_sequence_port_count() const;
|
|
|
|
virtual bool has_input_sequence_port() const;
|
|
|
|
|
|
|
|
virtual String get_output_sequence_port_text(int p_port) const;
|
|
|
|
|
|
|
|
virtual int get_input_value_port_count() const;
|
|
|
|
virtual int get_output_value_port_count() const;
|
|
|
|
|
|
|
|
virtual PropertyInfo get_input_value_port_info(int p_idx) const;
|
|
|
|
virtual PropertyInfo get_output_value_port_info(int p_idx) const;
|
|
|
|
|
|
|
|
virtual String get_caption() const = 0;
|
|
|
|
virtual String get_text() const = 0;
|
|
|
|
virtual String get_category() const = 0;
|
|
|
|
|
|
|
|
void add_input_data_port(Variant::Type p_type, const String &p_name, int p_index = -1);
|
|
|
|
void set_input_data_port_type(int p_idx, Variant::Type p_type);
|
|
|
|
void set_input_data_port_name(int p_idx, const String &p_name);
|
|
|
|
void remove_input_data_port(int p_argidx);
|
|
|
|
|
|
|
|
void add_output_data_port(Variant::Type p_type, const String &p_name, int p_index = -1);
|
|
|
|
void set_output_data_port_type(int p_idx, Variant::Type p_type);
|
|
|
|
void set_output_data_port_name(int p_idx, const String &p_name);
|
|
|
|
void remove_output_data_port(int p_argidx);
|
|
|
|
|
|
|
|
void set_sequenced(bool p_enable);
|
|
|
|
bool is_sequenced() const;
|
|
|
|
|
|
|
|
VisualScriptLists();
|
|
|
|
};
|
|
|
|
|
|
|
|
class VisualScriptComposeArray : public VisualScriptLists {
|
|
|
|
|
|
|
|
GDCLASS(VisualScriptComposeArray, VisualScriptLists)
|
|
|
|
|
|
|
|
public:
|
|
|
|
virtual int get_output_sequence_port_count() const;
|
|
|
|
virtual bool has_input_sequence_port() const;
|
|
|
|
|
|
|
|
virtual String get_output_sequence_port_text(int p_port) const;
|
|
|
|
|
|
|
|
virtual int get_input_value_port_count() const;
|
|
|
|
virtual int get_output_value_port_count() const;
|
|
|
|
|
|
|
|
virtual PropertyInfo get_input_value_port_info(int p_idx) const;
|
|
|
|
virtual PropertyInfo get_output_value_port_info(int p_idx) const;
|
|
|
|
|
|
|
|
virtual String get_caption() const;
|
|
|
|
virtual String get_text() const;
|
|
|
|
virtual String get_category() const { return "functions"; }
|
|
|
|
|
|
|
|
virtual VisualScriptNodeInstance *instance(VisualScriptInstance *p_instance);
|
|
|
|
|
|
|
|
VisualScriptComposeArray();
|
|
|
|
};
|
|
|
|
|
2016-08-03 00:11:05 +02:00
|
|
|
class VisualScriptOperator : public VisualScriptNode {
|
|
|
|
|
2019-03-19 19:35:57 +01:00
|
|
|
GDCLASS(VisualScriptOperator, VisualScriptNode);
|
2016-08-03 00:11:05 +02:00
|
|
|
|
2016-08-29 01:57:27 +02:00
|
|
|
Variant::Type typed;
|
2016-08-03 00:11:05 +02:00
|
|
|
Variant::Operator op;
|
|
|
|
|
2017-03-05 16:44:50 +01:00
|
|
|
protected:
|
2016-08-03 00:11:05 +02:00
|
|
|
static void _bind_methods();
|
|
|
|
|
2017-03-05 16:44:50 +01:00
|
|
|
public:
|
2016-08-03 00:11:05 +02:00
|
|
|
virtual int get_output_sequence_port_count() const;
|
|
|
|
virtual bool has_input_sequence_port() const;
|
|
|
|
|
|
|
|
virtual String get_output_sequence_port_text(int p_port) const;
|
|
|
|
|
|
|
|
virtual int get_input_value_port_count() const;
|
|
|
|
virtual int get_output_value_port_count() const;
|
|
|
|
|
|
|
|
virtual PropertyInfo get_input_value_port_info(int p_idx) const;
|
|
|
|
virtual PropertyInfo get_output_value_port_info(int p_idx) const;
|
|
|
|
|
|
|
|
virtual String get_caption() const;
|
2016-08-06 03:46:45 +02:00
|
|
|
virtual String get_category() const { return "operators"; }
|
2016-08-03 00:11:05 +02:00
|
|
|
|
|
|
|
void set_operator(Variant::Operator p_op);
|
|
|
|
Variant::Operator get_operator() const;
|
|
|
|
|
2016-08-29 01:57:27 +02:00
|
|
|
void set_typed(Variant::Type p_op);
|
|
|
|
Variant::Type get_typed() const;
|
|
|
|
|
2017-03-05 16:44:50 +01:00
|
|
|
virtual VisualScriptNodeInstance *instance(VisualScriptInstance *p_instance);
|
2016-08-03 00:11:05 +02:00
|
|
|
|
|
|
|
VisualScriptOperator();
|
|
|
|
};
|
|
|
|
|
2017-07-01 02:30:17 +02:00
|
|
|
class VisualScriptSelect : public VisualScriptNode {
|
|
|
|
|
2019-03-19 19:35:57 +01:00
|
|
|
GDCLASS(VisualScriptSelect, VisualScriptNode);
|
2017-07-01 02:30:17 +02:00
|
|
|
|
|
|
|
Variant::Type typed;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
static void _bind_methods();
|
|
|
|
|
|
|
|
public:
|
|
|
|
virtual int get_output_sequence_port_count() const;
|
|
|
|
virtual bool has_input_sequence_port() const;
|
|
|
|
|
|
|
|
virtual String get_output_sequence_port_text(int p_port) const;
|
|
|
|
|
|
|
|
virtual int get_input_value_port_count() const;
|
|
|
|
virtual int get_output_value_port_count() const;
|
|
|
|
|
|
|
|
virtual PropertyInfo get_input_value_port_info(int p_idx) const;
|
|
|
|
virtual PropertyInfo get_output_value_port_info(int p_idx) const;
|
|
|
|
|
|
|
|
virtual String get_caption() const;
|
|
|
|
virtual String get_text() const;
|
|
|
|
virtual String get_category() const { return "operators"; }
|
|
|
|
|
|
|
|
void set_typed(Variant::Type p_op);
|
|
|
|
Variant::Type get_typed() const;
|
|
|
|
|
|
|
|
virtual VisualScriptNodeInstance *instance(VisualScriptInstance *p_instance);
|
|
|
|
|
|
|
|
VisualScriptSelect();
|
|
|
|
};
|
|
|
|
|
2016-08-06 03:46:45 +02:00
|
|
|
class VisualScriptVariableGet : public VisualScriptNode {
|
|
|
|
|
2019-03-19 19:35:57 +01:00
|
|
|
GDCLASS(VisualScriptVariableGet, VisualScriptNode);
|
2016-08-06 03:46:45 +02:00
|
|
|
|
|
|
|
StringName variable;
|
|
|
|
|
2017-03-05 16:44:50 +01:00
|
|
|
protected:
|
|
|
|
virtual void _validate_property(PropertyInfo &property) const;
|
2016-08-06 03:46:45 +02:00
|
|
|
static void _bind_methods();
|
|
|
|
|
2017-03-05 16:44:50 +01:00
|
|
|
public:
|
2016-08-06 03:46:45 +02:00
|
|
|
virtual int get_output_sequence_port_count() const;
|
|
|
|
virtual bool has_input_sequence_port() const;
|
|
|
|
|
|
|
|
virtual String get_output_sequence_port_text(int p_port) const;
|
|
|
|
|
|
|
|
virtual int get_input_value_port_count() const;
|
|
|
|
virtual int get_output_value_port_count() const;
|
|
|
|
|
|
|
|
virtual PropertyInfo get_input_value_port_info(int p_idx) const;
|
|
|
|
virtual PropertyInfo get_output_value_port_info(int p_idx) const;
|
|
|
|
|
|
|
|
virtual String get_caption() const;
|
|
|
|
virtual String get_category() const { return "data"; }
|
|
|
|
|
2017-08-12 18:52:50 +02:00
|
|
|
void set_variable(StringName p_variable);
|
2016-08-06 03:46:45 +02:00
|
|
|
StringName get_variable() const;
|
|
|
|
|
2017-03-05 16:44:50 +01:00
|
|
|
virtual VisualScriptNodeInstance *instance(VisualScriptInstance *p_instance);
|
2016-08-06 03:46:45 +02:00
|
|
|
|
|
|
|
VisualScriptVariableGet();
|
|
|
|
};
|
|
|
|
|
|
|
|
class VisualScriptVariableSet : public VisualScriptNode {
|
2016-08-03 00:11:05 +02:00
|
|
|
|
2019-03-19 19:35:57 +01:00
|
|
|
GDCLASS(VisualScriptVariableSet, VisualScriptNode);
|
2016-08-03 00:11:05 +02:00
|
|
|
|
|
|
|
StringName variable;
|
|
|
|
|
2017-03-05 16:44:50 +01:00
|
|
|
protected:
|
|
|
|
virtual void _validate_property(PropertyInfo &property) const;
|
2016-08-03 00:11:05 +02:00
|
|
|
static void _bind_methods();
|
|
|
|
|
2017-03-05 16:44:50 +01:00
|
|
|
public:
|
2016-08-03 00:11:05 +02:00
|
|
|
virtual int get_output_sequence_port_count() const;
|
|
|
|
virtual bool has_input_sequence_port() const;
|
|
|
|
|
|
|
|
virtual String get_output_sequence_port_text(int p_port) const;
|
|
|
|
|
|
|
|
virtual int get_input_value_port_count() const;
|
|
|
|
virtual int get_output_value_port_count() const;
|
|
|
|
|
|
|
|
virtual PropertyInfo get_input_value_port_info(int p_idx) const;
|
|
|
|
virtual PropertyInfo get_output_value_port_info(int p_idx) const;
|
|
|
|
|
|
|
|
virtual String get_caption() const;
|
2016-08-06 03:46:45 +02:00
|
|
|
virtual String get_category() const { return "data"; }
|
2016-08-03 00:11:05 +02:00
|
|
|
|
2017-08-12 18:52:50 +02:00
|
|
|
void set_variable(StringName p_variable);
|
2016-08-03 00:11:05 +02:00
|
|
|
StringName get_variable() const;
|
|
|
|
|
2017-03-05 16:44:50 +01:00
|
|
|
virtual VisualScriptNodeInstance *instance(VisualScriptInstance *p_instance);
|
2016-08-03 00:11:05 +02:00
|
|
|
|
2016-08-06 03:46:45 +02:00
|
|
|
VisualScriptVariableSet();
|
2016-08-03 00:11:05 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
class VisualScriptConstant : public VisualScriptNode {
|
|
|
|
|
2019-03-19 19:35:57 +01:00
|
|
|
GDCLASS(VisualScriptConstant, VisualScriptNode);
|
2016-08-03 00:11:05 +02:00
|
|
|
|
|
|
|
Variant::Type type;
|
|
|
|
Variant value;
|
2017-03-05 16:44:50 +01:00
|
|
|
|
2016-08-03 00:11:05 +02:00
|
|
|
protected:
|
2017-03-05 16:44:50 +01:00
|
|
|
virtual void _validate_property(PropertyInfo &property) const;
|
2016-08-03 00:11:05 +02:00
|
|
|
static void _bind_methods();
|
|
|
|
|
|
|
|
public:
|
|
|
|
virtual int get_output_sequence_port_count() const;
|
|
|
|
virtual bool has_input_sequence_port() const;
|
|
|
|
|
|
|
|
virtual String get_output_sequence_port_text(int p_port) const;
|
|
|
|
|
|
|
|
virtual int get_input_value_port_count() const;
|
|
|
|
virtual int get_output_value_port_count() const;
|
|
|
|
|
|
|
|
virtual PropertyInfo get_input_value_port_info(int p_idx) const;
|
|
|
|
virtual PropertyInfo get_output_value_port_info(int p_idx) const;
|
|
|
|
|
|
|
|
virtual String get_caption() const;
|
2016-08-31 17:49:45 +02:00
|
|
|
virtual String get_category() const { return "constants"; }
|
2016-08-03 00:11:05 +02:00
|
|
|
|
|
|
|
void set_constant_type(Variant::Type p_type);
|
|
|
|
Variant::Type get_constant_type() const;
|
|
|
|
|
|
|
|
void set_constant_value(Variant p_value);
|
|
|
|
Variant get_constant_value() const;
|
|
|
|
|
2017-03-05 16:44:50 +01:00
|
|
|
virtual VisualScriptNodeInstance *instance(VisualScriptInstance *p_instance);
|
2016-08-03 00:11:05 +02:00
|
|
|
|
|
|
|
VisualScriptConstant();
|
|
|
|
};
|
|
|
|
|
2016-08-29 01:57:27 +02:00
|
|
|
class VisualScriptPreload : public VisualScriptNode {
|
|
|
|
|
2019-03-19 19:35:57 +01:00
|
|
|
GDCLASS(VisualScriptPreload, VisualScriptNode);
|
2016-08-29 01:57:27 +02:00
|
|
|
|
|
|
|
Ref<Resource> preload;
|
|
|
|
|
2017-03-05 16:44:50 +01:00
|
|
|
protected:
|
2016-08-29 01:57:27 +02:00
|
|
|
static void _bind_methods();
|
|
|
|
|
|
|
|
public:
|
|
|
|
virtual int get_output_sequence_port_count() const;
|
|
|
|
virtual bool has_input_sequence_port() const;
|
|
|
|
|
|
|
|
virtual String get_output_sequence_port_text(int p_port) const;
|
|
|
|
|
|
|
|
virtual int get_input_value_port_count() const;
|
|
|
|
virtual int get_output_value_port_count() const;
|
|
|
|
|
|
|
|
virtual PropertyInfo get_input_value_port_info(int p_idx) const;
|
|
|
|
virtual PropertyInfo get_output_value_port_info(int p_idx) const;
|
|
|
|
|
|
|
|
virtual String get_caption() const;
|
|
|
|
virtual String get_category() const { return "data"; }
|
|
|
|
|
2017-08-12 18:52:50 +02:00
|
|
|
void set_preload(const Ref<Resource> &p_preload);
|
2016-08-29 01:57:27 +02:00
|
|
|
Ref<Resource> get_preload() const;
|
|
|
|
|
2017-03-05 16:44:50 +01:00
|
|
|
virtual VisualScriptNodeInstance *instance(VisualScriptInstance *p_instance);
|
2016-08-29 01:57:27 +02:00
|
|
|
|
|
|
|
VisualScriptPreload();
|
|
|
|
};
|
|
|
|
|
2016-08-03 00:11:05 +02:00
|
|
|
class VisualScriptIndexGet : public VisualScriptNode {
|
|
|
|
|
2019-03-19 19:35:57 +01:00
|
|
|
GDCLASS(VisualScriptIndexGet, VisualScriptNode);
|
2016-08-03 00:11:05 +02:00
|
|
|
|
|
|
|
public:
|
|
|
|
virtual int get_output_sequence_port_count() const;
|
|
|
|
virtual bool has_input_sequence_port() const;
|
|
|
|
|
|
|
|
virtual String get_output_sequence_port_text(int p_port) const;
|
|
|
|
|
|
|
|
virtual int get_input_value_port_count() const;
|
|
|
|
virtual int get_output_value_port_count() const;
|
|
|
|
|
|
|
|
virtual PropertyInfo get_input_value_port_info(int p_idx) const;
|
|
|
|
virtual PropertyInfo get_output_value_port_info(int p_idx) const;
|
|
|
|
|
|
|
|
virtual String get_caption() const;
|
2016-08-06 03:46:45 +02:00
|
|
|
virtual String get_category() const { return "operators"; }
|
2016-08-03 00:11:05 +02:00
|
|
|
|
2017-03-05 16:44:50 +01:00
|
|
|
virtual VisualScriptNodeInstance *instance(VisualScriptInstance *p_instance);
|
2016-08-03 00:11:05 +02:00
|
|
|
|
|
|
|
VisualScriptIndexGet();
|
|
|
|
};
|
|
|
|
|
|
|
|
class VisualScriptIndexSet : public VisualScriptNode {
|
|
|
|
|
2019-03-19 19:35:57 +01:00
|
|
|
GDCLASS(VisualScriptIndexSet, VisualScriptNode);
|
2016-08-03 00:11:05 +02:00
|
|
|
|
|
|
|
public:
|
|
|
|
virtual int get_output_sequence_port_count() const;
|
|
|
|
virtual bool has_input_sequence_port() const;
|
|
|
|
|
|
|
|
virtual String get_output_sequence_port_text(int p_port) const;
|
|
|
|
|
|
|
|
virtual int get_input_value_port_count() const;
|
|
|
|
virtual int get_output_value_port_count() const;
|
|
|
|
|
|
|
|
virtual PropertyInfo get_input_value_port_info(int p_idx) const;
|
|
|
|
virtual PropertyInfo get_output_value_port_info(int p_idx) const;
|
|
|
|
|
|
|
|
virtual String get_caption() const;
|
2016-08-06 03:46:45 +02:00
|
|
|
virtual String get_category() const { return "operators"; }
|
2016-08-03 00:11:05 +02:00
|
|
|
|
2017-03-05 16:44:50 +01:00
|
|
|
virtual VisualScriptNodeInstance *instance(VisualScriptInstance *p_instance);
|
2016-08-03 00:11:05 +02:00
|
|
|
|
|
|
|
VisualScriptIndexSet();
|
|
|
|
};
|
|
|
|
|
|
|
|
class VisualScriptGlobalConstant : public VisualScriptNode {
|
|
|
|
|
2019-03-19 19:35:57 +01:00
|
|
|
GDCLASS(VisualScriptGlobalConstant, VisualScriptNode);
|
2016-08-03 00:11:05 +02:00
|
|
|
|
|
|
|
int index;
|
|
|
|
|
|
|
|
static void _bind_methods();
|
|
|
|
|
2017-03-05 16:44:50 +01:00
|
|
|
public:
|
2016-08-03 00:11:05 +02:00
|
|
|
virtual int get_output_sequence_port_count() const;
|
|
|
|
virtual bool has_input_sequence_port() const;
|
|
|
|
|
|
|
|
virtual String get_output_sequence_port_text(int p_port) const;
|
|
|
|
|
|
|
|
virtual int get_input_value_port_count() const;
|
|
|
|
virtual int get_output_value_port_count() const;
|
|
|
|
|
|
|
|
virtual PropertyInfo get_input_value_port_info(int p_idx) const;
|
|
|
|
virtual PropertyInfo get_output_value_port_info(int p_idx) const;
|
|
|
|
|
|
|
|
virtual String get_caption() const;
|
2016-08-31 17:49:45 +02:00
|
|
|
virtual String get_category() const { return "constants"; }
|
2016-08-03 00:11:05 +02:00
|
|
|
|
|
|
|
void set_global_constant(int p_which);
|
|
|
|
int get_global_constant();
|
|
|
|
|
2017-03-05 16:44:50 +01:00
|
|
|
virtual VisualScriptNodeInstance *instance(VisualScriptInstance *p_instance);
|
2016-08-03 00:11:05 +02:00
|
|
|
|
|
|
|
VisualScriptGlobalConstant();
|
|
|
|
};
|
|
|
|
|
2016-08-31 17:49:45 +02:00
|
|
|
class VisualScriptClassConstant : public VisualScriptNode {
|
|
|
|
|
2019-03-19 19:35:57 +01:00
|
|
|
GDCLASS(VisualScriptClassConstant, VisualScriptNode);
|
2016-08-31 17:49:45 +02:00
|
|
|
|
|
|
|
StringName base_type;
|
|
|
|
StringName name;
|
2017-03-05 16:44:50 +01:00
|
|
|
|
2016-08-31 17:49:45 +02:00
|
|
|
protected:
|
|
|
|
static void _bind_methods();
|
2017-03-05 16:44:50 +01:00
|
|
|
virtual void _validate_property(PropertyInfo &property) const;
|
2016-08-31 17:49:45 +02:00
|
|
|
|
|
|
|
public:
|
|
|
|
virtual int get_output_sequence_port_count() const;
|
|
|
|
virtual bool has_input_sequence_port() const;
|
|
|
|
|
|
|
|
virtual String get_output_sequence_port_text(int p_port) const;
|
|
|
|
|
|
|
|
virtual int get_input_value_port_count() const;
|
|
|
|
virtual int get_output_value_port_count() const;
|
|
|
|
|
|
|
|
virtual PropertyInfo get_input_value_port_info(int p_idx) const;
|
|
|
|
virtual PropertyInfo get_output_value_port_info(int p_idx) const;
|
|
|
|
|
|
|
|
virtual String get_caption() const;
|
|
|
|
virtual String get_category() const { return "constants"; }
|
|
|
|
|
2017-03-05 16:44:50 +01:00
|
|
|
void set_class_constant(const StringName &p_which);
|
2016-08-31 17:49:45 +02:00
|
|
|
StringName get_class_constant();
|
|
|
|
|
2017-03-05 16:44:50 +01:00
|
|
|
void set_base_type(const StringName &p_which);
|
2016-08-31 17:49:45 +02:00
|
|
|
StringName get_base_type();
|
|
|
|
|
2017-03-05 16:44:50 +01:00
|
|
|
virtual VisualScriptNodeInstance *instance(VisualScriptInstance *p_instance);
|
2016-08-31 17:49:45 +02:00
|
|
|
|
|
|
|
VisualScriptClassConstant();
|
|
|
|
};
|
|
|
|
|
2016-09-02 07:13:12 +02:00
|
|
|
class VisualScriptBasicTypeConstant : public VisualScriptNode {
|
|
|
|
|
2019-03-19 19:35:57 +01:00
|
|
|
GDCLASS(VisualScriptBasicTypeConstant, VisualScriptNode);
|
2016-09-02 07:13:12 +02:00
|
|
|
|
|
|
|
Variant::Type type;
|
|
|
|
StringName name;
|
2017-03-05 16:44:50 +01:00
|
|
|
|
2016-09-02 07:13:12 +02:00
|
|
|
protected:
|
|
|
|
static void _bind_methods();
|
2017-03-05 16:44:50 +01:00
|
|
|
virtual void _validate_property(PropertyInfo &property) const;
|
2016-09-02 07:13:12 +02:00
|
|
|
|
|
|
|
public:
|
|
|
|
virtual int get_output_sequence_port_count() const;
|
|
|
|
virtual bool has_input_sequence_port() const;
|
|
|
|
|
|
|
|
virtual String get_output_sequence_port_text(int p_port) const;
|
|
|
|
|
|
|
|
virtual int get_input_value_port_count() const;
|
|
|
|
virtual int get_output_value_port_count() const;
|
|
|
|
|
|
|
|
virtual PropertyInfo get_input_value_port_info(int p_idx) const;
|
|
|
|
virtual PropertyInfo get_output_value_port_info(int p_idx) const;
|
|
|
|
|
|
|
|
virtual String get_caption() const;
|
|
|
|
virtual String get_text() const;
|
|
|
|
virtual String get_category() const { return "constants"; }
|
|
|
|
|
2017-03-05 16:44:50 +01:00
|
|
|
void set_basic_type_constant(const StringName &p_which);
|
2016-09-02 07:13:12 +02:00
|
|
|
StringName get_basic_type_constant() const;
|
|
|
|
|
|
|
|
void set_basic_type(Variant::Type p_which);
|
|
|
|
Variant::Type get_basic_type() const;
|
|
|
|
|
2017-03-05 16:44:50 +01:00
|
|
|
virtual VisualScriptNodeInstance *instance(VisualScriptInstance *p_instance);
|
2016-09-02 07:13:12 +02:00
|
|
|
|
|
|
|
VisualScriptBasicTypeConstant();
|
|
|
|
};
|
|
|
|
|
2016-08-03 00:11:05 +02:00
|
|
|
class VisualScriptMathConstant : public VisualScriptNode {
|
|
|
|
|
2019-03-19 19:35:57 +01:00
|
|
|
GDCLASS(VisualScriptMathConstant, VisualScriptNode);
|
|
|
|
|
2016-08-03 00:11:05 +02:00
|
|
|
public:
|
|
|
|
enum MathConstant {
|
|
|
|
MATH_CONSTANT_ONE,
|
|
|
|
MATH_CONSTANT_PI,
|
|
|
|
MATH_CONSTANT_HALF_PI,
|
2017-11-04 10:34:27 +01:00
|
|
|
MATH_CONSTANT_TAU,
|
2016-08-03 00:11:05 +02:00
|
|
|
MATH_CONSTANT_E,
|
|
|
|
MATH_CONSTANT_SQRT2,
|
2017-02-06 23:44:22 +01:00
|
|
|
MATH_CONSTANT_INF,
|
|
|
|
MATH_CONSTANT_NAN,
|
|
|
|
MATH_CONSTANT_MAX
|
2016-08-03 00:11:05 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
private:
|
2017-03-05 16:44:50 +01:00
|
|
|
static const char *const_name[MATH_CONSTANT_MAX];
|
2016-08-06 03:46:45 +02:00
|
|
|
static double const_value[MATH_CONSTANT_MAX];
|
2016-08-03 00:11:05 +02:00
|
|
|
MathConstant constant;
|
2017-03-05 16:44:50 +01:00
|
|
|
|
2016-08-03 00:11:05 +02:00
|
|
|
protected:
|
|
|
|
static void _bind_methods();
|
|
|
|
|
2017-03-05 16:44:50 +01:00
|
|
|
public:
|
2016-08-03 00:11:05 +02:00
|
|
|
virtual int get_output_sequence_port_count() const;
|
|
|
|
virtual bool has_input_sequence_port() const;
|
|
|
|
|
|
|
|
virtual String get_output_sequence_port_text(int p_port) const;
|
|
|
|
|
|
|
|
virtual int get_input_value_port_count() const;
|
|
|
|
virtual int get_output_value_port_count() const;
|
|
|
|
|
|
|
|
virtual PropertyInfo get_input_value_port_info(int p_idx) const;
|
|
|
|
virtual PropertyInfo get_output_value_port_info(int p_idx) const;
|
|
|
|
|
|
|
|
virtual String get_caption() const;
|
2016-08-31 17:49:45 +02:00
|
|
|
virtual String get_category() const { return "constants"; }
|
2016-08-03 00:11:05 +02:00
|
|
|
|
|
|
|
void set_math_constant(MathConstant p_which);
|
|
|
|
MathConstant get_math_constant();
|
|
|
|
|
2017-03-05 16:44:50 +01:00
|
|
|
virtual VisualScriptNodeInstance *instance(VisualScriptInstance *p_instance);
|
2016-08-03 00:11:05 +02:00
|
|
|
|
|
|
|
VisualScriptMathConstant();
|
|
|
|
};
|
|
|
|
|
2017-03-05 16:44:50 +01:00
|
|
|
VARIANT_ENUM_CAST(VisualScriptMathConstant::MathConstant)
|
2016-08-03 00:11:05 +02:00
|
|
|
|
2016-08-03 16:28:20 +02:00
|
|
|
class VisualScriptEngineSingleton : public VisualScriptNode {
|
2016-08-03 00:11:05 +02:00
|
|
|
|
2019-03-19 19:35:57 +01:00
|
|
|
GDCLASS(VisualScriptEngineSingleton, VisualScriptNode);
|
2016-08-03 00:11:05 +02:00
|
|
|
|
|
|
|
String singleton;
|
|
|
|
|
2020-01-19 20:02:40 +01:00
|
|
|
protected:
|
|
|
|
void _validate_property(PropertyInfo &property) const;
|
|
|
|
|
2016-08-03 00:11:05 +02:00
|
|
|
static void _bind_methods();
|
|
|
|
|
2017-03-05 16:44:50 +01:00
|
|
|
public:
|
2016-08-03 00:11:05 +02:00
|
|
|
virtual int get_output_sequence_port_count() const;
|
|
|
|
virtual bool has_input_sequence_port() const;
|
|
|
|
|
|
|
|
virtual String get_output_sequence_port_text(int p_port) const;
|
|
|
|
|
|
|
|
virtual int get_input_value_port_count() const;
|
|
|
|
virtual int get_output_value_port_count() const;
|
|
|
|
|
|
|
|
virtual PropertyInfo get_input_value_port_info(int p_idx) const;
|
|
|
|
virtual PropertyInfo get_output_value_port_info(int p_idx) const;
|
|
|
|
|
|
|
|
virtual String get_caption() const;
|
2016-08-06 03:46:45 +02:00
|
|
|
virtual String get_category() const { return "data"; }
|
2016-08-03 00:11:05 +02:00
|
|
|
|
|
|
|
void set_singleton(const String &p_string);
|
|
|
|
String get_singleton();
|
|
|
|
|
2017-03-05 16:44:50 +01:00
|
|
|
virtual VisualScriptNodeInstance *instance(VisualScriptInstance *p_instance);
|
2016-09-03 19:58:23 +02:00
|
|
|
|
2017-03-05 16:44:50 +01:00
|
|
|
virtual TypeGuess guess_output_type(TypeGuess *p_inputs, int p_output) const;
|
2016-09-03 19:58:23 +02:00
|
|
|
|
2016-08-03 16:28:20 +02:00
|
|
|
VisualScriptEngineSingleton();
|
2016-08-03 00:11:05 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
class VisualScriptSceneNode : public VisualScriptNode {
|
|
|
|
|
2019-03-19 19:35:57 +01:00
|
|
|
GDCLASS(VisualScriptSceneNode, VisualScriptNode);
|
2016-08-03 00:11:05 +02:00
|
|
|
|
|
|
|
NodePath path;
|
2017-03-05 16:44:50 +01:00
|
|
|
|
2016-08-03 00:11:05 +02:00
|
|
|
protected:
|
2017-03-05 16:44:50 +01:00
|
|
|
virtual void _validate_property(PropertyInfo &property) const;
|
2016-08-03 00:11:05 +02:00
|
|
|
static void _bind_methods();
|
|
|
|
|
2017-03-05 16:44:50 +01:00
|
|
|
public:
|
2016-08-03 00:11:05 +02:00
|
|
|
virtual int get_output_sequence_port_count() const;
|
|
|
|
virtual bool has_input_sequence_port() const;
|
|
|
|
|
|
|
|
virtual String get_output_sequence_port_text(int p_port) const;
|
|
|
|
|
|
|
|
virtual int get_input_value_port_count() const;
|
|
|
|
virtual int get_output_value_port_count() const;
|
|
|
|
|
|
|
|
virtual PropertyInfo get_input_value_port_info(int p_idx) const;
|
|
|
|
virtual PropertyInfo get_output_value_port_info(int p_idx) const;
|
|
|
|
|
|
|
|
virtual String get_caption() const;
|
2016-08-06 03:46:45 +02:00
|
|
|
virtual String get_category() const { return "data"; }
|
2016-08-03 00:11:05 +02:00
|
|
|
|
|
|
|
void set_node_path(const NodePath &p_path);
|
|
|
|
NodePath get_node_path();
|
|
|
|
|
2017-03-05 16:44:50 +01:00
|
|
|
virtual VisualScriptNodeInstance *instance(VisualScriptInstance *p_instance);
|
2016-08-03 00:11:05 +02:00
|
|
|
|
2017-03-05 16:44:50 +01:00
|
|
|
virtual TypeGuess guess_output_type(TypeGuess *p_inputs, int p_output) const;
|
2016-09-03 19:58:23 +02:00
|
|
|
|
2016-08-03 00:11:05 +02:00
|
|
|
VisualScriptSceneNode();
|
|
|
|
};
|
|
|
|
|
2016-08-03 16:28:20 +02:00
|
|
|
class VisualScriptSceneTree : public VisualScriptNode {
|
|
|
|
|
2019-03-19 19:35:57 +01:00
|
|
|
GDCLASS(VisualScriptSceneTree, VisualScriptNode);
|
2016-08-03 16:28:20 +02:00
|
|
|
|
|
|
|
protected:
|
2017-03-05 16:44:50 +01:00
|
|
|
virtual void _validate_property(PropertyInfo &property) const;
|
2016-08-03 16:28:20 +02:00
|
|
|
static void _bind_methods();
|
|
|
|
|
2017-03-05 16:44:50 +01:00
|
|
|
public:
|
2016-08-03 16:28:20 +02:00
|
|
|
virtual int get_output_sequence_port_count() const;
|
|
|
|
virtual bool has_input_sequence_port() const;
|
|
|
|
|
|
|
|
virtual String get_output_sequence_port_text(int p_port) const;
|
|
|
|
|
|
|
|
virtual int get_input_value_port_count() const;
|
|
|
|
virtual int get_output_value_port_count() const;
|
|
|
|
|
|
|
|
virtual PropertyInfo get_input_value_port_info(int p_idx) const;
|
|
|
|
virtual PropertyInfo get_output_value_port_info(int p_idx) const;
|
|
|
|
|
|
|
|
virtual String get_caption() const;
|
2016-08-06 03:46:45 +02:00
|
|
|
virtual String get_category() const { return "data"; }
|
2016-08-03 16:28:20 +02:00
|
|
|
|
2017-03-05 16:44:50 +01:00
|
|
|
virtual VisualScriptNodeInstance *instance(VisualScriptInstance *p_instance);
|
2016-08-03 16:28:20 +02:00
|
|
|
|
2017-03-05 16:44:50 +01:00
|
|
|
virtual TypeGuess guess_output_type(TypeGuess *p_inputs, int p_output) const;
|
2016-09-03 19:58:23 +02:00
|
|
|
|
2016-08-03 16:28:20 +02:00
|
|
|
VisualScriptSceneTree();
|
|
|
|
};
|
|
|
|
|
|
|
|
class VisualScriptResourcePath : public VisualScriptNode {
|
|
|
|
|
2019-03-19 19:35:57 +01:00
|
|
|
GDCLASS(VisualScriptResourcePath, VisualScriptNode);
|
2016-08-03 16:28:20 +02:00
|
|
|
|
|
|
|
String path;
|
|
|
|
|
2017-03-05 16:44:50 +01:00
|
|
|
protected:
|
2016-08-03 16:28:20 +02:00
|
|
|
static void _bind_methods();
|
|
|
|
|
2017-03-05 16:44:50 +01:00
|
|
|
public:
|
2016-08-03 16:28:20 +02:00
|
|
|
virtual int get_output_sequence_port_count() const;
|
|
|
|
virtual bool has_input_sequence_port() const;
|
|
|
|
|
|
|
|
virtual String get_output_sequence_port_text(int p_port) const;
|
|
|
|
|
|
|
|
virtual int get_input_value_port_count() const;
|
|
|
|
virtual int get_output_value_port_count() const;
|
|
|
|
|
|
|
|
virtual PropertyInfo get_input_value_port_info(int p_idx) const;
|
|
|
|
virtual PropertyInfo get_output_value_port_info(int p_idx) const;
|
|
|
|
|
|
|
|
virtual String get_caption() const;
|
2016-08-06 03:46:45 +02:00
|
|
|
virtual String get_category() const { return "data"; }
|
2016-08-03 16:28:20 +02:00
|
|
|
|
|
|
|
void set_resource_path(const String &p_path);
|
|
|
|
String get_resource_path();
|
|
|
|
|
2017-03-05 16:44:50 +01:00
|
|
|
virtual VisualScriptNodeInstance *instance(VisualScriptInstance *p_instance);
|
2016-08-03 16:28:20 +02:00
|
|
|
|
|
|
|
VisualScriptResourcePath();
|
|
|
|
};
|
|
|
|
|
2016-08-06 03:46:45 +02:00
|
|
|
class VisualScriptSelf : public VisualScriptNode {
|
|
|
|
|
2019-03-19 19:35:57 +01:00
|
|
|
GDCLASS(VisualScriptSelf, VisualScriptNode);
|
2016-08-06 03:46:45 +02:00
|
|
|
|
|
|
|
protected:
|
|
|
|
static void _bind_methods();
|
|
|
|
|
2017-03-05 16:44:50 +01:00
|
|
|
public:
|
2016-08-06 03:46:45 +02:00
|
|
|
virtual int get_output_sequence_port_count() const;
|
|
|
|
virtual bool has_input_sequence_port() const;
|
|
|
|
|
|
|
|
virtual String get_output_sequence_port_text(int p_port) const;
|
|
|
|
|
|
|
|
virtual int get_input_value_port_count() const;
|
|
|
|
virtual int get_output_value_port_count() const;
|
|
|
|
|
|
|
|
virtual PropertyInfo get_input_value_port_info(int p_idx) const;
|
|
|
|
virtual PropertyInfo get_output_value_port_info(int p_idx) const;
|
|
|
|
|
|
|
|
virtual String get_caption() const;
|
|
|
|
virtual String get_category() const { return "data"; }
|
|
|
|
|
2017-03-05 16:44:50 +01:00
|
|
|
virtual VisualScriptNodeInstance *instance(VisualScriptInstance *p_instance);
|
2016-08-06 03:46:45 +02:00
|
|
|
|
2017-03-05 16:44:50 +01:00
|
|
|
virtual TypeGuess guess_output_type(TypeGuess *p_inputs, int p_output) const;
|
2016-09-03 19:58:23 +02:00
|
|
|
|
2016-08-06 03:46:45 +02:00
|
|
|
VisualScriptSelf();
|
|
|
|
};
|
|
|
|
|
2017-03-05 16:44:50 +01:00
|
|
|
class VisualScriptCustomNode : public VisualScriptNode {
|
2016-08-06 03:46:45 +02:00
|
|
|
|
2019-03-19 19:35:57 +01:00
|
|
|
GDCLASS(VisualScriptCustomNode, VisualScriptNode);
|
2016-08-08 02:22:14 +02:00
|
|
|
|
|
|
|
protected:
|
|
|
|
static void _bind_methods();
|
|
|
|
|
2017-03-05 16:44:50 +01:00
|
|
|
public:
|
2016-08-08 02:22:14 +02:00
|
|
|
enum StartMode { //replicated for step
|
|
|
|
START_MODE_BEGIN_SEQUENCE,
|
|
|
|
START_MODE_CONTINUE_SEQUENCE,
|
|
|
|
START_MODE_RESUME_YIELD
|
|
|
|
};
|
|
|
|
|
|
|
|
enum { //replicated for step
|
2017-03-05 16:44:50 +01:00
|
|
|
STEP_SHIFT = 1 << 24,
|
|
|
|
STEP_MASK = STEP_SHIFT - 1,
|
|
|
|
STEP_PUSH_STACK_BIT = STEP_SHIFT, //push bit to stack
|
|
|
|
STEP_GO_BACK_BIT = STEP_SHIFT << 1, //go back to previous node
|
|
|
|
STEP_NO_ADVANCE_BIT = STEP_SHIFT << 2, //do not advance past this node
|
|
|
|
STEP_EXIT_FUNCTION_BIT = STEP_SHIFT << 3, //return from function
|
|
|
|
STEP_YIELD_BIT = STEP_SHIFT << 4, //yield (will find VisualScriptFunctionState state in first working memory)
|
2016-08-08 02:22:14 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
virtual int get_output_sequence_port_count() const;
|
|
|
|
virtual bool has_input_sequence_port() const;
|
|
|
|
|
|
|
|
virtual String get_output_sequence_port_text(int p_port) const;
|
|
|
|
|
|
|
|
virtual int get_input_value_port_count() const;
|
|
|
|
virtual int get_output_value_port_count() const;
|
|
|
|
|
|
|
|
virtual PropertyInfo get_input_value_port_info(int p_idx) const;
|
|
|
|
virtual PropertyInfo get_output_value_port_info(int p_idx) const;
|
|
|
|
|
|
|
|
virtual String get_caption() const;
|
|
|
|
virtual String get_text() const;
|
|
|
|
virtual String get_category() const;
|
|
|
|
|
2017-03-05 16:44:50 +01:00
|
|
|
virtual VisualScriptNodeInstance *instance(VisualScriptInstance *p_instance);
|
2016-08-08 02:22:14 +02:00
|
|
|
|
2017-07-22 04:45:57 +02:00
|
|
|
void _script_changed();
|
|
|
|
|
2016-08-08 02:22:14 +02:00
|
|
|
VisualScriptCustomNode();
|
|
|
|
};
|
|
|
|
|
2017-08-20 17:45:01 +02:00
|
|
|
VARIANT_ENUM_CAST(VisualScriptCustomNode::StartMode);
|
|
|
|
|
2017-03-05 16:44:50 +01:00
|
|
|
class VisualScriptSubCall : public VisualScriptNode {
|
2016-08-08 06:21:22 +02:00
|
|
|
|
2019-03-19 19:35:57 +01:00
|
|
|
GDCLASS(VisualScriptSubCall, VisualScriptNode);
|
2016-08-08 06:21:22 +02:00
|
|
|
|
|
|
|
protected:
|
|
|
|
static void _bind_methods();
|
2017-03-05 16:44:50 +01:00
|
|
|
|
2016-08-08 06:21:22 +02:00
|
|
|
public:
|
|
|
|
virtual int get_output_sequence_port_count() const;
|
|
|
|
virtual bool has_input_sequence_port() const;
|
|
|
|
|
|
|
|
virtual String get_output_sequence_port_text(int p_port) const;
|
|
|
|
|
|
|
|
virtual int get_input_value_port_count() const;
|
|
|
|
virtual int get_output_value_port_count() const;
|
|
|
|
|
|
|
|
virtual PropertyInfo get_input_value_port_info(int p_idx) const;
|
|
|
|
virtual PropertyInfo get_output_value_port_info(int p_idx) const;
|
|
|
|
|
|
|
|
virtual String get_caption() const;
|
|
|
|
virtual String get_text() const;
|
|
|
|
virtual String get_category() const;
|
|
|
|
|
2017-03-05 16:44:50 +01:00
|
|
|
virtual VisualScriptNodeInstance *instance(VisualScriptInstance *p_instance);
|
2016-08-08 06:21:22 +02:00
|
|
|
|
|
|
|
VisualScriptSubCall();
|
|
|
|
};
|
|
|
|
|
2017-03-05 16:44:50 +01:00
|
|
|
class VisualScriptComment : public VisualScriptNode {
|
2016-08-25 22:45:20 +02:00
|
|
|
|
2019-03-19 19:35:57 +01:00
|
|
|
GDCLASS(VisualScriptComment, VisualScriptNode);
|
2016-08-25 22:45:20 +02:00
|
|
|
|
|
|
|
String title;
|
|
|
|
String description;
|
|
|
|
Size2 size;
|
|
|
|
|
2017-03-05 16:44:50 +01:00
|
|
|
protected:
|
2016-08-25 22:45:20 +02:00
|
|
|
static void _bind_methods();
|
2017-03-05 16:44:50 +01:00
|
|
|
|
2016-08-25 22:45:20 +02:00
|
|
|
public:
|
|
|
|
virtual int get_output_sequence_port_count() const;
|
|
|
|
virtual bool has_input_sequence_port() const;
|
|
|
|
|
|
|
|
virtual String get_output_sequence_port_text(int p_port) const;
|
|
|
|
|
|
|
|
virtual int get_input_value_port_count() const;
|
|
|
|
virtual int get_output_value_port_count() const;
|
|
|
|
|
|
|
|
virtual PropertyInfo get_input_value_port_info(int p_idx) const;
|
|
|
|
virtual PropertyInfo get_output_value_port_info(int p_idx) const;
|
|
|
|
|
|
|
|
virtual String get_caption() const;
|
|
|
|
virtual String get_text() const;
|
|
|
|
virtual String get_category() const;
|
|
|
|
|
2017-03-05 16:44:50 +01:00
|
|
|
void set_title(const String &p_title);
|
2016-08-25 22:45:20 +02:00
|
|
|
String get_title() const;
|
|
|
|
|
2017-03-05 16:44:50 +01:00
|
|
|
void set_description(const String &p_description);
|
2016-08-25 22:45:20 +02:00
|
|
|
String get_description() const;
|
|
|
|
|
2017-03-05 16:44:50 +01:00
|
|
|
void set_size(const Size2 &p_size);
|
2016-08-25 22:45:20 +02:00
|
|
|
Size2 get_size() const;
|
|
|
|
|
2017-03-05 16:44:50 +01:00
|
|
|
virtual VisualScriptNodeInstance *instance(VisualScriptInstance *p_instance);
|
2016-08-25 22:45:20 +02:00
|
|
|
|
|
|
|
VisualScriptComment();
|
|
|
|
};
|
2016-08-08 00:22:33 +02:00
|
|
|
|
2017-03-05 16:44:50 +01:00
|
|
|
class VisualScriptConstructor : public VisualScriptNode {
|
2016-08-26 22:34:25 +02:00
|
|
|
|
2019-03-19 19:35:57 +01:00
|
|
|
GDCLASS(VisualScriptConstructor, VisualScriptNode);
|
2016-08-26 22:34:25 +02:00
|
|
|
|
|
|
|
Variant::Type type;
|
|
|
|
MethodInfo constructor;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
static void _bind_methods();
|
2017-03-05 16:44:50 +01:00
|
|
|
|
2016-08-26 22:34:25 +02:00
|
|
|
public:
|
|
|
|
virtual int get_output_sequence_port_count() const;
|
|
|
|
virtual bool has_input_sequence_port() const;
|
|
|
|
|
|
|
|
virtual String get_output_sequence_port_text(int p_port) const;
|
|
|
|
|
|
|
|
virtual int get_input_value_port_count() const;
|
|
|
|
virtual int get_output_value_port_count() const;
|
|
|
|
|
|
|
|
virtual PropertyInfo get_input_value_port_info(int p_idx) const;
|
|
|
|
virtual PropertyInfo get_output_value_port_info(int p_idx) const;
|
|
|
|
|
|
|
|
virtual String get_caption() const;
|
|
|
|
virtual String get_category() const;
|
|
|
|
|
|
|
|
void set_constructor_type(Variant::Type p_type);
|
|
|
|
Variant::Type get_constructor_type() const;
|
|
|
|
|
2017-03-05 16:44:50 +01:00
|
|
|
void set_constructor(const Dictionary &p_info);
|
2016-08-26 22:34:25 +02:00
|
|
|
Dictionary get_constructor() const;
|
|
|
|
|
2017-03-05 16:44:50 +01:00
|
|
|
virtual VisualScriptNodeInstance *instance(VisualScriptInstance *p_instance);
|
2016-08-26 22:34:25 +02:00
|
|
|
|
|
|
|
VisualScriptConstructor();
|
|
|
|
};
|
|
|
|
|
2017-03-05 16:44:50 +01:00
|
|
|
class VisualScriptLocalVar : public VisualScriptNode {
|
2016-08-29 01:57:27 +02:00
|
|
|
|
2019-03-19 19:35:57 +01:00
|
|
|
GDCLASS(VisualScriptLocalVar, VisualScriptNode);
|
2016-08-29 01:57:27 +02:00
|
|
|
|
|
|
|
StringName name;
|
|
|
|
Variant::Type type;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
static void _bind_methods();
|
2017-03-05 16:44:50 +01:00
|
|
|
|
2016-08-29 01:57:27 +02:00
|
|
|
public:
|
|
|
|
virtual int get_output_sequence_port_count() const;
|
|
|
|
virtual bool has_input_sequence_port() const;
|
|
|
|
|
|
|
|
virtual String get_output_sequence_port_text(int p_port) const;
|
|
|
|
|
|
|
|
virtual int get_input_value_port_count() const;
|
|
|
|
virtual int get_output_value_port_count() const;
|
|
|
|
|
|
|
|
virtual PropertyInfo get_input_value_port_info(int p_idx) const;
|
|
|
|
virtual PropertyInfo get_output_value_port_info(int p_idx) const;
|
|
|
|
|
|
|
|
virtual String get_caption() const;
|
|
|
|
virtual String get_category() const;
|
|
|
|
|
2017-03-05 16:44:50 +01:00
|
|
|
void set_var_name(const StringName &p_name);
|
2016-08-29 01:57:27 +02:00
|
|
|
StringName get_var_name() const;
|
|
|
|
|
|
|
|
void set_var_type(Variant::Type p_type);
|
|
|
|
Variant::Type get_var_type() const;
|
|
|
|
|
2017-03-05 16:44:50 +01:00
|
|
|
virtual VisualScriptNodeInstance *instance(VisualScriptInstance *p_instance);
|
2016-08-29 01:57:27 +02:00
|
|
|
|
|
|
|
VisualScriptLocalVar();
|
|
|
|
};
|
|
|
|
|
2017-03-05 16:44:50 +01:00
|
|
|
class VisualScriptLocalVarSet : public VisualScriptNode {
|
2016-08-31 04:44:14 +02:00
|
|
|
|
2019-03-19 19:35:57 +01:00
|
|
|
GDCLASS(VisualScriptLocalVarSet, VisualScriptNode);
|
2016-08-31 04:44:14 +02:00
|
|
|
|
|
|
|
StringName name;
|
|
|
|
Variant::Type type;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
static void _bind_methods();
|
2017-03-05 16:44:50 +01:00
|
|
|
|
2016-08-31 04:44:14 +02:00
|
|
|
public:
|
|
|
|
virtual int get_output_sequence_port_count() const;
|
|
|
|
virtual bool has_input_sequence_port() const;
|
|
|
|
|
|
|
|
virtual String get_output_sequence_port_text(int p_port) const;
|
|
|
|
|
|
|
|
virtual int get_input_value_port_count() const;
|
|
|
|
virtual int get_output_value_port_count() const;
|
|
|
|
|
|
|
|
virtual PropertyInfo get_input_value_port_info(int p_idx) const;
|
|
|
|
virtual PropertyInfo get_output_value_port_info(int p_idx) const;
|
|
|
|
|
|
|
|
virtual String get_caption() const;
|
|
|
|
virtual String get_text() const;
|
|
|
|
virtual String get_category() const;
|
|
|
|
|
2017-03-05 16:44:50 +01:00
|
|
|
void set_var_name(const StringName &p_name);
|
2016-08-31 04:44:14 +02:00
|
|
|
StringName get_var_name() const;
|
|
|
|
|
|
|
|
void set_var_type(Variant::Type p_type);
|
|
|
|
Variant::Type get_var_type() const;
|
|
|
|
|
2017-03-05 16:44:50 +01:00
|
|
|
virtual VisualScriptNodeInstance *instance(VisualScriptInstance *p_instance);
|
2016-08-31 04:44:14 +02:00
|
|
|
|
|
|
|
VisualScriptLocalVarSet();
|
|
|
|
};
|
2016-08-29 01:57:27 +02:00
|
|
|
|
2017-03-05 16:44:50 +01:00
|
|
|
class VisualScriptInputAction : public VisualScriptNode {
|
2016-08-29 01:57:27 +02:00
|
|
|
|
2019-03-19 19:35:57 +01:00
|
|
|
GDCLASS(VisualScriptInputAction, VisualScriptNode);
|
|
|
|
|
2016-09-01 23:58:52 +02:00
|
|
|
public:
|
|
|
|
enum Mode {
|
|
|
|
MODE_PRESSED,
|
|
|
|
MODE_RELEASED,
|
|
|
|
MODE_JUST_PRESSED,
|
|
|
|
MODE_JUST_RELEASED,
|
|
|
|
};
|
2016-08-29 01:57:27 +02:00
|
|
|
|
|
|
|
StringName name;
|
2016-09-01 23:58:52 +02:00
|
|
|
Mode mode;
|
2016-08-29 01:57:27 +02:00
|
|
|
|
|
|
|
protected:
|
2017-03-05 16:44:50 +01:00
|
|
|
virtual void _validate_property(PropertyInfo &property) const;
|
2016-08-29 01:57:27 +02:00
|
|
|
|
|
|
|
static void _bind_methods();
|
2017-03-05 16:44:50 +01:00
|
|
|
|
2016-08-29 01:57:27 +02:00
|
|
|
public:
|
|
|
|
virtual int get_output_sequence_port_count() const;
|
|
|
|
virtual bool has_input_sequence_port() const;
|
|
|
|
|
|
|
|
virtual String get_output_sequence_port_text(int p_port) const;
|
|
|
|
|
|
|
|
virtual int get_input_value_port_count() const;
|
|
|
|
virtual int get_output_value_port_count() const;
|
|
|
|
|
|
|
|
virtual PropertyInfo get_input_value_port_info(int p_idx) const;
|
|
|
|
virtual PropertyInfo get_output_value_port_info(int p_idx) const;
|
|
|
|
|
|
|
|
virtual String get_caption() const;
|
|
|
|
virtual String get_category() const;
|
|
|
|
|
2017-03-05 16:44:50 +01:00
|
|
|
void set_action_name(const StringName &p_name);
|
2016-08-29 01:57:27 +02:00
|
|
|
StringName get_action_name() const;
|
|
|
|
|
2016-09-01 23:58:52 +02:00
|
|
|
void set_action_mode(Mode p_mode);
|
|
|
|
Mode get_action_mode() const;
|
|
|
|
|
2017-03-05 16:44:50 +01:00
|
|
|
virtual VisualScriptNodeInstance *instance(VisualScriptInstance *p_instance);
|
2016-08-29 01:57:27 +02:00
|
|
|
|
|
|
|
VisualScriptInputAction();
|
|
|
|
};
|
|
|
|
|
2017-03-05 16:44:50 +01:00
|
|
|
VARIANT_ENUM_CAST(VisualScriptInputAction::Mode)
|
2016-08-29 01:57:27 +02:00
|
|
|
|
2017-03-05 16:44:50 +01:00
|
|
|
class VisualScriptDeconstruct : public VisualScriptNode {
|
2016-08-29 01:57:27 +02:00
|
|
|
|
2019-03-19 19:35:57 +01:00
|
|
|
GDCLASS(VisualScriptDeconstruct, VisualScriptNode);
|
2016-08-29 01:57:27 +02:00
|
|
|
|
|
|
|
struct Element {
|
|
|
|
StringName name;
|
|
|
|
Variant::Type type;
|
|
|
|
};
|
|
|
|
|
|
|
|
Vector<Element> elements;
|
|
|
|
|
|
|
|
void _update_elements();
|
|
|
|
Variant::Type type;
|
|
|
|
|
2017-03-05 16:44:50 +01:00
|
|
|
void _set_elem_cache(const Array &p_elements);
|
2016-08-29 01:57:27 +02:00
|
|
|
Array _get_elem_cache() const;
|
|
|
|
|
2017-03-05 16:44:50 +01:00
|
|
|
virtual void _validate_property(PropertyInfo &property) const;
|
2016-08-29 01:57:27 +02:00
|
|
|
|
|
|
|
protected:
|
|
|
|
static void _bind_methods();
|
2017-03-05 16:44:50 +01:00
|
|
|
|
2016-08-29 01:57:27 +02:00
|
|
|
public:
|
|
|
|
virtual int get_output_sequence_port_count() const;
|
|
|
|
virtual bool has_input_sequence_port() const;
|
|
|
|
|
|
|
|
virtual String get_output_sequence_port_text(int p_port) const;
|
|
|
|
|
|
|
|
virtual int get_input_value_port_count() const;
|
|
|
|
virtual int get_output_value_port_count() const;
|
|
|
|
|
|
|
|
virtual PropertyInfo get_input_value_port_info(int p_idx) const;
|
|
|
|
virtual PropertyInfo get_output_value_port_info(int p_idx) const;
|
|
|
|
|
|
|
|
virtual String get_caption() const;
|
|
|
|
virtual String get_category() const;
|
|
|
|
|
|
|
|
void set_deconstruct_type(Variant::Type p_type);
|
|
|
|
Variant::Type get_deconstruct_type() const;
|
|
|
|
|
2017-03-05 16:44:50 +01:00
|
|
|
virtual VisualScriptNodeInstance *instance(VisualScriptInstance *p_instance);
|
2016-08-29 01:57:27 +02:00
|
|
|
|
|
|
|
VisualScriptDeconstruct();
|
|
|
|
};
|
|
|
|
|
2016-08-03 00:11:05 +02:00
|
|
|
void register_visual_script_nodes();
|
2016-08-26 22:34:25 +02:00
|
|
|
void unregister_visual_script_nodes();
|
2016-08-03 00:11:05 +02:00
|
|
|
|
|
|
|
#endif // VISUAL_SCRIPT_NODES_H
|