Merge pull request #9 from Fretuks/enhance-screen-appearance

Polish shrine and stats screen styling
This commit is contained in:
2026-01-25 09:57:22 +01:00
committed by GitHub
2 changed files with 29 additions and 20 deletions
@@ -143,26 +143,29 @@ public class ShrineScreen extends Screen {
public void render(GuiGraphics gui, int mouseX, int mouseY, float partialTicks) { public void render(GuiGraphics gui, int mouseX, int mouseY, float partialTicks) {
this.renderBackground(gui); this.renderBackground(gui);
RenderSystem.enableBlend(); RenderSystem.enableBlend();
gui.fill(leftPos - 6, topPos - 6, leftPos + WIDTH + 6, topPos + HEIGHT + 6, 0xCC000000); gui.fill(leftPos - 8, topPos - 8, leftPos + WIDTH + 8, topPos + HEIGHT + 8, 0xDD0D0B14);
gui.fill(leftPos - 4, topPos - 4, leftPos + WIDTH + 4, topPos + HEIGHT + 4, 0xE01A1424);
gui.fill(leftPos - 4, topPos - 4, leftPos + WIDTH + 4, topPos + 20, 0xFF2A1F3A);
gui.fill(leftPos - 4, topPos + 20, leftPos + WIDTH + 4, topPos + 21, 0x66FFFFFF);
RenderSystem.disableBlend(); RenderSystem.disableBlend();
int titleColor = 0xAA55FF; int titleColor = 0xCDA1FF;
gui.drawCenteredString(this.font, "Shrine of Remembrance", this.width / 2, topPos, 0xFFFFFF); gui.drawCenteredString(this.font, "Shrine of Remembrance", this.width / 2, topPos + 6, 0xFFFFFF);
gui.drawCenteredString(this.font, "Knowledge: " + playerKnowledge, this.width / 2, topPos + 20, 0x55FFAA); gui.drawCenteredString(this.font, "Knowledge: " + playerKnowledge, this.width / 2, topPos + 28, 0x8FEBD2);
switch (dialogueStage) { switch (dialogueStage) {
case 0 -> { case 0 -> {
gui.drawCenteredString(this.font, "SPEAK, LITTLE ONE.", this.width / 2, topPos + 40, titleColor); gui.drawCenteredString(this.font, "SPEAK, LITTLE ONE.", this.width / 2, topPos + 46, titleColor);
gui.drawCenteredString(this.font, "WHAT IS IT YOU SEEK TO UNMAKE?", this.width / 2, topPos + 55, titleColor); gui.drawCenteredString(this.font, "WHAT IS IT YOU SEEK TO UNMAKE?", this.width / 2, topPos + 62, titleColor);
} }
case 1 -> { case 1 -> {
gui.drawCenteredString(this.font, "THE TERMS ARE AS FOLLOWS:", this.width / 2, topPos + 40, titleColor); gui.drawCenteredString(this.font, "THE TERMS ARE AS FOLLOWS:", this.width / 2, topPos + 46, titleColor);
gui.drawCenteredString(this.font, "I WILL CONSUME YOUR KNOWLEDGE.", this.width / 2, topPos + 55, titleColor); gui.drawCenteredString(this.font, "I WILL CONSUME YOUR KNOWLEDGE.", this.width / 2, topPos + 62, titleColor);
gui.drawCenteredString(this.font, "YOU WILL REAP A BENEFIT.", this.width / 2, topPos + 70, titleColor); gui.drawCenteredString(this.font, "YOU WILL REAP A BENEFIT.", this.width / 2, topPos + 78, titleColor);
} }
case 2 -> { case 2 -> {
gui.drawCenteredString(this.font, "SPEAK YOUR DESIRE, FOOLISH ONE.", this.width / 2, topPos + 40, titleColor); gui.drawCenteredString(this.font, "SPEAK YOUR DESIRE, FOOLISH ONE.", this.width / 2, topPos + 52, titleColor);
} }
} }
@@ -71,9 +71,12 @@ public class StatsScreen extends Screen {
public void render(GuiGraphics gui, int mouseX, int mouseY, float partialTicks) { public void render(GuiGraphics gui, int mouseX, int mouseY, float partialTicks) {
this.renderBackground(gui); this.renderBackground(gui);
RenderSystem.enableBlend(); RenderSystem.enableBlend();
gui.fill(leftPos - 4, topPos - 4, leftPos + WIDTH + 4, topPos + HEIGHT + 4, 0xAA000000); gui.fill(leftPos - 8, topPos - 8, leftPos + WIDTH + 8, topPos + HEIGHT + 8, 0xDD0C0B12);
gui.fill(leftPos - 4, topPos - 4, leftPos + WIDTH + 4, topPos + HEIGHT + 4, 0xE0181422);
gui.fill(leftPos - 4, topPos - 4, leftPos + WIDTH + 4, topPos + 20, 0xFF2A2036);
gui.fill(leftPos - 4, topPos + 20, leftPos + WIDTH + 4, topPos + 21, 0x66FFFFFF);
RenderSystem.disableBlend(); RenderSystem.disableBlend();
gui.drawCenteredString(this.font, Component.translatable("ascend.stats.title"), this.width / 2, topPos + 8, 0xFFFFFF); gui.drawCenteredString(this.font, Component.translatable("ascend.stats.title"), this.width / 2, topPos + 6, 0xFFFFFF);
hoveredAttributeKey = null; hoveredAttributeKey = null;
if (mc.player != null) { if (mc.player != null) {
mc.player.getCapability(PlayerStatsProvider.PLAYER_STATS).ifPresent(stats -> { mc.player.getCapability(PlayerStatsProvider.PLAYER_STATS).ifPresent(stats -> {
@@ -81,22 +84,25 @@ public class StatsScreen extends Screen {
int xp = stats.getAscendXP(); int xp = stats.getAscendXP();
int xpNext = stats.getXPToNextAscendLevel(); int xpNext = stats.getXPToNextAscendLevel();
int unspent = stats.getUnspentPoints(); int unspent = stats.getUnspentPoints();
gui.drawString(font, Component.translatable("ascend.stats.level", level, 20), leftPos + 10, topPos + 24, 0xFFFF55); gui.drawString(font, Component.translatable("ascend.stats.level", level, 20), leftPos + 10, topPos + 28, 0xFFE27D);
if (level < 20) { if (level < 20) {
gui.drawString(font, Component.translatable("ascend.stats.xp", xp, xpNext), leftPos + 10, topPos + 36, 0xAAAAAA); gui.drawString(font, Component.translatable("ascend.stats.xp", xp, xpNext), leftPos + 10, topPos + 40, 0xB4B4C8);
} else { } else {
gui.drawString(font, Component.translatable("ascend.stats.xp_max"), leftPos + 10, topPos + 36, 0xAAAAAA); gui.drawString(font, Component.translatable("ascend.stats.xp_max"), leftPos + 10, topPos + 40, 0xB4B4C8);
} }
int unspentLabelWidth = font.width("Unspent Points: " + unspent);
int unspentX = leftPos + WIDTH - 10 - unspentLabelWidth;
gui.fill(unspentX - 6, topPos + 24, leftPos + WIDTH - 4, topPos + 38, 0x662D3B1E);
gui.drawString(font, Component.translatable("ascend.stats.unspent", unspent), gui.drawString(font, Component.translatable("ascend.stats.unspent", unspent),
leftPos + WIDTH - 10 - font.width("Unspent Points: " + unspent), topPos + 24, 0x55FF55); unspentX, topPos + 28, 0x8CFF8C);
int y = topPos + 55; int y = topPos + 64;
for (String key : ATTRIBUTES) { for (String key : ATTRIBUTES) {
int attrLevel = stats.getAttributeLevel(key); int attrLevel = stats.getAttributeLevel(key);
int cost = stats.getCostToUpgrade(key); int cost = stats.getCostToUpgrade(key);
Component name = Component.translatable("ascend.attribute." + key); Component name = Component.translatable("ascend.attribute." + key);
Component label = Component.translatable("ascend.attribute.display", name, attrLevel); Component label = Component.translatable("ascend.attribute.display", name, attrLevel);
int labelX = leftPos + 10; int labelX = leftPos + 10;
gui.drawString(font, label, labelX, y, 0xFFFFFF); gui.drawString(font, label, labelX, y, 0xE6E6F2);
Button plus = plusButtons.get(key); Button plus = plusButtons.get(key);
if (plus != null) { if (plus != null) {