Fix android station missing widgets

This commit is contained in:
DBotThePony 2021-08-23 19:44:34 +07:00
parent 95a96c35ca
commit c45435a6b0
Signed by: DBot
GPG Key ID: DCC23B5715498507
2 changed files with 10 additions and 3 deletions

View File

@ -112,6 +112,9 @@ public class AndroidStationScreen extends MatteryScreen<AndroidStationMenu> impl
@Override
protected FramePanel makeMainFrame() {
var frame = new FramePanel(this, null, 0, 0, FRAME_WIDTH, FRAME_HEIGHT, getTitle());
autoAttachToFrame(frame);
var grid = new GridPanel(this, frame, 0, 0, GRID_WIDTH * 18, 0, GRID_WIDTH, GRID_HEIGHT);
minecraft.player.getCapability(MatteryCapability.ANDROID).ifPresent(_cap -> {

View File

@ -157,11 +157,17 @@ public abstract class MatteryScreen<T extends MatteryMenu> extends AbstractConta
protected FramePanel makeMainFrame() {
var frame = new FramePanel(this, null, 0, 0, 18 * 9 + 16, 100, getTitle());
autoAttachToFrame(frame);
return frame;
}
protected void autoAttachToFrame(FramePanel frame) {
if (this instanceof IMatteryScreenLeftPanel) {
var reserve = new EditablePanel(this, frame, 0, 0, 0, 0);
reserve.setDock(Dock.LEFT);
float available_height = 90;
float available_height = frame.getHeight() - 14;
if (this instanceof IMatteryScreenGaugeGetter gauges) {
float width = 0;
@ -213,8 +219,6 @@ public abstract class MatteryScreen<T extends MatteryMenu> extends AbstractConta
grid_based.createGridPanels(grid);
}
return frame;
}
public ItemRenderer getItemRenderer() {