Added sector mission display and generation

This commit is contained in:
Anuken
2018-07-28 22:06:01 -04:00
parent a045ec9d46
commit b2d61a93d9
8 changed files with 45 additions and 9 deletions

View File

@@ -12,7 +12,6 @@ import io.anuke.ucore.scene.Element;
import io.anuke.ucore.scene.event.ClickListener;
import io.anuke.ucore.scene.event.InputEvent;
import io.anuke.ucore.scene.event.InputListener;
import io.anuke.ucore.scene.ui.TextButton;
import io.anuke.ucore.scene.ui.layout.Unit;
import io.anuke.ucore.scene.utils.Cursors;
import io.anuke.ucore.scene.utils.ScissorStack;
@@ -37,18 +36,21 @@ public class SectorsDialog extends FloatingDialog{
addCloseButton();
content().label(() -> Bundles.format("text.sector", selected == null ? "<none>" :
content().label(() -> Bundles.format("text.sector", selected == null ? Bundles.get("text.none") :
(selected.x + ", " + selected.y + (!selected.complete && selected.saveID != -1 ? " " + Bundles.get("text.sector.locked") : ""))
+ (selected.saveID == -1 ? " " + Bundles.get("text.sector.unexplored") :
(selected.hasSave() ? " [accent]/[white] " + Bundles.format("text.sector.time", selected.getSave().getPlayTime()) : ""))));
content().row();
content().label(() -> Bundles.format("text.mission", selected == null ? Bundles.get("text.none") : selected.mission.displayString()));
content().row();
content().add(new SectorView()).grow();
content().row();
buttons().addImageTextButton("$text.sector.deploy", "icon-play", 10*3, () -> {
hide();
ui.loadLogic(() -> world.sectors().playSector(selected));
}).size(230f, 64f).name("deploy-button").disabled(b -> selected == null);
}).size(230f, 64f).disabled(b -> selected == null)
.update(t -> t.setText(selected != null && selected.hasSave() ? "$text.sector.resume" : "$text.sector.deploy"));
if(debug){
buttons().addButton("unlock", () -> world.sectors().completeSector(selected.x, selected.y)).size(230f, 64f).disabled(b -> selected == null);
@@ -56,7 +58,6 @@ public class SectorsDialog extends FloatingDialog{
}
void selectSector(Sector sector){
buttons().<TextButton>find("deploy-button").setText(sector.hasSave() ? "$text.sector.resume" : "$text.sector.deploy");
selected = sector;
}