From 508d7248f912fac86de4ca9ccc79c4686bdb1081 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Fri, 4 Feb 2022 15:12:45 -0500 Subject: [PATCH] v1.2.0: increased game log length in full UI --- .../shatteredpixel/shatteredpixeldungeon/ui/GameLog.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/GameLog.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/GameLog.java index 7777df49d..ee2dcfee7 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/GameLog.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/GameLog.java @@ -21,6 +21,7 @@ package com.shatteredpixel.shatteredpixeldungeon.ui; +import com.shatteredpixel.shatteredpixeldungeon.SPDSettings; import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene; import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite; import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; @@ -52,6 +53,7 @@ public class GameLog extends Component implements Signal.Listener { @Override public synchronized void update() { + int maxLines = SPDSettings.interfaceSize() > 0 ? 5 : 3; for (String text : textsToAdd){ if (length != entries.size()){ clear(); @@ -81,7 +83,7 @@ public class GameLog extends Component implements Signal.Listener { color = CharSprite.NEUTRAL; } - if (lastEntry != null && color == lastColor && lastEntry.nLines < MAX_LINES) { + if (lastEntry != null && color == lastColor && lastEntry.nLines < maxLines) { String lastMessage = lastEntry.text(); lastEntry.text( lastMessage.length() == 0 ? text : lastMessage + " " + text ); @@ -108,14 +110,14 @@ public class GameLog extends Component implements Signal.Listener { nLines += ((RenderedTextBlock) members.get(i)).nLines; } - if (nLines > MAX_LINES) { + if (nLines > maxLines) { RenderedTextBlock r = ((RenderedTextBlock) members.get(0)); remove(r); r.destroy(); entries.remove( 0 ); } - } while (nLines > MAX_LINES); + } while (nLines > maxLines); if (entries.isEmpty()) { lastEntry = null; }