nothing
This commit is contained in:
@@ -1,33 +0,0 @@
|
|||||||
package io.anuke.mindustry.ui;
|
|
||||||
|
|
||||||
import io.anuke.arc.graphics.Color;
|
|
||||||
import io.anuke.arc.scene.ui.TextButton;
|
|
||||||
import io.anuke.arc.util.Align;
|
|
||||||
|
|
||||||
import static io.anuke.mindustry.Vars.iconsize;
|
|
||||||
|
|
||||||
public class MenuButton extends TextButton{
|
|
||||||
|
|
||||||
public MenuButton(String icon, String text, Runnable clicked){
|
|
||||||
this(icon, text, null, clicked);
|
|
||||||
}
|
|
||||||
|
|
||||||
public MenuButton(String icon, String text, String description, Runnable clicked){
|
|
||||||
super("default");
|
|
||||||
|
|
||||||
clicked(clicked);
|
|
||||||
clearChildren();
|
|
||||||
|
|
||||||
margin(0);
|
|
||||||
|
|
||||||
table(t -> {
|
|
||||||
t.addImage(icon).size(iconsize).padLeft(6);
|
|
||||||
|
|
||||||
t.add(text).wrap().growX().get().setAlignment(Align.center, Align.left);
|
|
||||||
if(description != null){
|
|
||||||
t.row();
|
|
||||||
t.add(description).color(Color.LIGHT_GRAY);
|
|
||||||
}
|
|
||||||
}).padLeft(5).growX();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -7,6 +7,7 @@ import io.anuke.arc.graphics.Color;
|
|||||||
import io.anuke.arc.graphics.g2d.Draw;
|
import io.anuke.arc.graphics.g2d.Draw;
|
||||||
import io.anuke.arc.graphics.g2d.Lines;
|
import io.anuke.arc.graphics.g2d.Lines;
|
||||||
import io.anuke.arc.math.Interpolation;
|
import io.anuke.arc.math.Interpolation;
|
||||||
|
import io.anuke.arc.math.geom.Rectangle;
|
||||||
import io.anuke.arc.scene.Element;
|
import io.anuke.arc.scene.Element;
|
||||||
import io.anuke.arc.scene.Group;
|
import io.anuke.arc.scene.Group;
|
||||||
import io.anuke.arc.scene.actions.Actions;
|
import io.anuke.arc.scene.actions.Actions;
|
||||||
@@ -33,6 +34,7 @@ public class TechTreeDialog extends FloatingDialog{
|
|||||||
private final float nodeSize = Unit.dp.scl(60f);
|
private final float nodeSize = Unit.dp.scl(60f);
|
||||||
private ObjectSet<TechTreeNode> nodes = new ObjectSet<>();
|
private ObjectSet<TechTreeNode> nodes = new ObjectSet<>();
|
||||||
private TechTreeNode root = new TechTreeNode(TechTree.root, null);
|
private TechTreeNode root = new TechTreeNode(TechTree.root, null);
|
||||||
|
private Rectangle bounds = new Rectangle();
|
||||||
private ItemsDisplay items;
|
private ItemsDisplay items;
|
||||||
|
|
||||||
public TechTreeDialog(){
|
public TechTreeDialog(){
|
||||||
@@ -68,6 +70,7 @@ public class TechTreeDialog extends FloatingDialog{
|
|||||||
layout.gapBetweenNodes = Unit.dp.scl(40f);
|
layout.gapBetweenNodes = Unit.dp.scl(40f);
|
||||||
LayoutNode node = new LayoutNode(root, null);
|
LayoutNode node = new LayoutNode(root, null);
|
||||||
layout.layout(node);
|
layout.layout(node);
|
||||||
|
bounds.set(layout.getBounds());
|
||||||
copyInfo(node);
|
copyInfo(node);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -312,6 +315,8 @@ public class TechTreeDialog extends FloatingDialog{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Lines.rect(bounds.x + Core.graphics.getWidth()/2f, bounds.y + Core.graphics.getHeight()/2f, bounds.width, bounds.height);
|
||||||
|
|
||||||
Draw.reset();
|
Draw.reset();
|
||||||
super.draw();
|
super.draw();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user