summaryrefslogtreecommitdiff
path: root/editor/editor_plugin.h
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2017-08-26 10:32:15 -0300
committerJuan Linietsky <reduzio@gmail.com>2017-08-26 10:33:07 -0300
commitdd7145b778ea4884fd52f5efaf79dc55375c8465 (patch)
treef4a3ff305d3bec624dda455701aad40eea1605a8 /editor/editor_plugin.h
parentf634973acb711432fe50f8072416f30c8f92122b (diff)
-Split EditorPlugin into EditorPlugin and EditorInterface
-Added EditorInterface to EditorScript -Added functions to save the scene to EditorInterface
Diffstat (limited to 'editor/editor_plugin.h')
-rw-r--r--editor/editor_plugin.h54
1 files changed, 36 insertions, 18 deletions
diff --git a/editor/editor_plugin.h b/editor/editor_plugin.h
index 77c5501b25..df094f4c50 100644
--- a/editor/editor_plugin.h
+++ b/editor/editor_plugin.h
@@ -55,6 +55,40 @@ class EditorFileSystem;
class EditorToolAddons;
class ScriptEditor;
+class EditorInterface : public Node {
+ GDCLASS(EditorInterface, Node)
+protected:
+ static void _bind_methods();
+ static EditorInterface *singleton;
+
+public:
+ static EditorInterface *get_singleton() { return singleton; }
+
+ Control *get_editor_viewport();
+ void edit_resource(const Ref<Resource> &p_resource);
+ void open_scene_from_path(const String &scene_path);
+ void reload_scene_from_path(const String &scene_path);
+
+ Node *get_edited_scene_root();
+ Array get_open_scenes() const;
+ ScriptEditor *get_script_editor();
+
+ void inspect_object(Object *p_obj, const String &p_for_property = String());
+
+ EditorSelection *get_selection();
+ //EditorImportExport *get_import_export();
+ EditorSettings *get_editor_settings();
+ EditorResourcePreview *get_resource_previewer();
+ EditorFileSystem *get_resource_file_system();
+
+ Control *get_base_control();
+
+ Error save_scene();
+ void save_scene_as(const String &p_scene, bool p_with_preview = true);
+
+ EditorInterface();
+};
+
class EditorPlugin : public Node {
GDCLASS(EditorPlugin, Node);
@@ -105,10 +139,6 @@ public:
void add_control_to_dock(DockSlot p_slot, Control *p_control);
void remove_control_from_docks(Control *p_control);
void remove_control_from_bottom_panel(Control *p_control);
- Control *get_editor_viewport();
- void edit_resource(const Ref<Resource> &p_resource);
- void open_scene_from_path(const String &scene_path);
- void reload_scene_from_path(const String &scene_path);
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, Object *p_submenu);
@@ -117,10 +147,6 @@ public:
void set_input_event_forwarding_always_enabled();
bool is_input_event_forwarding_always_enabled() { return input_event_forwarding_always_enabled; }
- Node *get_edited_scene_root();
- Array get_open_scenes() const;
- ScriptEditor *get_script_editor();
-
void notify_main_screen_changed(const String &screen_name);
void notify_scene_changed(const Node *scn_root);
void notify_scene_closed(const String &scene_filepath);
@@ -146,23 +172,15 @@ public:
virtual void get_window_layout(Ref<ConfigFile> p_layout);
virtual void edited_scene_changed() {} // if changes are pending in editor, apply them
- void update_canvas();
+ EditorInterface *get_editor_interface();
- virtual void inspect_object(Object *p_obj, const String &p_for_property = String());
+ void update_canvas();
void queue_save_layout() const;
- Control *get_base_control();
-
void make_bottom_panel_item_visible(Control *p_item);
void hide_bottom_panel();
- EditorSelection *get_selection();
- //EditorImportExport *get_import_export();
- EditorSettings *get_editor_settings();
- EditorResourcePreview *get_resource_previewer();
- EditorFileSystem *get_resource_file_system();
-
virtual void restore_global_state();
virtual void save_global_state();