diff --git a/core/src/mindustry/input/InputHandler.java b/core/src/mindustry/input/InputHandler.java index cede668a50..e2187aaf03 100644 --- a/core/src/mindustry/input/InputHandler.java +++ b/core/src/mindustry/input/InputHandler.java @@ -2015,7 +2015,6 @@ public abstract class InputHandler implements InputProcessor, GestureListener{ consumed = true; }else if(build.interactable(player.team()) && build.block.synthetic() && (!consumed || build.block.allowConfigInventory)){ if(build.block.hasItems && build.items.total() > 0){ - inv.swap = build.block.swapConfigInventory; inv.showFor(build); consumed = true; showedInventory = true; diff --git a/core/src/mindustry/ui/fragments/BlockInventoryFragment.java b/core/src/mindustry/ui/fragments/BlockInventoryFragment.java index cab6ba84ec..7013d0acdf 100644 --- a/core/src/mindustry/ui/fragments/BlockInventoryFragment.java +++ b/core/src/mindustry/ui/fragments/BlockInventoryFragment.java @@ -26,12 +26,11 @@ import static mindustry.Vars.*; public class BlockInventoryFragment{ private static final float holdWithdraw = 20f; private static final float holdShrink = 120f; - public boolean swap; Table table = new Table(); Building build; float holdTime = 0f, emptyTime; - boolean holding, held, swapped; + boolean holding, held; float[] shrinkHoldTimes = new float[content.items().size]; Item lastItem; @@ -56,7 +55,6 @@ public class BlockInventoryFragment{ if(build == null || !build.block.isAccessible() || build.items == null || build.items.total() == 0){ return; } - swapped = !swapped && swap; rebuild(true); } @@ -233,10 +231,9 @@ public class BlockInventoryFragment{ } private void updateTablePosition(){ - Vec2 v = Core.input.mouseScreen(build.x + (swapped ? -build.block.size : build.block.size) * tilesize / 2f, build.y + build.block.size * tilesize / 2f); + Vec2 v = Core.input.mouseScreen(build.x + build.block.size * tilesize / 2f, build.y + build.block.size * tilesize / 2f); table.pack(); - var alignment = swapped ? Align.topRight : Align.topLeft; - table.setPosition(v.x - Core.scene.marginLeft, v.y - Core.scene.marginBottom, alignment); + table.setPosition(v.x - Core.scene.marginLeft, v.y - Core.scene.marginBottom, build.block.diagonalConfigInventory ? Align.bottomLeft : Align.topLeft); } private Element itemImage(TextureRegion region, Prov text){ diff --git a/core/src/mindustry/world/Block.java b/core/src/mindustry/world/Block.java index 2fb61fd4b7..5f073c64dd 100644 --- a/core/src/mindustry/world/Block.java +++ b/core/src/mindustry/world/Block.java @@ -264,8 +264,8 @@ public class Block extends UnlockableContent implements Senseable{ public boolean commandable; /** If true, the building inventory can be shown with the config. */ public boolean allowConfigInventory = true; - /** If true, the building inventory will swap sides on the x axis each time it is tapped */ - public boolean swapConfigInventory = false; + /** If true, the building inventory will be placed diagonally on the top right. */ + public boolean diagonalConfigInventory = false; /** Defines how large selection menus, such as that of sorters, should be. */ public int selectionRows = 5, selectionColumns = 4; /** If true, this block can be configured by logic. */ diff --git a/core/src/mindustry/world/blocks/distribution/ItemBridge.java b/core/src/mindustry/world/blocks/distribution/ItemBridge.java index 92ad7e630f..0c3d002eb4 100644 --- a/core/src/mindustry/world/blocks/distribution/ItemBridge.java +++ b/core/src/mindustry/world/blocks/distribution/ItemBridge.java @@ -58,7 +58,7 @@ public class ItemBridge extends Block{ allowDiagonal = false; copyConfig = false; ignoreResizeConfig = true; - swapConfigInventory = true; + diagonalConfigInventory = true; priority = TargetPriority.transport; delayLandingConfig = true; @@ -156,7 +156,7 @@ public class ItemBridge extends Block{ if(!(tile.block().hasItems && other.block().hasItems) && !(tile.block().hasLiquids && other.block().hasLiquids)) return false; } - return ((linkSameType ? other.block() == tile.block() && tile.block() == this : (other.block() instanceof ItemBridge && tile.block() instanceof ItemBridge)) + return ((linkSameType ? other.block() == tile.block() && tile.block() == this : (other.block() instanceof ItemBridge && tile.block() instanceof ItemBridge)) || (!(tile.block() instanceof ItemBridge) && other.block() == this)) && (other.team() == tile.team() || tile.block() != this) && (!checkDouble || ((ItemBridgeBuild)other.build).link != tile.pos());