mirror of
https://github.com/Sollace/Unicopia.git
synced 2024-11-30 16:28:00 +01:00
Fixed z-index of the hud
This commit is contained in:
parent
1ed6ef7a17
commit
98e90c89f5
1 changed files with 11 additions and 2 deletions
|
@ -68,16 +68,25 @@ public class UHud {
|
||||||
|
|
||||||
public void render(InGameHud hud, DrawContext context, float tickDelta) {
|
public void render(InGameHud hud, DrawContext context, float tickDelta) {
|
||||||
|
|
||||||
|
// TODO: Check this when backporting!
|
||||||
|
// InGameHud#renderHotbar line 460
|
||||||
|
// context.getMatrices().translate(0.0f, 0.0f, -90.0f);
|
||||||
|
final int hotbarZ = -90;
|
||||||
|
|
||||||
if (client.player == null) {
|
if (client.player == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
int scaledWidth = client.getWindow().getScaledWidth();
|
int scaledWidth = client.getWindow().getScaledWidth();
|
||||||
int scaledHeight = client.getWindow().getScaledHeight();
|
int scaledHeight = client.getWindow().getScaledHeight();
|
||||||
|
MatrixStack matrices = context.getMatrices();
|
||||||
|
|
||||||
Pony pony = Pony.of(client.player);
|
Pony pony = Pony.of(client.player);
|
||||||
|
|
||||||
|
matrices.push();
|
||||||
|
matrices.translate(0, 0, hotbarZ);
|
||||||
renderViewEffects(pony, context, scaledWidth, scaledHeight, tickDelta);
|
renderViewEffects(pony, context, scaledWidth, scaledHeight, tickDelta);
|
||||||
|
matrices.pop();
|
||||||
|
|
||||||
if (client.currentScreen instanceof HidesHud || client.player.isSpectator() || client.options.hudHidden) {
|
if (client.currentScreen instanceof HidesHud || client.player.isSpectator() || client.options.hudHidden) {
|
||||||
return;
|
return;
|
||||||
|
@ -86,7 +95,7 @@ public class UHud {
|
||||||
font = client.textRenderer;
|
font = client.textRenderer;
|
||||||
xDirection = client.player.getMainArm() == Arm.LEFT ? -1 : 1;
|
xDirection = client.player.getMainArm() == Arm.LEFT ? -1 : 1;
|
||||||
|
|
||||||
MatrixStack matrices = context.getMatrices();
|
|
||||||
matrices.push();
|
matrices.push();
|
||||||
matrices.translate(scaledWidth / 2, scaledHeight / 2, 0);
|
matrices.translate(scaledWidth / 2, scaledHeight / 2, 0);
|
||||||
|
|
||||||
|
@ -101,7 +110,7 @@ public class UHud {
|
||||||
|
|
||||||
int hudX = ((scaledWidth - 50) / 2) + (104 * xDirection);
|
int hudX = ((scaledWidth - 50) / 2) + (104 * xDirection);
|
||||||
int hudY = scaledHeight - 50;
|
int hudY = scaledHeight - 50;
|
||||||
int hudZ = 0;
|
int hudZ = hotbarZ;
|
||||||
|
|
||||||
|
|
||||||
float exhaustion = pony.getMagicalReserves().getExhaustion().getPercentFill();
|
float exhaustion = pony.getMagicalReserves().getExhaustion().getPercentFill();
|
||||||
|
|
Loading…
Reference in a new issue