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

View File

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