Rounding of research amounts

This commit is contained in:
Anuken
2020-07-26 10:35:47 -04:00
parent 42d7eb4e05
commit 95f7fc1b3b
15 changed files with 60 additions and 22 deletions

View File

@@ -14,6 +14,7 @@ import arc.scene.ui.layout.*;
import arc.struct.*;
import arc.util.*;
import arc.util.ArcAnnotate.*;
import mindustry.core.*;
import mindustry.ctype.*;
import mindustry.game.*;
import mindustry.gen.*;
@@ -327,7 +328,7 @@ public class PlanetDialog extends BaseDialog implements PlanetInterfaceRenderer{
int total = (int)(stat.mean * 60);
if(total > 1){
t.image(item.icon(Cicon.small)).padRight(3);
t.add(ui.formatAmount(total) + " /min").color(Color.lightGray);
t.add(UI.formatAmount(total) + " /min").color(Color.lightGray);
t.row();
}
});
@@ -348,7 +349,7 @@ public class PlanetDialog extends BaseDialog implements PlanetInterfaceRenderer{
int amount = Math.min(map.get(item), sector.save.meta.secinfo.storageCapacity);
if(amount > 0){
res.image(item.icon(Cicon.small)).padRight(3);
res.add(ui.formatAmount(amount)).color(Color.lightGray);
res.add(UI.formatAmount(amount)).color(Color.lightGray);
if(++i % 2 == 0){
res.row();
}

View File

@@ -16,6 +16,7 @@ import arc.struct.*;
import arc.util.*;
import mindustry.content.*;
import mindustry.content.TechTree.*;
import mindustry.core.*;
import mindustry.game.EventType.*;
import mindustry.game.Objectives.*;
import mindustry.gen.*;
@@ -381,7 +382,7 @@ public class ResearchDialog extends BaseDialog{
list.left();
list.image(req.item.icon(Cicon.small)).size(8 * 3).padRight(3);
list.add(req.item.localizedName).color(Color.lightGray);
list.label(() -> " " + (player.team().core() != null ? Math.min(player.team().core().items.get(req.item), req.amount) + " / " : "") + req.amount)
list.label(() -> " " + (player.team().core() != null ? UI.formatAmount(Math.min(player.team().core().items.get(req.item), req.amount)) + " / " : "") + UI.formatAmount(req.amount))
.update(l -> l.setColor(items().has(req.item, req.amount) ? Color.lightGray : Color.scarlet));//TODO
}).fillX().left();
t.row();