This commit is contained in:
Anuken
2019-05-01 10:01:16 -04:00
parent 404b593ab8
commit 2d3fd513d8
16 changed files with 2839 additions and 2888 deletions

View File

@@ -265,7 +265,7 @@ public class Player extends Unit implements BuilderTrait, ShooterTrait{
@Override
public float drawSize(){
return isLocal ? Float.MAX_VALUE : 40;
return isLocal ? Float.MAX_VALUE : 40 + placeDistance;
}
@Override

View File

@@ -79,11 +79,12 @@ public class BlockRenderer implements Disposable{
Tile tile = world.rawTile(x, y);
int edgeBlend = 2;
float rot = tile.getRotation();
boolean fillable = (tile.block().solid && tile.block().fillsTile && !tile.block().synthetic());
int edgeDst = Math.min(x, Math.min(y, Math.min(Math.abs(x - (world.width() - 1)), Math.abs(y - (world.height() - 1)))));
if(edgeDst <= edgeBlend){
rot = Math.max((edgeBlend - edgeDst) * (4f / edgeBlend), rot);
rot = Math.max((edgeBlend - edgeDst) * (4f / edgeBlend), fillable ? rot : 0);
}
if(rot > 0 && ((tile.block().solid && tile.block().fillsTile && !tile.block().synthetic()) || edgeDst <= edgeBlend)){
if(rot > 0 && (fillable || edgeDst <= edgeBlend)){
Draw.color(0f, 0f, 0f, Math.min((rot + 0.5f) / 4f, 1f));
Fill.rect(tile.x + 0.5f, tile.y + 0.5f, 1, 1);
}

View File

@@ -37,6 +37,7 @@ public class MapIO{
private static void initBlocks(){
if(missingBlocks != null) return;
//only for legacy maps
missingBlocks = ObjectMap.of(
"stained-stone", Blocks.shale,
"stained-stone-red", Blocks.shale,

View File

@@ -1,6 +1,7 @@
package io.anuke.mindustry.io;
import io.anuke.arc.collection.Array;
import io.anuke.arc.collection.ObjectMap;
import io.anuke.arc.util.Pack;
import io.anuke.mindustry.content.Blocks;
import io.anuke.mindustry.entities.Entities;
@@ -19,6 +20,9 @@ import static io.anuke.mindustry.Vars.world;
public abstract class SaveFileVersion{
public final int version;
private final ObjectMap<String, String> fallback = ObjectMap.of(
"alpha-dart-mech-pad", "dart-mech-pad"
);
public SaveFileVersion(int version){
this.version = version;
@@ -219,7 +223,7 @@ public abstract class SaveFileVersion{
for(int j = 0; j < total; j++){
String name = stream.readUTF();
map[type.ordinal()][j] = content.getByName(type, name);
map[type.ordinal()][j] = content.getByName(type, fallback.get(name, name));
}
}

View File

@@ -183,7 +183,7 @@ public abstract class BasicGenerator extends RandomGenerator{
Tile end = tiles[endX][endY];
GridBits closed = new GridBits(width, height);
IntFloatMap costs = new IntFloatMap();
PriorityQueue<Tile> queue = new PriorityQueue<>((a, b) -> Float.compare(costs.get(a.pos(), 0f) + dh.cost(a.x, a.y, end.x, end.y), costs.get(b.pos(), 0f) + dh.cost(b.x, b.y, end.x, end.y)));
PriorityQueue<Tile> queue = new PriorityQueue<>(tiles.length * tiles[0].length / 2, (a, b) -> Float.compare(costs.get(a.pos(), 0f) + dh.cost(a.x, a.y, end.x, end.y), costs.get(b.pos(), 0f) + dh.cost(b.x, b.y, end.x, end.y)));
queue.add(start);
boolean found = false;
while(!queue.isEmpty()){

View File

@@ -45,7 +45,9 @@ public class TechTreeDialog extends FloatingDialog{
checkNodes(root);
treeLayout();
});
hidden(ui.deploy::setup);
addCloseButton();
buttons.addImageTextButton("$database", "icon-database", 14 * 2, () -> {
@@ -200,7 +202,7 @@ public class TechTreeDialog extends FloatingDialog{
if(mobile){
tapped(() -> {
Element e = hit(Core.input.mouseX(), Core.input.mouseY(), true);
Element e = Core.scene.hit(Core.input.mouseX(), Core.input.mouseY(), true);
if(e == this){
hoverNode = null;
rebuild();