Fixed #4830
This commit is contained in:
@@ -256,6 +256,10 @@ public class Block extends UnlockableContent{
|
||||
|
||||
/** Drawn when you are placing a block. */
|
||||
public void drawPlace(int x, int y, int rotation, boolean valid){
|
||||
drawPotentialLinks(x, y);
|
||||
}
|
||||
|
||||
public void drawPotentialLinks(int x, int y){
|
||||
if((consumesPower || outputsPower) && hasPower){
|
||||
Tile tile = world.tile(x, y);
|
||||
if(tile != null){
|
||||
|
||||
@@ -41,6 +41,8 @@ public class BaseTurret extends Block{
|
||||
|
||||
@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, range, Pal.placing);
|
||||
}
|
||||
|
||||
|
||||
@@ -90,6 +90,8 @@ public class ItemBridge extends Block{
|
||||
|
||||
@Override
|
||||
public void drawPlace(int x, int y, int rotation, boolean valid){
|
||||
super.drawPlace(x, y, rotation, valid);
|
||||
|
||||
Tile link = findLink(x, y);
|
||||
|
||||
Lines.stroke(2f, Pal.placing);
|
||||
|
||||
@@ -57,6 +57,8 @@ public class MassDriver extends Block{
|
||||
|
||||
@Override
|
||||
public void drawPlace(int x, int y, int rotation, boolean valid){
|
||||
super.drawPlace(x, y, rotation, valid);
|
||||
|
||||
Drawf.dashCircle(x * tilesize, y * tilesize, range, Pal.accent);
|
||||
|
||||
//check if a mass driver is selected while placing this driver
|
||||
|
||||
@@ -263,7 +263,8 @@ public class PowerNode extends PowerBlock{
|
||||
//add conducting graphs to prevent double link
|
||||
for(var p : Edges.getEdges(block.size)){
|
||||
Tile other = tile.nearby(p);
|
||||
if(other != null && other.team() == team && other.build != null && other.build.power != null){
|
||||
if(other != null && other.team() == team && other.build != null && other.build.power != null
|
||||
&& !(block.consumesPower && other.block().consumesPower && !block.outputsPower && !other.block().outputsPower)){
|
||||
graphs.add(other.build.power.graph);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,6 +27,8 @@ public class ThermalGenerator extends PowerGenerator{
|
||||
|
||||
@Override
|
||||
public void drawPlace(int x, int y, int rotation, boolean valid){
|
||||
super.drawPlace(x, y, rotation, valid);
|
||||
|
||||
drawPlaceText(Core.bundle.formatFloat("bar.efficiency", sumAttribute(attribute, x, y) * 100, 1), x, y, valid);
|
||||
}
|
||||
|
||||
|
||||
@@ -47,6 +47,8 @@ public class Cultivator extends GenericCrafter{
|
||||
|
||||
@Override
|
||||
public void drawPlace(int x, int y, int rotation, boolean valid){
|
||||
super.drawPlace(x, y, rotation, valid);
|
||||
|
||||
drawPlaceText(Core.bundle.formatFloat("bar.efficiency", (1 + sumAttribute(attribute, x, y)) * 100, 1), x, y, valid);
|
||||
}
|
||||
|
||||
|
||||
@@ -113,6 +113,8 @@ public class Drill extends Block{
|
||||
|
||||
@Override
|
||||
public void drawPlace(int x, int y, int rotation, boolean valid){
|
||||
super.drawPlace(x, y, rotation, valid);
|
||||
|
||||
Tile tile = world.tile(x, y);
|
||||
if(tile == null) return;
|
||||
|
||||
|
||||
@@ -31,6 +31,8 @@ public class Pump extends LiquidBlock{
|
||||
|
||||
@Override
|
||||
public void drawPlace(int x, int y, int rotation, boolean valid){
|
||||
super.drawPlace(x, y, rotation, valid);
|
||||
|
||||
Tile tile = world.tile(x, y);
|
||||
if(tile == null) return;
|
||||
|
||||
|
||||
@@ -35,6 +35,8 @@ public class SolidPump extends Pump{
|
||||
|
||||
@Override
|
||||
public void drawPlace(int x, int y, int rotation, boolean valid){
|
||||
drawPotentialLinks(x, y);
|
||||
|
||||
if(attribute != null){
|
||||
drawPlaceText(Core.bundle.formatFloat("bar.efficiency", Math.max(sumAttribute(attribute, x, y) / size / size + baseEfficiency, 0f) * 100 * percentSolid(x, y), 1), x, y, valid);
|
||||
}
|
||||
|
||||
@@ -56,6 +56,8 @@ public class RepairPoint extends Block{
|
||||
|
||||
@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, repairRadius, Pal.accent);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user