Better timer objective formatting

This commit is contained in:
Anuken 2022-04-22 15:05:23 -04:00
parent 2d025b43ed
commit 5a6d1787c5
2 changed files with 17 additions and 4 deletions

View File

@ -197,11 +197,24 @@ public class MapObjectives{
@Override
public String text(){
if(text != null){
int time = (int)((duration - countup) / 60f);
int i = (int)((duration - countup) / 60f);
StringBuilder timeString = new StringBuilder();
int m = i / 60;
int s = i % 60;
if(m > 0){
timeString.append(m);
timeString.append(":");
if(s < 10){
timeString.append("0");
}
}
timeString.append(s);
if(text.startsWith("@")){
return Core.bundle.format(text.substring(1), time);
return Core.bundle.format(text.substring(1), timeString.toString());
}else{
return Core.bundle.formatString(text, time);
return Core.bundle.formatString(text, timeString.toString());
}
}
return text;

View File

@ -100,7 +100,7 @@ public class HudFragment{
parent.fill(t -> {
t.name = "waiting";
t.visible(() -> netServer.isWaitingForPlayers()).touchable = Touchable.disabled;
t.table(Styles.black6, top -> top.add("@waiting.players").style(Styles.outlineLabel).pad(16f));
t.table(Styles.black6, top -> top.add("@waiting.players").style(Styles.outlineLabel).pad(18f));
});
//minimap + position