summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
Diffstat (limited to 'editor')
-rw-r--r--editor/debugger/editor_profiler.cpp22
-rw-r--r--editor/debugger/editor_profiler.h3
-rw-r--r--editor/debugger/script_editor_debugger.cpp9
-rw-r--r--editor/editor_help_search.cpp9
-rw-r--r--editor/editor_node.cpp9
-rw-r--r--editor/editor_undo_redo_manager.cpp7
-rw-r--r--editor/export/editor_export_platform.cpp13
-rw-r--r--editor/export/project_export.cpp15
-rw-r--r--editor/plugins/animation_blend_tree_editor_plugin.cpp4
-rw-r--r--editor/plugins/shader_editor_plugin.h4
-rw-r--r--editor/plugins/tiles/tile_map_editor.cpp1
11 files changed, 73 insertions, 23 deletions
diff --git a/editor/debugger/editor_profiler.cpp b/editor/debugger/editor_profiler.cpp
index cf48366bd3..a882275375 100644
--- a/editor/debugger/editor_profiler.cpp
+++ b/editor/debugger/editor_profiler.cpp
@@ -104,6 +104,10 @@ void EditorProfiler::clear() {
updating_frame = false;
hover_metric = -1;
seeking = false;
+
+ // Ensure button text (start, stop) is correct
+ _set_button_text();
+ emit_signal(SNAME("enable_profiling"), activate->is_pressed());
}
static String _get_percent_txt(float p_value, float p_total) {
@@ -374,15 +378,23 @@ void EditorProfiler::_update_frame() {
updating_frame = false;
}
-void EditorProfiler::_activate_pressed() {
+void EditorProfiler::_set_button_text() {
if (activate->is_pressed()) {
activate->set_icon(get_theme_icon(SNAME("Stop"), SNAME("EditorIcons")));
activate->set_text(TTR("Stop"));
- _clear_pressed();
} else {
activate->set_icon(get_theme_icon(SNAME("Play"), SNAME("EditorIcons")));
activate->set_text(TTR("Start"));
}
+}
+
+void EditorProfiler::_activate_pressed() {
+ _set_button_text();
+
+ if (activate->is_pressed()) {
+ _clear_pressed();
+ }
+
emit_signal(SNAME("enable_profiling"), activate->is_pressed());
}
@@ -499,8 +511,12 @@ void EditorProfiler::_bind_methods() {
ADD_SIGNAL(MethodInfo("break_request"));
}
-void EditorProfiler::set_enabled(bool p_enable) {
+void EditorProfiler::set_enabled(bool p_enable, bool p_clear) {
+ activate->set_pressed(false);
activate->set_disabled(!p_enable);
+ if (p_clear) {
+ clear();
+ }
}
bool EditorProfiler::is_profiling() {
diff --git a/editor/debugger/editor_profiler.h b/editor/debugger/editor_profiler.h
index df92125258..e9ecc285ed 100644
--- a/editor/debugger/editor_profiler.h
+++ b/editor/debugger/editor_profiler.h
@@ -122,6 +122,7 @@ private:
Timer *frame_delay = nullptr;
Timer *plot_delay = nullptr;
+ void _set_button_text();
void _update_frame();
void _activate_pressed();
@@ -153,7 +154,7 @@ protected:
public:
void add_frame_metric(const Metric &p_metric, bool p_final = false);
- void set_enabled(bool p_enable);
+ void set_enabled(bool p_enable, bool p_clear = true);
bool is_profiling();
bool is_seeking() { return seeking; }
void disable_seeking();
diff --git a/editor/debugger/script_editor_debugger.cpp b/editor/debugger/script_editor_debugger.cpp
index 5baa9970af..6bc1536cb9 100644
--- a/editor/debugger/script_editor_debugger.cpp
+++ b/editor/debugger/script_editor_debugger.cpp
@@ -52,7 +52,6 @@
#include "editor/plugins/node_3d_editor_plugin.h"
#include "main/performance.h"
#include "scene/3d/camera_3d.h"
-#include "scene/debugger/scene_debugger.h"
#include "scene/gui/dialogs.h"
#include "scene/gui/label.h"
#include "scene/gui/line_edit.h"
@@ -317,7 +316,7 @@ void ScriptEditorDebugger::_parse_message(const String &p_msg, const Array &p_da
if (!error.is_empty()) {
tabs->set_current_tab(0);
}
- profiler->set_enabled(false);
+ profiler->set_enabled(false, false);
inspector->clear_cache(); // Take a chance to force remote objects update.
} else if (p_msg == "debug_exit") {
@@ -327,7 +326,7 @@ void ScriptEditorDebugger::_parse_message(const String &p_msg, const Array &p_da
_update_buttons_state();
_set_reason_text(TTR("Execution resumed."), MESSAGE_SUCCESS);
emit_signal(SNAME("breaked"), false, false, "", false);
- profiler->set_enabled(true);
+ profiler->set_enabled(true, false);
profiler->disable_seeking();
} else if (p_msg == "set_pid") {
ERR_FAIL_COND(p_data.size() < 1);
@@ -916,6 +915,8 @@ void ScriptEditorDebugger::start(Ref<RemoteDebuggerPeer> p_peer) {
_clear_errors_list();
stop();
+ profiler->set_enabled(true, true);
+
peer = p_peer;
ERR_FAIL_COND(p_peer.is_null());
@@ -971,6 +972,8 @@ void ScriptEditorDebugger::stop() {
res_path_cache.clear();
profiler_signature.clear();
+ profiler->set_enabled(true, false);
+
inspector->edit(nullptr);
_update_buttons_state();
}
diff --git a/editor/editor_help_search.cpp b/editor/editor_help_search.cpp
index 129ad4d33b..7e7d7ca418 100644
--- a/editor/editor_help_search.cpp
+++ b/editor/editor_help_search.cpp
@@ -326,6 +326,7 @@ bool EditorHelpSearch::Runner::_phase_match_classes_init() {
bool EditorHelpSearch::Runner::_phase_match_classes() {
DocData::ClassDoc &class_doc = iterator_doc->value;
if (class_doc.name.is_empty()) {
+ ++iterator_doc;
return false;
}
if (!_is_class_disabled_by_feature_profile(class_doc.name)) {
@@ -432,7 +433,7 @@ bool EditorHelpSearch::Runner::_phase_class_items_init() {
bool EditorHelpSearch::Runner::_phase_class_items() {
if (!iterator_match) {
- return false;
+ return true;
}
ClassMatch &match = iterator_match->value;
@@ -459,10 +460,8 @@ bool EditorHelpSearch::Runner::_phase_member_items_init() {
bool EditorHelpSearch::Runner::_phase_member_items() {
ClassMatch &match = iterator_match->value;
- if (!match.doc) {
- return false;
- }
- if (match.doc->name.is_empty()) {
+ if (!match.doc || match.doc->name.is_empty()) {
+ ++iterator_match;
return false;
}
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp
index 9dc4c2c953..804722299c 100644
--- a/editor/editor_node.cpp
+++ b/editor/editor_node.cpp
@@ -6750,8 +6750,10 @@ EditorNode::EditorNode() {
project_menu->add_separator();
project_menu->add_shortcut(ED_SHORTCUT_AND_COMMAND("editor/export", TTR("Export..."), Key::NONE, TTR("Export")), FILE_EXPORT_PROJECT);
+#ifndef ANDROID_ENABLED
project_menu->add_item(TTR("Install Android Build Template..."), FILE_INSTALL_ANDROID_SOURCE);
project_menu->add_item(TTR("Open User Data Folder"), RUN_USER_DATA_FOLDER);
+#endif
project_menu->add_separator();
project_menu->add_item(TTR("Customize Engine Build Configuration..."), TOOLS_BUILD_PROFILE_MANAGER);
@@ -6814,12 +6816,14 @@ EditorNode::EditorNode() {
settings_menu->set_item_tooltip(-1, TTR("Screenshots are stored in the Editor Data/Settings Folder."));
+#ifndef ANDROID_ENABLED
ED_SHORTCUT_AND_COMMAND("editor/fullscreen_mode", TTR("Toggle Fullscreen"), KeyModifierMask::SHIFT | Key::F11);
ED_SHORTCUT_OVERRIDE("editor/fullscreen_mode", "macos", KeyModifierMask::META | KeyModifierMask::CTRL | Key::F);
settings_menu->add_shortcut(ED_GET_SHORTCUT("editor/fullscreen_mode"), SETTINGS_TOGGLE_FULLSCREEN);
-
+#endif
settings_menu->add_separator();
+#ifndef ANDROID_ENABLED
if (OS::get_singleton()->get_data_path() == OS::get_singleton()->get_config_path()) {
// Configuration and data folders are located in the same place (Windows/MacOS).
settings_menu->add_item(TTR("Open Editor Data/Settings Folder"), SETTINGS_EDITOR_DATA_FOLDER);
@@ -6829,9 +6833,12 @@ EditorNode::EditorNode() {
settings_menu->add_item(TTR("Open Editor Settings Folder"), SETTINGS_EDITOR_CONFIG_FOLDER);
}
settings_menu->add_separator();
+#endif
settings_menu->add_item(TTR("Manage Editor Features..."), SETTINGS_MANAGE_FEATURE_PROFILES);
+#ifndef ANDROID_ENABLED
settings_menu->add_item(TTR("Manage Export Templates..."), SETTINGS_MANAGE_EXPORT_TEMPLATES);
+#endif
help_menu = memnew(PopupMenu);
help_menu->set_name(TTR("Help"));
diff --git a/editor/editor_undo_redo_manager.cpp b/editor/editor_undo_redo_manager.cpp
index eca2b3143b..8c04a4d595 100644
--- a/editor/editor_undo_redo_manager.cpp
+++ b/editor/editor_undo_redo_manager.cpp
@@ -124,7 +124,7 @@ void EditorUndoRedoManager::create_action(const String &p_name, UndoRedo::MergeM
create_action_for_history(p_name, INVALID_HISTORY, p_mode);
if (p_custom_context) {
- // This assigns context to pending action.
+ // This assigns history to pending action.
get_history_for_object(p_custom_context);
}
}
@@ -218,7 +218,10 @@ void EditorUndoRedoManager::add_undo_reference(Object *p_object) {
}
void EditorUndoRedoManager::commit_action(bool p_execute) {
- ERR_FAIL_COND(pending_action.history_id == INVALID_HISTORY);
+ if (pending_action.history_id == INVALID_HISTORY) {
+ return; // Empty action, do nothing.
+ }
+
is_committing = true;
History &history = get_or_create_history(pending_action.history_id);
diff --git a/editor/export/editor_export_platform.cpp b/editor/export/editor_export_platform.cpp
index 2a444bb04f..bcc85570ed 100644
--- a/editor/export/editor_export_platform.cpp
+++ b/editor/export/editor_export_platform.cpp
@@ -1619,21 +1619,24 @@ void EditorExportPlatform::gen_export_flags(Vector<String> &r_flags, int p_flags
}
bool EditorExportPlatform::can_export(const Ref<EditorExportPreset> &p_preset, String &r_error, bool &r_missing_templates) const {
+ bool valid = true;
+#ifndef ANDROID_ENABLED
String templates_error;
- bool valid_export_configuration = has_valid_export_configuration(p_preset, templates_error, r_missing_templates);
-
- String project_configuration_error;
- bool valid_project_configuration = has_valid_project_configuration(p_preset, project_configuration_error);
+ valid = valid && has_valid_export_configuration(p_preset, templates_error, r_missing_templates);
if (!templates_error.is_empty()) {
r_error += templates_error;
}
+#endif
+
+ String project_configuration_error;
+ valid = valid && has_valid_project_configuration(p_preset, project_configuration_error);
if (!project_configuration_error.is_empty()) {
r_error += project_configuration_error;
}
- return valid_export_configuration && valid_project_configuration;
+ return valid;
}
EditorExportPlatform::EditorExportPlatform() {
diff --git a/editor/export/project_export.cpp b/editor/export/project_export.cpp
index 00a0e08d3a..8c67885971 100644
--- a/editor/export/project_export.cpp
+++ b/editor/export/project_export.cpp
@@ -932,8 +932,10 @@ void ProjectExportDialog::_export_project_to_path(const String &p_path) {
}
void ProjectExportDialog::_export_all_dialog() {
+#ifndef ANDROID_ENABLED
export_all_dialog->show();
export_all_dialog->popup_centered(Size2(300, 80));
+#endif
}
void ProjectExportDialog::_export_all_dialog_action(const String &p_str) {
@@ -1194,11 +1196,16 @@ ProjectExportDialog::ProjectExportDialog() {
set_cancel_button_text(TTR("Close"));
set_ok_button_text(TTR("Export PCK/ZIP..."));
+ get_ok_button()->set_disabled(true);
+#ifdef ANDROID_ENABLED
+ export_button = memnew(Button);
+ export_button->hide();
+#else
export_button = add_button(TTR("Export Project..."), !DisplayServer::get_singleton()->get_swap_cancel_ok(), "export");
+#endif
export_button->connect("pressed", callable_mp(this, &ProjectExportDialog::_export_project));
// Disable initially before we select a valid preset
export_button->set_disabled(true);
- get_ok_button()->set_disabled(true);
export_all_dialog = memnew(ConfirmationDialog);
add_child(export_all_dialog);
@@ -1208,8 +1215,14 @@ ProjectExportDialog::ProjectExportDialog() {
export_all_dialog->add_button(TTR("Debug"), true, "debug");
export_all_dialog->add_button(TTR("Release"), true, "release");
export_all_dialog->connect("custom_action", callable_mp(this, &ProjectExportDialog::_export_all_dialog_action));
+#ifdef ANDROID_ENABLED
+ export_all_dialog->hide();
+ export_all_button = memnew(Button);
+ export_all_button->hide();
+#else
export_all_button = add_button(TTR("Export All..."), !DisplayServer::get_singleton()->get_swap_cancel_ok(), "export");
+#endif
export_all_button->connect("pressed", callable_mp(this, &ProjectExportDialog::_export_all_dialog));
export_all_button->set_disabled(true);
diff --git a/editor/plugins/animation_blend_tree_editor_plugin.cpp b/editor/plugins/animation_blend_tree_editor_plugin.cpp
index f1e6c70549..f4b8646e18 100644
--- a/editor/plugins/animation_blend_tree_editor_plugin.cpp
+++ b/editor/plugins/animation_blend_tree_editor_plugin.cpp
@@ -907,6 +907,10 @@ void AnimationNodeBlendTreeEditor::_bind_methods() {
AnimationNodeBlendTreeEditor *AnimationNodeBlendTreeEditor::singleton = nullptr;
void AnimationNodeBlendTreeEditor::_node_renamed(const String &p_text, Ref<AnimationNode> p_node) {
+ if (blend_tree.is_null()) {
+ return;
+ }
+
String prev_name = blend_tree->get_node_name(p_node);
ERR_FAIL_COND(prev_name.is_empty());
GraphNode *gn = Object::cast_to<GraphNode>(graph->get_node(prev_name));
diff --git a/editor/plugins/shader_editor_plugin.h b/editor/plugins/shader_editor_plugin.h
index afd38ef71a..f48b2fc70e 100644
--- a/editor/plugins/shader_editor_plugin.h
+++ b/editor/plugins/shader_editor_plugin.h
@@ -115,8 +115,8 @@ public:
ShaderTextEditor();
};
-class ShaderEditor : public PanelContainer {
- GDCLASS(ShaderEditor, PanelContainer);
+class ShaderEditor : public MarginContainer {
+ GDCLASS(ShaderEditor, MarginContainer);
enum {
EDIT_UNDO,
diff --git a/editor/plugins/tiles/tile_map_editor.cpp b/editor/plugins/tiles/tile_map_editor.cpp
index a91f22ccd0..79230891f1 100644
--- a/editor/plugins/tiles/tile_map_editor.cpp
+++ b/editor/plugins/tiles/tile_map_editor.cpp
@@ -3677,6 +3677,7 @@ void TileMapEditor::_update_layers_selection() {
tile_map_layer = -1;
}
tile_map->set_selected_layer(toggle_highlight_selected_layer_button->is_pressed() ? tile_map_layer : -1);
+ tileset_changed_needs_update = false; // Update is not needed here and actually causes problems.
layers_selection_button->clear();
if (tile_map->get_layers_count() > 0) {