1
0
mirror of https://github.com/Anuken/Mindustry.git synced 2024-11-11 14:56:10 +03:00

Grammatical correction for remaining enemies label

Noticed that when the remaining enemy count comes down to 1, the word 'enemies' persists on the label, so i corrected that to show 'enemy' or 'enemies' instead, depending on the remaining enemy count.

~~also first dialogue JSON coming soon~~
This commit is contained in:
Luxray5474 2017-12-11 20:22:16 -05:00 committed by GitHub
parent 2d9710c708
commit 7b00d1160e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -159,6 +159,12 @@ public class HudFragment implements Fragment{
}
}
}
private String printEnemiesRemaining() {
if(control.getEnemiesRemaining() == 1) {
return " enemy left";
} else return " enemies left";
}
private void addWaveTable(){
float uheight = 66f;
@ -173,7 +179,7 @@ public class HudFragment implements Fragment{
row();
new label(()-> control.getEnemiesRemaining() > 0 ?
control.getEnemiesRemaining() + " enemies" :
control.getEnemiesRemaining() + printEnemiesRemaining() :
(control.getTutorial().active() || Vars.control.getMode() == GameMode.sandbox) ? "waiting..." : "Wave in " + (int) (control.getWaveCountdown() / 60f))
.minWidth(140).units(Unit.dp).left();