summaryrefslogtreecommitdiff
path: root/editor/editor_node.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/editor_node.cpp')
-rw-r--r--editor/editor_node.cpp33
1 files changed, 19 insertions, 14 deletions
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp
index 52f7366dd7..6fe6309eed 100644
--- a/editor/editor_node.cpp
+++ b/editor/editor_node.cpp
@@ -416,7 +416,7 @@ void EditorNode::_version_control_menu_option(int p_idx) {
void EditorNode::_update_title() {
const String appname = ProjectSettings::get_singleton()->get("application/config/name");
- String title = (appname.is_empty() ? "Unnamed Project" : appname) + String(" - ") + VERSION_NAME;
+ String title = (appname.is_empty() ? TTR("Unnamed Project") : appname) + String(" - ") + VERSION_NAME;
const String edited = editor_data.get_edited_scene_root() ? editor_data.get_edited_scene_root()->get_scene_file_path() : String();
if (!edited.is_empty()) {
// Display the edited scene name before the program name so that it can be seen in the OS task bar.
@@ -430,7 +430,7 @@ void EditorNode::_update_title() {
DisplayServer::get_singleton()->window_set_title(title);
}
-void EditorNode::unhandled_input(const Ref<InputEvent> &p_event) {
+void EditorNode::shortcut_input(const Ref<InputEvent> &p_event) {
ERR_FAIL_COND(p_event.is_null());
Ref<InputEventKey> k = p_event;
@@ -935,7 +935,7 @@ void EditorNode::_fs_changed() {
}
if (export_preset.is_null()) {
- DirAccessRef da = DirAccess::create(DirAccess::ACCESS_RESOURCES);
+ Ref<DirAccess> da = DirAccess::create(DirAccess::ACCESS_RESOURCES);
if (da->file_exists("res://export_presets.cfg")) {
export_error = vformat(
"Invalid export preset name: %s.\nThe following presets were detected in this project's `export_presets.cfg`:\n\n",
@@ -1058,7 +1058,7 @@ void EditorNode::_scan_external_changes() {
// Check if any edited scene has changed.
for (int i = 0; i < editor_data.get_edited_scene_count(); i++) {
- DirAccessRef da = DirAccess::create(DirAccess::ACCESS_RESOURCES);
+ Ref<DirAccess> da = DirAccess::create(DirAccess::ACCESS_RESOURCES);
if (editor_data.get_scene_path(i) == "" || !da->file_exists(editor_data.get_scene_path(i))) {
continue;
}
@@ -3854,7 +3854,7 @@ void EditorNode::add_io_error(const String &p_error) {
}
void EditorNode::_load_error_notify(void *p_ud, const String &p_text) {
- EditorNode *en = (EditorNode *)p_ud;
+ EditorNode *en = static_cast<EditorNode *>(p_ud);
en->load_errors->add_image(en->gui_base->get_theme_icon(SNAME("Error"), SNAME("EditorIcons")));
en->load_errors->add_text(p_text + "\n");
en->load_error_dialog->popup_centered_ratio(0.5);
@@ -4261,7 +4261,7 @@ void EditorNode::_copy_warning(const String &p_str) {
void EditorNode::_dock_floating_close_request(Control *p_control) {
// Through the MarginContainer to the Window.
- Window *window = (Window *)p_control->get_parent()->get_parent();
+ Window *window = static_cast<Window *>(p_control->get_parent()->get_parent());
int window_slot = window->get_meta("dock_slot");
p_control->get_parent()->remove_child(p_control);
@@ -5478,7 +5478,7 @@ void EditorNode::_global_menu_new_window(const Variant &p_tag) {
}
}
-void EditorNode::_dropped_files(const Vector<String> &p_files, int p_screen) {
+void EditorNode::_dropped_files(const Vector<String> &p_files) {
String to_path = ProjectSettings::get_singleton()->globalize_path(FileSystemDock::get_singleton()->get_selected_path());
_add_dropped_files_recursive(p_files, to_path);
@@ -5487,7 +5487,7 @@ void EditorNode::_dropped_files(const Vector<String> &p_files, int p_screen) {
}
void EditorNode::_add_dropped_files_recursive(const Vector<String> &p_files, String to_path) {
- DirAccessRef dir = DirAccess::create(DirAccess::ACCESS_FILESYSTEM);
+ Ref<DirAccess> dir = DirAccess::create(DirAccess::ACCESS_FILESYSTEM);
for (int i = 0; i < p_files.size(); i++) {
String from = p_files[i];
@@ -5496,7 +5496,7 @@ void EditorNode::_add_dropped_files_recursive(const Vector<String> &p_files, Str
if (dir->dir_exists(from)) {
Vector<String> sub_files;
- DirAccessRef sub_dir = DirAccess::open(from);
+ Ref<DirAccess> sub_dir = DirAccess::open(from);
sub_dir->list_dir_begin();
String next_file = sub_dir->get_next();
@@ -5773,7 +5773,7 @@ static Node *_resource_get_edited_scene() {
}
void EditorNode::_print_handler(void *p_this, const String &p_string, bool p_error) {
- EditorNode *en = (EditorNode *)p_this;
+ EditorNode *en = static_cast<EditorNode *>(p_this);
en->log->add_message(p_string, p_error ? EditorLog::MSG_TYPE_ERROR : EditorLog::MSG_TYPE_STD);
}
@@ -5997,18 +5997,22 @@ EditorNode::EditorNode() {
import_scene.instantiate();
ResourceFormatImporter::get_singleton()->add_importer(import_scene);
+ Ref<ResourceImporterScene> import_animation;
+ import_animation = Ref<ResourceImporterScene>(memnew(ResourceImporterScene(true)));
+ ResourceFormatImporter::get_singleton()->add_importer(import_animation);
+
{
Ref<EditorSceneFormatImporterCollada> import_collada;
import_collada.instantiate();
- import_scene->add_importer(import_collada);
+ ResourceImporterScene::add_importer(import_collada);
Ref<EditorOBJImporter> import_obj2;
import_obj2.instantiate();
- import_scene->add_importer(import_obj2);
+ ResourceImporterScene::add_importer(import_obj2);
Ref<EditorSceneFormatImporterESCN> import_escn;
import_escn.instantiate();
- import_scene->add_importer(import_escn);
+ ResourceImporterScene::add_importer(import_escn);
}
Ref<ResourceImporterBitMap> import_bitmap;
@@ -7168,7 +7172,7 @@ EditorNode::EditorNode() {
_update_recent_scenes();
editor_data.restore_editor_global_states();
- set_process_unhandled_input(true);
+ set_process_shortcut_input(true);
load_errors = memnew(RichTextLabel);
load_error_dialog = memnew(AcceptDialog);
@@ -7245,6 +7249,7 @@ EditorNode::EditorNode() {
EditorNode::~EditorNode() {
EditorInspector::cleanup_plugins();
EditorTranslationParser::get_singleton()->clean_parsers();
+ ResourceImporterScene::clean_up_importer_plugins();
remove_print_handler(&print_handler);
EditorHelp::cleanup_doc();