add names to some major dialog elements
This commit is contained in:
@@ -38,14 +38,15 @@ public class PausedDialog extends BaseDialog{
|
|||||||
cont.label(() -> state.getSector() == null ? "" :
|
cont.label(() -> state.getSector() == null ? "" :
|
||||||
("[lightgray]Next turn in [accent]" + state.getSector().displayTimeRemaining() +
|
("[lightgray]Next turn in [accent]" + state.getSector().displayTimeRemaining() +
|
||||||
(state.rules.winWave > 0 && !state.getSector().isCaptured() ? "\n[lightgray]Reach wave[accent] " + state.rules.winWave + "[] to capture" : "")))
|
(state.rules.winWave > 0 && !state.getSector().isCaptured() ? "\n[lightgray]Reach wave[accent] " + state.rules.winWave + "[] to capture" : "")))
|
||||||
.visible(() -> state.getSector() != null).colspan(2);
|
.visible(() -> state.getSector() != null).colspan(2)
|
||||||
|
.name("turn");
|
||||||
cont.row();
|
cont.row();
|
||||||
|
|
||||||
float dw = 220f;
|
float dw = 220f;
|
||||||
cont.defaults().width(dw).height(55).pad(5f);
|
cont.defaults().width(dw).height(55).pad(5f);
|
||||||
|
|
||||||
cont.button("@back", Icon.left, this::hide);
|
cont.button("@back", Icon.left, this::hide).name("back");
|
||||||
cont.button("@settings", Icon.settings, ui.settings::show);
|
cont.button("@settings", Icon.settings, ui.settings::show).name("settings");
|
||||||
|
|
||||||
if(!state.rules.tutorial){
|
if(!state.rules.tutorial){
|
||||||
if(!state.isCampaign() && !state.isEditor()){
|
if(!state.isCampaign() && !state.isEditor()){
|
||||||
|
|||||||
@@ -32,18 +32,18 @@ public class PlanetDialog extends BaseDialog implements PlanetInterfaceRenderer{
|
|||||||
//if true, enables launching anywhere for testing
|
//if true, enables launching anywhere for testing
|
||||||
public static boolean debugSelect = false;
|
public static boolean debugSelect = false;
|
||||||
|
|
||||||
final FrameBuffer buffer = new FrameBuffer(2, 2, true);
|
public final FrameBuffer buffer = new FrameBuffer(2, 2, true);
|
||||||
final PlanetRenderer planets = renderer.planets;
|
public final PlanetRenderer planets = renderer.planets;
|
||||||
final LaunchLoadoutDialog loadouts = new LaunchLoadoutDialog();
|
public final LaunchLoadoutDialog loadouts = new LaunchLoadoutDialog();
|
||||||
final Table stable = new Table().background(Styles.black3);
|
public final Table stable = new Table().background(Styles.black3);
|
||||||
|
|
||||||
int launchRange;
|
public int launchRange;
|
||||||
float zoom = 1f, selectAlpha = 1f;
|
public float zoom = 1f, selectAlpha = 1f;
|
||||||
@Nullable Sector selected, hovered, launchSector;
|
public @Nullable Sector selected, hovered, launchSector;
|
||||||
CoreBuild launcher;
|
public CoreBuild launcher;
|
||||||
Mode mode = look;
|
public Mode mode = look;
|
||||||
boolean launching;
|
public boolean launching;
|
||||||
Cons<Sector> listener = s -> {};
|
public Cons<Sector> listener = s -> {};
|
||||||
|
|
||||||
public PlanetDialog(){
|
public PlanetDialog(){
|
||||||
super("", Styles.fullDialog);
|
super("", Styles.fullDialog);
|
||||||
@@ -237,7 +237,6 @@ public class PlanetDialog extends BaseDialog implements PlanetInterfaceRenderer{
|
|||||||
cont.clear();
|
cont.clear();
|
||||||
titleTable.remove();
|
titleTable.remove();
|
||||||
|
|
||||||
|
|
||||||
cont.stack(
|
cont.stack(
|
||||||
new Element(){
|
new Element(){
|
||||||
{
|
{
|
||||||
@@ -468,7 +467,7 @@ public class PlanetDialog extends BaseDialog implements PlanetInterfaceRenderer{
|
|||||||
stable.act(0f);
|
stable.act(0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
enum Mode{
|
public enum Mode{
|
||||||
/** Look around for existing sectors. Can only deploy. */
|
/** Look around for existing sectors. Can only deploy. */
|
||||||
look,
|
look,
|
||||||
/** Launch to a new location. */
|
/** Launch to a new location. */
|
||||||
|
|||||||
@@ -31,14 +31,14 @@ import java.util.*;
|
|||||||
import static mindustry.Vars.*;
|
import static mindustry.Vars.*;
|
||||||
|
|
||||||
public class ResearchDialog extends BaseDialog{
|
public class ResearchDialog extends BaseDialog{
|
||||||
final float nodeSize = Scl.scl(60f);
|
public final float nodeSize = Scl.scl(60f);
|
||||||
ObjectSet<TechTreeNode> nodes = new ObjectSet<>();
|
public ObjectSet<TechTreeNode> nodes = new ObjectSet<>();
|
||||||
TechTreeNode root = new TechTreeNode(TechTree.root, null);
|
public TechTreeNode root = new TechTreeNode(TechTree.root, null);
|
||||||
Rect bounds = new Rect();
|
public Rect bounds = new Rect();
|
||||||
ItemsDisplay itemDisplay;
|
public ItemsDisplay itemDisplay;
|
||||||
View view;
|
public View view;
|
||||||
|
|
||||||
ItemSeq items;
|
public ItemSeq items;
|
||||||
|
|
||||||
public ResearchDialog(){
|
public ResearchDialog(){
|
||||||
super("");
|
super("");
|
||||||
@@ -114,7 +114,7 @@ public class ResearchDialog extends BaseDialog{
|
|||||||
buttons.button("@database", Icon.book, () -> {
|
buttons.button("@database", Icon.book, () -> {
|
||||||
hide();
|
hide();
|
||||||
ui.database.show();
|
ui.database.show();
|
||||||
}).size(210f, 64f);
|
}).size(210f, 64f).name("database");
|
||||||
|
|
||||||
//scaling/drag input
|
//scaling/drag input
|
||||||
addListener(new InputListener(){
|
addListener(new InputListener(){
|
||||||
@@ -250,7 +250,7 @@ public class ResearchDialog extends BaseDialog{
|
|||||||
return node.content.unlocked() || !node.objectives.contains(i -> !i.complete());
|
return node.content.unlocked() || !node.objectives.contains(i -> !i.complete());
|
||||||
}
|
}
|
||||||
|
|
||||||
void showToast(String info){
|
public void showToast(String info){
|
||||||
Table table = new Table();
|
Table table = new Table();
|
||||||
table.actions(Actions.fadeOut(0.5f, Interp.fade), Actions.remove());
|
table.actions(Actions.fadeOut(0.5f, Interp.fade), Actions.remove());
|
||||||
table.top().add(info);
|
table.top().add(info);
|
||||||
@@ -279,11 +279,11 @@ public class ResearchDialog extends BaseDialog{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class TechTreeNode extends TreeNode<TechTreeNode>{
|
public class TechTreeNode extends TreeNode<TechTreeNode>{
|
||||||
final TechNode node;
|
public final TechNode node;
|
||||||
boolean visible = true, selectable = true;
|
public boolean visible = true, selectable = true;
|
||||||
|
|
||||||
TechTreeNode(TechNode node, TechTreeNode parent){
|
public TechTreeNode(TechNode node, TechTreeNode parent){
|
||||||
this.node = node;
|
this.node = node;
|
||||||
this.parent = parent;
|
this.parent = parent;
|
||||||
this.width = this.height = nodeSize;
|
this.width = this.height = nodeSize;
|
||||||
@@ -297,11 +297,11 @@ public class ResearchDialog extends BaseDialog{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class View extends Group{
|
public class View extends Group{
|
||||||
float panX = 0, panY = -200, lastZoom = -1;
|
public float panX = 0, panY = -200, lastZoom = -1;
|
||||||
boolean moved = false;
|
public boolean moved = false;
|
||||||
ImageButton hoverNode;
|
public ImageButton hoverNode;
|
||||||
Table infoTable = new Table();
|
public Table infoTable = new Table();
|
||||||
|
|
||||||
{
|
{
|
||||||
infoTable.touchable = Touchable.enabled;
|
infoTable.touchable = Touchable.enabled;
|
||||||
|
|||||||
Reference in New Issue
Block a user