initial implementation

This commit is contained in:
Leonwang4234 2020-11-07 17:20:58 -08:00
parent fda2ed8b41
commit f9954ea4c7
3 changed files with 11 additions and 2 deletions

View File

@ -229,6 +229,8 @@ public class UnitType extends UnlockableContent{
if(inst instanceof Payloadc){
stats.add(Stat.payloadCapacity, (payloadCapacity / (tilesize * tilesize)), StatUnit.blocksSquared);
}
stats.add(Stat.weapons, new WeaponListValue(this, weapons));
}
@CallSuper

View File

@ -55,6 +55,10 @@ public enum Stat{
linkRange(StatCat.crafting),
instructions(StatCat.crafting),
weapons(StatCat.function),
mirrored(StatCat.function),
bullet(StatCat.function),
speedIncrease(StatCat.function),
repairTime(StatCat.function),
range(StatCat.function),

View File

@ -10,6 +10,7 @@ import mindustry.content.*;
import mindustry.ctype.*;
import mindustry.entities.bullet.*;
import mindustry.gen.*;
import mindustry.type.*;
import mindustry.ui.*;
import mindustry.world.meta.*;
@ -28,8 +29,10 @@ public class AmmoListValue<T extends UnlockableContent> implements StatValue{
table.row();
for(T t : map.keys()){
BulletType type = map.get(t);
table.image(icon(t)).size(3 * 8).padRight(4).right().top();
table.add(t.localizedName).padRight(10).left().top();
if(!(t instanceof UnitType)){
table.image(icon(t)).size(3 * 8).padRight(4).right().top();
table.add(t.localizedName).padRight(10).left().top();
}
table.table(Tex.underline, bt -> {
bt.left().defaults().padRight(3).left();