Skip to content

Commit

Permalink
Change Aureal Bar to fill from right to left
Browse files Browse the repository at this point in the history
  • Loading branch information
stal111 committed Sep 16, 2023
1 parent 8ce25e1 commit 2514082
Showing 1 changed file with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,11 @@
import java.util.Collections;

public class AurealMeterOverlay implements IGuiOverlay {

private static final ResourceLocation TEXTURE = new ResourceLocation(ForbiddenArcanus.MOD_ID, "textures/gui/hud.png");

private static final int BAR_WIDTH = 75;

@Override
public void render(ForgeGui gui, GuiGraphics guiGraphics, float partialTick, int screenWidth, int screenHeight) {
Window window = Minecraft.getInstance().getWindow();
Expand All @@ -27,14 +30,16 @@ public void render(ForgeGui gui, GuiGraphics guiGraphics, float partialTick, int
}
IAureal aureal = AurealHelper.getCapability(player);

guiGraphics.blit(TEXTURE, window.getGuiScaledWidth() / 2 + 9, window.getGuiScaledHeight() - 25 - 23, 17, 9, 81, 10, 256, 128);
guiGraphics.blit(TEXTURE, window.getGuiScaledWidth() / 2 + 10, window.getGuiScaledHeight() - 25 - 23, 18, 9, 81, 9, 256, 128);

this.renderOverlay(guiGraphics, window, aureal);
this.renderOverlay(guiGraphics, window, aureal);
}

private void renderOverlay(GuiGraphics guiGraphics, Window window, IAureal aureal) {
int xSize = Math.toIntExact(Math.round(80.0F * ((aureal.getAureal()) / 200.0F)));
guiGraphics.blit(TEXTURE, window.getGuiScaledWidth() / 2 + 11,window.getGuiScaledHeight() - 25 - 23, 19, 18,xSize, 18, 256, 128);
int xSize = Math.toIntExact(Math.round(BAR_WIDTH * ((aureal.getAureal()) / 200.0F)));
int startOffset = BAR_WIDTH - xSize;

guiGraphics.blit(TEXTURE, window.getGuiScaledWidth() / 2 + 13 + startOffset, window.getGuiScaledHeight() - 25 - 22, 21 + startOffset, 19, xSize, 7, 256, 128);
}
}

0 comments on commit 2514082

Please sign in to comment.