Merge branch 'erekir' of https://github.com/Anuken/Mindustry into erekir

This commit is contained in:
Anuken
2022-05-08 23:53:28 -04:00

View File

@ -53,24 +53,25 @@ public class GameOverDialog extends BaseDialog{
buttons.margin(10); buttons.margin(10);
cont.table(t -> {
if(state.rules.pvp && winner != null){ if(state.rules.pvp && winner != null){
cont.add(Core.bundle.format("gameover.pvp", winner.localized())).pad(6); t.add(Core.bundle.format("gameover.pvp", winner.localized())).center().pad(6);
}else{ }else{
cont.add(state.isCampaign() ? Core.bundle.format("sector.lost", state.getSector().name()) : "@gameover").center().pad(6); t.add(state.isCampaign() ? Core.bundle.format("sector.lost", state.getSector().name()) : "@gameover").center().pad(6);
} }
cont.row(); t.row();
if(control.isHighScore()){ if(control.isHighScore()){
cont.add("@highscore").pad(6); t.add("@highscore").pad(6);
cont.row(); t.row();
} }
cont.pane(t -> { t.pane(p -> {
t.margin(13f); p.margin(13f);
t.left().defaults().left(); p.left().defaults().left();
t.setBackground(Styles.black3); p.setBackground(Styles.black3);
t.table(stats -> { p.table(stats -> {
if(state.rules.waves) addStat(stats, Core.bundle.get("stats.wave"), state.stats.wavesLasted, 0f); if(state.rules.waves) addStat(stats, Core.bundle.get("stats.wave"), state.stats.wavesLasted, 0f);
addStat(stats, Core.bundle.get("stats.unitsCreated"), state.stats.unitsCreated, 0.05f); addStat(stats, Core.bundle.get("stats.unitsCreated"), state.stats.unitsCreated, 0.05f);
addStat(stats, Core.bundle.get("stats.enemiesDestroyed"), state.stats.enemyUnitsDestroyed, 0.1f); addStat(stats, Core.bundle.get("stats.enemiesDestroyed"), state.stats.enemyUnitsDestroyed, 0.1f);
@ -80,15 +81,16 @@ public class GameOverDialog extends BaseDialog{
}).top().grow().row(); }).top().grow().row();
if(control.saves.getCurrent() != null){ if(control.saves.getCurrent() != null){
t.table(tt -> { p.table(pt -> {
tt.add(new FLabel(Core.bundle.get("stats.playtime"))).left().pad(5).growX(); pt.add(new FLabel(Core.bundle.get("stats.playtime"))).left().pad(5).growX();
tt.add(new FLabel("[accent]" + control.saves.getCurrent().getPlayTime())).right().pad(5); pt.add(new FLabel("[accent]" + control.saves.getCurrent().getPlayTime())).right().pad(5);
}).growX(); }).growX();
} }
}).minWidth(370).maxSize(580, 500).grow().pad(12).center().get(); }).grow().pad(12).top();
}).center().minWidth(370).maxSize(600, 550).grow();
if(state.isCampaign() && net.client()){ if(state.isCampaign() && net.client()){
cont.row();
cont.add("@gameover.waiting").padTop(20f).row(); cont.add("@gameover.waiting").padTop(20f).row();
} }