Merge branch 'master' of https://github.com/Anuken/Mindustry into 7.0-features

 Conflicts:
	core/src/mindustry/ui/dialogs/JoinDialog.java
This commit is contained in:
Anuken
2022-04-20 14:16:20 -04:00
18 changed files with 487 additions and 429 deletions

View File

@@ -17,6 +17,8 @@ public class ParticleEffect extends Effect{
public Color colorFrom = Color.white.cpy(), colorTo = Color.white.cpy();
public int particles = 6;
public boolean randLength = true;
/** Gives the effect flipping compatability like casing effects. */
public boolean casingFlip;
public float cone = 180f, length = 20f, baseLength = 0f;
/** Particle size/length/radius interpolation. */
public Interp interp = Interp.linear;
@@ -55,11 +57,12 @@ public class ParticleEffect extends Effect{
public void render(EffectContainer e){
if(tex == null) tex = Core.atlas.find(region);
float realRotation = (useRotation ? e.rotation : baseRotation);
float realRotation = (useRotation ? (casingFlip ? Math.abs(e.rotation) : e.rotation) : baseRotation);
int flip = casingFlip ? -Mathf.sign(e.rotation) : 1;
float rawfin = e.fin();
float fin = e.fin(interp);
float rad = sizeInterp.apply(sizeFrom, sizeTo, rawfin) * 2;
float ox = e.x + Angles.trnsx(realRotation, offsetX, offsetY), oy = e.y + Angles.trnsy(realRotation, offsetX, offsetY);
float ox = e.x + Angles.trnsx(realRotation, offsetX * flip, offsetY), oy = e.y + Angles.trnsy(realRotation, offsetX * flip, offsetY);
Draw.color(colorFrom, colorTo, fin);
Color lightColor = this.lightColor == null ? Draw.getColor() : this.lightColor;