summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2022-10-31 23:03:21 +0100
committerRémi Verschelde <rverschelde@gmail.com>2022-10-31 23:03:21 +0100
commit778ffce1e35b508cab26a9e7028621b2606cfe15 (patch)
treef70e0bf2acd4ee9d25e0e60af5535f0ad41f79ef /editor
parent887a6c79cd07e670e98c6ae2c8e00b539037c37c (diff)
parentca7e92ed39587075d71a80271855234d6167e503 (diff)
Merge pull request #62416 from Calinou/movie-maker-request-attention-on-finish
Request attention on the editor window when done recording a movie
Diffstat (limited to 'editor')
-rw-r--r--editor/debugger/editor_debugger_node.cpp6
-rw-r--r--editor/editor_node.cpp8
-rw-r--r--editor/editor_node.h3
-rw-r--r--editor/editor_plugin.cpp11
-rw-r--r--editor/editor_plugin.h3
5 files changed, 31 insertions, 0 deletions
diff --git a/editor/debugger/editor_debugger_node.cpp b/editor/debugger/editor_debugger_node.cpp
index edcbcaf963..68aff328ed 100644
--- a/editor/debugger/editor_debugger_node.cpp
+++ b/editor/debugger/editor_debugger_node.cpp
@@ -229,6 +229,12 @@ void EditorDebuggerNode::stop() {
if (server.is_valid()) {
server->stop();
EditorNode::get_log()->add_message("--- Debugging process stopped ---", EditorLog::MSG_TYPE_EDITOR);
+
+ if (EditorNode::get_singleton()->is_movie_maker_enabled()) {
+ // Request attention in case the user was doing something else when movie recording is finished.
+ DisplayServer::get_singleton()->window_request_attention();
+ }
+
server.unref();
}
// Also close all debugging sessions.
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp
index bbb7fb384a..c8a6f43dbb 100644
--- a/editor/editor_node.cpp
+++ b/editor/editor_node.cpp
@@ -3560,6 +3560,14 @@ bool EditorNode::is_addon_plugin_enabled(const String &p_addon) const {
return addon_name_to_plugin.has("res://addons/" + p_addon + "/plugin.cfg");
}
+void EditorNode::set_movie_maker_enabled(bool p_enabled) {
+ write_movie_button->set_pressed(p_enabled);
+}
+
+bool EditorNode::is_movie_maker_enabled() const {
+ return write_movie_button->is_pressed();
+}
+
void EditorNode::_remove_edited_scene(bool p_change_tab) {
int new_index = editor_data.get_edited_scene();
int old_index = new_index;
diff --git a/editor/editor_node.h b/editor/editor_node.h
index b5d844558e..9c8d564057 100644
--- a/editor/editor_node.h
+++ b/editor/editor_node.h
@@ -770,6 +770,9 @@ public:
void set_addon_plugin_enabled(const String &p_addon, bool p_enabled, bool p_config_changed = false);
bool is_addon_plugin_enabled(const String &p_addon) const;
+ void set_movie_maker_enabled(bool p_enabled);
+ bool is_movie_maker_enabled() const;
+
void edit_node(Node *p_node);
void edit_resource(const Ref<Resource> &p_resource) { InspectorDock::get_singleton()->edit_resource(p_resource); };
diff --git a/editor/editor_plugin.cpp b/editor/editor_plugin.cpp
index e852100555..d83dc32e90 100644
--- a/editor/editor_plugin.cpp
+++ b/editor/editor_plugin.cpp
@@ -289,6 +289,14 @@ bool EditorInterface::is_plugin_enabled(const String &p_plugin) const {
return EditorNode::get_singleton()->is_addon_plugin_enabled(p_plugin);
}
+void EditorInterface::set_movie_maker_enabled(bool p_enabled) {
+ EditorNode::get_singleton()->set_movie_maker_enabled(p_enabled);
+}
+
+bool EditorInterface::is_movie_maker_enabled() const {
+ return EditorNode::get_singleton()->is_movie_maker_enabled();
+}
+
EditorInspector *EditorInterface::get_inspector() const {
return InspectorDock::get_inspector_singleton();
}
@@ -364,6 +372,9 @@ void EditorInterface::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_plugin_enabled", "plugin", "enabled"), &EditorInterface::set_plugin_enabled);
ClassDB::bind_method(D_METHOD("is_plugin_enabled", "plugin"), &EditorInterface::is_plugin_enabled);
+ ClassDB::bind_method(D_METHOD("set_movie_maker_enabled", "enabled"), &EditorInterface::set_movie_maker_enabled);
+ ClassDB::bind_method(D_METHOD("is_movie_maker_enabled"), &EditorInterface::is_movie_maker_enabled);
+
ClassDB::bind_method(D_METHOD("get_inspector"), &EditorInterface::get_inspector);
ClassDB::bind_method(D_METHOD("save_scene"), &EditorInterface::save_scene);
diff --git a/editor/editor_plugin.h b/editor/editor_plugin.h
index 1211bcf53c..d8c3cc7330 100644
--- a/editor/editor_plugin.h
+++ b/editor/editor_plugin.h
@@ -113,6 +113,9 @@ public:
void set_plugin_enabled(const String &p_plugin, bool p_enabled);
bool is_plugin_enabled(const String &p_plugin) const;
+ void set_movie_maker_enabled(bool p_enabled);
+ bool is_movie_maker_enabled() const;
+
EditorInspector *get_inspector() const;
Error save_scene();