diff --git a/core/src/mindustry/input/InputHandler.java b/core/src/mindustry/input/InputHandler.java index 77af23a5ec..3867a51690 100644 --- a/core/src/mindustry/input/InputHandler.java +++ b/core/src/mindustry/input/InputHandler.java @@ -159,6 +159,15 @@ public abstract class InputHandler implements InputProcessor, GestureListener{ } } + @Remote(targets = Loc.both, called = Loc.server, forward = true) + public static void onTileTapped(Playerc player, Tile tile){ + if(tile == null || player == null) return; + if(net.server() && (!Units.canInteract(player, tile) || + !netServer.admins.allowAction(player, ActionType.tapTile, tile, action -> {}))) throw new ValidateException(player, "Player cannot tap a tile."); + tile.block().tapped(tile, player); + Core.app.post(() -> Events.fire(new TapEvent(tile, player))); + } + @Remote(targets = Loc.both, called = Loc.both, forward = true) public static void onTileConfig(Playerc player, Tile tile, @Nullable Object value){ if(tile == null) return; @@ -583,7 +592,7 @@ public abstract class InputHandler implements InputProcessor, GestureListener{ //call tapped event if(!consumed && tile.interactable(player.team())){ - Call.onTileConfig(player, tile, null); + Call.onTileTapped(player, tile); } //consume tap event if necessary diff --git a/core/src/mindustry/world/Block.java b/core/src/mindustry/world/Block.java index 3194a93f1d..edabf16581 100644 --- a/core/src/mindustry/world/Block.java +++ b/core/src/mindustry/world/Block.java @@ -734,8 +734,8 @@ public class Block extends BlockStorage{ } public void drawRequestRegion(BuildRequest req, Eachable list){ - TextureRegion reg = icon(Cicon.full); - Draw.rect(icon(Cicon.full), req.drawx(), req.drawy(), + TextureRegion reg = getRequestRegion(req, list); + Draw.rect(reg, req.drawx(), req.drawy(), reg.getWidth() * req.animScale * Draw.scl, reg.getHeight() * req.animScale * Draw.scl, !rotate ? 0 : req.rotation * 90); @@ -745,6 +745,10 @@ public class Block extends BlockStorage{ } } + public TextureRegion getRequestRegion(BuildRequest req, Eachable list){ + return icon(Cicon.full); + } + public void drawRequestConfig(BuildRequest req, Eachable list){ } diff --git a/core/src/mindustry/world/blocks/defense/Door.java b/core/src/mindustry/world/blocks/defense/Door.java index 36b646e1cb..33eb7e8c6b 100644 --- a/core/src/mindustry/world/blocks/defense/Door.java +++ b/core/src/mindustry/world/blocks/defense/Door.java @@ -5,9 +5,11 @@ import arc.Graphics.*; import arc.Graphics.Cursor.*; import arc.graphics.g2d.*; import arc.math.geom.*; +import arc.util.*; import arc.util.io.*; import mindustry.content.*; import mindustry.entities.*; +import mindustry.entities.units.*; import mindustry.gen.*; import mindustry.world.*; @@ -52,12 +54,12 @@ public class Door extends Wall{ @Override public void draw(Tile tile){ DoorEntity entity = tile.ent(); + Draw.rect(entity.open ? openRegion : region, tile.drawx(), tile.drawy()); + } - if(!entity.open){ - Draw.rect(region, tile.drawx(), tile.drawy()); - }else{ - Draw.rect(openRegion, tile.drawx(), tile.drawy()); - } + @Override + public TextureRegion getRequestRegion(BuildRequest req, Eachable list){ + return req.config == Boolean.TRUE ? openRegion : region; } @Override diff --git a/gradle.properties b/gradle.properties index 9a6d877821..79495ee591 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,3 +1,3 @@ org.gradle.daemon=true org.gradle.jvmargs=-Xms256m -Xmx1024m -archash=69ef047313449905aff6d1390d7136f9c7cdc986 +archash=c1eab295b1a55397957fd54bec2f37daee0e8b4b