UI layout fixes

This commit is contained in:
Anuken
2019-03-28 12:50:22 -04:00
parent d56869aefa
commit fd190c7770
2 changed files with 24 additions and 21 deletions

View File

@@ -46,7 +46,8 @@ public class CustomGameDialog extends FloatingDialog{
Table selmode = new Table(); Table selmode = new Table();
ButtonGroup<TextButton> group = new ButtonGroup<>(); ButtonGroup<TextButton> group = new ButtonGroup<>();
selmode.add("$level.mode").padRight(15f); selmode.add("$level.mode").colspan(4);
selmode.row();
int i = 0; int i = 0;
Table modes = new Table(); Table modes = new Table();
@@ -75,7 +76,8 @@ public class CustomGameDialog extends FloatingDialog{
Table sdif = new Table(); Table sdif = new Table();
sdif.add("$setting.difficulty.name").padRight(15f); sdif.add("$setting.difficulty.name").colspan(3);
sdif.row();
sdif.defaults().height(s + 4); sdif.defaults().height(s + 4);
sdif.addImageButton("icon-arrow-left", 10 * 3, () -> { sdif.addImageButton("icon-arrow-left", 10 * 3, () -> {
difficulty = (ds[Mathf.mod(difficulty.ordinal() - 1, ds.length)]); difficulty = (ds[Mathf.mod(difficulty.ordinal() - 1, ds.length)]);

View File

@@ -14,7 +14,7 @@ public class GameOverDialog extends FloatingDialog{
public GameOverDialog(){ public GameOverDialog(){
super("$gameover"); super("$gameover");
setFillParent(false); setFillParent(true);
shown(this::rebuild); shown(this::rebuild);
} }
@@ -43,36 +43,37 @@ public class GameOverDialog extends FloatingDialog{
cont.row(); cont.row();
} }
cont.table(t -> { cont.pane(t -> {
cont.left().defaults().left(); t.margin(13f);
cont.add(Core.bundle.format("stat.wave", state.stats.wavesLasted)); t.left().defaults().left();
cont.row(); t.add(Core.bundle.format("stat.wave", state.stats.wavesLasted));
cont.add(Core.bundle.format("stat.enemiesDestroyed", state.stats.enemyUnitsDestroyed)); t.row();
cont.row(); t.add(Core.bundle.format("stat.enemiesDestroyed", state.stats.enemyUnitsDestroyed));
cont.add(Core.bundle.format("stat.built", state.stats.buildingsBuilt)); t.row();
cont.row(); t.add(Core.bundle.format("stat.built", state.stats.buildingsBuilt));
cont.add(Core.bundle.format("stat.destroyed", state.stats.buildingsDestroyed)); t.row();
cont.row(); t.add(Core.bundle.format("stat.destroyed", state.stats.buildingsDestroyed));
cont.add(Core.bundle.format("stat.deconstructed", state.stats.buildingsDeconstructed)); t.row();
cont.row(); t.add(Core.bundle.format("stat.deconstructed", state.stats.buildingsDeconstructed));
t.row();
if(world.isZone() && !state.stats.itemsDelivered.isEmpty()){ if(world.isZone() && !state.stats.itemsDelivered.isEmpty()){
cont.add("$stat.delivered"); t.add("$stat.delivered");
cont.row(); t.row();
for(Item item : content.items()){ for(Item item : content.items()){
if(state.stats.itemsDelivered.get(item, 0) > 0){ if(state.stats.itemsDelivered.get(item, 0) > 0){
cont.table(items -> { t.table(items -> {
items.add(" [LIGHT_GRAY]" + state.stats.itemsDelivered.get(item, 0)); items.add(" [LIGHT_GRAY]" + state.stats.itemsDelivered.get(item, 0));
items.addImage(item.icon(Icon.medium)).size(8 *3).pad(4); items.addImage(item.icon(Icon.medium)).size(8 *3).pad(4);
}).left(); }).left();
cont.row(); t.row();
} }
} }
} }
if(world.isZone()){ if(world.isZone()){
RankResult result = state.stats.calculateRank(world.getZone(), state.launched); RankResult result = state.stats.calculateRank(world.getZone(), state.launched);
cont.add(Core.bundle.format("stat.rank", result.rank + result.modifier)); t.add(Core.bundle.format("stat.rank", result.rank + result.modifier));
cont.row(); t.row();
} }
}).pad(12); }).pad(12);