This commit is contained in:
Anuken
2020-10-31 16:25:50 -04:00
parent 95c444a004
commit b5e2812d0b
3 changed files with 8 additions and 6 deletions

View File

@@ -21,9 +21,11 @@ public class LogicDialog extends BaseDialog{
canvas = new LCanvas();
shouldPause = true;
addCloseButton();
buttons.getCells().first().width(170f);
addCloseListener();
buttons.defaults().size(160f, 64f);
buttons.button("@back", Icon.left, this::hide);
buttons.button("@edit", Icon.edit, () -> {
BaseDialog dialog = new BaseDialog("@editor.export");
@@ -51,7 +53,7 @@ public class LogicDialog extends BaseDialog{
dialog.addCloseButton();
dialog.show();
}).width(170f);
});
buttons.button("@add", Icon.add, () -> {
BaseDialog dialog = new BaseDialog("@add");
@@ -75,7 +77,7 @@ public class LogicDialog extends BaseDialog{
});
dialog.addCloseButton();
dialog.show();
}).width(170f).disabled(t -> canvas.statements.getChildren().size >= LExecutor.maxInstructions);
}).disabled(t -> canvas.statements.getChildren().size >= LExecutor.maxInstructions);
add(canvas).grow();

View File

@@ -99,7 +99,7 @@ public class Sector{
}
public String name(){
if(preset != null) return preset.localizedName;
if(preset != null && info.name == null) return preset.localizedName;
return info.name == null ? id + "" : info.name;
}

View File

@@ -136,7 +136,7 @@ public class PlanetDialog extends BaseDialog implements PlanetInterfaceRenderer{
if(to.near().contains(launchSector)) return launchSector;
Sector launchFrom = launchSector;
if(launchFrom == null){
if(launchFrom == null || (to.preset == null && !to.near().contains(launchSector))){
//TODO pick one with the most resources
launchFrom = to.near().find(Sector::hasBase);
if(launchFrom == null && to.preset != null){