summaryrefslogtreecommitdiff
path: root/tools/editor/editor_node.h
diff options
context:
space:
mode:
Diffstat (limited to 'tools/editor/editor_node.h')
-rw-r--r--tools/editor/editor_node.h92
1 files changed, 79 insertions, 13 deletions
diff --git a/tools/editor/editor_node.h b/tools/editor/editor_node.h
index 365dff84ee..293da2031d 100644
--- a/tools/editor/editor_node.h
+++ b/tools/editor/editor_node.h
@@ -94,6 +94,8 @@
typedef void (*EditorNodeInitCallback)();
+
+
class EditorNode : public Node {
OBJ_TYPE( EditorNode, Node );
@@ -123,6 +125,7 @@ class EditorNode : public Node {
FILE_QUICK_OPEN_SCRIPT,
FILE_RUN_SCRIPT,
FILE_OPEN_PREV,
+ FILE_CLOSE,
FILE_QUIT,
FILE_EXTERNAL_OPEN_SCENE,
EDIT_UNDO,
@@ -168,19 +171,46 @@ class EditorNode : public Node {
OBJECT_METHOD_BASE=500
};
+ enum DockSlot {
+ DOCK_SLOT_LEFT_UL,
+ DOCK_SLOT_LEFT_BL,
+ DOCK_SLOT_LEFT_UR,
+ DOCK_SLOT_LEFT_BR,
+ DOCK_SLOT_RIGHT_UL,
+ DOCK_SLOT_RIGHT_BL,
+ DOCK_SLOT_RIGHT_UR,
+ DOCK_SLOT_RIGHT_BR,
+ DOCK_SLOT_MAX
+ };
-
- Node *edited_scene; //scene being edited
+ //Node *edited_scene; //scene being edited
Viewport *scene_root; //root of the scene being edited
- Ref<ResourceImportMetadata> scene_import_metadata;
+ //Ref<ResourceImportMetadata> scene_import_metadata;
Control* scene_root_parent;
Control *gui_base;
VBoxContainer *main_vbox;
- HSplitContainer *main_split;
- VSplitContainer *left_split;
+
+ //split
+
+ HSplitContainer *left_l_hsplit;
+ VSplitContainer *left_l_vsplit;
+ HSplitContainer *left_r_hsplit;
+ VSplitContainer *left_r_vsplit;
+ HSplitContainer *main_hsplit;
+ HSplitContainer *right_hsplit;
+ VSplitContainer *right_l_vsplit;
+ VSplitContainer *right_r_vsplit;
+
+ VSplitContainer *center_split;
+
+ //main tabs
+
+ Tabs *scene_tabs;
+
+
int old_split_ofs;
VSplitContainer *top_split;
HBoxContainer *bottom_hb;
@@ -190,8 +220,9 @@ class EditorNode : public Node {
TextureButton *anim_close;
Panel *menu_panel;
- HSplitContainer *editor_hsplit;
- VSplitContainer *editor_vsplit;
+
+ //HSplitContainer *editor_hsplit;
+ //VSplitContainer *editor_vsplit;
HBoxContainer *menu_hb;
Control *viewport;
MenuButton *file_menu;
@@ -249,8 +280,8 @@ class EditorNode : public Node {
String current_path;
MenuButton *update_menu;
ToolButton *sources_button;
- TabContainer *prop_pallete;
- TabContainer *top_pallete;
+ //TabContainer *prop_pallete;
+ //TabContainer *top_pallete;
String defer_load_scene;
String defer_translatable;
String defer_optimize;
@@ -277,6 +308,16 @@ class EditorNode : public Node {
ProgressDialog *progress_dialog;
BackgroundProgress *progress_hb;
+ TabContainer *dock_slot[DOCK_SLOT_MAX];
+ Rect2 dock_select_rect[DOCK_SLOT_MAX];
+ int dock_select_rect_over;
+ PopupPanel *dock_select_popoup;
+ Control *dock_select;
+ ToolButton *dock_tab_move_left;
+ ToolButton *dock_tab_move_right;
+ int dock_popup_selected;
+ Timer *dock_drag_timer;
+
String _tmp_import_path;
EditorImportExport *editor_import_export;
@@ -287,8 +328,10 @@ class EditorNode : public Node {
bool reference_resource_mem;
bool save_external_resources_mem;
uint64_t saved_version;
+ uint64_t last_checked_version;
bool unsaved_cache;
String open_navigate;
+ bool changing_scene;
uint32_t circle_step_msec;
uint64_t circle_step_frame;
@@ -338,6 +381,7 @@ class EditorNode : public Node {
void _set_scene_metadata();
void _get_scene_metadata();
void _update_title();
+ void _update_scene_tabs();
void _close_messages();
void _show_messages();
void _vp_resized();
@@ -365,7 +409,7 @@ class EditorNode : public Node {
void _add_to_recent_scenes(const String& p_scene);
void _update_recent_scenes();
void _open_recent_scene(int p_idx);
- void _open_recent_scene_confirm();
+ //void _open_recent_scene_confirm();
String _recent_scene;
bool convert_old;
@@ -394,7 +438,7 @@ class EditorNode : public Node {
void _cleanup_scene();
-
+ void _remove_edited_scene();
bool _find_and_save_resource(RES p_res,Map<RES,bool>& processed,int32_t flags);
bool _find_and_save_edited_subresources(Object *obj,Map<RES,bool>& processed,int32_t flags);
void _save_edited_subresources(Node* scene,Map<RES,bool>& processed,int32_t flags);
@@ -417,6 +461,20 @@ class EditorNode : public Node {
bool _find_scene_in_use(Node* p_node,const String& p_path) const;
+ void _dock_select_input(const InputEvent& p_input);
+ void _dock_move_left();
+ void _dock_move_right();
+ void _dock_select_draw();
+ void _dock_pre_popup(int p_which);
+ void _dock_split_dragged(int ofs);
+ void _dock_popup_exit();
+ void _scene_tab_changed(int p_tab);
+
+ Dictionary _get_main_scene_state();
+ void _set_main_scene_state(Dictionary p_state);
+
+ void _save_docks();
+ void _load_docks();
protected:
void _notification(int p_what);
@@ -451,7 +509,7 @@ public:
void open_request(const String& p_path);
- void set_edited_scene(Node *p_scene);
+ bool is_changing_scene() const;
static EditorLog *get_log() { return singleton->log; }
@@ -464,7 +522,9 @@ public:
void hide_animation_player_editors();
void animation_panel_make_visible(bool p_visible);
- Node *get_edited_scene() { return edited_scene; }
+ void set_edited_scene(Node *p_scene);
+
+ Node *get_edited_scene() { return editor_data.get_edited_scene_root(); }
Viewport *get_scene_root() { return scene_root; } //root of the scene being edited
Error save_optimized_copy(const String& p_scene,const String& p_preset);
@@ -473,6 +533,9 @@ public:
Error load_scene(const String& p_scene);
Error load_resource(const String& p_scene);
+ void set_current_version(uint64_t p_version);
+ void set_current_scene(int p_idx);
+
static EditorData& get_editor_data() { return singleton->editor_data; }
static VSplitContainer *get_top_split() { return singleton->top_split; }
@@ -519,6 +582,9 @@ public:
bool is_scene_in_use(const String& p_path);
void scan_import_changes();
+
+ void save_layout();
+
EditorNode();
~EditorNode();
void get_singleton(const char* arg1, bool arg2);