mirror of
https://github.com/yawaflua/Informatis.git
synced 2026-02-04 10:24:21 +02:00
update unitbar data
This commit is contained in:
@@ -24,6 +24,7 @@ import mindustry.graphics.*;
|
|||||||
import mindustry.logic.*;
|
import mindustry.logic.*;
|
||||||
import mindustry.type.*;
|
import mindustry.type.*;
|
||||||
import mindustry.ui.*;
|
import mindustry.ui.*;
|
||||||
|
import mindustry.world.Block;
|
||||||
import mindustry.world.blocks.*;
|
import mindustry.world.blocks.*;
|
||||||
import mindustry.world.blocks.defense.*;
|
import mindustry.world.blocks.defense.*;
|
||||||
import mindustry.world.blocks.defense.turrets.*;
|
import mindustry.world.blocks.defense.turrets.*;
|
||||||
@@ -455,6 +456,21 @@ public class UnitWindow extends Window {
|
|||||||
data.add(new BarData(bundle.format("shar-stat.attr", Mathf.round(display)), Pal.ammo, pro));
|
data.add(new BarData(bundle.format("shar-stat.attr", Mathf.round(display)), Pal.ammo, pro));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(target instanceof UnitAssembler.UnitAssemblerBuild assemblerBuild) {
|
||||||
|
UnitAssembler.AssemblerUnitPlan plan = assemblerBuild.plan();
|
||||||
|
|
||||||
|
UnitType unit = assemblerBuild.unit();
|
||||||
|
if(unit == null) data.add(new BarData("[lightgray]" + Iconc.cancel, Pal.power, 0f));
|
||||||
|
else data.add(new BarData(bundle.format("shar-stat.progress", Math.round(assemblerBuild.progress * 100 * 100) / 100), Pal.power, assemblerBuild.progress));
|
||||||
|
|
||||||
|
for(PayloadStack stack : plan.requirements) {
|
||||||
|
int value = assemblerBuild.blocks.get(stack.item);
|
||||||
|
int max = stack.amount;
|
||||||
|
float pro = value / (max * 1f);
|
||||||
|
data.add(new BarData(stack.item.localizedName + ": " + value + " / " + max, Pal.accent.cpy().lerp(Color.orange, pro), pro, stack.item.fullIcon));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user