Deprecated Draw.color(String), switched to type-safe usage

This commit is contained in:
Anuken
2018-05-21 13:37:16 -04:00
parent 9708d3183f
commit 37afb46957
29 changed files with 168 additions and 136 deletions

View File

@@ -1,7 +1,6 @@
package io.anuke.mindustry.content.fx;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.Colors;
import io.anuke.mindustry.entities.effect.GroundEffectEntity.GroundEffect;
import io.anuke.mindustry.graphics.Palette;
import io.anuke.ucore.core.Effects.Effect;
@@ -111,7 +110,7 @@ public class BlockFx {
}),
producesmoke = new Effect(12, e -> {
Angles.randLenVectors(e.id, 8, 4f + e.fin()*18f, (x, y)->{
Draw.color(Color.WHITE, Colors.get("accent"), e.fin());
Draw.color(Color.WHITE, Palette.accent, e.fin());
Fill.poly(e.x + x, e.y + y, 4, 1f+e.fout()*3f, 45);
Draw.reset();
});

View File

@@ -1,10 +1,12 @@
package io.anuke.mindustry.content.fx;
import com.badlogic.gdx.graphics.Color;
import io.anuke.mindustry.graphics.Palette;
import io.anuke.ucore.core.Effects.Effect;
import io.anuke.ucore.graphics.Draw;
import io.anuke.ucore.graphics.Fill;
import io.anuke.ucore.graphics.Lines;
import io.anuke.ucore.util.Angles;
import static io.anuke.mindustry.Vars.tilesize;
@@ -16,16 +18,22 @@ public class Fx{
none = new Effect(0, 0f, e->{}),
placeBlock = new Effect(16, e -> {
Draw.color("accent");
Draw.color(Palette.accent);
Lines.stroke(3f - e.fin() * 2f);
Lines.square(e.x, e.y, tilesize / 2f * (float)(e.data) + e.fin() * 3f);
Draw.reset();
}),
breakBlock = new Effect(12, e -> {
Draw.color("break");
float data = (float)(e.data);
Draw.color(Palette.remove);
Lines.stroke(3f - e.fin() * 2f);
Lines.square(e.x, e.y, tilesize / 2f * (float)(e.data) + e.fin() * 3f);
Lines.square(e.x, e.y, tilesize / 2f * data + e.fin() * 3f);
Angles.randLenVectors(e.id, 3 + (int)(data*3), data*2f + (tilesize * data) * e.finpow(), (x, y) -> {
Fill.square(e.x + x, e.y + y, 1f + e.fout()*(3f+data));
});
Draw.reset();
}),
@@ -41,27 +49,5 @@ public class Fx{
Draw.color(Color.DARK_GRAY, Color.SCARLET, e.fin());
Lines.circle(e.x, e.y, 7f - e.fin() * 6f);
Draw.reset();
}),
node1 = new Effect(50, e -> {
Lines.stroke(2f);
Draw.color(Color.RED);
Lines.circle(e.x, e.y, 3f);
Draw.reset();
}),
node2 = new Effect(50, e -> {
Draw.color(Color.GREEN);
Fill.circle(e.x, e.y, 3f);
Draw.reset();
}),
node3 = new Effect(50, e -> {
Lines.stroke(1f);
Draw.color(Color.BLUE);
Lines.circle(e.x, e.y, 5f);
Draw.reset();
}),
node4 = new Effect(50, e -> {
Draw.color(Color.YELLOW);
Fill.circle(e.x, e.y, 2f);
Draw.reset();
});
}