summaryrefslogtreecommitdiffstats
path: root/editor
diff options
context:
space:
mode:
Diffstat (limited to 'editor')
-rw-r--r--editor/action_map_editor.cpp3
-rw-r--r--editor/animation_bezier_editor.cpp14
-rw-r--r--editor/animation_track_editor.cpp1
-rw-r--r--editor/code_editor.cpp8
-rw-r--r--editor/create_dialog.cpp1
-rw-r--r--editor/directory_create_dialog.cpp11
-rw-r--r--editor/editor_audio_buses.cpp3
-rw-r--r--editor/editor_autoload_settings.cpp1
-rw-r--r--editor/editor_file_system.cpp51
-rw-r--r--editor/editor_file_system.h2
-rw-r--r--editor/editor_inspector.cpp1
-rw-r--r--editor/editor_node.cpp19
-rw-r--r--editor/editor_resource_preview.h2
-rw-r--r--editor/editor_settings.cpp2
-rw-r--r--editor/editor_settings_dialog.cpp2
-rw-r--r--editor/editor_translation.cpp16
-rw-r--r--editor/export/editor_export_platform.h2
-rw-r--r--editor/export/project_export.cpp1
-rw-r--r--editor/filesystem_dock.cpp49
-rw-r--r--editor/filesystem_dock.h2
-rw-r--r--editor/gui/editor_dir_dialog.cpp1
-rw-r--r--editor/gui/editor_file_dialog.cpp4
-rw-r--r--editor/gui/editor_title_bar.h2
-rw-r--r--editor/gui/scene_tree_editor.cpp1
-rw-r--r--editor/localization_editor.cpp2
-rw-r--r--editor/plugins/animation_state_machine_editor.h2
-rw-r--r--editor/plugins/font_config_plugin.h12
-rw-r--r--editor/plugins/gpu_particles_3d_editor_plugin.h2
-rw-r--r--editor/plugins/node_3d_editor_plugin.cpp2
-rw-r--r--editor/plugins/script_editor_plugin.cpp1
-rw-r--r--editor/plugins/shader_editor_plugin.cpp1
-rw-r--r--editor/plugins/skeleton_3d_editor_plugin.cpp1
-rw-r--r--editor/plugins/text_editor.h4
-rw-r--r--editor/plugins/tiles/tile_data_editors.cpp2
-rw-r--r--editor/plugins/tiles/tile_data_editors.h12
-rw-r--r--editor/plugins/tiles/tile_map_layer_editor.h6
-rw-r--r--editor/plugins/visual_shader_editor_plugin.cpp2
-rw-r--r--editor/project_manager.cpp2
-rw-r--r--editor/project_settings_editor.cpp4
39 files changed, 146 insertions, 108 deletions
diff --git a/editor/action_map_editor.cpp b/editor/action_map_editor.cpp
index 16423fb111..0d89f37dd2 100644
--- a/editor/action_map_editor.cpp
+++ b/editor/action_map_editor.cpp
@@ -254,6 +254,7 @@ Variant ActionMapEditor::get_drag_data_fw(const Point2 &p_point, Control *p_from
Label *label = memnew(Label(name));
label->set_theme_type_variation("HeaderSmall");
label->set_modulate(Color(1, 1, 1, 1.0f));
+ label->set_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED);
action_tree->set_drag_preview(label);
Dictionary drag_data;
@@ -588,7 +589,7 @@ ActionMapEditor::ActionMapEditor() {
add_hbox->add_child(show_builtin_actions_checkbutton);
show_builtin_actions = EditorSettings::get_singleton()->get_project_metadata("project_settings", "show_builtin_actions", false);
- show_builtin_actions_checkbutton->set_pressed(show_builtin_actions);
+ show_builtin_actions_checkbutton->set_pressed_no_signal(show_builtin_actions);
main_vbox->add_child(add_hbox);
diff --git a/editor/animation_bezier_editor.cpp b/editor/animation_bezier_editor.cpp
index 66ebd07c2a..2e8c727849 100644
--- a/editor/animation_bezier_editor.cpp
+++ b/editor/animation_bezier_editor.cpp
@@ -1443,6 +1443,11 @@ void AnimationBezierTrackEdit::gui_input(const Ref<InputEvent> &p_event) {
i++;
}
+ AnimationPlayerEditor *ape = AnimationPlayerEditor::get_singleton();
+ if (ape) {
+ undo_redo->add_do_method(ape, "_animation_update_key_frame");
+ undo_redo->add_undo_method(ape, "_animation_update_key_frame");
+ }
undo_redo->commit_action();
} else if (select_single_attempt != IntPair(-1, -1)) {
@@ -1967,15 +1972,6 @@ void AnimationBezierTrackEdit::delete_selection() {
void AnimationBezierTrackEdit::_bezier_track_insert_key_at_anim(const Ref<Animation> &p_anim, int p_track, double p_time, real_t p_value, const Vector2 &p_in_handle, const Vector2 &p_out_handle, const Animation::HandleMode p_handle_mode) {
int idx = p_anim->bezier_track_insert_key(p_track, p_time, p_value, p_in_handle, p_out_handle);
p_anim->bezier_track_set_key_handle_mode(p_track, idx, p_handle_mode);
-
- EditorUndoRedoManager *undo_redo = EditorUndoRedoManager::get_singleton();
- undo_redo->create_action(TTR("Animation Bezier Curve Change Call"));
- AnimationPlayerEditor *ape = AnimationPlayerEditor::get_singleton();
- if (ape) {
- undo_redo->add_do_method(ape, "_animation_update_key_frame");
- undo_redo->add_undo_method(ape, "_animation_update_key_frame");
- }
- undo_redo->commit_action();
}
void AnimationBezierTrackEdit::_bind_methods() {
diff --git a/editor/animation_track_editor.cpp b/editor/animation_track_editor.cpp
index 07b7c34a10..d277ba2f6d 100644
--- a/editor/animation_track_editor.cpp
+++ b/editor/animation_track_editor.cpp
@@ -3241,6 +3241,7 @@ Variant AnimationTrackEdit::get_drag_data(const Point2 &p_point) {
tb->set_flat(true);
tb->set_text(path_cache);
tb->set_icon(icon_cache);
+ tb->set_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED);
tb->add_theme_constant_override("icon_max_width", get_theme_constant("class_icon_size", EditorStringName(Editor)));
set_drag_preview(tb);
diff --git a/editor/code_editor.cpp b/editor/code_editor.cpp
index 59783c58b5..d97293329a 100644
--- a/editor/code_editor.cpp
+++ b/editor/code_editor.cpp
@@ -820,7 +820,7 @@ FindReplaceBar::FindReplaceBar() {
/*** CODE EDITOR ****/
-static constexpr float ZOOM_FACTOR_PRESETS[7] = { 0.25f, 0.5f, 0.75f, 1.0f, 1.5f, 2.0f, 3.0f };
+static constexpr float ZOOM_FACTOR_PRESETS[8] = { 0.5f, 0.75f, 0.9f, 1.0f, 1.1f, 1.25f, 1.5f, 2.0f };
// This function should be used to handle shortcuts that could otherwise
// be handled too late if they weren't handled here.
@@ -1716,8 +1716,7 @@ void CodeTextEditor::_zoom_to(float p_zoom_factor) {
}
void CodeTextEditor::set_zoom_factor(float p_zoom_factor) {
- int preset_count = sizeof(ZOOM_FACTOR_PRESETS) / sizeof(float);
- zoom_factor = CLAMP(p_zoom_factor, ZOOM_FACTOR_PRESETS[0], ZOOM_FACTOR_PRESETS[preset_count - 1]);
+ zoom_factor = CLAMP(p_zoom_factor, 0.25f, 3.0f);
int neutral_font_size = int(EDITOR_GET("interface/editor/code_font_size")) * EDSCALE;
int new_font_size = Math::round(zoom_factor * neutral_font_size);
@@ -1843,7 +1842,8 @@ CodeTextEditor::CodeTextEditor() {
status_bar->add_child(zoom_button);
zoom_button->set_flat(true);
zoom_button->set_v_size_flags(SIZE_EXPAND | SIZE_SHRINK_CENTER);
- zoom_button->set_tooltip_text(TTR("Zoom factor"));
+ zoom_button->set_tooltip_text(
+ TTR("Zoom factor") + "\n" + vformat(TTR("%sMouse wheel, %s/%s: Finetune\n%s: Reset"), keycode_get_string((Key)KeyModifierMask::CMD_OR_CTRL), ED_GET_SHORTCUT("script_editor/zoom_in")->get_as_text(), ED_GET_SHORTCUT("script_editor/zoom_out")->get_as_text(), ED_GET_SHORTCUT("script_editor/reset_zoom")->get_as_text()));
zoom_button->set_text("100 %");
PopupMenu *zoom_menu = zoom_button->get_popup();
diff --git a/editor/create_dialog.cpp b/editor/create_dialog.cpp
index 42346a0c0b..330ac3b437 100644
--- a/editor/create_dialog.cpp
+++ b/editor/create_dialog.cpp
@@ -615,6 +615,7 @@ Variant CreateDialog::get_drag_data_fw(const Point2 &p_point, Control *p_from) {
tb->set_flat(true);
tb->set_icon(ti->get_icon(0));
tb->set_text(ti->get_text(0));
+ tb->set_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED);
favorites->set_drag_preview(tb);
return d;
diff --git a/editor/directory_create_dialog.cpp b/editor/directory_create_dialog.cpp
index 604531f109..46baa2c6e1 100644
--- a/editor/directory_create_dialog.cpp
+++ b/editor/directory_create_dialog.cpp
@@ -31,6 +31,7 @@
#include "directory_create_dialog.h"
#include "core/io/dir_access.h"
+#include "editor/editor_file_system.h"
#include "editor/editor_node.h"
#include "editor/gui/editor_validation_panel.h"
#include "editor/themes/editor_scale.h"
@@ -100,15 +101,7 @@ void DirectoryCreateDialog::ok_pressed() {
const String error = _validate_path(path);
ERR_FAIL_COND_MSG(!error.is_empty(), error);
- Error err;
- Ref<DirAccess> da = DirAccess::create(DirAccess::ACCESS_RESOURCES);
-
- err = da->change_dir(base_dir);
- ERR_FAIL_COND_MSG(err != OK, "Cannot open directory '" + base_dir + "'.");
-
- print_verbose("Making folder " + path + " in " + base_dir);
- err = da->make_dir_recursive(path);
-
+ Error err = EditorFileSystem::get_singleton()->make_dir_recursive(path, base_dir);
if (err == OK) {
emit_signal(SNAME("dir_created"), base_dir.path_join(path));
} else {
diff --git a/editor/editor_audio_buses.cpp b/editor/editor_audio_buses.cpp
index de4e9240f6..24fc7a9c2b 100644
--- a/editor/editor_audio_buses.cpp
+++ b/editor/editor_audio_buses.cpp
@@ -657,6 +657,7 @@ Variant EditorAudioBus::get_drag_data_fw(const Point2 &p_point, Control *p_from)
Label *l = memnew(Label);
l->set_text(item->get_text(0));
+ l->set_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED);
effects->set_drag_preview(l);
return fxd;
@@ -929,6 +930,7 @@ EditorAudioBus::EditorAudioBus(EditorAudioBuses *p_buses, bool p_is_master) {
hb->add_child(scale);
effects = memnew(Tree);
+ effects->set_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED);
effects->set_hide_root(true);
effects->set_custom_minimum_size(Size2(0, 80) * EDSCALE);
effects->set_hide_folding(true);
@@ -954,6 +956,7 @@ EditorAudioBus::EditorAudioBus(EditorAudioBuses *p_buses, bool p_is_master) {
set_focus_mode(FOCUS_CLICK);
effect_options = memnew(PopupMenu);
+ effect_options->set_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED); // Don't translate class names.
effect_options->connect("index_pressed", callable_mp(this, &EditorAudioBus::_effect_add));
add_child(effect_options);
List<StringName> effect_list;
diff --git a/editor/editor_autoload_settings.cpp b/editor/editor_autoload_settings.cpp
index fb007aee28..0eabe53360 100644
--- a/editor/editor_autoload_settings.cpp
+++ b/editor/editor_autoload_settings.cpp
@@ -644,6 +644,7 @@ Variant EditorAutoloadSettings::get_drag_data_fw(const Point2 &p_point, Control
for (int i = 0; i < max_size; i++) {
Label *label = memnew(Label(autoloads[i]));
label->set_self_modulate(Color(1, 1, 1, Math::lerp(1, 0, float(i) / PREVIEW_LIST_MAX_SIZE)));
+ label->set_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED);
preview->add_child(label);
}
diff --git a/editor/editor_file_system.cpp b/editor/editor_file_system.cpp
index cad615e6c5..adae6599c1 100644
--- a/editor/editor_file_system.cpp
+++ b/editor/editor_file_system.cpp
@@ -32,6 +32,7 @@
#include "core/config/project_settings.h"
#include "core/extension/gdextension_manager.h"
+#include "core/io/dir_access.h"
#include "core/io/file_access.h"
#include "core/io/resource_saver.h"
#include "core/object/worker_thread_pool.h"
@@ -3075,33 +3076,51 @@ void EditorFileSystem::move_group_file(const String &p_path, const String &p_new
}
}
-void EditorFileSystem::add_new_directory(const String &p_path) {
- String path = p_path.get_base_dir();
- EditorFileSystemDirectory *parent = filesystem;
- int base = p_path.count("/");
- int max_bit = base + 1;
+Error EditorFileSystem::make_dir_recursive(const String &p_path, const String &p_base_path) {
+ Error err;
+ Ref<DirAccess> da = DirAccess::create(DirAccess::ACCESS_RESOURCES);
+ if (!p_base_path.is_empty()) {
+ err = da->change_dir(p_base_path);
+ ERR_FAIL_COND_V_MSG(err != OK, err, "Cannot open base directory '" + p_base_path + "'.");
+ }
- while (path != "res://") {
- EditorFileSystemDirectory *dir = get_filesystem_path(path);
- if (dir) {
- parent = dir;
- break;
- }
- path = path.get_base_dir();
- base--;
+ if (da->dir_exists(p_path)) {
+ return ERR_ALREADY_EXISTS;
+ }
+
+ err = da->make_dir_recursive(p_path);
+ if (err != OK) {
+ return err;
}
- for (int i = base; i < max_bit; i++) {
+ const String path = da->get_current_dir();
+ EditorFileSystemDirectory *parent = get_filesystem_path(path);
+ ERR_FAIL_NULL_V(parent, ERR_FILE_NOT_FOUND);
+
+ const PackedStringArray folders = p_path.trim_prefix(path).trim_suffix("/").split("/");
+ bool first = true;
+
+ for (const String &folder : folders) {
+ const int current = parent->find_dir_index(folder);
+ if (current > -1) {
+ parent = parent->get_subdir(current);
+ continue;
+ }
+
EditorFileSystemDirectory *efd = memnew(EditorFileSystemDirectory);
efd->parent = parent;
- efd->name = p_path.get_slice("/", i);
+ efd->name = folder;
parent->subdirs.push_back(efd);
- if (i == base) {
+ if (first) {
parent->subdirs.sort_custom<DirectoryComparator>();
+ first = false;
}
parent = efd;
}
+
+ emit_signal(SNAME("filesystem_changed"));
+ return OK;
}
ResourceUID::ID EditorFileSystem::_resource_saver_get_resource_id_for_path(const String &p_path, bool p_generate) {
diff --git a/editor/editor_file_system.h b/editor/editor_file_system.h
index be299800d8..e02127cb13 100644
--- a/editor/editor_file_system.h
+++ b/editor/editor_file_system.h
@@ -370,7 +370,7 @@ public:
bool is_group_file(const String &p_path) const;
void move_group_file(const String &p_path, const String &p_new_path);
- void add_new_directory(const String &p_path);
+ Error make_dir_recursive(const String &p_path, const String &p_base_path = String());
static bool _should_skip_directory(const String &p_path);
diff --git a/editor/editor_inspector.cpp b/editor/editor_inspector.cpp
index 4cd0761691..a215662f16 100644
--- a/editor/editor_inspector.cpp
+++ b/editor/editor_inspector.cpp
@@ -893,6 +893,7 @@ Variant EditorProperty::get_drag_data(const Point2 &p_point) {
Label *drag_label = memnew(Label);
drag_label->set_text(property);
+ drag_label->set_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED); // Don't translate raw property name.
set_drag_preview(drag_label);
return dp;
}
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp
index 0c21f3c2cd..2b4b6a5b7e 100644
--- a/editor/editor_node.cpp
+++ b/editor/editor_node.cpp
@@ -4113,7 +4113,9 @@ Error EditorNode::load_scene(const String &p_scene, bool p_ignore_broken_deps, b
_update_title();
scene_tabs->update_scene_tabs();
- _add_to_recent_scenes(lpath);
+ if (!restoring_scenes) {
+ _add_to_recent_scenes(lpath);
+ }
return OK;
}
@@ -5663,6 +5665,7 @@ Dictionary EditorNode::drag_resource(const Ref<Resource> &p_res, Control *p_from
Control *drag_control = memnew(Control);
TextureRect *drag_preview = memnew(TextureRect);
Label *label = memnew(Label);
+ label->set_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED);
Ref<Texture2D> preview;
@@ -5715,6 +5718,7 @@ Dictionary EditorNode::drag_files_and_dirs(const Vector<String> &p_paths, Contro
HBoxContainer *hbox = memnew(HBoxContainer);
TextureRect *icon = memnew(TextureRect);
Label *label = memnew(Label);
+ label->set_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED);
if (p_paths[i].ends_with("/")) {
label->set_text(p_paths[i].substr(0, p_paths[i].length() - 1).get_file());
@@ -6673,6 +6677,8 @@ EditorNode::EditorNode() {
DEV_ASSERT(!singleton);
singleton = this;
+ set_translation_domain("godot.editor");
+
Resource::_get_local_scene_func = _resource_get_edited_scene;
{
@@ -7906,9 +7912,14 @@ EditorNode::EditorNode() {
title_bar->set_can_move_window(true);
}
- String exec = OS::get_singleton()->get_executable_path();
- // Save editor executable path for third-party tools.
- EditorSettings::get_singleton()->set_project_metadata("editor_metadata", "executable_path", exec);
+ {
+ const String exec = OS::get_singleton()->get_executable_path();
+ const String old_exec = EditorSettings::get_singleton()->get_project_metadata("editor_metadata", "executable_path", "");
+ // Save editor executable path for third-party tools.
+ if (exec != old_exec) {
+ EditorSettings::get_singleton()->set_project_metadata("editor_metadata", "executable_path", exec);
+ }
+ }
follow_system_theme = EDITOR_GET("interface/theme/follow_system_theme");
use_system_accent_color = EDITOR_GET("interface/theme/use_system_accent_color");
diff --git a/editor/editor_resource_preview.h b/editor/editor_resource_preview.h
index 2870f9a201..57b6e4cedb 100644
--- a/editor/editor_resource_preview.h
+++ b/editor/editor_resource_preview.h
@@ -65,7 +65,7 @@ public:
virtual bool handles(const String &p_type) const;
virtual Ref<Texture2D> generate(const Ref<Resource> &p_from, const Size2 &p_size, Dictionary &p_metadata) const;
virtual Ref<Texture2D> generate_from_path(const String &p_path, const Size2 &p_size, Dictionary &p_metadata) const;
- virtual void abort(){};
+ virtual void abort() {}
virtual bool generate_small_preview_automatically() const;
virtual bool can_generate_small_preview() const;
diff --git a/editor/editor_settings.cpp b/editor/editor_settings.cpp
index 312140da67..963c45b573 100644
--- a/editor/editor_settings.cpp
+++ b/editor/editor_settings.cpp
@@ -1226,6 +1226,8 @@ fail:
void EditorSettings::setup_language() {
String lang = get("interface/editor/editor_language");
+ TranslationServer::get_singleton()->set_locale(lang);
+
if (lang == "en") {
return; // Default, nothing to do.
}
diff --git a/editor/editor_settings_dialog.cpp b/editor/editor_settings_dialog.cpp
index 81bc9c8fbe..b133847823 100644
--- a/editor/editor_settings_dialog.cpp
+++ b/editor/editor_settings_dialog.cpp
@@ -697,7 +697,7 @@ Variant EditorSettingsDialog::get_drag_data_fw(const Point2 &p_point, Control *p
return Variant();
}
- String label_text = "Event " + itos(selected->get_meta("event_index"));
+ String label_text = vformat(TTRC("Event %d"), selected->get_meta("event_index"));
Label *label = memnew(Label(label_text));
label->set_modulate(Color(1, 1, 1, 1.0f));
shortcuts->set_drag_preview(label);
diff --git a/editor/editor_translation.cpp b/editor/editor_translation.cpp
index 4654d41082..6ccde3b696 100644
--- a/editor/editor_translation.cpp
+++ b/editor/editor_translation.cpp
@@ -54,6 +54,8 @@ Vector<String> get_editor_locales() {
}
void load_editor_translations(const String &p_locale) {
+ const Ref<TranslationDomain> domain = TranslationServer::get_singleton()->get_or_add_domain("godot.editor");
+
EditorTranslationList *etl = _editor_translations;
while (etl->data) {
if (etl->lang == p_locale) {
@@ -70,7 +72,7 @@ void load_editor_translations(const String &p_locale) {
if (tr.is_valid()) {
tr->set_locale(etl->lang);
- TranslationServer::get_singleton()->set_tool_translation(tr);
+ domain->add_translation(tr);
break;
}
}
@@ -80,6 +82,8 @@ void load_editor_translations(const String &p_locale) {
}
void load_property_translations(const String &p_locale) {
+ const Ref<TranslationDomain> domain = TranslationServer::get_singleton()->get_or_add_domain("godot.properties");
+
PropertyTranslationList *etl = _property_translations;
while (etl->data) {
if (etl->lang == p_locale) {
@@ -96,7 +100,7 @@ void load_property_translations(const String &p_locale) {
if (tr.is_valid()) {
tr->set_locale(etl->lang);
- TranslationServer::get_singleton()->set_property_translation(tr);
+ domain->add_translation(tr);
break;
}
}
@@ -106,6 +110,8 @@ void load_property_translations(const String &p_locale) {
}
void load_doc_translations(const String &p_locale) {
+ const Ref<TranslationDomain> domain = TranslationServer::get_singleton()->get_or_add_domain("godot.documentation");
+
DocTranslationList *dtl = _doc_translations;
while (dtl->data) {
if (dtl->lang == p_locale) {
@@ -122,7 +128,7 @@ void load_doc_translations(const String &p_locale) {
if (tr.is_valid()) {
tr->set_locale(dtl->lang);
- TranslationServer::get_singleton()->set_doc_translation(tr);
+ domain->add_translation(tr);
break;
}
}
@@ -132,6 +138,8 @@ void load_doc_translations(const String &p_locale) {
}
void load_extractable_translations(const String &p_locale) {
+ const Ref<TranslationDomain> domain = TranslationServer::get_singleton()->get_or_add_domain("godot.editor");
+
ExtractableTranslationList *etl = _extractable_translations;
while (etl->data) {
if (etl->lang == p_locale) {
@@ -148,7 +156,7 @@ void load_extractable_translations(const String &p_locale) {
if (tr.is_valid()) {
tr->set_locale(etl->lang);
- TranslationServer::get_singleton()->set_extractable_translation(tr);
+ domain->add_translation(tr);
break;
}
}
diff --git a/editor/export/editor_export_platform.h b/editor/export/editor_export_platform.h
index a800bb95e6..95f21ceafb 100644
--- a/editor/export/editor_export_platform.h
+++ b/editor/export/editor_export_platform.h
@@ -308,7 +308,7 @@ public:
virtual Error export_pack(const Ref<EditorExportPreset> &p_preset, bool p_debug, const String &p_path, BitField<EditorExportPlatform::DebugFlags> p_flags = 0);
virtual Error export_zip(const Ref<EditorExportPreset> &p_preset, bool p_debug, const String &p_path, BitField<EditorExportPlatform::DebugFlags> p_flags = 0);
virtual void get_platform_features(List<String> *r_features) const = 0;
- virtual void resolve_platform_feature_priorities(const Ref<EditorExportPreset> &p_preset, HashSet<String> &p_features){};
+ virtual void resolve_platform_feature_priorities(const Ref<EditorExportPreset> &p_preset, HashSet<String> &p_features) {}
virtual String get_debug_protocol() const { return "tcp://"; }
EditorExportPlatform();
diff --git a/editor/export/project_export.cpp b/editor/export/project_export.cpp
index 3ad8ab0b19..be9e0f78ec 100644
--- a/editor/export/project_export.cpp
+++ b/editor/export/project_export.cpp
@@ -713,6 +713,7 @@ Variant ProjectExportDialog::get_drag_data_fw(const Point2 &p_point, Control *p_
drag->add_child(tr);
Label *label = memnew(Label);
label->set_text(presets->get_item_text(pos));
+ label->set_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED); // Don't translate user input.
drag->add_child(label);
presets->set_drag_preview(drag);
diff --git a/editor/filesystem_dock.cpp b/editor/filesystem_dock.cpp
index 1082e4d0c2..dd2eec6893 100644
--- a/editor/filesystem_dock.cpp
+++ b/editor/filesystem_dock.cpp
@@ -649,8 +649,7 @@ void FileSystemDock::_notification(int p_what) {
}
if (do_redraw) {
- _update_file_list(true);
- _update_tree(get_uncollapsed_paths());
+ update_all();
}
if (EditorThemeManager::is_generated_theme_outdated()) {
@@ -1343,13 +1342,7 @@ void FileSystemDock::_fs_changed() {
scanning_vb->hide();
split_box->show();
- if (tree->is_visible()) {
- _update_tree(get_uncollapsed_paths());
- }
-
- if (file_list_vb->is_visible()) {
- _update_file_list(true);
- }
+ update_all();
if (!select_after_scan.is_empty()) {
_navigate_to_path(select_after_scan);
@@ -1361,15 +1354,6 @@ void FileSystemDock::_fs_changed() {
set_process(false);
}
-void FileSystemDock::_directory_created(const String &p_path) {
- if (!DirAccess::exists(p_path)) {
- return;
- }
- EditorFileSystem::get_singleton()->add_new_directory(p_path);
- _update_tree(get_uncollapsed_paths());
- _update_file_list(true);
-}
-
void FileSystemDock::_set_scanning_mode() {
button_hist_prev->set_disabled(true);
button_hist_next->set_disabled(true);
@@ -2678,8 +2662,11 @@ void FileSystemDock::_file_option(int p_option, const Vector<String> &p_selected
} break;
default: {
- // Resource conversion commands:
- if (p_option >= CONVERT_BASE_ID) {
+ if (p_option >= EditorContextMenuPlugin::BASE_ID) {
+ if (!EditorContextMenuPluginManager::get_singleton()->activate_custom_option(EditorContextMenuPlugin::CONTEXT_SLOT_FILESYSTEM, p_option, p_selected)) {
+ EditorContextMenuPluginManager::get_singleton()->activate_custom_option(EditorContextMenuPlugin::CONTEXT_SLOT_FILESYSTEM_CREATE, p_option, p_selected);
+ }
+ } else if (p_option >= CONVERT_BASE_ID) {
selected_conversion_id = p_option - CONVERT_BASE_ID;
ERR_FAIL_INDEX(selected_conversion_id, (int)cached_valid_conversion_targets.size());
@@ -2697,10 +2684,6 @@ void FileSystemDock::_file_option(int p_option, const Vector<String> &p_selected
}
conversion_id++;
}
- } else {
- if (!EditorContextMenuPluginManager::get_singleton()->activate_custom_option(EditorContextMenuPlugin::CONTEXT_SLOT_FILESYSTEM, p_option, p_selected)) {
- EditorContextMenuPluginManager::get_singleton()->activate_custom_option(EditorContextMenuPlugin::CONTEXT_SLOT_FILESYSTEM_CREATE, p_option, p_selected);
- }
}
break;
}
@@ -2820,6 +2803,16 @@ void FileSystemDock::fix_dependencies(const String &p_for_file) {
deps_editor->edit(p_for_file);
}
+void FileSystemDock::update_all() {
+ if (tree->is_visible()) {
+ _update_tree(get_uncollapsed_paths());
+ }
+
+ if (file_list_vb->is_visible()) {
+ _update_file_list(true);
+ }
+}
+
void FileSystemDock::focus_on_path() {
current_path_line_edit->grab_focus();
current_path_line_edit->select_all();
@@ -3241,9 +3234,7 @@ void FileSystemDock::_folder_color_index_pressed(int p_index, PopupMenu *p_menu)
}
_update_folder_colors_setting();
-
- _update_tree(get_uncollapsed_paths());
- _update_file_list(true);
+ update_all();
emit_signal(SNAME("folder_color_changed"));
}
@@ -3951,8 +3942,7 @@ void FileSystemDock::set_file_sort(FileSortOption p_file_sort) {
file_sort = p_file_sort;
// Update everything needed.
- _update_tree(get_uncollapsed_paths());
- _update_file_list(true);
+ update_all();
}
void FileSystemDock::_file_sort_popup(int p_id) {
@@ -4342,7 +4332,6 @@ FileSystemDock::FileSystemDock() {
make_dir_dialog = memnew(DirectoryCreateDialog);
add_child(make_dir_dialog);
- make_dir_dialog->connect("dir_created", callable_mp(this, &FileSystemDock::_directory_created));
make_scene_dialog = memnew(SceneCreateDialog);
add_child(make_scene_dialog);
diff --git a/editor/filesystem_dock.h b/editor/filesystem_dock.h
index 751fbed022..108b646029 100644
--- a/editor/filesystem_dock.h
+++ b/editor/filesystem_dock.h
@@ -270,7 +270,6 @@ private:
void _toggle_file_display();
void _set_file_display(bool p_active);
void _fs_changed();
- void _directory_created(const String &p_path);
void _select_file(const String &p_path, bool p_select_in_favorites = false);
void _tree_activate_file();
@@ -417,6 +416,7 @@ public:
ScriptCreateDialog *get_script_create_dialog() const;
void fix_dependencies(const String &p_for_file);
+ void update_all();
int get_h_split_offset() const { return split_box_offset_h; }
void set_h_split_offset(int p_offset) { split_box_offset_h = p_offset; }
diff --git a/editor/gui/editor_dir_dialog.cpp b/editor/gui/editor_dir_dialog.cpp
index e64761d5b5..b677ba1098 100644
--- a/editor/gui/editor_dir_dialog.cpp
+++ b/editor/gui/editor_dir_dialog.cpp
@@ -191,7 +191,6 @@ void EditorDirDialog::_make_dir_confirm(const String &p_path) {
}
new_dir_path = p_path + "/";
- EditorFileSystem::get_singleton()->scan_changes(); // We created a dir, so rescan changes.
}
void EditorDirDialog::_bind_methods() {
diff --git a/editor/gui/editor_file_dialog.cpp b/editor/gui/editor_file_dialog.cpp
index b6aa3c2215..18f1f6da0c 100644
--- a/editor/gui/editor_file_dialog.cpp
+++ b/editor/gui/editor_file_dialog.cpp
@@ -207,6 +207,10 @@ void EditorFileDialog::_update_theme_item_cache() {
void EditorFileDialog::_notification(int p_what) {
switch (p_what) {
+ case NOTIFICATION_POSTINITIALIZE: {
+ set_translation_domain(SNAME("godot.editor"));
+ } break;
+
case NOTIFICATION_THEME_CHANGED:
case Control::NOTIFICATION_LAYOUT_DIRECTION_CHANGED:
case NOTIFICATION_TRANSLATION_CHANGED: {
diff --git a/editor/gui/editor_title_bar.h b/editor/gui/editor_title_bar.h
index 4055476b82..13fd5d6cdb 100644
--- a/editor/gui/editor_title_bar.h
+++ b/editor/gui/editor_title_bar.h
@@ -43,7 +43,7 @@ class EditorTitleBar : public HBoxContainer {
protected:
virtual void gui_input(const Ref<InputEvent> &p_event) override;
- static void _bind_methods(){};
+ static void _bind_methods() {}
public:
void set_can_move_window(bool p_enabled);
diff --git a/editor/gui/scene_tree_editor.cpp b/editor/gui/scene_tree_editor.cpp
index 6695abb70a..2e36b66025 100644
--- a/editor/gui/scene_tree_editor.cpp
+++ b/editor/gui/scene_tree_editor.cpp
@@ -1361,6 +1361,7 @@ Variant SceneTreeEditor::get_drag_data_fw(const Point2 &p_point, Control *p_from
tf->set_texture(icons[i]);
hb->add_child(tf);
Label *label = memnew(Label(selected_nodes[i]->get_name()));
+ label->set_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED);
hb->add_child(label);
vb->add_child(hb);
hb->set_modulate(Color(1, 1, 1, opacity_item));
diff --git a/editor/localization_editor.cpp b/editor/localization_editor.cpp
index 6bc3a27a95..3c07e85758 100644
--- a/editor/localization_editor.cpp
+++ b/editor/localization_editor.cpp
@@ -37,7 +37,6 @@
#include "editor/filesystem_dock.h"
#include "editor/gui/editor_file_dialog.h"
#include "editor/pot_generator.h"
-#include "editor/themes/editor_scale.h"
#include "scene/gui/control.h"
void LocalizationEditor::_notification(int p_what) {
@@ -49,6 +48,7 @@ void LocalizationEditor::_notification(int p_what) {
List<String> tfn;
ResourceLoader::get_recognized_extensions_for_type("Translation", &tfn);
+ tfn.erase("csv"); // CSV is recognized by the resource importer to generate translation files, but it's not a translation file itself.
for (const String &E : tfn) {
translation_file_open->add_filter("*." + E);
}
diff --git a/editor/plugins/animation_state_machine_editor.h b/editor/plugins/animation_state_machine_editor.h
index 860d0ed35d..eb623a147d 100644
--- a/editor/plugins/animation_state_machine_editor.h
+++ b/editor/plugins/animation_state_machine_editor.h
@@ -322,7 +322,7 @@ protected:
public:
void add_transition(const StringName &p_from, const StringName &p_to, Ref<AnimationNodeStateMachineTransition> p_transition);
- EditorAnimationMultiTransitionEdit(){};
+ EditorAnimationMultiTransitionEdit() {}
};
#endif // ANIMATION_STATE_MACHINE_EDITOR_H
diff --git a/editor/plugins/font_config_plugin.h b/editor/plugins/font_config_plugin.h
index e83f29a77b..87fd3861dc 100644
--- a/editor/plugins/font_config_plugin.h
+++ b/editor/plugins/font_config_plugin.h
@@ -51,7 +51,7 @@ public:
void set_dict(const Dictionary &p_dict);
Dictionary get_dict();
- EditorPropertyFontMetaObject(){};
+ EditorPropertyFontMetaObject() {}
};
/*************************************************************************/
@@ -75,7 +75,7 @@ public:
void set_defaults(const Dictionary &p_dict);
Dictionary get_defaults();
- EditorPropertyFontOTObject(){};
+ EditorPropertyFontOTObject() {}
};
/*************************************************************************/
@@ -103,7 +103,7 @@ class EditorPropertyFontMetaOverride : public EditorProperty {
protected:
void _notification(int p_what);
- static void _bind_methods(){};
+ static void _bind_methods() {}
void _edit_pressed();
void _page_changed(int p_page);
@@ -138,7 +138,7 @@ class EditorPropertyOTVariation : public EditorProperty {
EditorPaginator *paginator = nullptr;
protected:
- static void _bind_methods(){};
+ static void _bind_methods() {}
void _edit_pressed();
void _page_changed(int p_page);
@@ -187,7 +187,7 @@ class EditorPropertyOTFeatures : public EditorProperty {
protected:
void _notification(int p_what);
- static void _bind_methods(){};
+ static void _bind_methods() {}
void _edit_pressed();
void _page_changed(int p_page);
@@ -256,7 +256,7 @@ protected:
virtual void _add_element() override;
void _add_font(int p_option);
- static void _bind_methods(){};
+ static void _bind_methods() {}
public:
EditorPropertyFontNamesArray();
diff --git a/editor/plugins/gpu_particles_3d_editor_plugin.h b/editor/plugins/gpu_particles_3d_editor_plugin.h
index 5f59f6dca7..1295836b5f 100644
--- a/editor/plugins/gpu_particles_3d_editor_plugin.h
+++ b/editor/plugins/gpu_particles_3d_editor_plugin.h
@@ -59,7 +59,7 @@ protected:
Vector<Face3> geometry;
bool _generate(Vector<Vector3> &points, Vector<Vector3> &normals);
- virtual void _generate_emission_points(){};
+ virtual void _generate_emission_points() {}
void _node_selected(const NodePath &p_path);
public:
diff --git a/editor/plugins/node_3d_editor_plugin.cpp b/editor/plugins/node_3d_editor_plugin.cpp
index ba9fd4e66c..dc86acd884 100644
--- a/editor/plugins/node_3d_editor_plugin.cpp
+++ b/editor/plugins/node_3d_editor_plugin.cpp
@@ -3997,7 +3997,7 @@ void Node3DEditorViewport::update_transform_gizmo_view() {
xform.orthonormalize();
xform.basis.scale(scale);
RenderingServer::get_singleton()->instance_set_transform(rotate_gizmo_instance[3], xform);
- RenderingServer::get_singleton()->instance_set_visible(rotate_gizmo_instance[3], spatial_editor->is_gizmo_visible() && transform_gizmo_visible && (spatial_editor->get_tool_mode() == Node3DEditor::TOOL_MODE_SELECT || spatial_editor->get_tool_mode() == Node3DEditor::TOOL_MODE_ROTATE));
+ RenderingServer::get_singleton()->instance_set_visible(rotate_gizmo_instance[3], spatial_editor->is_gizmo_visible() && !_edit.instant && transform_gizmo_visible && (spatial_editor->get_tool_mode() == Node3DEditor::TOOL_MODE_SELECT || spatial_editor->get_tool_mode() == Node3DEditor::TOOL_MODE_ROTATE));
}
void Node3DEditorViewport::set_state(const Dictionary &p_state) {
diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp
index af401ee6a3..9579388d46 100644
--- a/editor/plugins/script_editor_plugin.cpp
+++ b/editor/plugins/script_editor_plugin.cpp
@@ -3101,6 +3101,7 @@ Variant ScriptEditor::get_drag_data_fw(const Point2 &p_point, Control *p_from) {
drag_preview->add_child(tf);
}
Label *label = memnew(Label(preview_name));
+ label->set_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED); // Don't translate script names and class names.
drag_preview->add_child(label);
set_drag_preview(drag_preview);
diff --git a/editor/plugins/shader_editor_plugin.cpp b/editor/plugins/shader_editor_plugin.cpp
index 6bfe78c216..6b00a2c9c5 100644
--- a/editor/plugins/shader_editor_plugin.cpp
+++ b/editor/plugins/shader_editor_plugin.cpp
@@ -614,6 +614,7 @@ Variant ShaderEditorPlugin::get_drag_data_fw(const Point2 &p_point, Control *p_f
drag_preview->add_child(tf);
}
Label *label = memnew(Label(preview_name));
+ label->set_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED); // Don't translate script names.
drag_preview->add_child(label);
main_split->set_drag_preview(drag_preview);
diff --git a/editor/plugins/skeleton_3d_editor_plugin.cpp b/editor/plugins/skeleton_3d_editor_plugin.cpp
index 64b9522864..81beaf6f91 100644
--- a/editor/plugins/skeleton_3d_editor_plugin.cpp
+++ b/editor/plugins/skeleton_3d_editor_plugin.cpp
@@ -689,6 +689,7 @@ Variant Skeleton3DEditor::get_drag_data_fw(const Point2 &p_point, Control *p_fro
tf->set_stretch_mode(TextureRect::STRETCH_KEEP_CENTERED);
hb->add_child(tf);
Label *label = memnew(Label(selected->get_text(0)));
+ label->set_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED);
hb->add_child(label);
vb->add_child(hb);
hb->set_modulate(Color(1, 1, 1, 1));
diff --git a/editor/plugins/text_editor.h b/editor/plugins/text_editor.h
index 1acec4e959..b6c203f2a2 100644
--- a/editor/plugins/text_editor.h
+++ b/editor/plugins/text_editor.h
@@ -127,8 +127,8 @@ public:
virtual Variant get_navigation_state() override;
virtual Vector<String> get_functions() override;
virtual PackedInt32Array get_breakpoints() override;
- virtual void set_breakpoint(int p_line, bool p_enabled) override{};
- virtual void clear_breakpoints() override{};
+ virtual void set_breakpoint(int p_line, bool p_enabled) override {}
+ virtual void clear_breakpoints() override {}
virtual void goto_line(int p_line, int p_column = 0) override;
void goto_line_selection(int p_line, int p_begin, int p_end);
virtual void set_executing_line(int p_line) override;
diff --git a/editor/plugins/tiles/tile_data_editors.cpp b/editor/plugins/tiles/tile_data_editors.cpp
index 79915012a8..12b9761fd2 100644
--- a/editor/plugins/tiles/tile_data_editors.cpp
+++ b/editor/plugins/tiles/tile_data_editors.cpp
@@ -1097,7 +1097,7 @@ void TileDataDefaultEditor::forward_draw_over_atlas(TileAtlasView *p_tile_atlas_
}
};
-void TileDataDefaultEditor::forward_draw_over_alternatives(TileAtlasView *p_tile_atlas_view, TileSetAtlasSource *p_tile_set_atlas_source, CanvasItem *p_canvas_item, Transform2D p_transform){
+void TileDataDefaultEditor::forward_draw_over_alternatives(TileAtlasView *p_tile_atlas_view, TileSetAtlasSource *p_tile_set_atlas_source, CanvasItem *p_canvas_item, Transform2D p_transform) {
};
diff --git a/editor/plugins/tiles/tile_data_editors.h b/editor/plugins/tiles/tile_data_editors.h
index 9b1eadf331..1426bb4c2f 100644
--- a/editor/plugins/tiles/tile_data_editors.h
+++ b/editor/plugins/tiles/tile_data_editors.h
@@ -54,7 +54,7 @@ private:
protected:
Ref<TileSet> tile_set;
TileData *_get_tile_data(TileMapCell p_cell);
- virtual void _tile_set_changed(){};
+ virtual void _tile_set_changed() {}
static void _bind_methods();
@@ -63,13 +63,13 @@ public:
// Input to handle painting.
virtual Control *get_toolbar() { return nullptr; };
- virtual void forward_draw_over_atlas(TileAtlasView *p_tile_atlas_view, TileSetAtlasSource *p_tile_atlas_source, CanvasItem *p_canvas_item, Transform2D p_transform){};
- virtual void forward_draw_over_alternatives(TileAtlasView *p_tile_atlas_view, TileSetAtlasSource *p_tile_atlas_source, CanvasItem *p_canvas_item, Transform2D p_transform){};
- virtual void forward_painting_atlas_gui_input(TileAtlasView *p_tile_atlas_view, TileSetAtlasSource *p_tile_atlas_source, const Ref<InputEvent> &p_event){};
- virtual void forward_painting_alternatives_gui_input(TileAtlasView *p_tile_atlas_view, TileSetAtlasSource *p_tile_atlas_source, const Ref<InputEvent> &p_event){};
+ virtual void forward_draw_over_atlas(TileAtlasView *p_tile_atlas_view, TileSetAtlasSource *p_tile_atlas_source, CanvasItem *p_canvas_item, Transform2D p_transform) {}
+ virtual void forward_draw_over_alternatives(TileAtlasView *p_tile_atlas_view, TileSetAtlasSource *p_tile_atlas_source, CanvasItem *p_canvas_item, Transform2D p_transform) {}
+ virtual void forward_painting_atlas_gui_input(TileAtlasView *p_tile_atlas_view, TileSetAtlasSource *p_tile_atlas_source, const Ref<InputEvent> &p_event) {}
+ virtual void forward_painting_alternatives_gui_input(TileAtlasView *p_tile_atlas_view, TileSetAtlasSource *p_tile_atlas_source, const Ref<InputEvent> &p_event) {}
// Used to draw the tile data property value over a tile.
- virtual void draw_over_tile(CanvasItem *p_canvas_item, Transform2D p_transform, TileMapCell p_cell, bool p_selected = false){};
+ virtual void draw_over_tile(CanvasItem *p_canvas_item, Transform2D p_transform, TileMapCell p_cell, bool p_selected = false) {}
};
class DummyObject : public Object {
diff --git a/editor/plugins/tiles/tile_map_layer_editor.h b/editor/plugins/tiles/tile_map_layer_editor.h
index 7d749be1ba..805af7b58e 100644
--- a/editor/plugins/tiles/tile_map_layer_editor.h
+++ b/editor/plugins/tiles/tile_map_layer_editor.h
@@ -66,9 +66,9 @@ public:
};
virtual bool forward_canvas_gui_input(const Ref<InputEvent> &p_event) { return false; };
- virtual void forward_canvas_draw_over_viewport(Control *p_overlay){};
- virtual void tile_set_changed(){};
- virtual void edit(ObjectID p_tile_map_layer_id){};
+ virtual void forward_canvas_draw_over_viewport(Control *p_overlay) {}
+ virtual void tile_set_changed() {}
+ virtual void edit(ObjectID p_tile_map_layer_id) {}
};
class TileMapLayerEditorTilesPlugin : public TileMapLayerSubEditorPlugin {
diff --git a/editor/plugins/visual_shader_editor_plugin.cpp b/editor/plugins/visual_shader_editor_plugin.cpp
index 412d58cf45..c378bf315b 100644
--- a/editor/plugins/visual_shader_editor_plugin.cpp
+++ b/editor/plugins/visual_shader_editor_plugin.cpp
@@ -5994,6 +5994,7 @@ Variant VisualShaderEditor::get_drag_data_fw(const Point2 &p_point, Control *p_f
Label *label = memnew(Label);
label->set_text(it->get_text(0));
+ label->set_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED);
set_drag_preview(label);
return d;
}
@@ -6560,6 +6561,7 @@ VisualShaderEditor::VisualShaderEditor() {
parameters->set_hide_folding(false);
parameters->set_h_size_flags(SIZE_EXPAND_FILL);
parameters->set_v_size_flags(SIZE_EXPAND_FILL);
+ parameters->set_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED);
parameters->connect(SceneStringName(item_selected), callable_mp(this, &VisualShaderEditor::_param_selected));
parameters->connect("nothing_selected", callable_mp(this, &VisualShaderEditor::_param_unselected));
sc->add_child(parameters);
diff --git a/editor/project_manager.cpp b/editor/project_manager.cpp
index 279590563a..8411c0edea 100644
--- a/editor/project_manager.cpp
+++ b/editor/project_manager.cpp
@@ -1081,6 +1081,8 @@ void ProjectManager::_titlebar_resized() {
ProjectManager::ProjectManager() {
singleton = this;
+ set_translation_domain("godot.editor");
+
// Turn off some servers we aren't going to be using in the Project Manager.
NavigationServer3D::get_singleton()->set_active(false);
PhysicsServer3D::get_singleton()->set_active(false);
diff --git a/editor/project_settings_editor.cpp b/editor/project_settings_editor.cpp
index 489fbb037f..d00fdc2123 100644
--- a/editor/project_settings_editor.cpp
+++ b/editor/project_settings_editor.cpp
@@ -267,7 +267,7 @@ void ProjectSettingsEditor::shortcut_input(const Ref<InputEvent> &p_event) {
String ProjectSettingsEditor::_get_setting_name() const {
String name = property_box->get_text().strip_edges();
- if (!name.contains("/")) {
+ if (!name.begins_with("_") && !name.contains("/")) {
name = "global/" + name;
}
return name;
@@ -771,7 +771,7 @@ ProjectSettingsEditor::ProjectSettingsEditor(EditorData *p_data) {
bool use_advanced = EditorSettings::get_singleton()->get_project_metadata("project_settings", "advanced_mode", false);
if (use_advanced) {
- advanced->set_pressed(true);
+ advanced->set_pressed_no_signal(true);
}
_update_advanced(use_advanced);