Skip to content

Commit

Permalink
Adjust color of text on music toasts
Browse files Browse the repository at this point in the history
  • Loading branch information
AliahX committed Jun 9, 2023
1 parent 520a326 commit cff9233
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/main/java/com/aliahx/mixtape/toast/MusicToast.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,15 @@ public Toast.Visibility draw(DrawContext context, ToastManager manager, long sta
}

int albumCoverOffset = config.musicToastConfig.showAlbumCover ? 30 : 6;
drawScrollableText(context, manager.getClient().textRenderer, Text.of(config.musicToastConfig.showArtistName ? ARTIST.getString() + " - " + NAME.getString() : NAME.getString()), albumCoverOffset, 0, 154, 20);
drawScrollableText(context, manager.getClient().textRenderer, Text.of(config.musicToastConfig.showArtistName ? ARTIST.getString() + " - " + NAME.getString() : NAME.getString()), albumCoverOffset, 0, 154, 20, -11534256);
if(config.musicToastConfig.showAlbumName) {
drawScrollableText(context, manager.getClient().textRenderer, ALBUM, albumCoverOffset, 10, 154, 30);
drawScrollableText(context, manager.getClient().textRenderer, ALBUM, albumCoverOffset, 10, 154, 30, -16777216);
}

return (double)(startTime) >= DURATION * manager.getNotificationDisplayTimeMultiplier() ? Toast.Visibility.HIDE : Toast.Visibility.SHOW;
}

static void drawScrollableText(DrawContext context, TextRenderer textRenderer, Text text, int left, int top, int right, int bottom) {
static void drawScrollableText(DrawContext context, TextRenderer textRenderer, Text text, int left, int top, int right, int bottom, int color) {
int i = textRenderer.getWidth(text);
int var10000 = top + bottom;
Objects.requireNonNull(textRenderer);
Expand All @@ -90,10 +90,10 @@ static void drawScrollableText(DrawContext context, TextRenderer textRenderer, T
int y = (int) matrices.peek().getPositionMatrix().translate(FORWARD_SHIFT).get(3, 1);

context.enableScissor(x + left, y + top, x + right, y + bottom);
context.drawText(textRenderer, text, left - g, j, -11534256, false);
context.drawText(textRenderer, text, left - g, j, color, false);
context.disableScissor();
} else {
context.drawText(textRenderer, text, left, j, -11534256, false);
context.drawText(textRenderer, text, left, j, color, false);
}
}

Expand Down

0 comments on commit cff9233

Please sign in to comment.