From 72d8e81622e5fa396a61e1309e0c965a05af58ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Wed, 18 May 2016 22:44:39 +0200 Subject: LabelStack,Msg: update Msg if LabelStack pops a message --- core/src/ch/asynk/rustanddust/ui/LabelStack.java | 3 ++- core/src/ch/asynk/rustanddust/ui/Msg.java | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/core/src/ch/asynk/rustanddust/ui/LabelStack.java b/core/src/ch/asynk/rustanddust/ui/LabelStack.java index 15b0117..b534f45 100644 --- a/core/src/ch/asynk/rustanddust/ui/LabelStack.java +++ b/core/src/ch/asynk/rustanddust/ui/LabelStack.java @@ -57,13 +57,14 @@ public class LabelStack extends Label implements Animation @Override public boolean animate(float delta) { - if (!visible) return true; + if (!visible) return false; elapsed += delta; if (elapsed >= duration) { visible = false; if (stack.size() > 0) { MsgInfo info = stack.pop(); write(info.text, info.duration, info.position); + return true; } } return false; diff --git a/core/src/ch/asynk/rustanddust/ui/Msg.java b/core/src/ch/asynk/rustanddust/ui/Msg.java index 16c4e2d..5e5f4b6 100644 --- a/core/src/ch/asynk/rustanddust/ui/Msg.java +++ b/core/src/ch/asynk/rustanddust/ui/Msg.java @@ -58,7 +58,9 @@ public class Msg extends Patch public boolean animate(float delta) { - return label.animate(delta); + if (label.animate(delta)) + resize(); + return true; } @Override -- cgit v1.1-2-g2b99