diff --git a/core/src/mindustry/content/TechTree.java b/core/src/mindustry/content/TechTree.java index efc6ef77f6..574c3a18f2 100644 --- a/core/src/mindustry/content/TechTree.java +++ b/core/src/mindustry/content/TechTree.java @@ -22,7 +22,6 @@ public class TechTree implements ContentList{ node(conveyor, () -> { node(junction, () -> { - node(itemBridge); node(router, () -> { node(launchPad, () -> { node(launchPadLarge, () -> { @@ -45,16 +44,18 @@ public class TechTree implements ContentList{ }); }); - node(titaniumConveyor, () -> { - node(phaseConveyor, () -> { - node(massDriver, () -> { + node(itemBridge, () -> { + node(titaniumConveyor, () -> { + node(phaseConveyor, () -> { + node(massDriver, () -> { + + }); + }); + + node(armoredConveyor, () -> { }); }); - - node(armoredConveyor, () -> { - - }); }); }); }); @@ -102,23 +103,25 @@ public class TechTree implements ContentList{ node(copperWall, () -> { - node(copperWallLarge); - node(titaniumWall, () -> { - node(door, () -> { - node(doorLarge); - }); - node(plastaniumWall, () -> { - node(plastaniumWallLarge, () -> { + node(copperWallLarge, () -> { + node(titaniumWall, () -> { + node(titaniumWallLarge); + node(door, () -> { + node(doorLarge); }); - }); - node(titaniumWallLarge); - node(thoriumWall, () -> { - node(thoriumWallLarge); - node(surgeWall, () -> { - node(surgeWallLarge); - node(phaseWall, () -> { - node(phaseWallLarge); + node(plastaniumWall, () -> { + node(plastaniumWallLarge, () -> { + + }); + }); + node(thoriumWall, () -> { + node(thoriumWallLarge); + node(surgeWall, () -> { + node(surgeWallLarge); + node(phaseWall, () -> { + node(phaseWallLarge); + }); }); }); }); diff --git a/core/src/mindustry/ui/dialogs/TechTreeDialog.java b/core/src/mindustry/ui/dialogs/TechTreeDialog.java index 4abf44e1a9..6889d55bed 100644 --- a/core/src/mindustry/ui/dialogs/TechTreeDialog.java +++ b/core/src/mindustry/ui/dialogs/TechTreeDialog.java @@ -1,6 +1,7 @@ package mindustry.ui.dialogs; import arc.*; +import arc.scene.ui.layout.Stack; import arc.struct.*; import arc.graphics.*; import arc.graphics.g2d.*; @@ -25,6 +26,8 @@ import mindustry.ui.Cicon; import mindustry.ui.layout.*; import mindustry.ui.layout.TreeLayout.*; +import java.util.*; + import static mindustry.Vars.*; public class TechTreeDialog extends FloatingDialog{ @@ -110,9 +113,24 @@ public class TechTreeDialog extends FloatingDialog{ } void treeLayout(){ - TreeLayout layout = new RadialTreeLayout(); + float spacing = 20f; LayoutNode node = new LayoutNode(root, null); - layout.layout(node); + LayoutNode[] children = node.children; + LayoutNode[] leftHalf = Arrays.copyOfRange(node.children, 0, Mathf.ceil(node.children.length/2f)); + LayoutNode[] rightHalf = Arrays.copyOfRange(node.children, Mathf.ceil(node.children.length/2f), node.children.length); + node.children = leftHalf; + new BranchTreeLayout(){{ + gapBetweenLevels = gapBetweenNodes = spacing; + }}.layout(node); + node.children = rightHalf; + + new BranchTreeLayout(){{ + gapBetweenLevels = gapBetweenNodes = spacing; + rootLocation = TreeLocation.bottom; + }}.layout(node); + + node.children = children; + float minx = 0f, miny = 0f, maxx = 0f, maxy = 0f; copyInfo(node); @@ -378,7 +396,12 @@ public class TechTreeDialog extends FloatingDialog{ Lines.stroke(Scl.scl(4f), locked(node.node) || locked(child.node) ? Pal.gray : Pal.accent); Draw.alpha(parentAlpha); - Lines.line(node.x + offsetX, node.y + offsetY, child.x + offsetX, child.y + offsetY); + if(Mathf.equal(Math.abs(node.y - child.y), Math.abs(node.x - child.x), 1f) && Mathf.dstm(node.x, node.y, child.x, child.y) <= node.width*3){ + Lines.line(node.x + offsetX, node.y + offsetY, child.x + offsetX, child.y + offsetY); + }else{ + Lines.line(node.x + offsetX, node.y + offsetY, child.x + offsetX, node.y + offsetY); + Lines.line(child.x + offsetX, node.y + offsetY, child.x + offsetX, child.y + offsetY); + } } } diff --git a/core/src/mindustry/ui/layout/BranchTreeLayout.java b/core/src/mindustry/ui/layout/BranchTreeLayout.java index 07c3fb5497..15dbe4ae6f 100644 --- a/core/src/mindustry/ui/layout/BranchTreeLayout.java +++ b/core/src/mindustry/ui/layout/BranchTreeLayout.java @@ -148,8 +148,7 @@ public class BranchTreeLayout implements TreeLayout{ wPlus.mode = wPlus.mode + shift; } - private TreeNode apportion(TreeNode v, TreeNode defaultAncestor, - TreeNode leftSibling, TreeNode parentOfV){ + private TreeNode apportion(TreeNode v, TreeNode defaultAncestor, TreeNode leftSibling, TreeNode parentOfV){ if(leftSibling == null){ return defaultAncestor; } diff --git a/gradle.properties b/gradle.properties index 20adabc721..5a91dd2eba 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,3 +1,3 @@ org.gradle.daemon=true org.gradle.jvmargs=-Xms256m -Xmx1024m -archash=e5894c1aaa00d4ba1c75ba16c7f341d2ea70344c +archash=ad4050f9b828c264c5e70e48679064ef5e4152fb