diff options
| author | viciscat <51047087+viciscat@users.noreply.github.com> | 2024-04-14 00:18:47 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-04-14 00:18:47 +0200 |
| commit | ddd068b44d5f724bcbbe4a19a2902d44a7262e71 (patch) | |
| tree | 572a952b05a30afaf2632bbbcee7ef770be40463 | |
| parent | 5041bdec5268c77638ca1d1e61093433e4d191e2 (diff) | |
| parent | 27e9e7b90a76bb662fd7a5f8fe1d7fbec17a8cb9 (diff) | |
| download | Skyblocker-ddd068b44d5f724bcbbe4a19a2902d44a7262e71.tar.gz Skyblocker-ddd068b44d5f724bcbbe4a19a2902d44a7262e71.tar.bz2 Skyblocker-ddd068b44d5f724bcbbe4a19a2902d44a7262e71.zip | |
Merge pull request #614 from viciscat/ah-gui-new
Fancy Auctions Browser: The Sequel
40 files changed, 1665 insertions, 157 deletions
diff --git a/src/main/java/de/hysky/skyblocker/config/SkyblockerConfig.java b/src/main/java/de/hysky/skyblocker/config/SkyblockerConfig.java index bf98ac1f..a1e1dadc 100644 --- a/src/main/java/de/hysky/skyblocker/config/SkyblockerConfig.java +++ b/src/main/java/de/hysky/skyblocker/config/SkyblockerConfig.java @@ -251,6 +251,9 @@ public class SkyblockerConfig { public SearchOverlay searchOverlay = new SearchOverlay(); @SerialEntry + public FancyAuctionHouse fancyAuctionHouse = new FancyAuctionHouse(); + + @SerialEntry public List<Integer> lockedSlots = new ArrayList<>(); @SerialEntry @@ -406,138 +409,11 @@ public class SkyblockerConfig { public boolean enableQuiverWarningAfterDungeon = true; } - public static class Hitbox { - @SerialEntry - public boolean oldFarmlandHitbox = false; - - @SerialEntry - public boolean oldLeverHitbox = false; - } - - public static class TitleContainer { - @SerialEntry - public float titleContainerScale = 100; - - @SerialEntry - public int x = 540; - - @SerialEntry - public int y = 10; - - @SerialEntry - public Direction direction = Direction.HORIZONTAL; - - @SerialEntry - public Alignment alignment = Alignment.MIDDLE; - } - - public enum Direction { - HORIZONTAL, VERTICAL; - - @Override - public String toString() { - return switch (this) { - case HORIZONTAL -> "Horizontal"; - case VERTICAL -> "Vertical"; - }; - } - } - - public enum Alignment { - LEFT, RIGHT, MIDDLE; - - @Override - public String toString() { - return switch (this) { - case LEFT -> "Left"; - case RIGHT -> "Right"; - case MIDDLE -> "Middle"; - }; - } - } - - public static class TeleportOverlay { - @SerialEntry - public boolean enableTeleportOverlays = true; - - @SerialEntry - public boolean enableWeirdTransmission = true; - - @SerialEntry - public boolean enableInstantTransmission = true; - - @SerialEntry - public boolean enableEtherTransmission = true; - - @SerialEntry - public boolean enableSinrecallTransmission = true; - - @SerialEntry - public boolean enableWitherImpact = true; - } - - public static class FlameOverlay { - @SerialEntry - public int flameHeight = 100; - - @SerialEntry - public int flameOpacity = 100; - } - - public static class SearchOverlay { - @SerialEntry - public boolean enableBazaar = true; - - @SerialEntry - public boolean enableAuctionHouse = true; - - @SerialEntry - public boolean keepPreviousSearches = false; - - @SerialEntry - public int maxSuggestions = 3; - - @SerialEntry - public int historyLength = 3; - - @SerialEntry - public boolean enableCommands = false; - - @SerialEntry - public List<String> bazaarHistory = new ArrayList<>(); - - @SerialEntry - public List<String> auctionHistory = new ArrayList<>(); - } - - public static class RichPresence { - @SerialEntry - public boolean enableRichPresence = false; - - @SerialEntry - public Info info = Info.LOCATION; - - @SerialEntry - public boolean cycleMode = false; - - @SerialEntry - public String customMessage = "Playing Skyblock"; - } - public static class ItemList { @SerialEntry public boolean enableItemList = true; } - public enum Average { - ONE_DAY, THREE_DAY, BOTH; - - @Override - public String toString() { - return I18n.translate("text.autoconfig.skyblocker.option.general.itemTooltip.avg." + name()); - } - } - public static class ItemTooltip { @SerialEntry public boolean enableNPCPrice = true; @@ -570,6 +446,15 @@ public class SkyblockerConfig { public boolean enableAccessoriesHelper = true; } + public enum Average { + ONE_DAY, THREE_DAY, BOTH; + + @Override + public String toString() { + return I18n.translate("text.autoconfig.skyblocker.option.general.itemTooltip.avg." + name()); + } + } + public static class ItemInfoDisplay { @SerialEntry public boolean attributeShardInfo = true; @@ -651,6 +536,118 @@ public class SkyblockerConfig { public boolean rareDungeonDropEffects = true; } + public static class Hitbox { + @SerialEntry + public boolean oldFarmlandHitbox = false; + + @SerialEntry + public boolean oldLeverHitbox = false; + } + + public static class TitleContainer { + @SerialEntry + public float titleContainerScale = 100; + + @SerialEntry + public int x = 540; + + @SerialEntry + public int y = 10; + + @SerialEntry + public Direction direction = Direction.HORIZONTAL; + + @SerialEntry + public Alignment alignment = Alignment.MIDDLE; + } + + public enum Direction { + HORIZONTAL, VERTICAL; + + @Override + public String toString() { + return switch (this) { + case HORIZONTAL -> "Horizontal"; + case VERTICAL -> "Vertical"; + }; + } + } + + public enum Alignment { + LEFT, RIGHT, MIDDLE; + + @Override + public String toString() { + return switch (this) { + case LEFT -> "Left"; + case RIGHT -> "Right"; + case MIDDLE -> "Middle"; + }; + } + } + + public static class TeleportOverlay { + @SerialEntry + public boolean enableTeleportOverlays = true; + + @SerialEntry + public boolean enableWeirdTransmission = true; + + @SerialEntry + public boolean enableInstantTransmission = true; + + @SerialEntry + public boolean enableEtherTransmission = true; + + @SerialEntry + public boolean enableSinrecallTransmission = true; + + @SerialEntry + public boolean enableWitherImpact = true; + } + + public static class FlameOverlay { + @SerialEntry + public int flameHeight = 100; + + @SerialEntry + public int flameOpacity = 100; + } + + public static class SearchOverlay { + @SerialEntry + public boolean enableBazaar = true; + + @SerialEntry + public boolean enableAuctionHouse = true; + + @SerialEntry + public boolean keepPreviousSearches = false; + + @SerialEntry + public int maxSuggestions = 3; + + @SerialEntry + public int historyLength = 3; + + @SerialEntry + public boolean enableCommands = false; + + @SerialEntry + public List<String> bazaarHistory = new ArrayList<>(); + + @SerialEntry + public List<String> auctionHistory = new ArrayList<>(); + } + + public static class FancyAuctionHouse { + @SerialEntry + public boolean enabled = true; + + @SerialEntry + public boolean highlightCheapBIN = true; + } + public static class Locations { @SerialEntry public Barn barn = new Barn(); @@ -1242,6 +1239,20 @@ public class SkyblockerConfig { public int announcementScale = 3; } + public static class RichPresence { + @SerialEntry + public boolean enableRichPresence = false; + + @SerialEntry + public Info info = Info.LOCATION; + + @SerialEntry + public boolean cycleMode = false; + + @SerialEntry + public String customMessage = "Playing Skyblock"; + } + public enum Info { PURSE, BITS, LOCATION; diff --git a/src/main/java/de/hysky/skyblocker/config/categories/GeneralCategory.java b/src/main/java/de/hysky/skyblocker/config/categories/GeneralCategory.java index e310cb85..a74b9483 100644 --- a/src/main/java/de/hysky/skyblocker/config/categories/GeneralCategory.java +++ b/src/main/java/de/hysky/skyblocker/config/categories/GeneralCategory.java @@ -739,6 +739,26 @@ public class GeneralCategory { .controller(ConfigUtils::createBooleanController) .build()) .build()) + + // Fancy Auction House + .group(OptionGroup.createBuilder() + .name(Text.translatable("text.autoconfig.skyblocker.option.general.betterAuctionHouse")) + .collapsed(true) + .option(Option.<Boolean>createBuilder() + .name(Text.translatable("text.autoconfig.skyblocker.option.general.betterAuctionHouse.enabled")) + .binding(defaults.general.fancyAuctionHouse.enabled, + () -> config.general.fancyAuctionHouse.enabled, + newValue -> config.general.fancyAuctionHouse.enabled = newValue) + .controller(ConfigUtils::createBooleanController) + .build()) + .option(Option.<Boolean>createBuilder() + .name(Text.translatable("text.autoconfig.skyblocker.option.general.betterAuctionHouse.highlightUnderAvgPrice")) + .binding(defaults.general.fancyAuctionHouse.highlightCheapBIN, + () -> config.general.fancyAuctionHouse.highlightCheapBIN, + newValue -> config.general.fancyAuctionHouse.highlightCheapBIN = newValue) + .controller(ConfigUtils::createBooleanController) + .build()) + .build()) .build(); } } diff --git a/src/main/java/de/hysky/skyblocker/mixin/ClientPlayerEntityMixin.java b/src/main/java/de/hysky/skyblocker/mixin/ClientPlayerEntityMixin.java index ceda9ed4..049443f7 100644 --- a/src/main/java/de/hysky/skyblocker/mixin/ClientPlayerEntityMixin.java +++ b/src/main/java/de/hysky/skyblocker/mixin/ClientPlayerEntityMixin.java @@ -2,6 +2,8 @@ package de.hysky.skyblocker.mixin; import com.mojang.authlib.GameProfile; import de.hysky.skyblocker.config.SkyblockerConfigManager; +import de.hysky.skyblocker.skyblock.auction.AuctionViewScreen; +import de.hysky.skyblocker.skyblock.auction.EditBidPopup; import de.hysky.skyblocker.skyblock.dungeon.partyfinder.PartyFinderScreen; import de.hysky.skyblocker.skyblock.item.HotbarSlotLock; import de.hysky.skyblocker.skyblock.item.ItemProtection; @@ -58,6 +60,11 @@ public abstract class ClientPlayerEntityMixin extends AbstractClientPlayerEntity return; } + if (client.currentScreen instanceof AuctionViewScreen auctionViewScreen) { + this.client.setScreen(new EditBidPopup(auctionViewScreen, sign, front, auctionViewScreen.minBid)); + callbackInfo.cancel(); + } + // Search Overlay if (client.currentScreen != null) { if (SkyblockerConfigManager.get().general.searchOverlay.enableAuctionHouse && client.currentScreen.getTitle().getString().toLowerCase().contains("auction")) { diff --git a/src/main/java/de/hysky/skyblocker/mixin/HandledScreenProviderMixin.java b/src/main/java/de/hysky/skyblocker/mixin/HandledScreenProviderMixin.java index 975c9c51..bf330d80 100644 --- a/src/main/java/de/hysky/skyblocker/mixin/HandledScreenProviderMixin.java +++ b/src/main/java/de/hysky/skyblocker/mixin/HandledScreenProviderMixin.java @@ -2,6 +2,9 @@ package de.hysky.skyblocker.mixin; import de.hysky.skyblocker.config.SkyblockerConfigManager; +import de.hysky.skyblocker.skyblock.auction.AuctionBrowserScreen; +import de.hysky.skyblocker.skyblock.auction.AuctionHouseScreenHandler; +import de.hysky.skyblocker.skyblock.auction.AuctionViewScreen; import de.hysky.skyblocker.skyblock.dungeon.partyfinder.PartyFinderScreen; import de.hysky.skyblocker.skyblock.item.SkyblockCraftingTableScreenHandler; import de.hysky.skyblocker.skyblock.item.SkyblockCraftingTableScreen; @@ -26,7 +29,10 @@ public interface HandledScreenProviderMixin<T extends ScreenHandler> { if (player == null) return; if (!Utils.isOnSkyblock()) return; T screenHandler = type.create(id, player.getInventory()); - if (SkyblockerConfigManager.get().general.betterPartyFinder && screenHandler instanceof GenericContainerScreenHandler containerScreenHandler && PartyFinderScreen.possibleInventoryNames.contains(name.getString().toLowerCase())) { + if (!(screenHandler instanceof GenericContainerScreenHandler containerScreenHandler)) return; + String nameLowercase = name.getString().toLowerCase(); + // Better party finder + if (SkyblockerConfigManager.get().general.betterPartyFinder && PartyFinderScreen.possibleInventoryNames.contains(nameLowercase)) { if (client.currentScreen != null) { String lowerCase = client.currentScreen.getTitle().getString().toLowerCase(); if (lowerCase.contains("group builder")) return; @@ -45,7 +51,28 @@ public interface HandledScreenProviderMixin<T extends ScreenHandler> { } ci.cancel(); - } else if (SkyblockerConfigManager.get().general.fancyCraftingTable && screenHandler instanceof GenericContainerScreenHandler containerScreenHandler && name.getString().toLowerCase().contains("craft item")) { + // Fancy AH + } else if (SkyblockerConfigManager.get().general.fancyAuctionHouse.enabled && (nameLowercase.contains("auctions browser") || nameLowercase.contains("auctions: "))) { + AuctionHouseScreenHandler auctionHouseScreenHandler = AuctionHouseScreenHandler.of(containerScreenHandler, false); + client.player.currentScreenHandler = auctionHouseScreenHandler; + if (client.currentScreen instanceof AuctionBrowserScreen auctionBrowserScreen) { + auctionBrowserScreen.changeHandler(auctionHouseScreenHandler); + } else client.setScreen(new AuctionBrowserScreen(auctionHouseScreenHandler, client.player.getInventory())); + ci.cancel(); + } else if (SkyblockerConfigManager.get().general.fancyAuctionHouse.enabled && nameLowercase.contains("auction view")) { + AuctionHouseScreenHandler auctionHouseScreenHandler = AuctionHouseScreenHandler.of(containerScreenHandler, true); + client.player.currentScreenHandler = auctionHouseScreenHandler; + if (client.currentScreen instanceof AuctionViewScreen auctionViewScreen) { + auctionViewScreen.changeHandler(auctionHouseScreenHandler); + } else + client.setScreen(new AuctionViewScreen(auctionHouseScreenHandler, client.player.getInventory(), name)); + ci.cancel(); + } else if (SkyblockerConfigManager.get().general.fancyAuctionHouse.enabled && (nameLowercase.contains("confirm purchase") || nameLowercase.contains("confirm bid")) && client.currentScreen instanceof AuctionViewScreen auctionViewScreen) { + client.setScreen(auctionViewScreen.getConfirmPurchasePopup(name)); + client.player.currentScreenHandler = containerScreenHandler; + ci.cancel(); + // Fancy crafting table + } else if (SkyblockerConfigManager.get().general.fancyCraftingTable && name.getString().toLowerCase().contains("craft item")) { SkyblockCraftingTableScreenHandler skyblockCraftingTableScreenHandler = new SkyblockCraftingTableScreenHandler(containerScreenHandler, player.getInventory()); client.player.currentScreenHandler = skyblockCraftingTableScreenHandler; client.setScreen(new SkyblockCraftingTableScreen(skyblockCraftingTableScreenHandler, player.getInventory(), Text.literal("Craft Item"))); diff --git a/src/main/java/de/hysky/skyblocker/mixin/accessor/HandledScreenAccessor.java b/src/main/java/de/hysky/skyblocker/mixin/accessor/HandledScreenAccessor.java index d82422cb..5b84072d 100644 --- a/src/main/java/de/hysky/skyblocker/mixin/accessor/HandledScreenAccessor.java +++ b/src/main/java/de/hysky/skyblocker/mixin/accessor/HandledScreenAccessor.java @@ -1,7 +1,9 @@ package de.hysky.skyblocker.mixin.accessor; import net.minecraft.client.gui.screen.ingame.HandledScreen; +import net.minecraft.screen.ScreenHandler; import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Mutable; import org.spongepowered.asm.mixin.gen.Accessor; @Mixin(HandledScreen.class) @@ -17,4 +19,8 @@ public interface HandledScreenAccessor { @Accessor int getBackgroundHeight(); + + @Mutable + @Accessor("handler") + void setHandler(ScreenHandler handler); } diff --git a/src/main/java/de/hysky/skyblocker/mixin/accessor/SlotAccessor.java b/src/main/java/de/hysky/skyblocker/mixin/accessor/SlotAccessor.java new file mode 100644 index 00000000..ef11006c --- /dev/null +++ b/src/main/java/de/hysky/skyblocker/mixin/accessor/SlotAccessor.java @@ -0,0 +1,17 @@ +package de.hysky.skyblocker.mixin.accessor; + +import net.minecraft.screen.slot.Slot; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Mutable; +import org.spongepowered.asm.mixin.gen.Accessor; + +@Mixin(Slot.class) +public interface SlotAccessor { + @Mutable + @Accessor("x") + void setX(int x); + + @Mutable + @Accessor("y") + void setY(int y); +} diff --git a/src/main/java/de/hysky/skyblocker/skyblock/auction/AuctionBrowserScreen.java b/src/main/java/de/hysky/skyblocker/skyblock/auction/AuctionBrowserScreen.java new file mode 100644 index 00000000..d47fef05 --- /dev/null +++ b/src/main/java/de/hysky/skyblocker/skyblock/auction/AuctionBrowserScreen.java @@ -0,0 +1,388 @@ +package de.hysky.skyblocker.skyblock.auction; + +import com.google.gson.JsonElement; +import de.hysky.skyblocker.SkyblockerMod; +import de.hysky.skyblocker.config.SkyblockerConfigManager; +import de.hysky.skyblocker.skyblock.auction.widgets.AuctionTypeWidget; +import de.hysky.skyblocker.skyblock.auction.widgets.CategoryTabWidget; +import de.hysky.skyblocker.skyblock.auction.widgets.RarityWidget; +import de.hysky.skyblocker.skyblock.auction.widgets.SortWidget; +import de.hysky.skyblocker.skyblock.item.tooltip.ItemTooltip; +import de.hysky.skyblocker.skyblock.item.tooltip.TooltipInfoType; +import de.hysky.skyblocker.utils.ItemUtils; +import de.hysky.skyblocker.utils.render.gui.AbstractCustomHypixelGUI; +import it.unimi.dsi.fastutil.ints.Int2BooleanOpenHashMap; +import net.minecraft.client.MinecraftClient; +import net.minecraft.client.font.TextRenderer; +import net.minecraft.client.gui.DrawContext; +import net.minecraft.client.gui.tooltip.Tooltip; +import net.minecraft.client.gui.widget.ButtonWidget; +import net.minecraft.client.texture.Sprite; +import net.minecraft.client.util.math.MatrixStack; +import net.minecraft.entity.player.PlayerInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.item.Items; +import net.minecraft.screen.slot.Slot; +import net.minecraft.screen.slot.SlotActionType; +import net.minecraft.text.Style; +import net.minecraft.text.Text; +import net.minecraft.util.Colors; +import net.minecraft.util.Identifier; +import net.minecraft.util.math.MathHelper; +import org.lwjgl.glfw.GLFW; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.awt.*; +import java.util.ArrayList; +import java.util.List; +import java.util.function.Supplier; + +public class AuctionBrowserScreen extends AbstractCustomHypixelGUI<AuctionHouseScreenHandler> { + private static final Logger LOGGER = LoggerFactory.getLogger(AuctionBrowserScreen.class); + private static final Identifier TEXTURE = new Identifier(SkyblockerMod.NAMESPACE, "textures/gui/auctions_gui/browser/background.png"); + private static final Identifier SCROLLER_TEXTURE = new Identifier("container/creative_inventory/scroller"); + + private static final Identifier up_arrow_tex = new Identifier(SkyblockerMod.NAMESPACE, "up_arrow_even"); // Put them in their own fields to avoid object allocation on each frame + private static final Identifier down_arrow_tex = new Identifier(SkyblockerMod.NAMESPACE, "down_arrow_even"); + public static final Supplier<Sprite> UP_ARROW = () -> MinecraftClient.getInstance().getGuiAtlasManager().getSprite(up_arrow_tex); + public static final Supplier<Sprite> DOWN_ARROW = () -> MinecraftClient.getInstance().getGuiAtlasManager().getSprite(down_arrow_tex); + + + // SLOTS + public static final int RESET_BUTTON_SLOT = 47; + public static final int SEARCH_BUTTON_SLOT = 48; + public static final int BACK_BUTTON_SLOT = 49; + public static final int SORT_BUTTON_SLOT = 50; + public static final int RARITY_BUTTON_SLOT = 51; + public static final int AUCTION_TYPE_BUTTON_SLOT = 52; + + public static final int PREV_PAGE_BUTTON = 46; + public static final int NEXT_PAGE_BUTTON = 53; + + private final Int2BooleanOpenHashMap isSlotHighlighted = new Int2BooleanOpenHashMap(24); + + + // WIDGETS + private SortWidget sortWidget; + private AuctionTypeWidget auctionTypeWidget; + private RarityWidget rarityWidget; + private ButtonWidget resetFiltersButton; + private final List<CategoryTabWidget> categoryTabWidgets = new ArrayList<>(6); + private String search = ""; + + public AuctionBrowserScreen(AuctionHouseScreenHandler handler, PlayerInventory inventory) { + super(handler, inventory, Text.literal("Auctions Browser")); + this.backgroundHeight = 187; + this.playerInventoryTitleY = 92; + this.titleX = 999; + } + + @Override + protected void init() { + super.init(); + sortWidget = new SortWidget(x + 25, y + 81, this::clickSlot); + sortWidget.setSlotId(SORT_BUTTON_SLOT); + addDrawableChild(sortWidget); + auctionTypeWidget = new AuctionTypeWidget(x + 134, y + 77, this::clickSlot); + auctionTypeWidget.setSlotId(AUCTION_TYPE_BUTTON_SLOT); + addDrawableChild(auctionTypeWidget); + rarityWidget = new RarityWidget(x + 73, y + 80, this::clickSlot); + rarityWidget.setSlotId(RARITY_BUTTON_SLOT); + addDrawableChild(rarityWidget); + resetFiltersButton = new ScaledTextButtonWidget(x + 10, y + 77, 12, 12, Text.literal("↻"), this::onResetPressed); + addDrawableChild(resetFiltersButton); + resetFiltersButton.setTooltip(Tooltip.of(Text.literal("Reset Filters"))); + resetFiltersButton.setTooltipDelay(500); + + addDrawableChild(new ButtonWidget.Builder(Text.literal("<"), button -> this.clickSlot(BACK_BUTTON_SLOT)) + .position(x + 98, y + 4) + .size(12, 12) + .build()); + + if (categoryTabWidgets.isEmpty()) + for (int i = 0; i < 6; i++) { + CategoryTabWidget categoryTabWidget = new CategoryTabWidget(new ItemStack(Items.SPONGE), this::clickSlot); + categoryTabWidgets.add(categoryTabWidget); + addSelectableChild(categoryTabWidget); // This method only makes it clickable, does not add it to the drawables list + // manually rendered in the render method to have it not render behind the durability bars + categoryTabWidget.setPosition(x - 30, y + 3 + i * 28); + } + else + for (int i = 0; i < categoryTabWidgets.size(); i++) { + CategoryTabWidget categoryTabWidget = categoryTabWidgets.get(i); + categoryTabWidget.setPosition(x - 30, y + 3 + i * 28); + + } + } + + private void onResetPressed(ButtonWidget buttonWidget) { + buttonWidget.setFocused(false); // Annoying. + this.clickSlot(RESET_BUTTON_SLOT, 0); + } + + @Override + protected void drawBackground(DrawContext context, float delta, int mouseX, int mouseY) { + context.drawTexture(TEXTURE, this.x, this.y, 0, 0, this.backgroundWidth, this.backgroundHeight); + } + + @Override + public void render(DrawContext context, int mouseX, int mouseY, float delta) { + super.render(context, mouseX, mouseY, delta); + for (CategoryTabWidget categoryTabWidget : categoryTabWidgets) { + categoryTabWidget.render(context, mouseX, mouseY, delta); + } + if (isWaitingForServer) { + String waiting = "Waiting for server..."; + context.drawText(textRenderer, waiting, this.width - textRenderer.getWidth(waiting) - 5, this.height - textRenderer.fontHeight - 2, Colors.WHITE, true); + } + + MatrixStack matrices = context.getMatrices(); + matrices.push(); + matrices.translate(x, y, 0); + // Search + context.enableScissor(x + 7, y + 4, x + 97, y + 16); + context.drawText(textRenderer, Text.literal(search).fillStyle(Style.EMPTY.withUnderline(onSearchField(mouseX, mouseY))), 9, 6, Colors.WHITE, true); + context.disableScissor(); + + // Scrollbar + if (prevPageVisible) { + if (onScrollbarTop(mouseX, mouseY)) + context.drawSprite(159, 13, 0, 6, 3, UP_ARROW.get()); + else context.drawSprite(159, 13, 0, 6, 3, UP_ARROW.get(), 0.54f, 0.54f, 0.54f, 1); + } + + if (nextPageVisible) { + if (onScrollbarBottom(mouseX, mouseY)) + context.drawSprite(159, 72, 0, 6, 3, DOWN_ARROW.get()); + else context.drawSprite(159, 72, 0, 6, 3, DOWN_ARROW.get(), 0.54f, 0.54f, 0.54f, 1); + } + context.drawText(textRenderer, String.format("%d/%d", currentPage, totalPages), 111, 6, Colors.GRAY, false); + if (totalPages <= 1) + context.drawGuiTexture(SCROLLER_TEXTURE, 156, 18, 12, 15); + else + context.drawGuiTexture(SCROLLER_TEXTURE, 156, (int) (18 + (float) (Math.min(currentPage, totalPages) - 1) / (totalPages - 1) * 37), 12, 15); + + matrices.pop(); + + this.drawMouseoverTooltip(context, mouseX, mouseY); + } + + @Override + protected void drawSlot(DrawContext context, Slot slot) { + if (SkyblockerConfigManager.get().general.fancyAuctionHouse.highlightCheapBIN && isSlotHighlighted.getOrDefault(slot.id, false)) { + context.drawB |
