diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/ui/GameLog.java b/src/com/shatteredpixel/shatteredpixeldungeon/ui/GameLog.java index d54132959..1760f1fa0 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/ui/GameLog.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/ui/GameLog.java @@ -53,6 +53,7 @@ public class GameLog extends Component implements Signal.Listener { for (Entry entry : entries) { lastEntry = PixelScene.createMultiline( entry.text, 6 ); lastEntry.hardlight( lastColor = entry.color ); + lastEntry.measure(); add( lastEntry ); } } @@ -64,6 +65,11 @@ public class GameLog extends Component implements Signal.Listener { @Override public void onSignal( String text ) { + if (length != entries.size()){ + clear(); + recreateLines(); + } + int color = CharSprite.DEFAULT; if (text.startsWith( GLog.POSITIVE )) { text = text.substring( GLog.POSITIVE.length() ); @@ -97,6 +103,7 @@ public class GameLog extends Component implements Signal.Listener { lastEntry = PixelScene.createMultiline( text, 6 ); lastEntry.hardlight( color ); + lastEntry.measure(); lastColor = color; add( lastEntry ); @@ -108,7 +115,7 @@ public class GameLog extends Component implements Signal.Listener { int nLines; do { nLines = 0; - for (int i = 0; i < length; i++) { + for (int i = 0; i < length-1; i++) { nLines += ((BitmapTextMultiline) members.get(i)).nLines; }