You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-12-01 16:38:31 +00:00
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:
@@ -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();
|
||||
}
|
||||
TypedArray<String> CanvasModulate::get_configuration_warnings() const {
|
||||
TypedArray<String> warnings = Node::get_configuration_warnings();
|
||||
|
||||
String warning = Node2D::get_configuration_warning();
|
||||
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);
|
||||
|
||||
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 instanced 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() {
|
||||
|
||||
Reference in New Issue
Block a user