This commit is contained in:
Anuken
2021-07-20 10:45:15 -04:00
parent 82f0d6a542
commit 6ffc8ba3c5

View File

@@ -3,12 +3,15 @@ package mindustry.world.blocks.power;
import arc.graphics.*;
import arc.graphics.g2d.*;
import arc.math.*;
import arc.math.geom.*;
import arc.scene.ui.layout.*;
import arc.struct.*;
import arc.util.*;
import arc.util.io.*;
import mindustry.annotations.Annotations.*;
import mindustry.gen.*;
import mindustry.graphics.*;
import mindustry.input.*;
import mindustry.logic.*;
import mindustry.world.*;
@@ -25,6 +28,7 @@ public class LightBlock extends Block{
update = true;
configurable = true;
saveConfig = true;
swapDiagonalPlacement = true;
config(Integer.class, (LightBuild tile, Integer value) -> tile.color = value);
}
@@ -36,6 +40,19 @@ public class LightBlock extends Block{
super.init();
}
@Override
public void drawPlace(int x, int y, int rotation, boolean valid){
super.drawPlace(x, y, rotation, valid);
Drawf.dashCircle(x * tilesize + offset, y * tilesize + offset, radius * 0.75f, Pal.placing);
}
@Override
public void changePlacementPath(Seq<Point2> points, int rotation){
var placeRadius2 = Mathf.pow(radius * 0.7f / tilesize, 2f) * 3;
Placement.calculateNodes(points, this, rotation, (point, other) -> point.dst2(other) <= placeRadius2);
}
public class LightBuild extends Building{
public int color = Pal.accent.rgba();
public float smoothTime = 1f;