From 0d26b9e4f853e7788336129ea67b5152acee5692 Mon Sep 17 00:00:00 2001 From: whert-dev <57214741+whert-dev@users.noreply.github.com> Date: Sat, 7 Jan 2023 16:45:33 +0000 Subject: [PATCH] Added angleOffset to DrawPistons (#7950) --- core/src/mindustry/world/draw/DrawPistons.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/mindustry/world/draw/DrawPistons.java b/core/src/mindustry/world/draw/DrawPistons.java index 2015cc801f..bdf6faca0b 100644 --- a/core/src/mindustry/world/draw/DrawPistons.java +++ b/core/src/mindustry/world/draw/DrawPistons.java @@ -9,7 +9,7 @@ import mindustry.gen.*; import mindustry.world.*; public class DrawPistons extends DrawBlock{ - public float sinMag = 4f, sinScl = 6f, sinOffset = 50f, sideOffset = 0f, lenOffset = -1f; + public float sinMag = 4f, sinScl = 6f, sinOffset = 50f, sideOffset = 0f, lenOffset = -1f, angleOffset = 0f; public int sides = 4; public String suffix = "-piston"; public TextureRegion region1, region2, regiont; @@ -23,7 +23,7 @@ public class DrawPistons extends DrawBlock{ public void draw(Building build){ for(int i = 0; i < sides; i++){ float len = Mathf.absin(build.totalProgress() + sinOffset + sideOffset * sinScl * i, sinScl, sinMag) + lenOffset; - float angle = i * 360f / sides; + float angle = angleOffset + i * 360f / sides; TextureRegion reg = regiont.found() && (Mathf.equal(angle, 315) || Mathf.equal(angle, 135)) ? regiont : angle >= 135 && angle < 315 ? region2 : region1;