most ability displays (#8981)

* works

* why not

* idk if that changes it but

* json

* destringening

* automatic imports and leftover marker

* uirfirf
This commit is contained in:
nullevoy
2023-09-02 15:19:32 +02:00
committed by GitHub
parent bff4097c88
commit cc66ccb49f
49 changed files with 358 additions and 107 deletions

View File

@@ -12,6 +12,7 @@ import arc.util.*;
import mindustry.*;
import mindustry.content.*;
import mindustry.ctype.*;
import mindustry.entities.abilities.*;
import mindustry.entities.bullet.*;
import mindustry.gen.*;
import mindustry.maps.*;
@@ -348,7 +349,7 @@ public class StatValues{
public static StatValue weapons(UnitType unit, Seq<Weapon> weapons){
return table -> {
table.row();
for(int i = 0; i < weapons.size;i ++){
for(int i = 0; i < weapons.size; i++){
Weapon weapon = weapons.get(i);
if(weapon.flipSprite || !weapon.hasStats(unit)){
@@ -370,6 +371,23 @@ public class StatValues{
};
}
public static StatValue abilities(Seq<Ability> abilities){
return table -> {
table.row();
table.table(t -> abilities.each(ability -> {
if(ability.display){
t.row();
t.table(Styles.grayPanel, a -> {
a.add("[accent]" + ability.localized()).padBottom(4);
a.row();
a.left().top().defaults().left();
ability.addStats(a);
}).pad(5).margin(10).growX();
}
}));
};
}
public static <T extends UnlockableContent> StatValue ammo(ObjectMap<T, BulletType> map){
return ammo(map, 0, false);
}