Add context menu to visual script editor

This commit is contained in:
Yuri Roubinsky 2022-01-09 19:10:17 +03:00
parent 5a61822d7c
commit e9694a8971
2 changed files with 59 additions and 15 deletions

View file

@ -54,13 +54,18 @@ class VisualScriptEditor : public ScriptEditorBase {
};
enum {
EDIT_ADD_NODE,
EDIT_SEPARATOR, // popup menu separator - ignored
EDIT_CUT_NODES,
EDIT_COPY_NODES,
EDIT_PASTE_NODES,
EDIT_DELETE_NODES,
EDIT_DUPLICATE_NODES,
EDIT_CLEAR_COPY_BUFFER,
EDIT_CREATE_FUNCTION,
EDIT_TOGGLE_BREAKPOINT,
EDIT_FIND_NODE_TYPE,
EDIT_COPY_NODES,
EDIT_CUT_NODES,
EDIT_PASTE_NODES,
EDIT_CREATE_FUNCTION,
REFRESH_GRAPH,
};
@ -123,7 +128,7 @@ class VisualScriptEditor : public ScriptEditorBase {
Label *select_func_text;
bool updating_graph;
bool updating_graph = false;
void _show_hint(const String &p_hint);
void _hide_timer();
@ -162,7 +167,8 @@ class VisualScriptEditor : public ScriptEditorBase {
static Clipboard *clipboard;
PopupMenu *member_popup;
PopupMenu *popup_menu = nullptr;
PopupMenu *member_popup = nullptr;
MemberType member_type;
String member_name;
@ -172,8 +178,7 @@ class VisualScriptEditor : public ScriptEditorBase {
Vector2 port_action_pos;
int port_action_new_node;
bool saved_pos_dirty;
Vector2 saved_position;
bool saved_pos_dirty = false;
Vector2 mouse_up_position;