Fix warning printing for `VisualShaderNodeTextureParameter`

This commit is contained in:
Yuri Rubinsky 2024-07-22 11:16:12 +03:00
parent e25f3c0d38
commit 7c9afbc139
1 changed files with 11 additions and 3 deletions

View File

@ -6498,6 +6498,8 @@ bool VisualShaderNodeTextureParameter::is_show_prop_names() const {
} }
String VisualShaderNodeTextureParameter::get_warning(Shader::Mode p_mode, VisualShader::Type p_type) const { String VisualShaderNodeTextureParameter::get_warning(Shader::Mode p_mode, VisualShader::Type p_type) const {
String warning = VisualShaderNodeParameter::get_warning(p_mode, p_type);
if (texture_source != SOURCE_NONE) { if (texture_source != SOURCE_NONE) {
String texture_source_str; String texture_source_str;
@ -6528,7 +6530,10 @@ String VisualShaderNodeTextureParameter::get_warning(Shader::Mode p_mode, Visual
default: default:
break; break;
} }
return vformat(RTR("'%s' type is incompatible with '%s' source."), texture_type_str, texture_source_str); if (!warning.is_empty()) {
warning += "\n";
}
warning += vformat(RTR("'%s' type is incompatible with '%s' source."), texture_type_str, texture_source_str);
} else if (color_default != COLOR_DEFAULT_WHITE) { } else if (color_default != COLOR_DEFAULT_WHITE) {
String color_default_str; String color_default_str;
@ -6542,11 +6547,14 @@ String VisualShaderNodeTextureParameter::get_warning(Shader::Mode p_mode, Visual
default: default:
break; break;
} }
return vformat(RTR("'%s' default color is incompatible with '%s' source."), color_default_str, texture_source_str); if (!warning.is_empty()) {
warning += "\n";
}
warning += vformat(RTR("'%s' default color is incompatible with '%s' source."), color_default_str, texture_source_str);
} }
} }
return ""; return warning;
} }
HashMap<StringName, String> VisualShaderNodeTextureParameter::get_editable_properties_names() const { HashMap<StringName, String> VisualShaderNodeTextureParameter::get_editable_properties_names() const {