aboutsummaryrefslogtreecommitdiff
path: root/modules/visual_script/visual_script_editor.h
diff options
context:
space:
mode:
Diffstat (limited to 'modules/visual_script/visual_script_editor.h')
-rw-r--r--modules/visual_script/visual_script_editor.h56
1 files changed, 55 insertions, 1 deletions
diff --git a/modules/visual_script/visual_script_editor.h b/modules/visual_script/visual_script_editor.h
index 1ce7e5a6c..483ae1644 100644
--- a/modules/visual_script/visual_script_editor.h
+++ b/modules/visual_script/visual_script_editor.h
@@ -6,13 +6,14 @@
#include "tools/editor/property_editor.h"
#include "scene/gui/graph_edit.h"
#include "tools/editor/create_dialog.h"
-
+#include "tools/editor/property_selector.h"
class VisualScriptEditorSignalEdit;
class VisualScriptEditorVariableEdit;
#ifdef TOOLS_ENABLED
+
class VisualScriptEditor : public ScriptEditorBase {
OBJ_TYPE(VisualScriptEditor,ScriptEditorBase)
@@ -27,6 +28,22 @@ class VisualScriptEditor : public ScriptEditorBase {
EDIT_DELETE_NODES,
EDIT_TOGGLE_BREAKPOINT,
EDIT_FIND_NODE_TYPE,
+ EDIT_COPY_NODES,
+ EDIT_CUT_NODES,
+ EDIT_PASTE_NODES,
+ };
+
+ enum PortAction {
+
+ CREATE_CALL,
+ CREATE_SET,
+ CREATE_GET,
+ CREATE_COND,
+ CREATE_SEQUENCE,
+ CREATE_SWITCH,
+ CREATE_ITERATOR,
+ CREATE_WHILE,
+ CREATE_RETURN,
};
MenuButton *edit_menu;
@@ -48,6 +65,8 @@ class VisualScriptEditor : public ScriptEditorBase {
AcceptDialog *edit_signal_dialog;
PropertyEditor *edit_signal_edit;
+ PropertySelector *method_select;
+ PropertySelector *new_connect_node_select;
VisualScriptEditorVariableEdit *variable_editor;
@@ -98,6 +117,27 @@ class VisualScriptEditor : public ScriptEditorBase {
String _validate_name(const String& p_name) const;
+ struct Clipboard {
+
+ Map<int,Ref<VisualScriptNode> > nodes;
+ Map<int,Vector2 > nodes_positions;
+
+ Set<VisualScript::SequenceConnection> sequence_connections;
+ Set<VisualScript::DataConnection> data_connections;
+ };
+
+ static Clipboard *clipboard;
+
+ PopupMenu *port_action_popup;
+
+ PortAction port_action;
+ int port_action_node;
+ int port_action_output;
+ Vector2 port_action_pos;
+ int port_action_new_node;
+ void _port_action_menu(int p_option);
+ void _selected_connect_node_method_or_setget(const String& p_text);
+
int error_line;
@@ -128,6 +168,8 @@ class VisualScriptEditor : public ScriptEditorBase {
void _member_button(Object *p_item, int p_column, int p_button);
+ void _expression_text_changed(const String& p_text,int p_id);
+
String revert_on_drag;
@@ -149,6 +191,15 @@ class VisualScriptEditor : public ScriptEditorBase {
void _menu_option(int p_what);
void _graph_ofs_changed(const Vector2& p_ofs);
+ void _comment_node_resized(const Vector2& p_new_size,int p_node);
+
+ int selecting_method_id;
+ void _selected_method(const String& p_method);
+
+ void _draw_color_over_button(Object* obj,Color p_color);
+ void _button_resource_previewed(const String& p_path,const Ref<Texture>& p_preview,Variant p_ud);
+
+ VisualScriptNode::TypeGuess _guess_output_type(int p_port_action_node,int p_port_action_output,Set<int> &visited_nodes);
protected:
@@ -179,9 +230,12 @@ public:
virtual void set_debugger_active(bool p_active);
virtual void set_tooltip_request_func(String p_method,Object* p_obj);
virtual Control *get_edit_menu();
+ virtual bool can_lose_focus_on_node_selection() { return false; }
static void register_editor();
+ static void free_clipboard();
+
VisualScriptEditor();
~VisualScriptEditor();
};