update widgets

This commit is contained in:
DBotThePony 2021-08-14 12:37:34 +07:00
parent d5a0c8acd2
commit 010fd38e92
Signed by: DBot
GPG Key ID: DCC23B5715498507
3 changed files with 7 additions and 7 deletions

View File

@ -30,9 +30,9 @@ public class BatteryBankMenu extends MatteryMenu {
this.tile = tile;
if (tile == null || tile.getCapability(MatteryCapability.ENERGY).resolve().isEmpty()) {
battery_widget = new BatteryLevelWidget(this, 13, 14);
battery_widget = new BatteryLevelWidget(this, 13, 24);
} else {
battery_widget = new BatteryLevelWidget(this, 13, 14, tile.getCapability(MatteryCapability.ENERGY).resolve().get());
battery_widget = new BatteryLevelWidget(this, 13, 24, tile.getCapability(MatteryCapability.ENERGY).resolve().get());
}
for (int row = 0; row < 3; row++)

View File

@ -12,7 +12,7 @@ import java.util.List;
import java.util.function.Supplier;
public class ProgressGaugeWidget<T extends MatteryMenu> extends GaugeWidget<T> {
protected Supplier<Float> progress_supplier;
protected final Supplier<Float> progress_supplier;
protected final ContainerData progress_container = new ContainerData() {
private int value;
@ -33,15 +33,15 @@ public class ProgressGaugeWidget<T extends MatteryMenu> extends GaugeWidget<T> {
}
};
public ProgressGaugeWidget(T menu, int x, int y) {
public ProgressGaugeWidget(T menu, int x, int y, Supplier<Float> progress) {
super(menu, x, y);
fill_order = GaugeDirection.LEFT_TO_RIGHT;
addDataSlots(progress_container);
progress_supplier = progress;
}
public ProgressGaugeWidget(T menu, int x, int y, Supplier<Float> progress) {
this(menu, x, y);
progress_supplier = progress;
public ProgressGaugeWidget(T menu, int x, int y) {
this(menu, x, y, null);
}
@Override