summaryrefslogtreecommitdiff
path: root/scene/2d/canvas_modulate.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'scene/2d/canvas_modulate.cpp')
-rw-r--r--scene/2d/canvas_modulate.cpp23
1 files changed, 9 insertions, 14 deletions
diff --git a/scene/2d/canvas_modulate.cpp b/scene/2d/canvas_modulate.cpp
index 5d5aaae505..4de99959a3 100644
--- a/scene/2d/canvas_modulate.cpp
+++ b/scene/2d/canvas_modulate.cpp
@@ -51,7 +51,7 @@ void CanvasModulate::_notification(int p_what) {
remove_from_group("_canvas_modulate_" + itos(get_canvas().get_id()));
}
- update_configuration_warning();
+ update_configuration_warnings();
}
}
@@ -73,24 +73,19 @@ Color CanvasModulate::get_color() const {
return color;
}
-String CanvasModulate::get_configuration_warning() const {
- if (!is_visible_in_tree() || !is_inside_tree()) {
- return String();
- }
-
- String warning = Node2D::get_configuration_warning();
+TypedArray<String> CanvasModulate::get_configuration_warnings() const {
+ TypedArray<String> warnings = Node::get_configuration_warnings();
- List<Node *> nodes;
- get_tree()->get_nodes_in_group("_canvas_modulate_" + itos(get_canvas().get_id()), &nodes);
+ if (is_visible_in_tree() && is_inside_tree()) {
+ List<Node *> nodes;
+ get_tree()->get_nodes_in_group("_canvas_modulate_" + itos(get_canvas().get_id()), &nodes);
- if (nodes.size() > 1) {
- if (!warning.is_empty()) {
- warning += "\n\n";
+ if (nodes.size() > 1) {
+ warnings.push_back(TTR("Only one visible CanvasModulate is allowed per scene (or set of instantiated scenes). The first created one will work, while the rest will be ignored."));
}
- warning += TTR("Only one visible CanvasModulate is allowed per scene (or set of instanced scenes). The first created one will work, while the rest will be ignored.");
}
- return warning;
+ return warnings;
}
CanvasModulate::CanvasModulate() {