Schematic fixes
This commit is contained in:
@@ -20,6 +20,7 @@ import io.anuke.mindustry.entities.traits.BuilderTrait.*;
|
|||||||
import io.anuke.mindustry.entities.traits.*;
|
import io.anuke.mindustry.entities.traits.*;
|
||||||
import io.anuke.mindustry.entities.type.*;
|
import io.anuke.mindustry.entities.type.*;
|
||||||
import io.anuke.mindustry.game.EventType.*;
|
import io.anuke.mindustry.game.EventType.*;
|
||||||
|
import io.anuke.mindustry.game.*;
|
||||||
import io.anuke.mindustry.gen.*;
|
import io.anuke.mindustry.gen.*;
|
||||||
import io.anuke.mindustry.graphics.*;
|
import io.anuke.mindustry.graphics.*;
|
||||||
import io.anuke.mindustry.ui.*;
|
import io.anuke.mindustry.ui.*;
|
||||||
@@ -414,6 +415,12 @@ public class MobileInput extends InputHandler implements GestureListener{
|
|||||||
return mode == breaking;
|
return mode == breaking;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void useSchematic(Schematic schem){
|
||||||
|
selectRequests.clear();
|
||||||
|
selectRequests.addAll(schematics.toRequests(schem, world.toTile(player.x), world.toTile(player.y)));
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean touchDown(int screenX, int screenY, int pointer, KeyCode button){
|
public boolean touchDown(int screenX, int screenY, int pointer, KeyCode button){
|
||||||
if(state.is(State.menu) || player.isDead()) return false;
|
if(state.is(State.menu) || player.isDead()) return false;
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ public class SchematicsDialog extends FloatingDialog{
|
|||||||
addCloseButton();
|
addCloseButton();
|
||||||
buttons.addImageTextButton("$schematic.import", Icon.loadMapSmall, this::showImport);
|
buttons.addImageTextButton("$schematic.import", Icon.loadMapSmall, this::showImport);
|
||||||
shown(this::setup);
|
shown(this::setup);
|
||||||
|
onResize(this::setup);
|
||||||
}
|
}
|
||||||
|
|
||||||
void setup(){
|
void setup(){
|
||||||
@@ -123,7 +124,7 @@ public class SchematicsDialog extends FloatingDialog{
|
|||||||
|
|
||||||
sel[0].getStyle().up = Tex.pane;
|
sel[0].getStyle().up = Tex.pane;
|
||||||
|
|
||||||
if(++i % 4 == 0){
|
if(++i % (mobile ? Core.graphics.isPortrait() ? 2 : 3 : 4) == 0){
|
||||||
t.row();
|
t.row();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -69,10 +69,10 @@ public class Conduit extends LiquidBlock implements Autotiler{
|
|||||||
public Block getReplacement(BuildRequest req, Array<BuildRequest> requests){
|
public Block getReplacement(BuildRequest req, Array<BuildRequest> requests){
|
||||||
Boolf<Point2> cont = p -> requests.contains(o -> o.x == req.x + p.x && o.y == req.y + p.y && o.rotation == req.rotation && (req.block instanceof Conduit || req.block instanceof LiquidJunction));
|
Boolf<Point2> cont = p -> requests.contains(o -> o.x == req.x + p.x && o.y == req.y + p.y && o.rotation == req.rotation && (req.block instanceof Conduit || req.block instanceof LiquidJunction));
|
||||||
return cont.get(Geometry.d4(req.rotation)) &&
|
return cont.get(Geometry.d4(req.rotation)) &&
|
||||||
cont.get(Geometry.d4(req.rotation - 2)) &&
|
cont.get(Geometry.d4(req.rotation - 2)) &&
|
||||||
req.tile() != null &&
|
req.tile() != null &&
|
||||||
req.tile().block() instanceof Conduit &&
|
req.tile().block() instanceof Conduit &&
|
||||||
Mathf.mod(req.tile().rotation() - req.rotation, 2) == 1 ? Blocks.liquidJunction : this;
|
Mathf.mod(req.tile().rotation() - req.rotation, 2) == 1 ? Blocks.liquidJunction : this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user