mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-03-03 06:03:21 +07:00
Better timer objective formatting
This commit is contained in:
parent
2d025b43ed
commit
5a6d1787c5
@ -197,11 +197,24 @@ public class MapObjectives{
|
|||||||
@Override
|
@Override
|
||||||
public String text(){
|
public String text(){
|
||||||
if(text != null){
|
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("@")){
|
if(text.startsWith("@")){
|
||||||
return Core.bundle.format(text.substring(1), time);
|
return Core.bundle.format(text.substring(1), timeString.toString());
|
||||||
}else{
|
}else{
|
||||||
return Core.bundle.formatString(text, time);
|
return Core.bundle.formatString(text, timeString.toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return text;
|
return text;
|
||||||
|
@ -100,7 +100,7 @@ public class HudFragment{
|
|||||||
parent.fill(t -> {
|
parent.fill(t -> {
|
||||||
t.name = "waiting";
|
t.name = "waiting";
|
||||||
t.visible(() -> netServer.isWaitingForPlayers()).touchable = Touchable.disabled;
|
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
|
//minimap + position
|
||||||
|
Loading…
Reference in New Issue
Block a user