mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-02-01 02:14:27 +07:00
Better timer objective formatting
This commit is contained in:
parent
2d025b43ed
commit
5a6d1787c5
@ -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;
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user