Use Array for node configuration warnings

Previously, the warnings were passed as a string and delimitation of which were hard coded at each implementation.
This commit is contained in:
Nathan Franke
2020-10-29 05:01:28 -05:00
parent 4a1f2dcb74
commit 2a8c59c171
96 changed files with 426 additions and 674 deletions

View File

@@ -373,7 +373,7 @@ void PointLight2D::set_texture(const Ref<Texture2D> &p_texture) {
RS::get_singleton()->canvas_light_set_texture(_get_light(), RID());
}
update_configuration_warning();
update_configuration_warnings();
}
Ref<Texture2D> PointLight2D::get_texture() const {
@@ -390,17 +390,14 @@ Vector2 PointLight2D::get_texture_offset() const {
return texture_offset;
}
String PointLight2D::get_configuration_warning() const {
String warning = Node2D::get_configuration_warning();
TypedArray<String> PointLight2D::get_configuration_warnings() const {
TypedArray<String> warnings = Node::get_configuration_warnings();
if (!texture.is_valid()) {
if (!warning.is_empty()) {
warning += "\n\n";
}
warning += TTR("A texture with the shape of the light must be supplied to the \"Texture\" property.");
warnings.push_back(TTR("A texture with the shape of the light must be supplied to the \"Texture\" property."));
}
return warning;
return warnings;
}
void PointLight2D::set_texture_scale(real_t p_scale) {