Skip to content

Commit

Permalink
Respect the foreground color in more places in the early display (#153)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jab125 authored Jun 2, 2024
1 parent 69b5811 commit e574c5f
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ private static void startupLogMessages(SimpleBufferBuilder bb, SimpleFont font,
final float fade = clamp((4000.0f - (float) pair.age() - (i - 4) * 1000.0f) / 5000.0f, 0.0f, 1.0f);
if (fade < 0.01f) continue;
Message msg = pair.message();
int colour = Math.min((int) (fade * 255f), globalAlpha) << 24 | 0xFFFFFF;
int colour = context.colourScheme.foreground().packedint(Math.min((int) (fade * 255f), globalAlpha));
texts.add(new SimpleFont.DisplayText(msg.getText() + "\n", colour));
}

Expand All @@ -102,8 +102,8 @@ public static RenderElement mojang(final int textureId, final int frameStart) {
var fade = Math.min((frame - frameStart) * 10, 255);
glBindTexture(GL_TEXTURE_2D, textureId);
bb.begin(SimpleBufferBuilder.Format.POS_TEX_COLOR, SimpleBufferBuilder.Mode.QUADS);
QuadHelper.loadQuad(bb, x0, x0 + size, y0, y0 + size / 2f, 0f, 1f, 0f, 0.5f, (fade << 24) | 0xFFFFFF);
QuadHelper.loadQuad(bb, x0 + size, x0 + 2 * size, y0, y0 + size / 2f, 0f, 1f, 0.5f, 1f, (fade << 24) | 0xFFFFFF);
QuadHelper.loadQuad(bb, x0, x0 + size, y0, y0 + size / 2f, 0f, 1f, 0f, 0.5f, ctx.colourScheme.foreground().packedint(fade));
QuadHelper.loadQuad(bb, x0 + size, x0 + 2 * size, y0, y0 + size / 2f, 0f, 1f, 0.5f, 1f, ctx.colourScheme.foreground().packedint(fade));
bb.draw();
glBindTexture(GL_TEXTURE_2D, 0);
});
Expand Down Expand Up @@ -179,7 +179,7 @@ public static void startupProgressBars(SimpleFont font, final SimpleBufferBuilde
private static Renderer barRenderer(int cnt, int alpha, SimpleFont font, ProgressMeter pm, DisplayContext context) {
var barSpacing = font.lineSpacing() - font.descent() + BAR_HEIGHT;
var y = 250 * context.scale() + cnt * barSpacing;
var colour = (alpha << 24) | 0xFFFFFF;
var colour = context.colourScheme.foreground().packedint(alpha);
Renderer bar;
if (pm.steps() == 0) {
bar = progressBar(ctx -> new int[] { (ctx.scaledWidth() - BAR_WIDTH * ctx.scale()) / 2, y + font.lineSpacing() - font.descent(), BAR_WIDTH * ctx.scale() }, f -> colour, frame -> indeterminateBar(frame, cnt == 0));
Expand Down

0 comments on commit e574c5f

Please sign in to comment.