Improve editor theme generation after the refactor

This commit is contained in:
Yuri Sizov 2024-01-17 15:03:55 +01:00
parent 107f2961cc
commit 45eedba1fa
17 changed files with 221 additions and 108 deletions

View file

@ -36,10 +36,10 @@
#include "core/version.h"
#include "editor/editor_file_system.h"
#include "editor/editor_node.h"
#include "editor/editor_settings.h"
#include "editor/gui/editor_toaster.h"
#include "editor/import/resource_importer_texture_settings.h"
#include "editor/themes/editor_scale.h"
#include "editor/themes/editor_theme_manager.h"
#include "scene/resources/compressed_texture.h"
void ResourceImporterTexture::_texture_reimport_roughness(const Ref<CompressedTexture2D> &p_tex, const String &p_normal_path, RS::TextureDetectRoughnessChannel p_channel) {
@ -696,7 +696,7 @@ Error ResourceImporterTexture::import(const String &p_source_file, const String
editor_meta["editor_scale"] = EDSCALE;
}
if (convert_editor_colors) {
editor_meta["editor_dark_theme"] = EditorSettings::get_singleton()->is_dark_theme();
editor_meta["editor_dark_theme"] = EditorThemeManager::is_dark_theme();
}
_save_editor_meta(editor_meta, p_save_path + ".editor.meta");
@ -755,7 +755,7 @@ bool ResourceImporterTexture::are_import_settings_valid(const String &p_path) co
if (editor_meta.has("editor_scale") && (float)editor_meta["editor_scale"] != EDSCALE) {
return false;
}
if (editor_meta.has("editor_dark_theme") && (bool)editor_meta["editor_dark_theme"] != EditorSettings::get_singleton()->is_dark_theme()) {
if (editor_meta.has("editor_dark_theme") && (bool)editor_meta["editor_dark_theme"] != EditorThemeManager::is_dark_theme()) {
return false;
}
}