diff --git a/src/generators/java/mekanism/generators/client/gui/GuiFissionReactorLogicAdapter.java b/src/generators/java/mekanism/generators/client/gui/GuiFissionReactorLogicAdapter.java index f48ccb33c4b..7faeb75f2ad 100644 --- a/src/generators/java/mekanism/generators/client/gui/GuiFissionReactorLogicAdapter.java +++ b/src/generators/java/mekanism/generators/client/gui/GuiFissionReactorLogicAdapter.java @@ -26,16 +26,17 @@ public class GuiFissionReactorLogicAdapter extends GuiMekanismTile container, Inventory inv, Component title) { super(container, inv, title); + imageWidth += 20; } @Override protected void addGuiElements() { super.addGuiElements(); - addRenderableWidget(new GuiElementHolder(this, 16, 31, 130, 90)); - scrollBar = addRenderableWidget(new GuiScrollBar(this, 146, 31, 90, () -> tile.getModes().length, () -> DISPLAY_COUNT)); + addRenderableWidget(new GuiElementHolder(this, 26, 31, 130, 90)); + scrollBar = addRenderableWidget(new GuiScrollBar(this, 156, 31, 90, () -> tile.getModes().length, () -> DISPLAY_COUNT)); for (int i = 0; i < DISPLAY_COUNT; i++) { int typeShift = 22 * i; - addRenderableWidget(new ReactorLogicButton<>(this, 17, 32 + typeShift, i, tile, FissionReactorLogic.class, scrollBar::getCurrentSelection, tile::getModes, this::changeLogic)); + addRenderableWidget(new ReactorLogicButton<>(this, 27, 32 + typeShift, i, tile, FissionReactorLogic.class, scrollBar::getCurrentSelection, tile::getModes, this::changeLogic)); } } @@ -48,8 +49,8 @@ private void changeLogic(FissionReactorLogic type) { @Override protected void drawForegroundText(@NotNull GuiGraphics guiGraphics, int mouseX, int mouseY) { renderTitleText(guiGraphics); - drawScrollingString(guiGraphics, GeneratorsLang.REACTOR_LOGIC_REDSTONE_MODE.translate(tile.logicType.getColor(), tile.logicType), 0, 123, TextAlignment.CENTER, titleTextColor(), 16, false); - drawScrollingString(guiGraphics, MekanismLang.STATUS.translate(EnumColor.RED, tile.getStatus()), 0, 136, TextAlignment.CENTER, titleTextColor(), 16, false); + drawScrollingString(guiGraphics, GeneratorsLang.REACTOR_LOGIC_REDSTONE_MODE.translate(tile.logicType.getColor(), tile.logicType), 0, 123, TextAlignment.CENTER, titleTextColor(), 4, false); + drawScrollingString(guiGraphics, MekanismLang.STATUS.translate(EnumColor.RED, tile.getStatus()), 0, 136, TextAlignment.CENTER, titleTextColor(), 4, false); super.drawForegroundText(guiGraphics, mouseX, mouseY); } diff --git a/src/generators/java/mekanism/generators/client/gui/GuiFusionReactorLogicAdapter.java b/src/generators/java/mekanism/generators/client/gui/GuiFusionReactorLogicAdapter.java index 784d594d13c..f1d7dee8507 100644 --- a/src/generators/java/mekanism/generators/client/gui/GuiFusionReactorLogicAdapter.java +++ b/src/generators/java/mekanism/generators/client/gui/GuiFusionReactorLogicAdapter.java @@ -30,19 +30,20 @@ public class GuiFusionReactorLogicAdapter extends GuiMekanismTile container, Inventory inv, Component title) { super(container, inv, title); + imageWidth += 20; } @Override protected void addGuiElements() { super.addGuiElements(); - addRenderableWidget(new GuiElementHolder(this, 16, 31, 130, 90)); - addRenderableWidget(new ToggleButton(this, 16, 19, 11, tile::isActiveCooled, + addRenderableWidget(new GuiElementHolder(this, 26, 31, 130, 90)); + addRenderableWidget(new ToggleButton(this, 26, 19, 11, tile::isActiveCooled, (element, mouseX, mouseY) -> PacketUtils.sendToServer(new PacketGuiInteract(GuiInteraction.NEXT_MODE, ((GuiFusionReactorLogicAdapter) element.gui()).tile)))) .setTooltip(GeneratorsLang.REACTOR_LOGIC_TOGGLE_COOLING); - scrollBar = addRenderableWidget(new GuiScrollBar(this, 146, 31, 90, () -> tile.getModes().length, () -> DISPLAY_COUNT)); + scrollBar = addRenderableWidget(new GuiScrollBar(this, 156, 31, 90, () -> tile.getModes().length, () -> DISPLAY_COUNT)); for (int i = 0; i < DISPLAY_COUNT; i++) { int typeShift = 22 * i; - addRenderableWidget(new ReactorLogicButton<>(this, 17, 32 + typeShift, i, tile, FusionReactorLogic.class, scrollBar::getCurrentSelection, tile::getModes, this::changeLogic)); + addRenderableWidget(new ReactorLogicButton<>(this, 27, 32 + typeShift, i, tile, FusionReactorLogic.class, scrollBar::getCurrentSelection, tile::getModes, this::changeLogic)); } } @@ -55,11 +56,11 @@ private void changeLogic(FusionReactorLogic type) { @Override protected void drawForegroundText(@NotNull GuiGraphics guiGraphics, int mouseX, int mouseY) { renderTitleText(guiGraphics); - drawScrollingString(guiGraphics, GeneratorsLang.REACTOR_LOGIC_ACTIVE_COOLING.translate(EnumColor.RED, OnOff.of(tile.isActiveCooled())), 13, 20, TextAlignment.LEFT, - titleTextColor(), getXSize() - 13, 16, false); - drawScrollingString(guiGraphics, GeneratorsLang.REACTOR_LOGIC_REDSTONE_MODE.translate(EnumColor.RED, tile.logicType), 0, 123, TextAlignment.CENTER, titleTextColor(), 16, false); + drawScrollingString(guiGraphics, GeneratorsLang.REACTOR_LOGIC_ACTIVE_COOLING.translate(EnumColor.RED, OnOff.of(tile.isActiveCooled())), 23, 20, TextAlignment.LEFT, + titleTextColor(), getXSize() - 23, 16, false); + drawScrollingString(guiGraphics, GeneratorsLang.REACTOR_LOGIC_REDSTONE_MODE.translate(EnumColor.RED, tile.logicType), 0, 123, TextAlignment.CENTER, titleTextColor(), 4, false); drawScrollingString(guiGraphics, MekanismLang.STATUS.translate(EnumColor.RED, tile.checkMode() ? GeneratorsLang.REACTOR_LOGIC_OUTPUTTING : MekanismLang.IDLE), - 0, 136, TextAlignment.CENTER, titleTextColor(), 16, false); + 0, 136, TextAlignment.CENTER, titleTextColor(), 4, false); super.drawForegroundText(guiGraphics, mouseX, mouseY); } diff --git a/src/generators/java/mekanism/generators/client/gui/GuiSolarGenerator.java b/src/generators/java/mekanism/generators/client/gui/GuiSolarGenerator.java index 235b350ce30..befcbd98c34 100644 --- a/src/generators/java/mekanism/generators/client/gui/GuiSolarGenerator.java +++ b/src/generators/java/mekanism/generators/client/gui/GuiSolarGenerator.java @@ -32,7 +32,7 @@ protected void addGuiElements() { //Add the side holder before the slots, as it holds a couple of the slots addRenderableWidget(GuiSideHolder.create(this, -26, 6, 98, true, true, SpecialColors.TAB_ARMOR_SLOTS)); super.addGuiElements(); - addRenderableWidget(new GuiInnerScreen(this, 48, 23, 80, 40, () -> List.of( + addRenderableWidget(new GuiInnerScreen(this, 40, 23, 96, 40, () -> List.of( EnergyDisplay.of(tile.getEnergyContainer()).getTextComponent(), GeneratorsLang.PRODUCING_AMOUNT.translate(EnergyDisplay.of(tile.getProductionRate())), GeneratorsLang.OUTPUT_RATE_SHORT.translate(EnergyDisplay.of(tile.getMaxOutput())) diff --git a/src/main/java/mekanism/client/gui/element/GuiScreenSwitch.java b/src/main/java/mekanism/client/gui/element/GuiScreenSwitch.java index dde31010867..d68bcd3fd52 100644 --- a/src/main/java/mekanism/client/gui/element/GuiScreenSwitch.java +++ b/src/main/java/mekanism/client/gui/element/GuiScreenSwitch.java @@ -21,6 +21,7 @@ public GuiScreenSwitch(IGuiWrapper gui, int x, int y, int width, Component butto this.active = true; this.clickSound = () -> this.stateSupplier.getAsBoolean() ? MekanismSounds.BEEP_OFF.get() : MekanismSounds.BEEP_ON.get(); this.clickVolume = 1.0F; + padding(4); } @Override diff --git a/src/main/java/mekanism/client/gui/element/custom/GuiQIOCrystallizerScreen.java b/src/main/java/mekanism/client/gui/element/custom/GuiQIOCrystallizerScreen.java index 378b9ff3efa..66859d2412e 100644 --- a/src/main/java/mekanism/client/gui/element/custom/GuiQIOCrystallizerScreen.java +++ b/src/main/java/mekanism/client/gui/element/custom/GuiQIOCrystallizerScreen.java @@ -38,10 +38,10 @@ public GuiQIOCrystallizerScreen(IGuiWrapper gui, int x, int y, int width, int he super(gui, x, y, width, height); this.oreInfo = oreInfo; int slotX = relativeX + this.width - SlotType.ORE.getWidth(); - this.slot = addChild(new GuiSlot(SlotType.ORE, gui, slotX, 13)); + this.slot = addChild(new GuiSlot(SlotType.ORE, gui, slotX, relativeY)); if (this.oreInfo.usesSequencedDisplay()) { this.iterStacks = new ArrayList<>(); - this.slotDisplay = addChild(new GuiSequencedSlotDisplay(gui, slotX + 1, 14, () -> this.iterStacks)); + this.slotDisplay = addChild(new GuiSequencedSlotDisplay(gui, slotX + 1, relativeY + 1, () -> this.iterStacks)); updateSlotContents(); } else { this.iterStacks = Collections.emptyList(); diff --git a/src/main/java/mekanism/client/gui/element/window/GuiSideConfiguration.java b/src/main/java/mekanism/client/gui/element/window/GuiSideConfiguration.java index cf1cd94507e..bb78ca5faea 100644 --- a/src/main/java/mekanism/client/gui/element/window/GuiSideConfiguration.java +++ b/src/main/java/mekanism/client/gui/element/window/GuiSideConfiguration.java @@ -59,7 +59,7 @@ public GuiSideConfiguration(IGuiWrapper gui, int x, int y, TILE tile, SelectedWi setCurrentType(transmissions.getFirst()); //TODO: Try to make the GUI look a bit better as it still seems a bit off with the scales and such // Maybe we want to eventually add some sort of "in world preview" type thing - addChild(new GuiInnerScreen(gui, relativeX + 41, relativeY + 25, 74, 12, () -> { + addChild(new GuiInnerScreen(gui, relativeX + 38, relativeY + 25, 80, 12, () -> { ConfigInfo config = getCurrentConfig(); if (config == null || !config.canEject()) { return Collections.singletonList(MekanismLang.NO_EJECT.translate()); diff --git a/src/main/java/mekanism/client/gui/element/window/GuiTransporterConfig.java b/src/main/java/mekanism/client/gui/element/window/GuiTransporterConfig.java index 0fc4c773cdf..917e9fbbfdf 100644 --- a/src/main/java/mekanism/client/gui/element/window/GuiTransporterConfig.java +++ b/src/main/java/mekanism/client/gui/element/window/GuiTransporterConfig.java @@ -38,7 +38,7 @@ public GuiTransporterConfig(IGuiWrapper gui, int x, int y, TILE tile, SelectedWi } this.tile = tile; interactionStrategy = InteractionStrategy.ALL; - addChild(new GuiInnerScreen(gui, relativeX + 41, relativeY + 15, 74, 12, + addChild(new GuiInnerScreen(gui, relativeX + 38, relativeY + 15, 80, 12, () -> Collections.singletonList(MekanismLang.STRICT_INPUT_ENABLED.translate(OnOff.of(tile.getEjector().hasStrictInput()))))); addChild(new GuiSlot(SlotType.NORMAL, gui, relativeX + 111, relativeY + 48)); addChild(new MekanismImageButton(gui, relativeX + 136, relativeY + 6, 14, 16, getButtonLocation("exclamation"), diff --git a/src/main/java/mekanism/client/gui/element/window/filter/GuiOredictionificatorFilter.java b/src/main/java/mekanism/client/gui/element/window/filter/GuiOredictionificatorFilter.java index 9f97c8d7bea..dfcc5e48212 100644 --- a/src/main/java/mekanism/client/gui/element/window/filter/GuiOredictionificatorFilter.java +++ b/src/main/java/mekanism/client/gui/element/window/filter/GuiOredictionificatorFilter.java @@ -21,16 +21,18 @@ public class GuiOredictionificatorFilter extends GuiTextFilter { + private static final int WIDTH = 162; + public static GuiOredictionificatorFilter create(IGuiWrapper gui, TileEntityOredictionificator tile) { - return new GuiOredictionificatorFilter(gui, (gui.getXSize() - 152) / 2, 15, tile, null); + return new GuiOredictionificatorFilter(gui, (gui.getXSize() - WIDTH) / 2, 15, tile, null); } public static GuiOredictionificatorFilter edit(IGuiWrapper gui, TileEntityOredictionificator tile, OredictionificatorItemFilter filter) { - return new GuiOredictionificatorFilter(gui, (gui.getXSize() - 152) / 2, 15, tile, filter); + return new GuiOredictionificatorFilter(gui, (gui.getXSize() - WIDTH) / 2, 15, tile, filter); } private GuiOredictionificatorFilter(IGuiWrapper gui, int x, int y, TileEntityOredictionificator tile, @Nullable OredictionificatorItemFilter origFilter) { - super(gui, x, y, 152, 100, MekanismLang.OREDICTIONIFICATOR_FILTER.translate(), tile, origFilter); + super(gui, x, y, WIDTH, 100, MekanismLang.OREDICTIONIFICATOR_FILTER.translate(), tile, origFilter); } @Override @@ -38,15 +40,10 @@ protected int getScreenHeight() { return 52; } - @Override - protected int getSlotOffset() { - return 32; - } - @Override protected void init() { super.init(); - addChild(new MekanismImageButton(gui(), relativeX + 10, relativeY + 18, 12, getButtonLocation("left"), (element, mouseX, mouseY) -> { + addChild(new MekanismImageButton(gui(), relativeX + 3, relativeY + 38, 12, getButtonLocation("left"), (element, mouseX, mouseY) -> { if (filter.hasFilter()) { filter.previous(); slotDisplay.updateStackList(); @@ -54,7 +51,7 @@ protected void init() { } return false; })).setTooltip(MekanismLang.LAST_ITEM); - addChild(new MekanismImageButton(gui(), relativeX + 10, relativeY + 52, 12, getButtonLocation("right"), (element, mouseX, mouseY) -> { + addChild(new MekanismImageButton(gui(), relativeX + 16, relativeY + 38, 12, getButtonLocation("right"), (element, mouseX, mouseY) -> { if (filter.hasFilter()) { filter.next(); slotDisplay.updateStackList(); diff --git a/src/main/java/mekanism/client/gui/element/window/filter/miner/GuiMinerFilterHelper.java b/src/main/java/mekanism/client/gui/element/window/filter/miner/GuiMinerFilterHelper.java index 64bb8d5616c..18878ca23fc 100644 --- a/src/main/java/mekanism/client/gui/element/window/filter/miner/GuiMinerFilterHelper.java +++ b/src/main/java/mekanism/client/gui/element/window/filter/miner/GuiMinerFilterHelper.java @@ -22,6 +22,8 @@ public interface GuiMinerFilterHelper extends GuiFilterHelper { + int MINER_FILTER_WIDTH = 173; + @Override MinerFilter getFilter(); diff --git a/src/main/java/mekanism/client/gui/element/window/filter/miner/GuiMinerItemStackFilter.java b/src/main/java/mekanism/client/gui/element/window/filter/miner/GuiMinerItemStackFilter.java index f0c5072acc1..35380d85416 100644 --- a/src/main/java/mekanism/client/gui/element/window/filter/miner/GuiMinerItemStackFilter.java +++ b/src/main/java/mekanism/client/gui/element/window/filter/miner/GuiMinerItemStackFilter.java @@ -12,15 +12,15 @@ public class GuiMinerItemStackFilter extends GuiItemStackFilter implements GuiMinerFilterHelper { public static GuiMinerItemStackFilter create(IGuiWrapper gui, TileEntityDigitalMiner tile) { - return new GuiMinerItemStackFilter(gui, (gui.getXSize() - 173) / 2, 30, tile, null); + return new GuiMinerItemStackFilter(gui, (gui.getXSize() - MINER_FILTER_WIDTH) / 2, 30, tile, null); } public static GuiMinerItemStackFilter edit(IGuiWrapper gui, TileEntityDigitalMiner tile, MinerItemStackFilter filter) { - return new GuiMinerItemStackFilter(gui, (gui.getXSize() - 173) / 2, 30, tile, filter); + return new GuiMinerItemStackFilter(gui, (gui.getXSize() - MINER_FILTER_WIDTH) / 2, 30, tile, filter); } private GuiMinerItemStackFilter(IGuiWrapper gui, int x, int y, TileEntityDigitalMiner tile, @Nullable MinerItemStackFilter origFilter) { - super(gui, x, y, 173, 90, tile, origFilter); + super(gui, x, y, MINER_FILTER_WIDTH, 90, tile, origFilter); } @Override diff --git a/src/main/java/mekanism/client/gui/element/window/filter/miner/GuiMinerModIDFilter.java b/src/main/java/mekanism/client/gui/element/window/filter/miner/GuiMinerModIDFilter.java index 1e8a9987485..ca8e30d61d6 100644 --- a/src/main/java/mekanism/client/gui/element/window/filter/miner/GuiMinerModIDFilter.java +++ b/src/main/java/mekanism/client/gui/element/window/filter/miner/GuiMinerModIDFilter.java @@ -14,15 +14,15 @@ public class GuiMinerModIDFilter extends GuiModIDFilter implements GuiMinerFilterHelper { public static GuiMinerModIDFilter create(IGuiWrapper gui, TileEntityDigitalMiner tile) { - return new GuiMinerModIDFilter(gui, (gui.getXSize() - 173) / 2, 30, tile, null); + return new GuiMinerModIDFilter(gui, (gui.getXSize() - MINER_FILTER_WIDTH) / 2, 30, tile, null); } public static GuiMinerModIDFilter edit(IGuiWrapper gui, TileEntityDigitalMiner tile, MinerModIDFilter filter) { - return new GuiMinerModIDFilter(gui, (gui.getXSize() - 173) / 2, 30, tile, filter); + return new GuiMinerModIDFilter(gui, (gui.getXSize() - MINER_FILTER_WIDTH) / 2, 30, tile, filter); } private GuiMinerModIDFilter(IGuiWrapper gui, int x, int y, TileEntityDigitalMiner tile, @Nullable MinerModIDFilter origFilter) { - super(gui, x, y, 173, 90, tile, origFilter); + super(gui, x, y, MINER_FILTER_WIDTH, 90, tile, origFilter); } @Override diff --git a/src/main/java/mekanism/client/gui/element/window/filter/miner/GuiMinerTagFilter.java b/src/main/java/mekanism/client/gui/element/window/filter/miner/GuiMinerTagFilter.java index 780e0afc88e..4367b41cd51 100644 --- a/src/main/java/mekanism/client/gui/element/window/filter/miner/GuiMinerTagFilter.java +++ b/src/main/java/mekanism/client/gui/element/window/filter/miner/GuiMinerTagFilter.java @@ -14,15 +14,15 @@ public class GuiMinerTagFilter extends GuiTagFilter implements GuiMinerFilterHelper { public static GuiMinerTagFilter create(IGuiWrapper gui, TileEntityDigitalMiner tile) { - return new GuiMinerTagFilter(gui, (gui.getXSize() - 173) / 2, 30, tile, null); + return new GuiMinerTagFilter(gui, (gui.getXSize() - MINER_FILTER_WIDTH) / 2, 30, tile, null); } public static GuiMinerTagFilter edit(IGuiWrapper gui, TileEntityDigitalMiner tile, MinerTagFilter filter) { - return new GuiMinerTagFilter(gui, (gui.getXSize() - 173) / 2, 30, tile, filter); + return new GuiMinerTagFilter(gui, (gui.getXSize() - MINER_FILTER_WIDTH) / 2, 30, tile, filter); } private GuiMinerTagFilter(IGuiWrapper gui, int x, int y, TileEntityDigitalMiner tile, @Nullable MinerTagFilter origFilter) { - super(gui, x, y, 173, 90, tile, origFilter); + super(gui, x, y, MINER_FILTER_WIDTH, 90, tile, origFilter); } @Override diff --git a/src/main/java/mekanism/client/gui/element/window/filter/transporter/GuiSorterFilterHelper.java b/src/main/java/mekanism/client/gui/element/window/filter/transporter/GuiSorterFilterHelper.java index 9eebd0c4c2b..2f6a77339d0 100644 --- a/src/main/java/mekanism/client/gui/element/window/filter/transporter/GuiSorterFilterHelper.java +++ b/src/main/java/mekanism/client/gui/element/window/filter/transporter/GuiSorterFilterHelper.java @@ -28,6 +28,8 @@ public interface GuiSorterFilterHelper extends GuiFilterHelper, IFancyFontRenderer, ContainerEventHandler { + int SORTER_FILTER_WIDTH = 200; + @Override SorterFilter getFilter(); @@ -54,12 +56,12 @@ default void addSorterDefaults(IGuiWrapper gui, int slotOffset, UnaryOperator filter = getFilter(); - int screenEnd = 29 + getScreenWidth(); + int screenEnd = 30 + getScreenWidth(); drawScrollingString(guiGraphics, OnOff.of(filter.allowDefault).getTextComponent(), 159, 20, TextAlignment.LEFT, titleTextColor(), getXSize() - 161, 2, false); //Note: We add two to the length, as min and max have two spaces at the end given we aren't actually providing a parameter //TODO: Do we want to adjust this, and just have separate lang keys for them? - drawScrollingString(guiGraphics, MekanismLang.MIN.translate(""), screenEnd, 32, TextAlignment.LEFT, titleTextColor(), 168 - screenEnd, 1, false); - //TODO - 1.21: Make the gui slightly wider so that we can have it so max isn't scrolling ever so slightly be default? - drawScrollingString(guiGraphics, MekanismLang.MAX.translate(""), screenEnd, 44, TextAlignment.LEFT, titleTextColor(), 168 - screenEnd, 1, false); + drawScrollingString(guiGraphics, MekanismLang.MIN.translate(""), screenEnd, 32, TextAlignment.LEFT, titleTextColor(), 173 - screenEnd, 2, false); + drawScrollingString(guiGraphics, MekanismLang.MAX.translate(""), screenEnd, 44, TextAlignment.LEFT, titleTextColor(), 173 - screenEnd, 2, false); if (isSingleItem() && filter.sizeMode) { drawScrollingString(guiGraphics, MekanismLang.SORTER_FILTER_SIZE_MODE.translateColored(EnumColor.RED, OnOff.ON), 159, 58, TextAlignment.LEFT, titleTextColor(), getXSize() - 159, 2, false); } else { diff --git a/src/main/java/mekanism/client/gui/element/window/filter/transporter/GuiSorterItemStackFilter.java b/src/main/java/mekanism/client/gui/element/window/filter/transporter/GuiSorterItemStackFilter.java index 91191a72b1d..b879cf24f01 100644 --- a/src/main/java/mekanism/client/gui/element/window/filter/transporter/GuiSorterItemStackFilter.java +++ b/src/main/java/mekanism/client/gui/element/window/filter/transporter/GuiSorterItemStackFilter.java @@ -14,18 +14,18 @@ public class GuiSorterItemStackFilter extends GuiItemStackFilter implements GuiSorterFilterHelper { public static GuiSorterItemStackFilter create(IGuiWrapper gui, TileEntityLogisticalSorter tile) { - return new GuiSorterItemStackFilter(gui, (gui.getXSize() - 195) / 2, 30, tile, null); + return new GuiSorterItemStackFilter(gui, (gui.getXSize() - SORTER_FILTER_WIDTH) / 2, 30, tile, null); } public static GuiSorterItemStackFilter edit(IGuiWrapper gui, TileEntityLogisticalSorter tile, SorterItemStackFilter filter) { - return new GuiSorterItemStackFilter(gui, (gui.getXSize() - 195) / 2, 30, tile, filter); + return new GuiSorterItemStackFilter(gui, (gui.getXSize() - SORTER_FILTER_WIDTH) / 2, 30, tile, filter); } private GuiTextField minField; private GuiTextField maxField; private GuiSorterItemStackFilter(IGuiWrapper gui, int x, int y, TileEntityLogisticalSorter tile, @Nullable SorterItemStackFilter origFilter) { - super(gui, x, y, 195, 90, tile, origFilter); + super(gui, x, y, SORTER_FILTER_WIDTH, 90, tile, origFilter); } @Override diff --git a/src/main/java/mekanism/client/gui/element/window/filter/transporter/GuiSorterModIDFilter.java b/src/main/java/mekanism/client/gui/element/window/filter/transporter/GuiSorterModIDFilter.java index 506aad2dbe9..0d4301f5209 100644 --- a/src/main/java/mekanism/client/gui/element/window/filter/transporter/GuiSorterModIDFilter.java +++ b/src/main/java/mekanism/client/gui/element/window/filter/transporter/GuiSorterModIDFilter.java @@ -11,18 +11,18 @@ public class GuiSorterModIDFilter extends GuiModIDFilter implements GuiSorterFilterHelper { public static GuiSorterModIDFilter create(IGuiWrapper gui, TileEntityLogisticalSorter tile) { - return new GuiSorterModIDFilter(gui, (gui.getXSize() - 182) / 2, 30, tile, null); + return new GuiSorterModIDFilter(gui, (gui.getXSize() - SORTER_FILTER_WIDTH) / 2, 30, tile, null); } public static GuiSorterModIDFilter edit(IGuiWrapper gui, TileEntityLogisticalSorter tile, SorterModIDFilter filter) { - return new GuiSorterModIDFilter(gui, (gui.getXSize() - 182) / 2, 30, tile, filter); + return new GuiSorterModIDFilter(gui, (gui.getXSize() - SORTER_FILTER_WIDTH) / 2, 30, tile, filter); } private GuiTextField minField; private GuiTextField maxField; private GuiSorterModIDFilter(IGuiWrapper gui, int x, int y, TileEntityLogisticalSorter tile, @Nullable SorterModIDFilter origFilter) { - super(gui, x, y, 195, 90, tile, origFilter); + super(gui, x, y, SORTER_FILTER_WIDTH, 90, tile, origFilter); } @Override diff --git a/src/main/java/mekanism/client/gui/element/window/filter/transporter/GuiSorterTagFilter.java b/src/main/java/mekanism/client/gui/element/window/filter/transporter/GuiSorterTagFilter.java index 18851b914cd..19f04580728 100644 --- a/src/main/java/mekanism/client/gui/element/window/filter/transporter/GuiSorterTagFilter.java +++ b/src/main/java/mekanism/client/gui/element/window/filter/transporter/GuiSorterTagFilter.java @@ -11,18 +11,18 @@ public class GuiSorterTagFilter extends GuiTagFilter implements GuiSorterFilterHelper { public static GuiSorterTagFilter create(IGuiWrapper gui, TileEntityLogisticalSorter tile) { - return new GuiSorterTagFilter(gui, (gui.getXSize() - 182) / 2, 30, tile, null); + return new GuiSorterTagFilter(gui, (gui.getXSize() - SORTER_FILTER_WIDTH) / 2, 30, tile, null); } public static GuiSorterTagFilter edit(IGuiWrapper gui, TileEntityLogisticalSorter tile, SorterTagFilter filter) { - return new GuiSorterTagFilter(gui, (gui.getXSize() - 182) / 2, 30, tile, filter); + return new GuiSorterTagFilter(gui, (gui.getXSize() - SORTER_FILTER_WIDTH) / 2, 30, tile, filter); } private GuiTextField minField; private GuiTextField maxField; private GuiSorterTagFilter(IGuiWrapper gui, int x, int y, TileEntityLogisticalSorter tile, @Nullable SorterTagFilter origFilter) { - super(gui, x, y, 195, 90, tile, origFilter); + super(gui, x, y, SORTER_FILTER_WIDTH, 90, tile, origFilter); } @Override diff --git a/src/main/java/mekanism/client/gui/robit/GuiRobitMain.java b/src/main/java/mekanism/client/gui/robit/GuiRobitMain.java index 82692326b26..05dcd430d7e 100644 --- a/src/main/java/mekanism/client/gui/robit/GuiRobitMain.java +++ b/src/main/java/mekanism/client/gui/robit/GuiRobitMain.java @@ -63,7 +63,7 @@ protected void addGuiElements() { addRenderableWidget(new GuiInnerScreen(this, 27, 16, 122, 56, () -> List.of( MekanismLang.ROBIT_GREETING.translate(robit.getName()), Component.empty(), - MekanismLang.ENERGY.translate(EnergyDisplay.of(robit.getEnergyContainer())), + MekanismLang.ENERGY.translate(EnergyDisplay.of(robit.getEnergyContainer().getEnergy())), MekanismLang.ROBIT_FOLLOWING.translate(robit.getFollowing()), MekanismLang.ROBIT_DROP_PICKUP.translate(robit.getDropPickup()), MekanismLang.ROBIT_OWNER.translate(robit.getOwnerName()) diff --git a/src/main/java/mekanism/client/render/IFancyFontRenderer.java b/src/main/java/mekanism/client/render/IFancyFontRenderer.java index 0d238b212e8..7116c60c11b 100644 --- a/src/main/java/mekanism/client/render/IFancyFontRenderer.java +++ b/src/main/java/mekanism/client/render/IFancyFontRenderer.java @@ -196,6 +196,9 @@ enum TextAlignment { RIGHT; public float getTarget(int minX, int maxX, float areaWidth, float textWidth) { + //TODO: Do we want to swap left and right when Font#isBidirectional is true? + // I believe in right to left languages text is meant to be aligned to the right + // but it likely would look odd in various GUIs return switch (this) { case LEFT -> minX; case CENTER -> minX + (areaWidth - textWidth) / 2F;