Add EditorStringNames singleton

This commit is contained in:
kobewi 2023-08-13 02:33:39 +02:00
parent fa3428ff25
commit 6de34fde27
176 changed files with 2549 additions and 2325 deletions

View file

@ -37,6 +37,7 @@
#include "editor/editor_node.h"
#include "editor/editor_scale.h"
#include "editor/editor_settings.h"
#include "editor/editor_string_names.h"
#include "scene/gui/item_list.h"
#include "scene/gui/split_container.h"
#include "servers/display_server.h"
@ -67,9 +68,9 @@ void ShaderFileEditor::_version_selected(int p_option) {
Ref<Texture2D> icon;
if (bytecode->get_stage_compile_error(RD::ShaderStage(i)) != String()) {
icon = get_theme_icon(SNAME("ImportFail"), SNAME("EditorIcons"));
icon = get_editor_theme_icon(SNAME("ImportFail"));
} else {
icon = get_theme_icon(SNAME("ImportCheck"), SNAME("EditorIcons"));
icon = get_editor_theme_icon(SNAME("ImportCheck"));
}
stages[i]->set_icon(icon);
@ -96,7 +97,7 @@ void ShaderFileEditor::_version_selected(int p_option) {
String error = bytecode->get_stage_compile_error(stage);
error_text->push_font(get_theme_font(SNAME("source"), SNAME("EditorFonts")));
error_text->push_font(get_theme_font(SNAME("source"), EditorStringName(EditorFonts)));
if (error.is_empty()) {
error_text->add_text(TTR("Shader stage compiled without errors."));
@ -112,7 +113,7 @@ void ShaderFileEditor::_update_options() {
stage_hb->hide();
versions->hide();
error_text->clear();
error_text->push_font(get_theme_font(SNAME("source"), SNAME("EditorFonts")));
error_text->push_font(get_theme_font(SNAME("source"), EditorStringName(EditorFonts)));
error_text->add_text(vformat(TTR("File structure for '%s' contains unrecoverable errors:\n\n"), shader_file->get_path().get_file()));
error_text->add_text(shader_file->get_base_error());
return;
@ -155,9 +156,9 @@ void ShaderFileEditor::_update_options() {
}
if (failed) {
icon = get_theme_icon(SNAME("ImportFail"), SNAME("EditorIcons"));
icon = get_editor_theme_icon(SNAME("ImportFail"));
} else {
icon = get_theme_icon(SNAME("ImportCheck"), SNAME("EditorIcons"));
icon = get_editor_theme_icon(SNAME("ImportCheck"));
}
versions->add_item(title, icon);