v1.2.0: increased game log length in full UI
This commit is contained in:
parent
dfdd0648de
commit
508d7248f9
|
@ -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<String> {
|
|||
|
||||
@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<String> {
|
|||
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<String> {
|
|||
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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user