Better tree layout
This commit is contained in:
@@ -73,6 +73,12 @@ public class TechTree implements ContentList{
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
node(coreFoundation, () -> {
|
||||||
|
node(coreNucleus, () -> {
|
||||||
|
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
node(mechanicalDrill, () -> {
|
node(mechanicalDrill, () -> {
|
||||||
|
|
||||||
node(mechanicalPump, () -> {
|
node(mechanicalPump, () -> {
|
||||||
@@ -255,6 +261,81 @@ public class TechTree implements ContentList{
|
|||||||
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
node(duo, () -> {
|
||||||
|
node(copperWall, () -> {
|
||||||
|
node(copperWallLarge, () -> {
|
||||||
|
node(titaniumWall, () -> {
|
||||||
|
node(titaniumWallLarge);
|
||||||
|
|
||||||
|
node(door, () -> {
|
||||||
|
node(doorLarge);
|
||||||
|
});
|
||||||
|
node(plastaniumWall, () -> {
|
||||||
|
node(plastaniumWallLarge, () -> {
|
||||||
|
|
||||||
|
});
|
||||||
|
});
|
||||||
|
node(thoriumWall, () -> {
|
||||||
|
node(thoriumWallLarge);
|
||||||
|
node(surgeWall, () -> {
|
||||||
|
node(surgeWallLarge);
|
||||||
|
node(phaseWall, () -> {
|
||||||
|
node(phaseWallLarge);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
node(scatter, () -> {
|
||||||
|
node(hail, () -> {
|
||||||
|
|
||||||
|
node(salvo, () -> {
|
||||||
|
node(swarmer, () -> {
|
||||||
|
node(cyclone, () -> {
|
||||||
|
node(spectre, () -> {
|
||||||
|
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
node(ripple, () -> {
|
||||||
|
node(fuse, () -> {
|
||||||
|
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
node(scorch, () -> {
|
||||||
|
node(arc, () -> {
|
||||||
|
node(wave, () -> {
|
||||||
|
node(parallax, () -> {
|
||||||
|
node(segment, () -> {
|
||||||
|
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
node(lancer, () -> {
|
||||||
|
node(meltdown, () -> {
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
node(shockMine, () -> {
|
||||||
|
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
node(groundFactory, () -> {
|
node(groundFactory, () -> {
|
||||||
node(dagger, () -> {
|
node(dagger, () -> {
|
||||||
@@ -323,88 +404,6 @@ public class TechTree implements ContentList{
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
node(coreFoundation, () -> {
|
|
||||||
node(coreNucleus, () -> {
|
|
||||||
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
node(duo, () -> {
|
|
||||||
node(scatter, () -> {
|
|
||||||
node(hail, () -> {
|
|
||||||
|
|
||||||
node(salvo, () -> {
|
|
||||||
node(swarmer, () -> {
|
|
||||||
node(cyclone, () -> {
|
|
||||||
node(spectre, () -> {
|
|
||||||
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
node(ripple, () -> {
|
|
||||||
node(fuse, () -> {
|
|
||||||
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
node(scorch, () -> {
|
|
||||||
node(arc, () -> {
|
|
||||||
node(wave, () -> {
|
|
||||||
node(parallax, () -> {
|
|
||||||
node(segment, () -> {
|
|
||||||
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
node(lancer, () -> {
|
|
||||||
node(meltdown, () -> {
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
node(shockMine, () -> {
|
|
||||||
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
node(copperWall, () -> {
|
|
||||||
node(copperWallLarge, () -> {
|
|
||||||
node(titaniumWall, () -> {
|
|
||||||
node(titaniumWallLarge);
|
|
||||||
|
|
||||||
node(door, () -> {
|
|
||||||
node(doorLarge);
|
|
||||||
});
|
|
||||||
node(plastaniumWall, () -> {
|
|
||||||
node(plastaniumWallLarge, () -> {
|
|
||||||
|
|
||||||
});
|
|
||||||
});
|
|
||||||
node(thoriumWall, () -> {
|
|
||||||
node(thoriumWallLarge);
|
|
||||||
node(surgeWall, () -> {
|
|
||||||
node(surgeWallLarge);
|
|
||||||
node(phaseWall, () -> {
|
|
||||||
node(phaseWallLarge);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static TechNode node(UnlockableContent content, Runnable children){
|
private static TechNode node(UnlockableContent content, Runnable children){
|
||||||
|
|||||||
@@ -416,13 +416,16 @@ public class ResearchDialog extends BaseDialog{
|
|||||||
public void drawChildren(){
|
public void drawChildren(){
|
||||||
clamp();
|
clamp();
|
||||||
float offsetX = panX + width / 2f, offsetY = panY + height / 2f;
|
float offsetX = panX + width / 2f, offsetY = panY + height / 2f;
|
||||||
|
Draw.sort(true);
|
||||||
|
|
||||||
for(TechTreeNode node : nodes){
|
for(TechTreeNode node : nodes){
|
||||||
if(!node.visible) continue;
|
if(!node.visible) continue;
|
||||||
for(TechTreeNode child : node.children){
|
for(TechTreeNode child : node.children){
|
||||||
if(!child.visible) continue;
|
if(!child.visible) continue;
|
||||||
|
boolean lock = locked(node.node) || locked(child.node);
|
||||||
|
Draw.z(lock ? 1f : 2f);
|
||||||
|
|
||||||
Lines.stroke(Scl.scl(4f), locked(node.node) || locked(child.node) ? Pal.gray : Pal.accent);
|
Lines.stroke(Scl.scl(4f), lock ? Pal.gray : Pal.accent);
|
||||||
Draw.alpha(parentAlpha);
|
Draw.alpha(parentAlpha);
|
||||||
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){
|
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);
|
Lines.line(node.x + offsetX, node.y + offsetY, child.x + offsetX, child.y + offsetY);
|
||||||
@@ -433,6 +436,7 @@ public class ResearchDialog extends BaseDialog{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Draw.sort(false);
|
||||||
Draw.reset();
|
Draw.reset();
|
||||||
super.drawChildren();
|
super.drawChildren();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user