diff --git a/src/main/java/com/minelittlepony/unicopia/client/gui/Slot.java b/src/main/java/com/minelittlepony/unicopia/client/gui/Slot.java index 80b7ef78..ced749de 100644 --- a/src/main/java/com/minelittlepony/unicopia/client/gui/Slot.java +++ b/src/main/java/com/minelittlepony/unicopia/client/gui/Slot.java @@ -14,6 +14,7 @@ import com.mojang.blaze3d.systems.RenderSystem; import net.minecraft.client.gui.DrawContext; import net.minecraft.client.util.math.MatrixStack; import net.minecraft.text.MutableText; +import net.minecraft.util.Colors; import net.minecraft.util.Formatting; import net.minecraft.util.math.MathHelper; @@ -145,10 +146,7 @@ class Slot { return; } - MutableText label = KeyBindingsHandler.INSTANCE.getBinding(aSlot).getLabel().copy().formatted(Formatting.BOLD); - - MatrixStack matrices = context.getMatrices(); - matrices.push(); + MutableText label = KeyBindingsHandler.INSTANCE.getBinding(aSlot).getLabel().copy(); int x = getX(); if (uHud.xDirection > 0) { @@ -158,9 +156,6 @@ class Slot { x -= uHud.client.textRenderer.getWidth(label)/2; } - matrices.translate(x, getY() + labelY, 0); - matrices.scale(0.5F, 0.5F, 0.5F); - ActivationType activation = KeyBindingsHandler.INSTANCE.getForcedActivationType(); if (activation.isResult()) { label = label.append("+T" + activation.getTapCount()); @@ -169,8 +164,6 @@ class Slot { } } - context.drawText(uHud.font, label, 0, 0, 0xFFFFFF, true); - - matrices.pop(); + DrawableUtil.drawScaledText(context, label, x, getY() + labelY, 0.5F, Colors.WHITE); } } \ No newline at end of file diff --git a/src/main/java/com/minelittlepony/unicopia/client/gui/UHud.java b/src/main/java/com/minelittlepony/unicopia/client/gui/UHud.java index 1dd0ae28..590ed1e7 100644 --- a/src/main/java/com/minelittlepony/unicopia/client/gui/UHud.java +++ b/src/main/java/com/minelittlepony/unicopia/client/gui/UHud.java @@ -51,8 +51,8 @@ public class UHud { private final List slots = List.of( new ManaRingSlot(this, AbilitySlot.PRIMARY, AbilitySlot.PASSIVE, 0, 0), - new Slot(this, AbilitySlot.SECONDARY, AbilitySlot.SECONDARY, 30, -8), - new Slot(this, AbilitySlot.TERTIARY, AbilitySlot.TERTIARY, 40, 18) + new Slot(this, AbilitySlot.SECONDARY, AbilitySlot.SECONDARY, 30, -10), + new Slot(this, AbilitySlot.TERTIARY, AbilitySlot.TERTIARY, 43, 10) ); @Nullable @@ -137,9 +137,11 @@ public class UHud { slots.forEach(slot -> slot.renderBackground(context, abilities, swap, tickDelta)); + int currentPage = Unicopia.getConfig().hudPage.get(); + int maxPages = pony.getAbilities().getMaxPage(); Ability ability = pony.getAbilities().getStat(AbilitySlot.PRIMARY) - .getAbility(Unicopia.getConfig().hudPage.get()) + .getAbility(currentPage) .orElse(null); boolean canCast = ability == Abilities.CAST || ability == Abilities.KIRIN_CAST || ability == Abilities.SHOOT; @@ -168,6 +170,14 @@ public class UHud { slots.forEach(slot -> slot.renderLabel(context, abilities, tickDelta)); + //if (maxPages > 0) { + DrawableUtil.drawScaledText(context, Text.literal((currentPage + 1) + "/" + (maxPages + 1)), 44, 38, 0.5F, Colors.WHITE); + //down + context.drawTexture(HUD_TEXTURE, 42, 43, 52, currentPage == 0 ? 6 : 0, 6, 6, 128, 128); + //up + context.drawTexture(HUD_TEXTURE, 48, 43, 57, currentPage < maxPages ? 0 : 6, 8, 6, 128, 128); + //} + matrices.pop(); if (canCast) { @@ -188,7 +198,7 @@ public class UHud { int progress = Math.min(255, (int)(time * 255F / 20F)); if (progress > 8) { - int color = 0xFFFFFF; + int color = Colors.WHITE; int alpha = progress << 24 & -16777216; color |= alpha; diff --git a/src/main/resources/assets/unicopia/textures/gui/hud.png b/src/main/resources/assets/unicopia/textures/gui/hud.png index 7070f5ad..6fcab1f6 100644 Binary files a/src/main/resources/assets/unicopia/textures/gui/hud.png and b/src/main/resources/assets/unicopia/textures/gui/hud.png differ