Merge branch 'master' into patch-2

This commit is contained in:
Sharlotte
2021-07-30 18:04:08 +09:00
committed by GitHub
7 changed files with 63 additions and 34 deletions

View File

@@ -52,7 +52,7 @@ public class BarInfo {
return Strings.fixed(number, 1);
}
public static <T extends Teamc> void getInfo(T target) {
public static <T extends Teamc> void getInfo(T target) throws IllegalAccessException, NoSuchFieldException {
for(int i = 0; i < 6; i++) { //init
strings.set(i, "[lightgray]<Empty>[]");
colors.set(i, Color.clear);
@@ -109,9 +109,12 @@ public class BarInfo {
numbers.set(1, (float) mend.sense(LAccess.progress));
}
else if(target instanceof OverdriveProjector.OverdriveBuild over){
strings.set(1, Core.bundle.format("shar-stat.progress", Strings.fixed((float) over.sense(LAccess.progress) * 100f, 2)));
colors.set(1, Pal.heal);
numbers.set(1, (float) over.sense(LAccess.progress));
Field ohno = OverdriveProjector.OverdriveBuild.class.getDeclaredField("charge");
ohno.setAccessible(true);
float charge = (float) ohno.get(over);
strings.set(1, Core.bundle.format("shar-stat.progress", Strings.fixed(Mathf.clamp(charge/((OverdriveProjector)over.block).reload) * 100f, 2)));
colors.set(1, Color.valueOf("feb380"));
numbers.set(1, Mathf.clamp(charge/((OverdriveProjector)over.block).reload));
}
else if(target instanceof Drill.DrillBuild drill){
strings.set(1, bundle.format("shar-stat.progress", Strings.fixed((float) drill.sense(LAccess.progress) * 100f, 2)));
@@ -194,6 +197,13 @@ public class BarInfo {
colors.set(3, Pal.power);
numbers.set(3, factory.unit() == null ? 0f : (float)factory.team.data().countType(factory.unit()) / Units.getCap(factory.team));
}
else if(target instanceof Reconstructor.ReconstructorBuild reconstruct){
strings.set(3, reconstruct.unit() == null ? "[lightgray]" + Iconc.cancel :
Core.bundle.format("bar.unitcap", Fonts.getUnicodeStr(reconstruct.unit().name), format(reconstruct.team.data().countType(reconstruct.unit())), format(Units.getCap(reconstruct.team))));
colors.set(3, Pal.power);
numbers.set(3, reconstruct.unit() == null ? 0f : (float)reconstruct.team.data().countType(reconstruct.unit()) / Units.getCap(reconstruct.team));
}
else if(target instanceof Drill.DrillBuild e){
strings.set(3, bundle.format("bar.drillspeed", Strings.fixed(e.lastDrillSpeed * 60 * e.timeScale, 2)));
colors.set(3, Pal.ammo);