Deprecated Draw.color(String), switched to type-safe usage
This commit is contained in:
@@ -2,6 +2,7 @@ package io.anuke.mindustry.entities;
|
||||
|
||||
import com.badlogic.gdx.utils.Queue;
|
||||
import io.anuke.mindustry.Vars;
|
||||
import io.anuke.mindustry.graphics.Palette;
|
||||
import io.anuke.mindustry.type.Recipe;
|
||||
import io.anuke.mindustry.world.Build;
|
||||
import io.anuke.mindustry.world.Tile;
|
||||
@@ -122,7 +123,7 @@ public interface BlockBuilder {
|
||||
default void drawBuilding(Unit unit){
|
||||
Tile tile = world.tile(getCurrentRequest().x, getCurrentRequest().y);
|
||||
|
||||
Draw.color(unit.distanceTo(tile) > placeDistance || getCurrentRequest().remove ? "break" : "accent");
|
||||
Draw.color(unit.distanceTo(tile) > placeDistance || getCurrentRequest().remove ? Palette.remove : Palette.accent);
|
||||
float focusLen = 3.8f + Mathf.absin(Timers.time(), 1.1f, 0.6f);
|
||||
float px = unit.x + Angles.trnsx(unit.rotation, focusLen);
|
||||
float py = unit.y + Angles.trnsy(unit.rotation, focusLen);
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.badlogic.gdx.math.Interpolation;
|
||||
import com.badlogic.gdx.math.Vector2;
|
||||
import com.badlogic.gdx.utils.Pools;
|
||||
import io.anuke.mindustry.Vars;
|
||||
import io.anuke.mindustry.graphics.Palette;
|
||||
import io.anuke.mindustry.type.Item;
|
||||
import io.anuke.ucore.entities.Entity;
|
||||
import io.anuke.ucore.entities.TimedEntity;
|
||||
@@ -65,7 +66,7 @@ public class ItemTransfer extends TimedEntity{
|
||||
public void draw() {
|
||||
float length = fslope()*6f;
|
||||
float angle = current.set(x, y).sub(from).angle();
|
||||
Draw.color("accent");
|
||||
Draw.color(Palette.accent);
|
||||
Lines.stroke(fslope()*2f);
|
||||
|
||||
Lines.circle(x, y, fslope()*2f);
|
||||
|
||||
@@ -245,7 +245,7 @@ public class Player extends Unit implements BlockBuilder {
|
||||
public void drawBuildRequests(){
|
||||
for (BuildRequest request : getPlaceQueue()) {
|
||||
if(request.remove){
|
||||
Draw.color("break");
|
||||
Draw.color(Palette.remove);
|
||||
Draw.alpha(0.4f);
|
||||
Lines.stroke(1f);
|
||||
|
||||
@@ -267,7 +267,7 @@ public class Player extends Unit implements BlockBuilder {
|
||||
Lines.poly(tile.drawx(), tile.drawy(),
|
||||
4, tile.block().size * tilesize /2f * (1f-progress) + Mathf.absin(Timers.time(), 3f, 1f));
|
||||
}else{
|
||||
Draw.color("accent");
|
||||
Draw.color(Palette.accent);
|
||||
Lines.stroke((1f-request.progress));
|
||||
Lines.poly(request.x * tilesize + request.recipe.result.getPlaceOffset().x,
|
||||
request.y * tilesize + request.recipe.result.getPlaceOffset().y,
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package io.anuke.mindustry.entities.effect;
|
||||
|
||||
import com.badlogic.gdx.graphics.Color;
|
||||
import com.badlogic.gdx.graphics.Colors;
|
||||
import com.badlogic.gdx.math.Rectangle;
|
||||
import com.badlogic.gdx.math.Vector2;
|
||||
import io.anuke.mindustry.content.bullets.TurretBullets;
|
||||
@@ -11,6 +10,7 @@ import io.anuke.mindustry.entities.Bullet;
|
||||
import io.anuke.mindustry.entities.Unit;
|
||||
import io.anuke.mindustry.entities.Units;
|
||||
import io.anuke.mindustry.game.Team;
|
||||
import io.anuke.mindustry.graphics.Palette;
|
||||
import io.anuke.mindustry.world.Tile;
|
||||
import io.anuke.ucore.core.Effects;
|
||||
import io.anuke.ucore.core.Effects.Effect;
|
||||
@@ -33,7 +33,7 @@ public class DamageArea{
|
||||
for(int i = 0; i < Mathf.clamp(power / 20, 0, 6); i ++){
|
||||
int branches = 5 + Mathf.clamp((int)(power/30), 1, 20);
|
||||
Timers.run(i*2f + Mathf.random(4f), () -> {
|
||||
Lightning.create(Team.none, Fx.none, Colors.get("power"), 3, x, y, Mathf.random(360f), branches + Mathf.range(2));
|
||||
Lightning.create(Team.none, Fx.none, Palette.power, 3, x, y, Mathf.random(360f), branches + Mathf.range(2));
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user