Skip to content

Commit

Permalink
Slightly resize a handful of multiblock guis so that they don't have …
Browse files Browse the repository at this point in the history
…to make use of scrolling text for default configs when set to english
  • Loading branch information
pupnewfster committed Sep 24, 2024
1 parent cb1a182 commit 070f293
Show file tree
Hide file tree
Showing 18 changed files with 67 additions and 58 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ public class GuiFusionReactorController extends GuiMekanismTile<TileEntityFusion
public GuiFusionReactorController(MekanismTileContainer<TileEntityFusionReactorController> container, Inventory inv, Component title) {
super(container, inv, title);
dynamicSlots = true;
imageWidth += 10;
inventoryLabelX += 5;
titleLabelY = 5;
}

Expand Down Expand Up @@ -52,7 +54,8 @@ protected void addGuiElements() {
@Override
protected void drawForegroundText(@NotNull GuiGraphics guiGraphics, int mouseX, int mouseY) {
renderTitleText(guiGraphics);
drawScrollingString(guiGraphics, MekanismLang.MULTIBLOCK_FORMED.translate(), 0, 16, TextAlignment.LEFT, titleTextColor(), 8, false);
renderInventoryText(guiGraphics);
drawScrollingString(guiGraphics, MekanismLang.MULTIBLOCK_FORMED.translate(), 0, 16, TextAlignment.LEFT, titleTextColor(), 13, false);
super.drawForegroundText(guiGraphics, mouseX, mouseY);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ public GuiFusionReactorFuel(EmptyTileContainer<TileEntityFusionReactorController
@Override
protected void addGuiElements() {
super.addGuiElements();
addRenderableWidget(new GuiChemicalGauge(() -> tile.getMultiblock().deuteriumTank, () -> tile.getMultiblock().getChemicalTanks(null), GaugeType.SMALL, this, 25, 64));
addRenderableWidget(new GuiChemicalGauge(() -> tile.getMultiblock().fuelTank, () -> tile.getMultiblock().getChemicalTanks(null), GaugeType.STANDARD, this, 79, 50));
addRenderableWidget(new GuiChemicalGauge(() -> tile.getMultiblock().tritiumTank, () -> tile.getMultiblock().getChemicalTanks(null), GaugeType.SMALL, this, 133, 64));
addRenderableWidget(new GuiProgress(() -> tile.getMultiblock().isBurning(), ProgressType.SMALL_RIGHT, this, 47, 76));
addRenderableWidget(new GuiProgress(() -> tile.getMultiblock().isBurning(), ProgressType.SMALL_LEFT, this, 101, 76));
addRenderableWidget(new GuiChemicalGauge(() -> tile.getMultiblock().deuteriumTank, () -> tile.getMultiblock().getChemicalTanks(null), GaugeType.SMALL, this, 30, 64));
addRenderableWidget(new GuiChemicalGauge(() -> tile.getMultiblock().fuelTank, () -> tile.getMultiblock().getChemicalTanks(null), GaugeType.STANDARD, this, 84, 50));
addRenderableWidget(new GuiChemicalGauge(() -> tile.getMultiblock().tritiumTank, () -> tile.getMultiblock().getChemicalTanks(null), GaugeType.SMALL, this, 138, 64));
addRenderableWidget(new GuiProgress(() -> tile.getMultiblock().isBurning(), ProgressType.SMALL_RIGHT, this, 52, 76));
addRenderableWidget(new GuiProgress(() -> tile.getMultiblock().isBurning(), ProgressType.SMALL_LEFT, this, 106, 76));
addRenderableWidget(new GuiFusionReactorTab(this, tile, FusionReactorTab.HEAT));
addRenderableWidget(new GuiFusionReactorTab(this, tile, FusionReactorTab.STAT));
injectionRateField = addRenderableWidget(new GuiTextField(this, 98, 115, 26, 11));
injectionRateField = addRenderableWidget(new GuiTextField(this, 103, 115, 26, 11));
injectionRateField.setInputValidator(InputValidator.DIGIT)
.setEnterHandler(this::setInjection)
.setMaxLength(2);
Expand All @@ -47,7 +47,7 @@ protected void addGuiElements() {
@Override
protected void drawForegroundText(@NotNull GuiGraphics guiGraphics, int mouseX, int mouseY) {
drawScrollingString(guiGraphics, GeneratorsLang.REACTOR_INJECTION_RATE.translate(tile.getMultiblock().getInjectionRate()), 0, 35, TextAlignment.CENTER, titleTextColor(), 16, false);
drawScrollingString(guiGraphics, GeneratorsLang.REACTOR_EDIT_RATE.translate(), 4, 117, TextAlignment.RIGHT, titleTextColor(), 94, 2, false);
drawScrollingString(guiGraphics, GeneratorsLang.REACTOR_EDIT_RATE.translate(), 4, 117, TextAlignment.RIGHT, titleTextColor(), 99, 2, false);
super.drawForegroundText(guiGraphics, mouseX, mouseY);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ public double getScaledLevel() {
public Component getText() {
return GeneratorsLang.REACTOR_PLASMA.translate(MekanismUtils.getTemperatureDisplay(getLevel(), TemperatureUnit.KELVIN, true));
}
}, GaugeType.STANDARD, this, 7, 50));
}, GaugeType.STANDARD, this, 12, 50));
addRenderableWidget(new GuiProgress(() -> {
FusionReactorMultiblockData multiblock = tile.getMultiblock();
return multiblock.getLastPlasmaTemp() > multiblock.getLastCaseTemp();
}, ProgressType.SMALL_RIGHT, this, 29, 76));
}, ProgressType.SMALL_RIGHT, this, 34, 76));
addRenderableWidget(new GuiNumberGauge(new INumberInfoHandler() {
@Override
public TextureAtlasSprite getIcon() {
Expand All @@ -79,15 +79,15 @@ public double getScaledLevel() {
public Component getText() {
return GeneratorsLang.REACTOR_CASE.translate(MekanismUtils.getTemperatureDisplay(getLevel(), TemperatureUnit.KELVIN, true));
}
}, GaugeType.STANDARD, this, 61, 50));
addRenderableWidget(new GuiProgress(() -> tile.getMultiblock().getCaseTemp() > 0, ProgressType.SMALL_RIGHT, this, 83, 61));
}, GaugeType.STANDARD, this, 66, 50));
addRenderableWidget(new GuiProgress(() -> tile.getMultiblock().getCaseTemp() > 0, ProgressType.SMALL_RIGHT, this, 88, 61));
addRenderableWidget(new GuiProgress(() -> {
FusionReactorMultiblockData multiblock = tile.getMultiblock();
return multiblock.getCaseTemp() > 0 && !multiblock.waterTank.isEmpty() && multiblock.steamTank.getStored() < multiblock.steamTank.getCapacity();
}, ProgressType.SMALL_RIGHT, this, 83, 91));
addRenderableWidget(new GuiFluidGauge(() -> tile.getMultiblock().waterTank, () -> tile.getFluidTanks(null), GaugeType.SMALL, this, 115, 84));
addRenderableWidget(new GuiChemicalGauge(() -> tile.getMultiblock().steamTank, () -> tile.getChemicalTanks(null), GaugeType.SMALL, this, 151, 84));
addRenderableWidget(new GuiEnergyGauge(tile.getMultiblock().energyContainer, GaugeType.SMALL, this, 115, 46));
}, ProgressType.SMALL_RIGHT, this, 88, 91));
addRenderableWidget(new GuiFluidGauge(() -> tile.getMultiblock().waterTank, () -> tile.getFluidTanks(null), GaugeType.SMALL, this, 120, 84));
addRenderableWidget(new GuiChemicalGauge(() -> tile.getMultiblock().steamTank, () -> tile.getChemicalTanks(null), GaugeType.SMALL, this, 156, 84));
addRenderableWidget(new GuiEnergyGauge(tile.getMultiblock().energyContainer, GaugeType.SMALL, this, 120, 46));
addRenderableWidget(new GuiFusionReactorTab(this, tile, FusionReactorTab.FUEL));
addRenderableWidget(new GuiFusionReactorTab(this, tile, FusionReactorTab.STAT));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public abstract class GuiFusionReactorInfo extends GuiMekanismTile<TileEntityFus

protected GuiFusionReactorInfo(EmptyTileContainer<TileEntityFusionReactorController> container, Inventory inv, Component title) {
super(container, inv, title);
imageWidth += 10;
titleLabelY = 5;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,34 +33,35 @@ protected void addGuiElements() {
protected void drawForegroundText(@NotNull GuiGraphics guiGraphics, int mouseX, int mouseY) {
FusionReactorMultiblockData multiblock = tile.getMultiblock();
if (multiblock.isFormed()) {
int textArea = getXSize() - 8;
int indentation = 4;
int textArea = getXSize() - indentation;
drawScrollingString(guiGraphics,GeneratorsLang.REACTOR_PASSIVE.translateColored(EnumColor.DARK_GREEN),
0, 26, TextAlignment.LEFT, titleTextColor(), 6, false);
drawScrollingString(guiGraphics, GeneratorsLang.REACTOR_MIN_INJECTION.translate(multiblock.getMinInjectionRate(false)),
8, 36, TextAlignment.LEFT, titleTextColor(), textArea, 6, false);
indentation, 36, TextAlignment.LEFT, titleTextColor(), textArea, 6, false);
drawScrollingString(guiGraphics, GeneratorsLang.REACTOR_IGNITION.translate(MekanismUtils.getTemperatureDisplay(multiblock.getIgnitionTemperature(false), TemperatureUnit.KELVIN, true)),
8, 46, TextAlignment.LEFT, titleTextColor(), textArea, 6, false);
indentation, 46, TextAlignment.LEFT, titleTextColor(), textArea, 6, false);
drawScrollingString(guiGraphics, GeneratorsLang.REACTOR_MAX_PLASMA.translate(MekanismUtils.getTemperatureDisplay(multiblock.getMaxPlasmaTemperature(false), TemperatureUnit.KELVIN, true)),
8, 56, TextAlignment.LEFT, titleTextColor(), textArea, 6, false);
indentation, 56, TextAlignment.LEFT, titleTextColor(), textArea, 6, false);
drawScrollingString(guiGraphics, GeneratorsLang.REACTOR_MAX_CASING.translate(MekanismUtils.getTemperatureDisplay(multiblock.getMaxCasingTemperature(false), TemperatureUnit.KELVIN, true)),
8, 66, TextAlignment.LEFT, titleTextColor(), textArea, 6, false);
indentation, 66, TextAlignment.LEFT, titleTextColor(), textArea, 6, false);
drawScrollingString(guiGraphics, GeneratorsLang.REACTOR_PASSIVE_RATE.translate(EnergyDisplay.of(multiblock.getPassiveGeneration(false, false))),
8, 76, TextAlignment.LEFT, titleTextColor(), textArea, 6, false);
indentation, 76, TextAlignment.LEFT, titleTextColor(), textArea, 6, false);

drawScrollingString(guiGraphics,GeneratorsLang.REACTOR_ACTIVE.translateColored(EnumColor.DARK_BLUE),
0, 92, TextAlignment.LEFT, titleTextColor(), 6, false);
drawScrollingString(guiGraphics, GeneratorsLang.REACTOR_MIN_INJECTION.translate(multiblock.getMinInjectionRate(true)),
8, 102, TextAlignment.LEFT, titleTextColor(), textArea, 6, false);
indentation, 102, TextAlignment.LEFT, titleTextColor(), textArea, 6, false);
drawScrollingString(guiGraphics, GeneratorsLang.REACTOR_IGNITION.translate(MekanismUtils.getTemperatureDisplay(multiblock.getIgnitionTemperature(true), TemperatureUnit.KELVIN, true)),
8, 112, TextAlignment.LEFT, titleTextColor(), textArea, 6, false);
indentation, 112, TextAlignment.LEFT, titleTextColor(), textArea, 6, false);
drawScrollingString(guiGraphics, GeneratorsLang.REACTOR_MAX_PLASMA.translate(MekanismUtils.getTemperatureDisplay(multiblock.getMaxPlasmaTemperature(true), TemperatureUnit.KELVIN, true)),
8, 122, TextAlignment.LEFT, titleTextColor(), textArea, 6, false);
indentation, 122, TextAlignment.LEFT, titleTextColor(), textArea, 6, false);
drawScrollingString(guiGraphics, GeneratorsLang.REACTOR_MAX_CASING.translate(MekanismUtils.getTemperatureDisplay(multiblock.getMaxCasingTemperature(true), TemperatureUnit.KELVIN, true)),
8, 132, TextAlignment.LEFT, titleTextColor(), textArea, 6, false);
indentation, 132, TextAlignment.LEFT, titleTextColor(), textArea, 6, false);
drawScrollingString(guiGraphics, GeneratorsLang.REACTOR_PASSIVE_RATE.translate(EnergyDisplay.of(multiblock.getPassiveGeneration(true, false))),
8, 142, TextAlignment.LEFT, titleTextColor(), textArea, 6, false);
indentation, 142, TextAlignment.LEFT, titleTextColor(), textArea, 6, false);
drawScrollingString(guiGraphics, GeneratorsLang.REACTOR_STEAM_PRODUCTION.translate(TextUtils.format(multiblock.getSteamPerTick(false))),
8, 152, TextAlignment.LEFT, titleTextColor(), textArea, 6, false);
indentation, 152, TextAlignment.LEFT, titleTextColor(), textArea, 6, false);
}
super.drawForegroundText(guiGraphics, mouseX, mouseY);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ public class GuiIndustrialTurbine extends GuiMekanismTile<TileEntityTurbineCasin

public GuiIndustrialTurbine(MekanismTileContainer<TileEntityTurbineCasing> container, Inventory inv, Component title) {
super(container, inv, title);
imageWidth += 14;
inventoryLabelX += 7;
inventoryLabelY += 2;
titleLabelY = 5;
dynamicSlots = true;
Expand All @@ -43,7 +45,7 @@ public GuiIndustrialTurbine(MekanismTileContainer<TileEntityTurbineCasing> conta
@Override
protected void addGuiElements() {
super.addGuiElements();
addRenderableWidget(new GuiInnerScreen(this, 50, 18, 112, 50, () -> {
addRenderableWidget(new GuiInnerScreen(this, 50, 18, 126, 50, () -> {
List<Component> list = new ArrayList<>();
TurbineMultiblockData multiblock = tile.getMultiblock();
if (multiblock.isFormed()) {
Expand Down Expand Up @@ -73,7 +75,7 @@ public double getLevel() {
}
return 1;
}
}, 164, 16));
}, 178, 16));
addRenderableWidget(new GuiVerticalRateBar(this, new IBarInfoHandler() {
@Override
public Component getTooltip() {
Expand Down Expand Up @@ -112,15 +114,15 @@ public double getLevel() {
return List.of(MekanismLang.STORING.translate(storing), GeneratorsLang.PRODUCING_AMOUNT.translate(producing));
}));
Component warning = GeneratorsLang.TURBINE_DUMPING_STEAM_WARNING.translateColored(EnumColor.RED);
addRenderableWidget(new GuiGasMode(this, 159, 72, true, () -> tile.getMultiblock().dumpMode, tile.getBlockPos(), 0,
addRenderableWidget(new GuiGasMode(this, 173, 72, true, () -> tile.getMultiblock().dumpMode, tile.getBlockPos(), 0,
TooltipUtils.create(GeneratorsLang.TURBINE_DUMPING_EXCESS_STEAM.translate(), warning),
TooltipUtils.create(GeneratorsLang.TURBINE_DUMPING_STEAM.translate(), warning)));
}

@Override
protected void drawForegroundText(@NotNull GuiGraphics guiGraphics, int mouseX, int mouseY) {
renderTitleText(guiGraphics);
renderInventoryText(guiGraphics, 85);
renderInventoryText(guiGraphics, 99);
super.drawForegroundText(guiGraphics, mouseX, mouseY);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public class GuiTurbineStats extends GuiMekanismTile<TileEntityTurbineCasing, Em

public GuiTurbineStats(EmptyTileContainer<TileEntityTurbineCasing> container, Inventory inv, Component title) {
super(container, inv, title);
imageWidth += 14;
}

@Override
Expand Down Expand Up @@ -60,21 +61,21 @@ protected void drawForegroundText(@NotNull GuiGraphics guiGraphics, int mouseX,
int lowerVolume = multiblock.lowerVolume;
int dispersers = multiblock.getDispersers();
int vents = multiblock.vents;
drawScrollingString(guiGraphics, GeneratorsLang.TURBINE_TANK_VOLUME.translate(lowerVolume), 0, 26, TextAlignment.LEFT, titleTextColor(), 8, false);
drawScrollingString(guiGraphics, GeneratorsLang.TURBINE_TANK_VOLUME.translate(lowerVolume), 0, 26, TextAlignment.LEFT, titleTextColor(), 6, false);
boolean dispersersLimiting = lowerVolume * dispersers * MekanismGeneratorsConfig.generators.turbineDisperserChemicalFlow.get()
< vents * MekanismGeneratorsConfig.generators.turbineVentChemicalFlow.get();
boolean ventsLimiting = lowerVolume * dispersers * MekanismGeneratorsConfig.generators.turbineDisperserChemicalFlow.get()
> vents * MekanismGeneratorsConfig.generators.turbineVentChemicalFlow.get();
drawScrollingString(guiGraphics, GeneratorsLang.TURBINE_STEAM_FLOW.translate(), 0, 40, TextAlignment.LEFT, subheadingTextColor(), 8, false);
drawScrollingString(guiGraphics, GeneratorsLang.TURBINE_DISPERSERS.translate(dispersers, dispersersLimiting ? limiting : ""), 6, 49, TextAlignment.LEFT, titleTextColor(), getXSize() - 6, 8, false);
drawScrollingString(guiGraphics, GeneratorsLang.TURBINE_VENTS.translate(vents, ventsLimiting ? limiting : ""), 6, 58, TextAlignment.LEFT, titleTextColor(), getXSize() - 6, 8, false);
drawScrollingString(guiGraphics, GeneratorsLang.TURBINE_STEAM_FLOW.translate(), 0, 40, TextAlignment.LEFT, subheadingTextColor(), 6, false);
drawScrollingString(guiGraphics, GeneratorsLang.TURBINE_DISPERSERS.translate(dispersers, dispersersLimiting ? limiting : ""), 4, 49, TextAlignment.LEFT, titleTextColor(), getXSize() - 4, 6, false);
drawScrollingString(guiGraphics, GeneratorsLang.TURBINE_VENTS.translate(vents, ventsLimiting ? limiting : ""), 4, 58, TextAlignment.LEFT, titleTextColor(), getXSize() - 4, 6, false);
int coils = multiblock.coils;
int blades = multiblock.blades;
drawScrollingString(guiGraphics, GeneratorsLang.TURBINE_PRODUCTION.translate(), 0, 72, TextAlignment.LEFT, subheadingTextColor(), 8, false);
drawScrollingString(guiGraphics, GeneratorsLang.TURBINE_BLADES.translate(blades, coils * 4 > blades ? limiting : ""), 6, 81, TextAlignment.LEFT, titleTextColor(), getXSize() - 6, 8, false);
drawScrollingString(guiGraphics, GeneratorsLang.TURBINE_COILS.translate(coils, coils * 4 < blades ? limiting : ""), 6, 90, TextAlignment.LEFT, titleTextColor(), getXSize() - 6, 8, false);
drawScrollingString(guiGraphics, GeneratorsLang.TURBINE_MAX_PRODUCTION.translate(EnergyDisplay.of(multiblock.getMaxProduction())), 0, 104, TextAlignment.LEFT, titleTextColor(), 8, false);
drawScrollingString(guiGraphics, GeneratorsLang.TURBINE_MAX_WATER_OUTPUT.translate(TextUtils.format(multiblock.getMaxWaterOutput())), 0, 113, TextAlignment.LEFT, titleTextColor(), 8, false);
drawScrollingString(guiGraphics, GeneratorsLang.TURBINE_PRODUCTION.translate(), 0, 72, TextAlignment.LEFT, subheadingTextColor(), 6, false);
drawScrollingString(guiGraphics, GeneratorsLang.TURBINE_BLADES.translate(blades, coils * 4 > blades ? limiting : ""), 4, 81, TextAlignment.LEFT, titleTextColor(), getXSize() - 4, 6, false);
drawScrollingString(guiGraphics, GeneratorsLang.TURBINE_COILS.translate(coils, coils * 4 < blades ? limiting : ""), 4, 90, TextAlignment.LEFT, titleTextColor(), getXSize() - 4, 6, false);
drawScrollingString(guiGraphics, GeneratorsLang.TURBINE_MAX_PRODUCTION.translate(EnergyDisplay.of(multiblock.getMaxProduction())), 0, 104, TextAlignment.LEFT, titleTextColor(), 6, false);
drawScrollingString(guiGraphics, GeneratorsLang.TURBINE_MAX_WATER_OUTPUT.translate(TextUtils.format(multiblock.getMaxWaterOutput())), 0, 113, TextAlignment.LEFT, titleTextColor(), 6, false);
}
super.drawForegroundText(guiGraphics, mouseX, mouseY);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ public FusionReactorMultiblockData(TileEntityFusionReactorBlock tile) {
energyContainers.add(energyContainer = VariableCapacityEnergyContainer.output(MekanismGeneratorsConfig.generators.fusionEnergyCapacity, this));
heatCapacitors.add(heatCapacitor = VariableHeatCapacitor.create(caseHeatCapacity, FusionReactorMultiblockData::getInverseConductionCoefficient,
() -> inverseInsulation, () -> biomeAmbientTemp, this));
inventorySlots.add(reactorSlot = ReactorInventorySlot.at(stack -> stack.getItem() instanceof ItemHohlraum, this, 80, 39));
inventorySlots.add(reactorSlot = ReactorInventorySlot.at(stack -> stack.getItem() instanceof ItemHohlraum, this, 85, 39));
}

@Override
Expand Down
Loading

0 comments on commit 070f293

Please sign in to comment.