From ed63c8908dd3b772c47a11093207664deac46648 Mon Sep 17 00:00:00 2001 From: modmuss50 Date: Thu, 1 Jun 2023 12:13:14 +0100 Subject: [PATCH] More sprites --- .../java/reborncore/client/gui/GuiBase.java | 34 +++++++-- .../reborncore/client/gui/GuiBuilder.java | 66 +++++++++--------- .../gui/config/elements/ElementBase.java | 28 ++------ .../gui/config/elements/GuiSprites.java | 18 ++++- .../client/gui/config/elements/SlotType.java | 2 +- .../client/gui/widget/GuiButtonUpDown.java | 28 ++++---- .../gui/sprites/button_hologram_disabled.png | Bin 0 -> 114 bytes .../gui/sprites/button_hologram_enabled.png | Bin 0 -> 115 bytes .../textures/gui/sprites/button_locked.png | Bin 0 -> 135 bytes .../textures/gui/sprites/button_unlocked.png | Bin 0 -> 133 bytes .../textures/gui/sprites/fast_forward.png | Bin 0 -> 127 bytes .../textures/gui/sprites/fast_rewind.png | Bin 0 -> 124 bytes .../textures/gui/sprites/forward.png | Bin 0 -> 119 bytes .../textures/gui/sprites/output_slot.png | Bin 0 -> 115 bytes .../textures/gui/sprites/rewind.png | Bin 0 -> 119 bytes .../gui/sprites/{slot_normal.png => slot.png} | Bin .../textures/gui/sprites/slot_bar_center.png | Bin 0 -> 112 bytes .../textures/gui/sprites/slot_bar_left.png | Bin 0 -> 88 bytes .../textures/gui/sprites/slot_bar_right.png | Bin 0 -> 86 bytes .../textures/gui/sprites/slot_tab.png | Bin 0 -> 244 bytes .../textures/gui/sprites/tank_background.png | Bin 0 -> 192 bytes .../textures/gui/sprites/tank_foreground.png | Bin 0 -> 132 bytes .../textures/gui/sprites/upgrades.png | Bin 0 -> 407 bytes .../client/compat/rei/ReiPlugin.java | 18 ++--- 24 files changed, 110 insertions(+), 84 deletions(-) create mode 100644 RebornCore/src/main/resources/assets/reborncore/textures/gui/sprites/button_hologram_disabled.png create mode 100644 RebornCore/src/main/resources/assets/reborncore/textures/gui/sprites/button_hologram_enabled.png create mode 100644 RebornCore/src/main/resources/assets/reborncore/textures/gui/sprites/button_locked.png create mode 100644 RebornCore/src/main/resources/assets/reborncore/textures/gui/sprites/button_unlocked.png create mode 100644 RebornCore/src/main/resources/assets/reborncore/textures/gui/sprites/fast_forward.png create mode 100644 RebornCore/src/main/resources/assets/reborncore/textures/gui/sprites/fast_rewind.png create mode 100644 RebornCore/src/main/resources/assets/reborncore/textures/gui/sprites/forward.png create mode 100644 RebornCore/src/main/resources/assets/reborncore/textures/gui/sprites/output_slot.png create mode 100644 RebornCore/src/main/resources/assets/reborncore/textures/gui/sprites/rewind.png rename RebornCore/src/main/resources/assets/reborncore/textures/gui/sprites/{slot_normal.png => slot.png} (100%) create mode 100644 RebornCore/src/main/resources/assets/reborncore/textures/gui/sprites/slot_bar_center.png create mode 100644 RebornCore/src/main/resources/assets/reborncore/textures/gui/sprites/slot_bar_left.png create mode 100644 RebornCore/src/main/resources/assets/reborncore/textures/gui/sprites/slot_bar_right.png create mode 100644 RebornCore/src/main/resources/assets/reborncore/textures/gui/sprites/slot_tab.png create mode 100644 RebornCore/src/main/resources/assets/reborncore/textures/gui/sprites/tank_background.png create mode 100644 RebornCore/src/main/resources/assets/reborncore/textures/gui/sprites/tank_foreground.png create mode 100644 RebornCore/src/main/resources/assets/reborncore/textures/gui/sprites/upgrades.png 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 0000000000000000000000000000000000000000..58475a9ffd9a9d9f47c1de86e5654933ba882957 GIT binary patch literal 114 zcmeAS@N?(olHy`uVBq!ia0vp^B0$W;!3HFgc;@~FQkI@Bjv*Cs$v^yEFWkNRcRu5> z1#D*K=Ew6BGBPwI9zRwFDkA$oHD%OAkiEp!7yb@cC}%4RW{HN N22WQ%mvv4FO#o;}CUpP+ literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..63f3a6041077e3e033757a19566fb0451395ddb1 GIT binary patch literal 115 zcmeAS@N?(olHy`uVBq!ia0vp^B0$W;!3HFgc;@~FQdXWWjv*Cs$p+@;|NV9E+`apE zKI5?kY;25s*xK6Knhf>qtmNF-7A2RIsz`Tq_xHK;E|F>GZ82QI%J3{dyZTYDkTB2` N22WQ%mvv4FO#r9BA)x>O literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..37c6c55ffc788c44822e59958ca4e465415dbe1b GIT binary patch literal 135 zcmeAS@N?(olHy`uVBq!ia0vp^B0$W;!3HFgc;@~FQhuH;jv*CsN6%d3WKiH>xVWuI zXnE0#MF;Hq9GEp9I%viTPmG&7^XoHj*J7uD(DIsOMUNKq-^@n;JeymLGNf$oF2C30 jqNKxmZ<|B>sx*e6BU$E_R}?CNCNp@t`njxgN@xNAJ$o!8 literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..6280debfa6c79b4cdee4f4f095682d0035eb040a GIT binary patch literal 133 zcmeAS@N?(olHy`uVBq!ia0vp^B0$W;!3HFgc;@~FQa+w8jv*CsN6$2JGAMAkT-;V9 zw7e*z`9O#B2PVyj%@g-L>`hLyOM2!3$l&Sf=d#Wzp$P!U+bos< literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..83ddcdd0bf3125920c7c22881e9793b4816197e2 GIT binary patch literal 124 zcmeAS@N?(olHy`uVBq!ia0vp^JRr=$1|-8uW1a&kXHOT$kcznEAO1`)-o5*Go*`MF z`Rv)Vf>Lre6%5B-bWJ!KXtKaN>2Y#~Ls-i?iRElLYROj{ye|fPVm6dm!+1|TeP+4&Dh#LBE@n~{_=%fMuTw$t;)84lBrEaN=P<}|}kDuE}-kYV@D{zsQA S1pfg|V(@hJb6Mw<&;$VXl_yvL literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..1e3f2604d11d083dc20f256a43b406f2890b4dbd GIT binary patch literal 115 zcmeAS@N?(olHy`uVBq!ia0vp^QXtI11|(N{`J4k%R-P`7Ar*0N&mQDtaNs!NuzQn7 z_qQGGyexk_#Mr(~KXK+>Sg35V*G+w`Vr;G8phMIp!a2 zm?Afehf!1KFVdQ&MBb@0JPL4`2YX_ literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..ab3538cbaf856541f1fcd7da9181bb92940aa984 GIT binary patch literal 88 zcmeAS@N?(olHy`uVBq!ia0vp^%s?!~!3HFYK0bQ`q~twa978JNk`2tw|MMTZd-v{t mNe32=<^vk-6?`*Vm>3onzOPMtD60lk%HZkh=d#Wzp$P!SS{bqc literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..20832e6cad5eb961d5cdedc75bbd6651b9b61d2b GIT binary patch literal 86 zcmeAS@N?(olHy`uVBq!ia0vp^%s?!~!3HFYK0bQ`q+~r^978JNk`2tw|MMT_QCPHl kw{(xY<&k0s79Iu$6Xq>XXYaUN1yso3>FVdQ&MBb@09Lvec>n+a literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..b6c54026a9e55e1fffccd4ce812a2381193b1cc1 GIT binary patch literal 244 zcmV*Ci zl+s@?yIYs$b>kRg2_Y2keR0mw6~}o0IF8$*ui$KKj1dKJPDeFI02dDh_}M&^fCTvV zILADc0F+X+aQnVDp#-oj3kkMuYeES?YfZnOwYCW*7%w;%8K;Sd5{%ym^-kuY1eddj uhZ4MkF0Y`=BLb4(U|m;nP60`HD8UD+Uip+4HPf#E0000G+w^t1L8Wb3u1M`m_ z;j}b4cChjO1BZ)8C;e%$u$jy!^SAYK)a&E5HzPHlD*yQP;0wp+_nWiUI+sjKbbH=j zU^eZ=4LG55xUzrw#f=YhbdZS1w$F0@i<1xEj97#qj1RnG+WCL^a|Nfk548kr< z(b2d6pO9ejFk+D9No00AoM6J^kf73jFr%`8VR52?6q|y*l4(&uV;MYM{an^LB{Ts5^j0Hn literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..505291b039335487177758d985db478cc2341580 GIT binary patch literal 407 zcmV;I0cie-P)SjSLh}GQ!FGYb)hz=@{ z9Ym2u76rIvFPdi(u+GKmZb9yQkM-tTG&-6|fMJaL3M@zTZ~;D|l+n?uL9Ff;cqs~W zLUd4p>>!FPvM9hUd(k|TfORfbcMEdgd#pF#qS4Vz0t{o^S714!hYRo#rHqbN4Pte- zz)Mk}6QY9(WCu}XkwpP+*^B0x1gvwhx?7O@-ebM_7LAT(5?~nPz5>e;JzRi~C}niC zY7nct1zw5*oe&*V(38IiPKo@$E7t=RoD%%A2XBl^o=g7Sl|ujk002ovPDHLkV1l}l Bs=fdK literal 0 HcmV?d00001 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));