feat: modules moved and engine moved to submodule
This commit is contained in:
parent
dfb5e645cd
commit
c33d2130cc
5136 changed files with 225275 additions and 64485 deletions
|
|
@ -317,12 +317,8 @@ void DependencyEditorOwners::_list_rmb_clicked(int p_item, const Vector2 &p_pos,
|
|||
|
||||
void DependencyEditorOwners::_select_file(int p_idx) {
|
||||
String fpath = owners->get_item_text(p_idx);
|
||||
EditorNode::get_singleton()->load_scene_or_resource(fpath);
|
||||
|
||||
if (ResourceLoader::get_resource_type(fpath) == "PackedScene") {
|
||||
EditorNode::get_singleton()->open_request(fpath);
|
||||
} else {
|
||||
EditorNode::get_singleton()->load_resource(fpath);
|
||||
}
|
||||
hide();
|
||||
emit_signal(SceneStringName(confirmed));
|
||||
}
|
||||
|
|
@ -467,17 +463,16 @@ void DependencyRemoveDialog::_find_localization_remaps_of_removed_files(Vector<R
|
|||
p_removed.push_back(dep);
|
||||
}
|
||||
|
||||
Array remap_keys = remaps.keys();
|
||||
for (int j = 0; j < remap_keys.size(); j++) {
|
||||
PackedStringArray remapped_files = remaps[remap_keys[j]];
|
||||
for (int k = 0; k < remapped_files.size(); k++) {
|
||||
int splitter_pos = remapped_files[k].rfind_char(':');
|
||||
String res_path = remapped_files[k].substr(0, splitter_pos);
|
||||
for (const KeyValue<Variant, Variant> &remap_kv : remaps) {
|
||||
PackedStringArray remapped_files = remap_kv.value;
|
||||
for (const String &remapped_file : remapped_files) {
|
||||
int splitter_pos = remapped_file.rfind_char(':');
|
||||
String res_path = remapped_file.substr(0, splitter_pos);
|
||||
if (res_path == path) {
|
||||
String locale_name = remapped_files[k].substr(splitter_pos + 1);
|
||||
String locale_name = remapped_file.substr(splitter_pos + 1);
|
||||
|
||||
RemovedDependency dep;
|
||||
dep.file = vformat(TTR("Localization remap for path '%s' and locale '%s'."), remap_keys[j], locale_name);
|
||||
dep.file = vformat(TTR("Localization remap for path '%s' and locale '%s'."), remap_kv.key, locale_name);
|
||||
dep.file_type = "";
|
||||
dep.dependency = path;
|
||||
dep.dependency_folder = files.value;
|
||||
|
|
@ -589,34 +584,19 @@ void DependencyRemoveDialog::ok_pressed() {
|
|||
}
|
||||
}
|
||||
|
||||
HashMap<String, StringName> setting_path_map;
|
||||
for (const StringName &setting : path_project_settings) {
|
||||
const String path = ResourceUID::ensure_path(GLOBAL_GET(setting));
|
||||
setting_path_map[path] = setting;
|
||||
}
|
||||
|
||||
bool project_settings_modified = false;
|
||||
for (const String &file : files_to_delete) {
|
||||
// If the file we are deleting for e.g. the main scene, default environment,
|
||||
// or audio bus layout, we must clear its definition in Project Settings.
|
||||
if (file == ResourceUID::ensure_path(GLOBAL_GET("application/config/icon"))) {
|
||||
ProjectSettings::get_singleton()->set("application/config/icon", "");
|
||||
project_settings_modified = true;
|
||||
} else if (file == ResourceUID::ensure_path(GLOBAL_GET("application/run/main_scene"))) {
|
||||
ProjectSettings::get_singleton()->set("application/run/main_scene", "");
|
||||
project_settings_modified = true;
|
||||
} else if (file == ResourceUID::ensure_path(GLOBAL_GET("application/boot_splash/image"))) {
|
||||
ProjectSettings::get_singleton()->set("application/boot_splash/image", "");
|
||||
project_settings_modified = true;
|
||||
} else if (file == ResourceUID::ensure_path(GLOBAL_GET("rendering/environment/defaults/default_environment"))) {
|
||||
ProjectSettings::get_singleton()->set("rendering/environment/defaults/default_environment", "");
|
||||
project_settings_modified = true;
|
||||
} else if (file == ResourceUID::ensure_path(GLOBAL_GET("display/mouse_cursor/custom_image"))) {
|
||||
ProjectSettings::get_singleton()->set("display/mouse_cursor/custom_image", "");
|
||||
project_settings_modified = true;
|
||||
} else if (file == ResourceUID::ensure_path(GLOBAL_GET("gui/theme/custom"))) {
|
||||
ProjectSettings::get_singleton()->set("gui/theme/custom", "");
|
||||
project_settings_modified = true;
|
||||
} else if (file == ResourceUID::ensure_path(GLOBAL_GET("gui/theme/custom_font"))) {
|
||||
ProjectSettings::get_singleton()->set("gui/theme/custom_font", "");
|
||||
project_settings_modified = true;
|
||||
} else if (file == ResourceUID::ensure_path(GLOBAL_GET("audio/buses/default_bus_layout"))) {
|
||||
ProjectSettings::get_singleton()->set("audio/buses/default_bus_layout", "");
|
||||
project_settings_modified = true;
|
||||
const StringName *setting_name = setting_path_map.getptr(file);
|
||||
if (setting_name) {
|
||||
ProjectSettings::get_singleton()->set(*setting_name, "");
|
||||
}
|
||||
|
||||
const String path = OS::get_singleton()->get_resource_dir() + file.replace_first("res://", "/");
|
||||
|
|
@ -632,7 +612,7 @@ void DependencyRemoveDialog::ok_pressed() {
|
|||
ProjectSettings::get_singleton()->save();
|
||||
}
|
||||
|
||||
if (dirs_to_delete.size() == 0) {
|
||||
if (dirs_to_delete.is_empty()) {
|
||||
// If we only deleted files we should only need to tell the file system about the files we touched.
|
||||
for (int i = 0; i < files_to_delete.size(); ++i) {
|
||||
EditorFileSystem::get_singleton()->update_file(files_to_delete[i]);
|
||||
|
|
@ -698,6 +678,7 @@ DependencyRemoveDialog::DependencyRemoveDialog() {
|
|||
files_to_delete_list->set_h_size_flags(Control::SIZE_EXPAND_FILL);
|
||||
files_to_delete_list->set_v_size_flags(Control::SIZE_EXPAND_FILL);
|
||||
files_to_delete_list->set_custom_minimum_size(Size2(0, 94) * EDSCALE);
|
||||
files_to_delete_list->set_accessibility_name(TTRC("Files to be Deleted"));
|
||||
vb->add_child(files_to_delete_list);
|
||||
|
||||
vb_owners = memnew(VBoxContainer);
|
||||
|
|
@ -714,14 +695,22 @@ DependencyRemoveDialog::DependencyRemoveDialog() {
|
|||
owners->set_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED);
|
||||
owners->set_hide_root(true);
|
||||
owners->set_custom_minimum_size(Size2(0, 94) * EDSCALE);
|
||||
owners->set_accessibility_name(TTRC("Dependencies"));
|
||||
vb_owners->add_child(owners);
|
||||
owners->set_v_size_flags(Control::SIZE_EXPAND_FILL);
|
||||
|
||||
List<PropertyInfo> property_list;
|
||||
ProjectSettings::get_singleton()->get_property_list(&property_list);
|
||||
for (const PropertyInfo &pi : property_list) {
|
||||
if (pi.type == Variant::STRING && pi.hint == PROPERTY_HINT_FILE) {
|
||||
path_project_settings.push_back(pi.name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//////////////
|
||||
|
||||
void DependencyErrorDialog::show(Mode p_mode, const String &p_for_file, const Vector<String> &report) {
|
||||
mode = p_mode;
|
||||
void DependencyErrorDialog::show(const String &p_for_file, const Vector<String> &report) {
|
||||
for_file = p_for_file;
|
||||
set_title(TTR("Error loading:") + " " + p_for_file.get_file());
|
||||
files->clear();
|
||||
|
|
@ -746,14 +735,7 @@ void DependencyErrorDialog::show(Mode p_mode, const String &p_for_file, const Ve
|
|||
}
|
||||
|
||||
void DependencyErrorDialog::ok_pressed() {
|
||||
switch (mode) {
|
||||
case MODE_SCENE:
|
||||
EditorNode::get_singleton()->load_scene(for_file, true);
|
||||
break;
|
||||
case MODE_RESOURCE:
|
||||
EditorNode::get_singleton()->load_resource(for_file, true);
|
||||
break;
|
||||
}
|
||||
EditorNode::get_singleton()->load_scene_or_resource(for_file, true);
|
||||
}
|
||||
|
||||
void DependencyErrorDialog::custom_action(const String &) {
|
||||
|
|
@ -778,8 +760,6 @@ DependencyErrorDialog::DependencyErrorDialog() {
|
|||
vb->add_child(text);
|
||||
text->set_text(TTR("Which action should be taken?"));
|
||||
|
||||
mode = Mode::MODE_RESOURCE;
|
||||
|
||||
fdep = add_button(TTR("Fix Dependencies"), true, "fixdeps");
|
||||
|
||||
set_title(TTR("Errors loading!"));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue