Skip to content

Commit

Permalink
WIP: Improve Instrument and MusicVenueTool overlays.
Browse files Browse the repository at this point in the history
  • Loading branch information
Aeronica committed Mar 12, 2024
1 parent 4ff7f9b commit b9214a0
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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) {
Expand Down

0 comments on commit b9214a0

Please sign in to comment.