From 2a8c59c171e609d739dcc59d15e3e205dbf47cde Mon Sep 17 00:00:00 2001 From: Nathan Franke Date: Thu, 29 Oct 2020 05:01:28 -0500 Subject: Use Array for node configuration warnings Previously, the warnings were passed as a string and delimitation of which were hard coded at each implementation. --- scene/gui/scroll_container.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'scene/gui/scroll_container.cpp') diff --git a/scene/gui/scroll_container.cpp b/scene/gui/scroll_container.cpp index 757a0841ea..73c6371658 100644 --- a/scene/gui/scroll_container.cpp +++ b/scene/gui/scroll_container.cpp @@ -544,8 +544,8 @@ void ScrollContainer::set_follow_focus(bool p_follow) { follow_focus = p_follow; } -String ScrollContainer::get_configuration_warning() const { - String warning = Container::get_configuration_warning(); +TypedArray ScrollContainer::get_configuration_warnings() const { + TypedArray warnings = Container::get_configuration_warnings(); int found = 0; @@ -565,12 +565,10 @@ String ScrollContainer::get_configuration_warning() const { } if (found != 1) { - if (!warning.is_empty()) { - warning += "\n\n"; - } - warning += TTR("ScrollContainer is intended to work with a single child control.\nUse a container as child (VBox, HBox, etc.), or a Control and set the custom minimum size manually."); + warnings.push_back(TTR("ScrollContainer is intended to work with a single child control.\nUse a container as child (VBox, HBox, etc.), or a Control and set the custom minimum size manually.")); } - return warning; + + return warnings; } HScrollBar *ScrollContainer::get_h_scrollbar() { -- cgit v1.2.3