mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-22 15:18:34 +01:00
Fixed position of furnace auto split button.
Fixed rendering of Furnace and Crusher auto split tooltips.
This commit is contained in:
parent
8104cc4be2
commit
bfaf90b42c
2 changed files with 5 additions and 8 deletions
|
@ -53,7 +53,8 @@ public class CrusherScreen extends AAScreen<CrusherContainer> {
|
|||
|
||||
if (this.isDouble) {
|
||||
this.buttonAutoSplit = Button.builder(Component.literal("S"), (button) -> actionPerformed(0))
|
||||
.bounds(this.leftPos - 10, this.topPos, 16, 16).build();
|
||||
.bounds(this.leftPos - 10, this.topPos, 16, 16)
|
||||
.build();
|
||||
this.addRenderableWidget(this.buttonAutoSplit);
|
||||
}
|
||||
|
||||
|
@ -84,7 +85,7 @@ public class CrusherScreen extends AAScreen<CrusherContainer> {
|
|||
this.energy.render(guiGraphics, x, y);
|
||||
|
||||
if (this.isDouble && this.buttonAutoSplit.isMouseOver(x,y)) {
|
||||
guiGraphics.drawString(font, Component.translatable("info.actuallyadditions.gui.autosplititems." + (tileGrinder.isAutoSplit?"on":"off")).withStyle(ChatFormatting.BOLD), x , y, 0xffffff);
|
||||
guiGraphics.renderTooltip(font, Component.translatable("info.actuallyadditions.gui.autosplititems." + (tileGrinder.isAutoSplit?"on":"off")), x, y);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -11,7 +11,6 @@
|
|||
package de.ellpeck.actuallyadditions.mod.inventory.gui;
|
||||
|
||||
import com.mojang.blaze3d.systems.RenderSystem;
|
||||
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
|
||||
import de.ellpeck.actuallyadditions.mod.inventory.ContainerFurnaceDouble;
|
||||
import de.ellpeck.actuallyadditions.mod.network.PacketHandlerHelper;
|
||||
import de.ellpeck.actuallyadditions.mod.tile.TileEntityPoweredFurnace;
|
||||
|
@ -26,7 +25,6 @@ import net.neoforged.api.distmarker.Dist;
|
|||
import net.neoforged.api.distmarker.OnlyIn;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.Collections;
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public class GuiFurnaceDouble extends AAScreen<ContainerFurnaceDouble> {
|
||||
|
@ -50,9 +48,7 @@ public class GuiFurnaceDouble extends AAScreen<ContainerFurnaceDouble> {
|
|||
this.energy.render(guiGraphics, x, y);
|
||||
|
||||
if (this.buttonAutoSplit.isMouseOver(x, y)) {
|
||||
guiGraphics.renderComponentTooltip(font, Collections.singletonList(this.tileFurnace.isAutoSplit
|
||||
? Component.translatable("info." + ActuallyAdditions.MODID + ".gui.autoSplitItems.on").withStyle(ChatFormatting.BOLD)
|
||||
: Component.translatable("info." + ActuallyAdditions.MODID + ".gui.autoSplitItems.off").withStyle(ChatFormatting.BOLD)), x, y);
|
||||
guiGraphics.renderTooltip(font, Component.translatable("info.actuallyadditions.gui.autosplititems." + (tileFurnace.isAutoSplit?"on":"off")), x, y);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -61,7 +57,7 @@ public class GuiFurnaceDouble extends AAScreen<ContainerFurnaceDouble> {
|
|||
super.init();
|
||||
this.energy = new EnergyDisplay(this.leftPos + 27, this.topPos + 5, this.tileFurnace.storage);
|
||||
this.buttonAutoSplit = Button.builder(Component.literal("S"), (button) -> PacketHandlerHelper.sendButtonPacket(this.tileFurnace, 0))
|
||||
.bounds(this.getGuiLeft(), 30, 16, 16).build();
|
||||
.bounds(this.getGuiLeft(), this.topPos + 5, 16, 16).build();
|
||||
buttonAutoSplit.setFGColor(this.tileFurnace.isAutoSplit ? ChatFormatting.DARK_GREEN.getColor() : ChatFormatting.RED.getColor());
|
||||
this.addRenderableWidget(this.buttonAutoSplit);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue