|
|
|
@ -2,9 +2,13 @@ package mightypork.rogue.screens.game; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import java.util.Collection; |
|
|
|
|
import java.util.ConcurrentModificationException; |
|
|
|
|
import java.util.LinkedList; |
|
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
|
|
import mightypork.gamecore.gui.AlignX; |
|
|
|
|
import mightypork.gamecore.gui.components.BaseComponent; |
|
|
|
|
import mightypork.gamecore.logging.Log; |
|
|
|
|
import mightypork.gamecore.resources.fonts.FontRenderer; |
|
|
|
|
import mightypork.gamecore.util.math.color.Color; |
|
|
|
|
import mightypork.gamecore.util.math.color.pal.RGB; |
|
|
|
@ -23,7 +27,8 @@ public class WorldConsoleRenderer extends BaseComponent { |
|
|
|
|
private final FontRenderer fr; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public WorldConsoleRenderer(Num rowHeight) { |
|
|
|
|
public WorldConsoleRenderer(Num rowHeight) |
|
|
|
|
{ |
|
|
|
|
this.rowHeight = rowHeight; |
|
|
|
|
this.fr = new FontRenderer(Res.getFont("tiny")); |
|
|
|
|
} |
|
|
|
@ -36,13 +41,16 @@ public class WorldConsoleRenderer extends BaseComponent { |
|
|
|
|
|
|
|
|
|
Rect lowRow = bottomEdge().growUp(rowHeight); |
|
|
|
|
|
|
|
|
|
Collection<Entry> entries = WorldProvider.get().getWorld().getConsole().getEntries(); |
|
|
|
|
Collection<WorldConsole.Entry> entries = WorldProvider.get().getWorld().getConsole().getEntries(); |
|
|
|
|
|
|
|
|
|
int cnt = 0; |
|
|
|
|
|
|
|
|
|
NumVar alph = Num.makeVar(); |
|
|
|
|
|
|
|
|
|
Color.pushAlpha(alph); |
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
|
|
for (WorldConsole.Entry entry : entries) { |
|
|
|
|
|
|
|
|
|
alph.setTo(entry.getAlpha()); |
|
|
|
@ -55,6 +63,10 @@ public class WorldConsoleRenderer extends BaseComponent { |
|
|
|
|
cnt++; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} catch (ConcurrentModificationException e) { |
|
|
|
|
Log.e(e); // this should not happen anymore
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Color.popAlpha(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|