From c195c0df6b36debc870216dd42e49fbda70fa861 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Tue, 17 May 2016 18:27:15 -0300 Subject: -Added configuration warning system for nodes -Added a new "add" and "instance" buttons for scene tree -Added a vformat() function to ease translation work --- scene/2d/sample_player_2d.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'scene/2d/sample_player_2d.cpp') diff --git a/scene/2d/sample_player_2d.cpp b/scene/2d/sample_player_2d.cpp index bf0913023..4d719b532 100644 --- a/scene/2d/sample_player_2d.cpp +++ b/scene/2d/sample_player_2d.cpp @@ -103,6 +103,7 @@ void SamplePlayer2D::set_sample_library(const Ref& p_library) { library=p_library; _change_notify(); + update_configuration_warning(); } Ref SamplePlayer2D::get_sample_library() const { @@ -207,6 +208,14 @@ float SamplePlayer2D::get_random_pitch_scale() const { return random_pitch_scale; } +String SamplePlayer2D::get_configuration_warning() const { + + if (library.is_null()) { + return TTR("A SampleLibrary resource must be created or set in the 'samples' property in order for SamplePlayer to play sound."); + } + + return String(); +} void SamplePlayer2D::_bind_methods() { -- cgit v1.2.3-70-g09d2