Skip to content

Commit

Permalink
offsets
Browse files Browse the repository at this point in the history
  • Loading branch information
KrLite committed May 1, 2024
1 parent a01f2e9 commit 5a5f96c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,12 @@ public static void verticallyShiftBarPre(DrawContext context, boolean hideInAlte
}
}

public static void horizontallyShiftBarByEdge(DrawContext context) {
if (!alternativeLayoutPartiallyEnabled() && !enabled()) {
context.getMatrices().translate(-raisedHudShiftEdge(), 0, 0);
}
}

public static void verticallyShiftBarPost(DrawContext context) {
context.setShaderColor(1, 1, 1, 1);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ private void renderStatusBarsPost(DrawContext context, CallbackInfo ci) {
private void renderMountHealthPre(DrawContext context, CallbackInfo ci) {
context.getMatrices().push();
Verticality.verticallyShiftBarPre(context, true);
Verticality.horizontallyShiftBarByEdge(context);
}

@Inject(
Expand Down Expand Up @@ -112,6 +113,7 @@ private void renderMountHealthPost(DrawContext context, CallbackInfo ci) {
private void renderMountJumpBarBackgroundPre(JumpingMount mount, DrawContext context, int x, CallbackInfo ci) {
context.getMatrices().push();
Verticality.verticallyShiftBarPre(context, false);
Verticality.horizontallyShiftBarByEdge(context);

context.getMatrices().translate(Verticality.alternativeLayoutOffset().x(), 0, 0);
}
Expand Down Expand Up @@ -147,6 +149,7 @@ private void renderMountJumpBarBackgroundPost(JumpingMount mount, DrawContext co
private void renderMountJumpBarProgressPre(JumpingMount mount, DrawContext context, int x, CallbackInfo ci) {
context.getMatrices().push();
Verticality.verticallyShiftBarPre(context, false);
Verticality.horizontallyShiftBarByEdge(context);

context.getMatrices().translate(Verticality.alternativeLayoutOffset().x(), 0, 0);
}
Expand Down Expand Up @@ -176,6 +179,7 @@ private void renderMountJumpBarProgressPost(JumpingMount mount, DrawContext cont
private void renderExperienceBarBackgroundPre(DrawContext context, int x, CallbackInfo ci) {
context.getMatrices().push();
Verticality.verticallyShiftBarPre(context, false);
Verticality.horizontallyShiftBarByEdge(context);

context.getMatrices().translate(Verticality.alternativeLayoutOffset().x(), 0, 0);
}
Expand Down Expand Up @@ -205,6 +209,7 @@ private void renderExperienceBarBackgroundPost(DrawContext context, int x, Callb
private void renderExperienceBarProgressPre(DrawContext context, int x, CallbackInfo ci) {
context.getMatrices().push();
Verticality.verticallyShiftBarPre(context, false);
Verticality.horizontallyShiftBarByEdge(context);

context.getMatrices().translate(Verticality.alternativeLayoutOffset().x(), 0, 0);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,7 @@ private void renderHotbar(float tickDelta, DrawContext context, CallbackInfo ci)
(Verticality.height() - Verticality.width() + Verticality.OFFHAND_WIDTH * Verticality.offset()) / 2.0,
0
);
context.getMatrices().translate(0, Verticality.raisedHudShiftEdge() * (1 - Verticality.alternativeTransition()), 0);

context.getMatrices().multiply(RotationAxis.POSITIVE_Z.rotationDegrees(90));

Expand All @@ -459,6 +460,7 @@ private void renderHotbar(float tickDelta, DrawContext context, CallbackInfo ci)
}
} else {
context.getMatrices().translate(0, Verticality.hotbarShift() * Verticality.transition(), 0);
context.getMatrices().translate(-Verticality.raisedHudShiftEdge() * (1 - Verticality.alternativeTransition()), 0, 0);
}
}

Expand Down

0 comments on commit 5a5f96c

Please # to comment.