diff --git a/RebornCore/src/client/java/reborncore/client/gui/GuiBase.java b/RebornCore/src/client/java/reborncore/client/gui/GuiBase.java index 6acabe451..6e34c4189 100644 --- a/RebornCore/src/client/java/reborncore/client/gui/GuiBase.java +++ b/RebornCore/src/client/java/reborncore/client/gui/GuiBase.java @@ -32,6 +32,8 @@ import net.minecraft.client.gui.Selectable; import net.minecraft.client.gui.screen.ingame.HandledScreen; import net.minecraft.client.gui.widget.ClickableWidget; import net.minecraft.client.resource.language.I18n; +import net.minecraft.client.texture.Sprite; +import net.minecraft.client.util.SpriteIdentifier; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.fluid.Fluid; import net.minecraft.item.ItemStack; @@ -42,6 +44,7 @@ import org.jetbrains.annotations.Nullable; import org.lwjgl.glfw.GLFW; import reborncore.api.blockentity.IUpgradeable; import reborncore.client.gui.config.GuiTab; +import reborncore.client.gui.config.elements.GuiSpriteAtlasHolder; import reborncore.client.gui.widget.GuiButtonHologram; import reborncore.common.blockentity.MachineBaseBlockEntity; import reborncore.common.screen.BuiltScreenHandler; @@ -85,7 +88,7 @@ public class GuiBase extends HandledScreen { x += this.x; y += this.y; } - builder.drawSlot(drawContext, this, x - 1, y - 1); + builder.drawSlot(drawContext, x - 1, y - 1); } public void drawOutputSlotBar(DrawContext drawContext, int x, int y, int count, Layer layer) { @@ -93,7 +96,7 @@ public class GuiBase extends HandledScreen { x += this.x; y += this.y; } - builder.drawOutputSlotBar(drawContext, this, x - 4, y - 4, count); + builder.drawOutputSlotBar(drawContext, x - 4, y - 4, count); } public void drawArmourSlots(DrawContext drawContext, int x, int y, Layer layer) { @@ -101,10 +104,10 @@ public class GuiBase extends HandledScreen { x += this.x; y += this.y; } - builder.drawSlot(drawContext, this, x - 1, y - 1); - builder.drawSlot(drawContext, this, x - 1, y - 1 + 18); - builder.drawSlot(drawContext, this, x - 1, y - 1 + 18 + 18); - builder.drawSlot(drawContext, this, x - 1, y - 1 + 18 + 18 + 18); + builder.drawSlot(drawContext, x - 1, y - 1); + builder.drawSlot(drawContext, x - 1, y - 1 + 18); + builder.drawSlot(drawContext, x - 1, y - 1 + 18 + 18); + builder.drawSlot(drawContext, x - 1, y - 1 + 18 + 18 + 18); } public void drawOutputSlot(DrawContext drawContext, int x, int y, Layer layer) { @@ -112,7 +115,7 @@ public class GuiBase extends HandledScreen { x += this.x; y += this.y; } - builder.drawOutputSlot(drawContext, this, x - 5, y - 5); + builder.drawOutputSlot(drawContext, x - 5, y - 5); } @Override @@ -382,4 +385,21 @@ public class GuiBase extends HandledScreen { public List getTabs() { return tabs; } + + public static Sprite getSprite(SpriteIdentifier spriteIdentifier) { + return GuiSpriteAtlasHolder.INSTANCE.getSprite(spriteIdentifier.getTextureId()); + } + + public void drawSprite(DrawContext drawContext, SpriteIdentifier spriteIdentifier, int x, int y) { + final Sprite sprite = getSprite(spriteIdentifier); + + drawContext.drawSprite( + x, + y, + 0, + sprite.getContents().getWidth(), + sprite.getContents().getHeight(), + sprite + ); + } } diff --git a/RebornCore/src/client/java/reborncore/client/gui/GuiBuilder.java b/RebornCore/src/client/java/reborncore/client/gui/GuiBuilder.java index d0662a515..6a547c77f 100644 --- a/RebornCore/src/client/java/reborncore/client/gui/GuiBuilder.java +++ b/RebornCore/src/client/java/reborncore/client/gui/GuiBuilder.java @@ -32,6 +32,7 @@ import net.minecraft.client.gui.screen.Screen; import net.minecraft.client.gui.screen.narration.NarrationMessageBuilder; import net.minecraft.client.gui.widget.EntryListWidget; import net.minecraft.client.texture.Sprite; +import net.minecraft.client.util.SpriteIdentifier; import net.minecraft.fluid.Fluids; import net.minecraft.item.ItemStack; import net.minecraft.text.Text; @@ -39,6 +40,7 @@ import net.minecraft.util.Formatting; import net.minecraft.util.Identifier; import reborncore.api.IListInfoProvider; import reborncore.client.gui.config.GuiTab; +import reborncore.client.gui.config.elements.GuiSprites; import reborncore.common.fluid.FluidUtils; import reborncore.common.fluid.FluidValue; import reborncore.common.fluid.container.FluidInstance; @@ -54,21 +56,8 @@ import java.util.stream.Collectors; * Created by Gigabit101 on 08/08/2016. */ public class GuiBuilder { - public static final Identifier defaultTextureSheet = new Identifier("reborncore", "textures/gui/guielements.png"); private static final Text SPACE_TEXT = Text.literal(" "); - static Identifier resourceLocation; - - public GuiBuilder() { - GuiBuilder.resourceLocation = defaultTextureSheet; - } - - public GuiBuilder(Identifier resourceLocation) { - GuiBuilder.resourceLocation = resourceLocation; - } - - public Identifier getResourceLocation() { - return resourceLocation; - } + public static final Identifier resourceLocation = new Identifier("reborncore", "textures/gui/guielements.png"); public void drawDefaultBackground(DrawContext drawContext, Screen gui, int x, int y, int width, int height) { drawContext.drawTexture(resourceLocation, x, y, 0, 0, width / 2, height / 2); @@ -78,6 +67,19 @@ public class GuiBuilder { height / 2); } + public void drawSprite(DrawContext drawContext, SpriteIdentifier spriteIdentifier, int x, int y) { + final Sprite sprite = GuiBase.getSprite(spriteIdentifier); + + drawContext.drawSprite( + x, + y, + 0, + sprite.getContents().getWidth(), + sprite.getContents().getHeight(), + sprite + ); + } + public void drawPlayerSlots(DrawContext drawContext, Screen gui, int posX, int posY, boolean center) { if (center) { posX -= 81; @@ -85,17 +87,17 @@ public class GuiBuilder { for (int y = 0; y < 3; y++) { for (int x = 0; x < 9; x++) { - drawContext.drawTexture(resourceLocation, posX + x * 18, posY + y * 18, 150, 0, 18, 18); + drawSlot(drawContext,posX + x * 18, posY + y * 18); } } for (int x = 0; x < 9; x++) { - drawContext.drawTexture(resourceLocation, posX + x * 18, posY + 58, 150, 0, 18, 18); + drawSlot(drawContext, posX + x * 18, posY + 58); } } - public void drawSlot(DrawContext drawContext, Screen gui, int posX, int posY) { - drawContext.drawTexture(resourceLocation, posX, posY, 150, 0, 18, 18); + public void drawSlot(DrawContext drawContext,int posX, int posY) { + drawSprite(drawContext, GuiSprites.SLOT, posX, posY); } public void drawText(DrawContext drawContext, GuiBase gui, Text text, int x, int y, int color) { @@ -110,8 +112,8 @@ public class GuiBuilder { } } - public void drawOutputSlot(DrawContext drawContext, GuiBase gui, int x, int y) { - drawContext.drawTexture(resourceLocation, x, y, 174, 0, 26, 26); + public void drawOutputSlot(DrawContext drawContext, int x, int y) { + drawSprite(drawContext, GuiSprites.OUTPUT_SLOT, x, y); } /** @@ -131,7 +133,8 @@ public class GuiBuilder { x += gui.getGuiLeft(); y += gui.getGuiTop(); } - drawContext.drawTexture(resourceLocation, x, y, 174, 26 + (locked ? 12 : 0), 20, 12); + + drawSprite(drawContext, locked ? GuiSprites.BUTTON_LOCKED : GuiSprites.BUTTON_UNLOCKED, x, y); if (gui.isPointInRect(x, y, 20, 12, mouseX, mouseY)) { List list = new ArrayList<>(); if (locked) { @@ -160,9 +163,9 @@ public class GuiBuilder { y += gui.getGuiTop(); } if (gui.getMachine().renderMultiblock) { - drawContext.drawTexture(resourceLocation, x, y, 174, 62, 20, 12); + drawSprite(drawContext, GuiSprites.BUTTON_HOLOGRAM_ENABLED, x, y); } else { - drawContext.drawTexture(resourceLocation, x, y, 174, 50, 20, 12); + drawSprite(drawContext, GuiSprites.BUTTON_HOLOGRAM_DISABLED, x, y); } if (gui.isPointInRect(x, y, 20, 12, mouseX, mouseY)) { List list = new ArrayList<>(); @@ -322,7 +325,7 @@ public class GuiBuilder { * @param y {@code int} Top left corner where to place slots */ public void drawUpgrades(DrawContext drawContext, GuiBase gui, int x, int y) { - drawContext.drawTexture(resourceLocation, x, y, 217, 0, 24, 81); + drawSprite(drawContext, GuiSprites.UPGRADES, x, y); } /** @@ -334,7 +337,7 @@ public class GuiBuilder { * @param stack {@link ItemStack} Item to show as tab icon */ public void drawSlotTab(DrawContext drawContext, GuiBase gui, int x, int y, ItemStack stack) { - drawContext.drawTexture(resourceLocation, x, y, 217, 82, 24, 24); + drawSprite(drawContext, GuiSprites.SLOT_TAB, x, y); drawContext.drawItem(stack, x + 5, y + 4); } @@ -592,11 +595,11 @@ public class GuiBuilder { amount = fluid.getAmount(); percentage = percentage(maxCapacity.getRawValue(), amount.getRawValue()); } - drawContext.drawTexture(resourceLocation, x, y, 194, 26, 22, 56); + drawSprite(drawContext, GuiSprites.TANK_BACKGROUND, x, y); if (!isTankEmpty) { drawFluid(drawContext, gui, fluid, x + 4, y + 4, 14, 48, maxCapacity.getRawValue()); } - drawContext.drawTexture(resourceLocation, x + 3, y + 3, 194, 82, 16, 50); + drawSprite(drawContext, GuiSprites.TANK_FOREGROUND, x + 3, y + 3); if (gui.isPointInRect(x, y, 22, 56, mouseX, mouseY)) { List list = new ArrayList<>(); @@ -704,19 +707,18 @@ public class GuiBuilder { /** * Draws bar containing output slots * - * @param gui {@link GuiBase} The GUI to draw on * @param x {@code int} Top left corner where to place slots bar * @param y {@code int} Top left corner where to place slots bar * @param count {@code int} Number of output slots */ - public void drawOutputSlotBar(DrawContext drawContext, GuiBase gui, int x, int y, int count) { - drawContext.drawTexture(resourceLocation, x, y, 150, 122, 3, 26); + public void drawOutputSlotBar(DrawContext drawContext, int x, int y, int count) { + drawSprite(drawContext, GuiSprites.SLOT_BAR_RIGHT, x, y); x += 3; for (int i = 1; i <= count; i++) { - drawContext.drawTexture(resourceLocation, x, y, 150 + 3, 122, 20, 26); + drawSprite(drawContext, GuiSprites.SLOT_BAR_CENTER, x, y); x += 20; } - drawContext.drawTexture(resourceLocation, x, y, 150 + 23, 122, 3, 26); + drawSprite(drawContext, GuiSprites.SLOT_BAR_LEFT, x, y); } protected int percentage(long MaxValue, long CurrentValue) { diff --git a/RebornCore/src/client/java/reborncore/client/gui/config/elements/ElementBase.java b/RebornCore/src/client/java/reborncore/client/gui/config/elements/ElementBase.java index 189a510cd..ee9fa2c5d 100644 --- a/RebornCore/src/client/java/reborncore/client/gui/config/elements/ElementBase.java +++ b/RebornCore/src/client/java/reborncore/client/gui/config/elements/ElementBase.java @@ -26,7 +26,6 @@ package reborncore.client.gui.config.elements; import net.minecraft.client.gui.DrawContext; import net.minecraft.client.gui.screen.Screen; -import net.minecraft.client.texture.Sprite; import net.minecraft.client.util.SpriteIdentifier; import net.minecraft.text.Text; import reborncore.client.gui.GuiBase; @@ -60,11 +59,11 @@ public class ElementBase { } public int getWidth() { - return getGuiSprite(sprite).getContents().getWidth(); + return GuiBase.getSprite(sprite).getContents().getWidth(); } public int getHeight() { - return getGuiSprite(sprite).getContents().getHeight(); + return GuiBase.getSprite(sprite).getContents().getHeight(); } public boolean onClick(GuiBase gui, double mouseX, double mouseY) { @@ -94,26 +93,13 @@ public class ElementBase { } public void drawSprite(DrawContext drawContext, GuiBase gui, SpriteIdentifier spriteIdentifier, int x, int y) { - final Sprite sprite = getGuiSprite(spriteIdentifier); - - drawContext.drawSprite( - x + gui.getGuiLeft(), - y + gui.getGuiTop(), - 0, - sprite.getContents().getWidth(), - sprite.getContents().getHeight(), - sprite - ); + gui.drawSprite(drawContext, spriteIdentifier, x + gui.getGuiLeft(), y + gui.getGuiTop()); } public void drawDefaultBackground(DrawContext drawContext, Screen gui, int x, int y, int width, int height) { - drawContext.drawTexture(GuiBuilder.defaultTextureSheet, x, y, 0, 0, width / 2, height / 2); - drawContext.drawTexture(GuiBuilder.defaultTextureSheet, x + width / 2, y, 150 - width / 2, 0, width / 2, height / 2); - drawContext.drawTexture(GuiBuilder.defaultTextureSheet, x, y + height / 2, 0, 150 - height / 2, width / 2, height / 2); - drawContext.drawTexture(GuiBuilder.defaultTextureSheet, x + width / 2, y + height / 2, 150 - width / 2, 150 - height / 2, width / 2, height / 2); - } - - private Sprite getGuiSprite(SpriteIdentifier spriteIdentifier) { - return GuiSpriteAtlasHolder.INSTANCE.getSprite(sprite.getTextureId()); + drawContext.drawTexture(GuiBuilder.resourceLocation, x, y, 0, 0, width / 2, height / 2); + drawContext.drawTexture(GuiBuilder.resourceLocation, x + width / 2, y, 150 - width / 2, 0, width / 2, height / 2); + drawContext.drawTexture(GuiBuilder.resourceLocation, x, y + height / 2, 0, 150 - height / 2, width / 2, height / 2); + drawContext.drawTexture(GuiBuilder.resourceLocation, x + width / 2, y + height / 2, 150 - width / 2, 150 - height / 2, width / 2, height / 2); } } diff --git a/RebornCore/src/client/java/reborncore/client/gui/config/elements/GuiSprites.java b/RebornCore/src/client/java/reborncore/client/gui/config/elements/GuiSprites.java index 02b235d18..da9b7c704 100644 --- a/RebornCore/src/client/java/reborncore/client/gui/config/elements/GuiSprites.java +++ b/RebornCore/src/client/java/reborncore/client/gui/config/elements/GuiSprites.java @@ -28,7 +28,6 @@ import net.minecraft.client.util.SpriteIdentifier; import net.minecraft.util.Identifier; public final class GuiSprites { - public static final SpriteIdentifier SLOT_NORMAL = create("slot_normal"); public static final SpriteIdentifier CHARGE_SLOT_ICON = create("charge_slot_icon"); public static final SpriteIdentifier DISCHARGE_SLOT_ICON = create("discharge_slot_icon"); public static final SpriteIdentifier ENERGY_BAR = create("energy_bar"); @@ -46,6 +45,23 @@ public final class GuiSprites { public static final SpriteIdentifier FAKE_SLOT = create("fake_slot"); public static final SpriteIdentifier BUTTON_HOVER_OVERLAY_SLOT_NORMAL = create("button_hover_overlay_slot_normal"); public static final SpriteIdentifier SLOT_CONFIG_POPUP = create("slot_config_popup"); + public static final SpriteIdentifier FAST_FORWARD = create("fast_forward"); + public static final SpriteIdentifier FORWARD = create("forward"); + public static final SpriteIdentifier REWIND = create("rewind"); + public static final SpriteIdentifier FAST_REWIND = create("fast_rewind"); + public static final SpriteIdentifier SLOT = create("slot"); + public static final SpriteIdentifier OUTPUT_SLOT = create("output_slot"); + public static final SpriteIdentifier BUTTON_UNLOCKED = create("button_unlocked"); + public static final SpriteIdentifier BUTTON_LOCKED = create("button_locked"); + public static final SpriteIdentifier BUTTON_HOLOGRAM_ENABLED = create("button_hologram_enabled"); + public static final SpriteIdentifier BUTTON_HOLOGRAM_DISABLED = create("button_hologram_disabled"); + public static final SpriteIdentifier SLOT_TAB = create("slot_tab"); + public static final SpriteIdentifier UPGRADES = create("upgrades"); + public static final SpriteIdentifier TANK_BACKGROUND = create("tank_background"); + public static final SpriteIdentifier TANK_FOREGROUND = create("tank_foreground"); + public static final SpriteIdentifier SLOT_BAR_RIGHT = create("slot_bar_right"); + public static final SpriteIdentifier SLOT_BAR_CENTER = create("slot_bar_center"); + public static final SpriteIdentifier SLOT_BAR_LEFT = create("slot_bar_left"); public static final SpriteIdentifier EXIT_BUTTON_NORMAL = create("exit_button_normal"); public static final SpriteIdentifier EXIT_BUTTON_HOVERED = create("exit_button_hovered"); diff --git a/RebornCore/src/client/java/reborncore/client/gui/config/elements/SlotType.java b/RebornCore/src/client/java/reborncore/client/gui/config/elements/SlotType.java index 0d9ee8359..68826be08 100644 --- a/RebornCore/src/client/java/reborncore/client/gui/config/elements/SlotType.java +++ b/RebornCore/src/client/java/reborncore/client/gui/config/elements/SlotType.java @@ -27,7 +27,7 @@ package reborncore.client.gui.config.elements; import net.minecraft.client.util.SpriteIdentifier; public enum SlotType { - NORMAL(1, 1, GuiSprites.SLOT_NORMAL, GuiSprites.BUTTON_SLOT_NORMAL, GuiSprites.BUTTON_HOVER_OVERLAY_SLOT_NORMAL); + NORMAL(1, 1, GuiSprites.SLOT, GuiSprites.BUTTON_SLOT_NORMAL, GuiSprites.BUTTON_HOVER_OVERLAY_SLOT_NORMAL); int slotOffsetX; int slotOffsetY; diff --git a/RebornCore/src/client/java/reborncore/client/gui/widget/GuiButtonUpDown.java b/RebornCore/src/client/java/reborncore/client/gui/widget/GuiButtonUpDown.java index 301bed176..896f9b5ec 100644 --- a/RebornCore/src/client/java/reborncore/client/gui/widget/GuiButtonUpDown.java +++ b/RebornCore/src/client/java/reborncore/client/gui/widget/GuiButtonUpDown.java @@ -26,16 +26,17 @@ package reborncore.client.gui.widget; import net.minecraft.client.gui.DrawContext; import net.minecraft.client.gui.widget.ButtonWidget; +import net.minecraft.client.util.SpriteIdentifier; import net.minecraft.text.Text; import reborncore.client.gui.GuiBase; +import reborncore.client.gui.config.elements.GuiSprites; /** * @author drcrazy */ public class GuiButtonUpDown extends GuiButtonExtended { - - GuiBase gui; - UpDownButtonType type; + private final GuiBase gui; + private final UpDownButtonType type; public GuiButtonUpDown(int x, int y, GuiBase gui, ButtonWidget.PressAction pressAction, UpDownButtonType type) { super(x, y, 12, 12, Text.empty(), pressAction); @@ -46,18 +47,19 @@ public class GuiButtonUpDown extends GuiButtonExtended { @Override public void renderButton(DrawContext drawContext, int mouseX, int mouseY, float partialTicks) { if (gui.hideGuiElements()) return; - switch (type) { - case FASTFORWARD -> drawContext.drawTexture(gui.builder.getResourceLocation(), getX(), getY(), 174, 74, 12, 12); - case FORWARD -> drawContext.drawTexture(gui.builder.getResourceLocation(), getX(), getY(), 174, 86, 12, 12); - case REWIND -> drawContext.drawTexture(gui.builder.getResourceLocation(), getX(), getY(), 174, 98, 12, 12); - case FASTREWIND -> drawContext.drawTexture(gui.builder.getResourceLocation(), getX(), getY(), 174, 110, 12, 12); - } + gui.drawSprite(drawContext, type.spriteIdentifier, getX(), getY()); } public enum UpDownButtonType { - FASTFORWARD, - FORWARD, - REWIND, - FASTREWIND + FASTFORWARD(GuiSprites.FAST_FORWARD), + FORWARD(GuiSprites.FORWARD), + REWIND(GuiSprites.REWIND), + FASTREWIND(GuiSprites.FAST_REWIND); + + private final SpriteIdentifier spriteIdentifier; + + UpDownButtonType(SpriteIdentifier spriteIdentifier) { + this.spriteIdentifier = spriteIdentifier; + } } } diff --git a/RebornCore/src/main/resources/assets/reborncore/textures/gui/sprites/button_hologram_disabled.png b/RebornCore/src/main/resources/assets/reborncore/textures/gui/sprites/button_hologram_disabled.png new file mode 100644 index 000000000..58475a9ff Binary files /dev/null and b/RebornCore/src/main/resources/assets/reborncore/textures/gui/sprites/button_hologram_disabled.png differ diff --git a/RebornCore/src/main/resources/assets/reborncore/textures/gui/sprites/button_hologram_enabled.png b/RebornCore/src/main/resources/assets/reborncore/textures/gui/sprites/button_hologram_enabled.png new file mode 100644 index 000000000..63f3a6041 Binary files /dev/null and b/RebornCore/src/main/resources/assets/reborncore/textures/gui/sprites/button_hologram_enabled.png differ diff --git a/RebornCore/src/main/resources/assets/reborncore/textures/gui/sprites/button_locked.png b/RebornCore/src/main/resources/assets/reborncore/textures/gui/sprites/button_locked.png new file mode 100644 index 000000000..37c6c55ff Binary files /dev/null and b/RebornCore/src/main/resources/assets/reborncore/textures/gui/sprites/button_locked.png differ diff --git a/RebornCore/src/main/resources/assets/reborncore/textures/gui/sprites/button_unlocked.png b/RebornCore/src/main/resources/assets/reborncore/textures/gui/sprites/button_unlocked.png new file mode 100644 index 000000000..6280debfa Binary files /dev/null and b/RebornCore/src/main/resources/assets/reborncore/textures/gui/sprites/button_unlocked.png differ diff --git a/RebornCore/src/main/resources/assets/reborncore/textures/gui/sprites/fast_forward.png b/RebornCore/src/main/resources/assets/reborncore/textures/gui/sprites/fast_forward.png new file mode 100644 index 000000000..3462c36ca Binary files /dev/null and b/RebornCore/src/main/resources/assets/reborncore/textures/gui/sprites/fast_forward.png differ diff --git a/RebornCore/src/main/resources/assets/reborncore/textures/gui/sprites/fast_rewind.png b/RebornCore/src/main/resources/assets/reborncore/textures/gui/sprites/fast_rewind.png new file mode 100644 index 000000000..83ddcdd0b Binary files /dev/null and b/RebornCore/src/main/resources/assets/reborncore/textures/gui/sprites/fast_rewind.png differ diff --git a/RebornCore/src/main/resources/assets/reborncore/textures/gui/sprites/forward.png b/RebornCore/src/main/resources/assets/reborncore/textures/gui/sprites/forward.png new file mode 100644 index 000000000..d07bdfa37 Binary files /dev/null and b/RebornCore/src/main/resources/assets/reborncore/textures/gui/sprites/forward.png differ diff --git a/RebornCore/src/main/resources/assets/reborncore/textures/gui/sprites/output_slot.png b/RebornCore/src/main/resources/assets/reborncore/textures/gui/sprites/output_slot.png new file mode 100644 index 000000000..1e3f2604d Binary files /dev/null and b/RebornCore/src/main/resources/assets/reborncore/textures/gui/sprites/output_slot.png differ diff --git a/RebornCore/src/main/resources/assets/reborncore/textures/gui/sprites/rewind.png b/RebornCore/src/main/resources/assets/reborncore/textures/gui/sprites/rewind.png new file mode 100644 index 000000000..04f77d31e Binary files /dev/null and b/RebornCore/src/main/resources/assets/reborncore/textures/gui/sprites/rewind.png differ diff --git a/RebornCore/src/main/resources/assets/reborncore/textures/gui/sprites/slot_normal.png b/RebornCore/src/main/resources/assets/reborncore/textures/gui/sprites/slot.png similarity index 100% rename from RebornCore/src/main/resources/assets/reborncore/textures/gui/sprites/slot_normal.png rename to RebornCore/src/main/resources/assets/reborncore/textures/gui/sprites/slot.png diff --git a/RebornCore/src/main/resources/assets/reborncore/textures/gui/sprites/slot_bar_center.png b/RebornCore/src/main/resources/assets/reborncore/textures/gui/sprites/slot_bar_center.png new file mode 100644 index 000000000..012831f3e Binary files /dev/null and b/RebornCore/src/main/resources/assets/reborncore/textures/gui/sprites/slot_bar_center.png differ diff --git a/RebornCore/src/main/resources/assets/reborncore/textures/gui/sprites/slot_bar_left.png b/RebornCore/src/main/resources/assets/reborncore/textures/gui/sprites/slot_bar_left.png new file mode 100644 index 000000000..ab3538cba Binary files /dev/null and b/RebornCore/src/main/resources/assets/reborncore/textures/gui/sprites/slot_bar_left.png differ diff --git a/RebornCore/src/main/resources/assets/reborncore/textures/gui/sprites/slot_bar_right.png b/RebornCore/src/main/resources/assets/reborncore/textures/gui/sprites/slot_bar_right.png new file mode 100644 index 000000000..20832e6ca Binary files /dev/null and b/RebornCore/src/main/resources/assets/reborncore/textures/gui/sprites/slot_bar_right.png differ diff --git a/RebornCore/src/main/resources/assets/reborncore/textures/gui/sprites/slot_tab.png b/RebornCore/src/main/resources/assets/reborncore/textures/gui/sprites/slot_tab.png new file mode 100644 index 000000000..b6c54026a Binary files /dev/null and b/RebornCore/src/main/resources/assets/reborncore/textures/gui/sprites/slot_tab.png differ diff --git a/RebornCore/src/main/resources/assets/reborncore/textures/gui/sprites/tank_background.png b/RebornCore/src/main/resources/assets/reborncore/textures/gui/sprites/tank_background.png new file mode 100644 index 000000000..7b30e3810 Binary files /dev/null and b/RebornCore/src/main/resources/assets/reborncore/textures/gui/sprites/tank_background.png differ diff --git a/RebornCore/src/main/resources/assets/reborncore/textures/gui/sprites/tank_foreground.png b/RebornCore/src/main/resources/assets/reborncore/textures/gui/sprites/tank_foreground.png new file mode 100644 index 000000000..b384cd03f Binary files /dev/null and b/RebornCore/src/main/resources/assets/reborncore/textures/gui/sprites/tank_foreground.png differ diff --git a/RebornCore/src/main/resources/assets/reborncore/textures/gui/sprites/upgrades.png b/RebornCore/src/main/resources/assets/reborncore/textures/gui/sprites/upgrades.png new file mode 100644 index 000000000..505291b03 Binary files /dev/null and b/RebornCore/src/main/resources/assets/reborncore/textures/gui/sprites/upgrades.png differ diff --git a/src/client/java/techreborn/client/compat/rei/ReiPlugin.java b/src/client/java/techreborn/client/compat/rei/ReiPlugin.java index 156d26ecb..2f061910a 100644 --- a/src/client/java/techreborn/client/compat/rei/ReiPlugin.java +++ b/src/client/java/techreborn/client/compat/rei/ReiPlugin.java @@ -270,17 +270,17 @@ public class ReiPlugin implements REIClientPlugin { public static Widget createProgressBar(int x, int y, double animationDuration, GuiBuilder.ProgressDirection direction) { return Widgets.createDrawableWidget((drawContext, mouseX, mouseY, delta) -> { - drawContext.drawTexture(GuiBuilder.defaultTextureSheet, x, y, direction.x, direction.y, direction.width, direction.height); + drawContext.drawTexture(GuiBuilder.resourceLocation, x, y, direction.x, direction.y, direction.width, direction.height); int j = (int) ((System.currentTimeMillis() / animationDuration) % 1.0 * 16.0); if (j < 0) { j = 0; } switch (direction) { - case RIGHT -> drawContext.drawTexture(GuiBuilder.defaultTextureSheet, x, y, direction.xActive, direction.yActive, j, 10); - case LEFT -> drawContext.drawTexture(GuiBuilder.defaultTextureSheet, x + 16 - j, y, direction.xActive + 16 - j, direction.yActive, j, 10); - case UP -> drawContext.drawTexture(GuiBuilder.defaultTextureSheet, x, y + 16 - j, direction.xActive, direction.yActive + 16 - j, 10, j); - case DOWN -> drawContext.drawTexture(GuiBuilder.defaultTextureSheet, x, y, direction.xActive, direction.yActive, 10, j); + case RIGHT -> drawContext.drawTexture(GuiBuilder.resourceLocation, x, y, direction.xActive, direction.yActive, j, 10); + case LEFT -> drawContext.drawTexture(GuiBuilder.resourceLocation, x + 16 - j, y, direction.xActive + 16 - j, direction.yActive, j, 10); + case UP -> drawContext.drawTexture(GuiBuilder.resourceLocation, x, y + 16 - j, direction.xActive, direction.yActive + 16 - j, 10, j); + case DOWN -> drawContext.drawTexture(GuiBuilder.resourceLocation, x, y, direction.xActive, direction.yActive, 10, j); } }); } @@ -313,14 +313,14 @@ public class ReiPlugin implements REIClientPlugin { int innerHeight = height - 2; PowerSystem.EnergySystem displayPower = PowerSystem.getDisplayPower(); - drawContext.drawTexture(GuiBuilder.defaultTextureSheet, bounds.x - 1, bounds.y - 1, displayPower.xBar - 15, displayPower.yBar - 1, width, height); + drawContext.drawTexture(GuiBuilder.resourceLocation, bounds.x - 1, bounds.y - 1, displayPower.xBar - 15, displayPower.yBar - 1, width, height); int innerDisplayHeight; if (animation.animationType != EntryAnimationType.NONE) { innerDisplayHeight = MathHelper.ceil((System.currentTimeMillis() / (animation.duration / (float) innerHeight) % innerHeight)); if (animation.animationType == EntryAnimationType.DOWNWARDS) innerDisplayHeight = innerHeight - innerDisplayHeight; } else innerDisplayHeight = innerHeight; - drawContext.drawTexture(GuiBuilder.defaultTextureSheet, bounds.x, bounds.y + innerHeight - innerDisplayHeight, displayPower.xBar, innerHeight + displayPower.yBar - innerDisplayHeight, width - 2, innerDisplayHeight); + drawContext.drawTexture(GuiBuilder.resourceLocation, bounds.x, bounds.y + innerHeight - innerDisplayHeight, displayPower.xBar, innerHeight + displayPower.yBar - innerDisplayHeight, width - 2, innerDisplayHeight); } @Override @@ -344,8 +344,8 @@ public class ReiPlugin implements REIClientPlugin { int width = bounds.width; int height = bounds.height; - drawContext.drawTexture(GuiBuilder.defaultTextureSheet, bounds.x - 4, bounds.y - 4, 194, 26, width + 8, height + 8); - drawContext.drawTexture(GuiBuilder.defaultTextureSheet, bounds.x - 1, bounds.y - 1, 194, 82, width + 2, height + 2); + drawContext.drawTexture(GuiBuilder.resourceLocation, bounds.x - 4, bounds.y - 4, 194, 26, width + 8, height + 8); + drawContext.drawTexture(GuiBuilder.resourceLocation, bounds.x - 1, bounds.y - 1, 194, 82, width + 2, height + 2); int innerDisplayHeight; if (animation.animationType != EntryAnimationType.NONE) { innerDisplayHeight = MathHelper.ceil((System.currentTimeMillis() / (animation.duration / (float) height) % height));