Merge pull request #94611 from Chaosus/vs_fix_texture_warning

Fix warning printing for `VisualShaderNodeTextureParameter`
This commit is contained in:
Rémi Verschelde 2024-07-22 14:13:20 +02:00
commit 962c2512c3
No known key found for this signature in database
GPG Key ID: C3336907360768E1
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 warning = VisualShaderNodeParameter::get_warning(p_mode, p_type);
if (texture_source != SOURCE_NONE) {
String texture_source_str;
@ -6528,7 +6530,10 @@ String VisualShaderNodeTextureParameter::get_warning(Shader::Mode p_mode, Visual
default:
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) {
String color_default_str;
@ -6542,11 +6547,14 @@ String VisualShaderNodeTextureParameter::get_warning(Shader::Mode p_mode, Visual
default:
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 {