From b9214a0622e963a6b615d484a2f4145134fa49b1 Mon Sep 17 00:00:00 2001 From: Aeronica Date: Mon, 11 Mar 2024 20:40:10 -0500 Subject: [PATCH] WIP: Improve Instrument and MusicVenueTool overlays. --- .../aeronicamc/mods/mxtune/render/OverlayItemGui.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/java/aeronicamc/mods/mxtune/render/OverlayItemGui.java b/src/main/java/aeronicamc/mods/mxtune/render/OverlayItemGui.java index a264eddd..e7503131 100644 --- a/src/main/java/aeronicamc/mods/mxtune/render/OverlayItemGui.java +++ b/src/main/java/aeronicamc/mods/mxtune/render/OverlayItemGui.java @@ -138,11 +138,10 @@ public boolean render(int x, int y, int instIndex, MatrixStack pPoseStack) { switch (position) { case LEFT: - xPos = 0F - this.overlayItem.totalWidth() + ((float)this.overlayItem.totalWidth() * this.getVisibility(ms)); + xPos = this.overlayItem.totalWidth() * (1 - this.getVisibility(ms)) + this.overlayItem.totalWidth() * (this.getVisibility(ms)) - this.overlayItem.totalWidth(); break; case CENTER: - xPos = (x * 0.5F) - this.overlayItem.totalWidth() * 0.5F; - yPos = 0F - this.overlayItem.totalHeight() + (y * ratio + this.overlayItem.totalHeight() * ratio) * this.getVisibility(ms); + xPos = ((x * this.getVisibility(ms) * 0.5F)) + ((x * (1F - this.getVisibility(ms)) * 0.5F)) - this.overlayItem.totalWidth() * 0.5F * (this.getVisibility(ms)); break; case RIGHT: xPos = (float)x - (float)this.overlayItem.totalWidth() * this.getVisibility(ms); @@ -152,7 +151,10 @@ public boolean render(int x, int y, int instIndex, MatrixStack pPoseStack) { } RenderSystem.pushMatrix(); + RenderSystem.translatef(xPos, yPos, 800F + instIndex); + RenderSystem.scalef(this.getVisibility(ms), this.getVisibility(ms), 1F); + IOverlayItem.Visibility overlayVisibility = this.overlayItem.render(pPoseStack, OverlayItemGui.this, ms - this.visibleTime); RenderSystem.popMatrix(); if (overlayVisibility != this.visibility) {