diff options
Diffstat (limited to 'tools/editor/editor_node.h')
-rw-r--r-- | tools/editor/editor_node.h | 45 |
1 files changed, 32 insertions, 13 deletions
diff --git a/tools/editor/editor_node.h b/tools/editor/editor_node.h index 6392b96f8f..fbba7ae7a9 100644 --- a/tools/editor/editor_node.h +++ b/tools/editor/editor_node.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* 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 */ @@ -79,7 +79,7 @@ #include "fileserver/editor_file_server.h" #include "editor_resource_preview.h" - +#include "scene/gui/viewport_container.h" #include "progress_dialog.h" @@ -101,7 +101,7 @@ class EditorPluginList; class EditorNode : public Node { - OBJ_TYPE( EditorNode, Node ); + GDCLASS( EditorNode, Node ); public: enum DockSlot { @@ -139,7 +139,6 @@ private: FILE_OPEN_OLD_SCENE, FILE_QUICK_OPEN_SCENE, FILE_QUICK_OPEN_SCRIPT, - FILE_QUICK_OPEN_FILE, FILE_RUN_SCRIPT, FILE_OPEN_PREV, FILE_CLOSE, @@ -159,7 +158,6 @@ private: OBJECT_COPY_PARAMS, OBJECT_PASTE_PARAMS, OBJECT_UNIQUE_RESOURCES, - OBJECT_CALL_METHOD, OBJECT_REQUEST_HELP, RUN_PLAY, @@ -198,7 +196,9 @@ private: IMPORT_PLUGIN_BASE=100, - OBJECT_METHOD_BASE=500 + OBJECT_METHOD_BASE=500, + + TOOL_MENU_BASE=1000 }; @@ -208,7 +208,7 @@ private: //Ref<ResourceImportMetadata> scene_import_metadata; - Control* scene_root_parent; + PanelContainer* scene_root_parent; Control *gui_base; VBoxContainer *main_vbox; @@ -279,7 +279,7 @@ private: PropertyEditor *property_editor; NodeDock *node_dock; VBoxContainer *prop_editor_vb; - FileSystemDock *scenes_dock; + FileSystemDock *filesystem_dock; EditorRunNative *run_native; HBoxContainer *search_bar; @@ -287,7 +287,7 @@ private: CreateDialog *create_dialog; - CallDialog *call_dialog; + //CallDialog *call_dialog; ConfirmationDialog *confirmation; ConfirmationDialog *import_confirmation; ConfirmationDialog *open_recent_confirmation; @@ -594,6 +594,22 @@ private: void _call_build(); static int build_callback_count; static EditorBuildCallback build_callbacks[MAX_BUILD_CALLBACKS]; + + bool _initializing_tool_menu; + + struct ToolMenuItem { + String name; + String submenu; + Variant ud; + ObjectID handler; + String callback; + }; + + Vector<ToolMenuItem> tool_menu_items; + + void _tool_menu_insert_item(const ToolMenuItem& p_item); + void _rebuild_tool_menu() const; + protected: void _notification(int p_what); static void _bind_methods(); @@ -689,7 +705,7 @@ public: void request_instance_scene(const String &p_path); void request_instance_scenes(const Vector<String>& p_files); - FileSystemDock *get_scenes_dock(); + FileSystemDock *get_filesystem_dock(); SceneTreeDock *get_scene_tree_dock(); static UndoRedo* get_undo_redo() { return &singleton->editor_data.get_undo_redo(); } @@ -756,6 +772,9 @@ public: Variant drag_files(const Vector<String>& p_files,Control* p_from); Variant drag_files_and_dirs(const Vector<String>& p_files,Control* p_from); + void add_tool_menu_item(const String& p_name, Object *p_handler, const String& p_callback, const Variant& p_ud = Variant()); + void add_tool_submenu_item(const String& p_name, PopupMenu *p_submenu); + void remove_tool_menu_item(const String& p_name); EditorNode(); ~EditorNode(); @@ -793,9 +812,9 @@ public: void make_visible(bool p_visible); void edit(Object *p_object); - bool forward_input_event(const Matrix32& p_canvas_xform,const InputEvent& p_event); - bool forward_spatial_input_event(Camera* p_camera, const InputEvent& p_event); - void forward_draw_over_canvas(const Matrix32& p_canvas_xform,Control* p_canvas); + bool forward_gui_input(const Transform2D& p_canvas_xform,const InputEvent& p_event); + bool forward_spatial_gui_input(Camera* p_camera, const InputEvent& p_event); + void forward_draw_over_canvas(const Transform2D& p_canvas_xform,Control* p_canvas); void clear(); bool empty(); |