summaryrefslogtreecommitdiffstats
path: root/scene/2d/animated_sprite.cpp
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2016-05-17 18:27:15 -0300
committerJuan Linietsky <reduzio@gmail.com>2016-05-17 18:28:44 -0300
commitc195c0df6b36debc870216dd42e49fbda70fa861 (patch)
tree194a26e39ace86d7a471f3e86159c2aed6be261c /scene/2d/animated_sprite.cpp
parent3a26e14a2bab777c9ba6aedceff6e4ef2666faf0 (diff)
downloadredot-engine-c195c0df6b36debc870216dd42e49fbda70fa861.tar.gz
-Added configuration warning system for nodes
-Added a new "add" and "instance" buttons for scene tree -Added a vformat() function to ease translation work
Diffstat (limited to 'scene/2d/animated_sprite.cpp')
-rw-r--r--scene/2d/animated_sprite.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/scene/2d/animated_sprite.cpp b/scene/2d/animated_sprite.cpp
index 1d2f912784..c062a6d1fc 100644
--- a/scene/2d/animated_sprite.cpp
+++ b/scene/2d/animated_sprite.cpp
@@ -452,6 +452,7 @@ void AnimatedSprite::set_sprite_frames(const Ref<SpriteFrames> &p_frames) {
_change_notify();
_reset_timeout();
update();
+ update_configuration_warning();
}
@@ -486,6 +487,8 @@ void AnimatedSprite::set_frame(int p_frame) {
_change_notify("frame");
emit_signal(SceneStringNames::get_singleton()->frame_changed);
+
+
}
int AnimatedSprite::get_frame() const {
@@ -646,6 +649,15 @@ StringName AnimatedSprite::get_animation() const{
return animation;
}
+String AnimatedSprite::get_configuration_warning() const {
+
+ if (frames.is_null()) {
+ return TTR("A SpriteFrames resource must be created or set in the 'Frames' property in order for AnimatedSprite to display frames.");
+ }
+
+ return String();
+}
+
void AnimatedSprite::_bind_methods() {