diff --git a/Common/src/main/java/mezz/jei/common/config/ClientConfig.java b/Common/src/main/java/mezz/jei/common/config/ClientConfig.java index 518d894f2..882a73208 100644 --- a/Common/src/main/java/mezz/jei/common/config/ClientConfig.java +++ b/Common/src/main/java/mezz/jei/common/config/ClientConfig.java @@ -33,6 +33,10 @@ public final class ClientConfig implements IClientConfig { private final Supplier holdShiftToShowBookmarkTooltipFeaturesEnabled; private final Supplier dragToRearrangeBookmarksEnabled; + // history + private final Supplier historyEnabled; + private final Supplier maxHistoryRows; + // advanced private final Supplier lowMemorySlowSearchEnabled; private final Supplier catchRenderErrorsEnabled; @@ -112,6 +116,19 @@ public ClientConfig(IConfigSchemaBuilder schema) { "Drag bookmarks to rearrange them in the list." ); + historyEnabled = bookmarks.addBoolean( + "HistoryEnabled", + false, + "Enable the history overlay." + ); + maxHistoryRows = bookmarks.addInteger( + "MaxHistoryRows", + 1, + 0, + 5, + "Max number of rows in the history overlay." + ); + IConfigCategoryBuilder advanced = schema.addCategory("advanced"); lowMemorySlowSearchEnabled = advanced.addBoolean( "LowMemorySlowSearchEnabled", @@ -256,6 +273,16 @@ public boolean isDragToRearrangeBookmarksEnabled() { return dragToRearrangeBookmarksEnabled.get(); } + @Override + public boolean isHistoryEnabled() { + return historyEnabled.get(); + } + + @Override + public int getMaxHistoryRows() { + return maxHistoryRows.get(); + } + @Override public int getDragDelayMs() { return dragDelayMs.get(); diff --git a/Common/src/main/java/mezz/jei/common/config/IClientConfig.java b/Common/src/main/java/mezz/jei/common/config/IClientConfig.java index 3124a1b1d..aee17788f 100644 --- a/Common/src/main/java/mezz/jei/common/config/IClientConfig.java +++ b/Common/src/main/java/mezz/jei/common/config/IClientConfig.java @@ -32,6 +32,10 @@ public interface IClientConfig { boolean isDragToRearrangeBookmarksEnabled(); + boolean isHistoryEnabled(); + + int getMaxHistoryRows(); + int getDragDelayMs(); int getSmoothScrollRate(); diff --git a/Gui/src/main/java/mezz/jei/gui/overlay/bookmarks/BookmarkOverlay.java b/Gui/src/main/java/mezz/jei/gui/overlay/bookmarks/BookmarkOverlay.java index d7afffa13..e83afa39d 100644 --- a/Gui/src/main/java/mezz/jei/gui/overlay/bookmarks/BookmarkOverlay.java +++ b/Gui/src/main/java/mezz/jei/gui/overlay/bookmarks/BookmarkOverlay.java @@ -5,6 +5,8 @@ import mezz.jei.api.ingredients.ITypedIngredient; import mezz.jei.api.runtime.IBookmarkOverlay; import mezz.jei.api.runtime.IScreenHelper; +import mezz.jei.common.Internal; +import mezz.jei.common.config.IClientConfig; import mezz.jei.common.config.IClientToggleState; import mezz.jei.common.input.IInternalKeyMappings; import mezz.jei.common.util.ImmutablePoint2i; @@ -27,6 +29,7 @@ import mezz.jei.gui.overlay.IngredientGridWithNavigation; import mezz.jei.gui.overlay.IngredientListSlot; import mezz.jei.gui.overlay.ScreenPropertiesCache; +import mezz.jei.gui.overlay.bookmarks.history.HistoryOverlay; import mezz.jei.gui.overlay.elements.IElement; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiGraphics; @@ -51,23 +54,29 @@ public class BookmarkOverlay implements IRecipeFocusSource, IBookmarkOverlay { // display elements private final IngredientGridWithNavigation contents; + private final HistoryOverlay historyOverlay; private final GuiIconToggleButton bookmarkButton; // data private final BookmarkList bookmarkList; private final IClientToggleState toggleState; + private final IClientConfig clientConfig; public BookmarkOverlay( BookmarkList bookmarkList, IngredientGridWithNavigation contents, + HistoryOverlay historyOverlay, IClientToggleState toggleState, + IClientConfig clientConfig, IScreenHelper screenHelper, IInternalKeyMappings keyBindings ) { this.bookmarkList = bookmarkList; this.toggleState = toggleState; + this.clientConfig = clientConfig; this.bookmarkButton = BookmarkButton.create(this, bookmarkList, toggleState, keyBindings); this.contents = contents; + this.historyOverlay = historyOverlay; this.screenPropertiesCache = new ScreenPropertiesCache(screenHelper); this.bookmarkDragManager = new BookmarkDragManager(this); bookmarkList.addSourceListChangedListener(() -> { @@ -77,6 +86,12 @@ public BookmarkOverlay( .updateScreen(minecraft.screen) .update(); }); + historyOverlay.getHistoryList().addSourceListChangedListener(() -> { + Minecraft minecraft = Minecraft.getInstance(); + this.getScreenPropertiesUpdater() + .updateScreen(minecraft.screen) + .update(); + }); } public boolean isListDisplayed() { @@ -103,8 +118,17 @@ private void updateBounds(IGuiProperties guiProperties) { ImmutableRect2i displayArea = getDisplayArea(guiProperties); Set guiExclusionAreas = this.screenPropertiesCache.getGuiExclusionAreas(); ImmutablePoint2i mouseExclusionArea = this.screenPropertiesCache.getMouseExclusionArea(); - ImmutableRect2i availableContentsArea = displayArea.cropBottom(BUTTON_SIZE + INNER_PADDING); + if (clientConfig.isHistoryEnabled()) { + int historyRows = clientConfig.getMaxHistoryRows(); + availableContentsArea = availableContentsArea.cropBottom(historyRows * HistoryOverlay.SLOT_HEIGHT); + ImmutableRect2i historyArea = displayArea + .insetBy(BORDER_MARGIN) + .moveUp(BUTTON_SIZE + INNER_PADDING) + .keepBottom(historyRows * HistoryOverlay.SLOT_HEIGHT); + this.historyOverlay.updateBounds(historyArea, guiExclusionAreas, mouseExclusionArea); + this.historyOverlay.updateLayout(); + } this.contents.updateBounds(availableContentsArea, guiExclusionAreas, mouseExclusionArea); this.contents.updateLayout(false); @@ -138,6 +162,7 @@ public void drawScreen(Minecraft minecraft, GuiGraphics guiGraphics, int mouseX, if (isListDisplayed()) { this.bookmarkDragManager.updateDrag(mouseX, mouseY); this.contents.draw(minecraft, guiGraphics, mouseX, mouseY, partialTicks); + this.historyOverlay.draw(minecraft, guiGraphics, mouseX, mouseY, partialTicks); } if (this.screenPropertiesCache.hasValidScreen()) { this.bookmarkButton.draw(guiGraphics, mouseX, mouseY, partialTicks); @@ -148,6 +173,7 @@ public void drawTooltips(Minecraft minecraft, GuiGraphics guiGraphics, int mouse if (isListDisplayed()) { if (!this.bookmarkDragManager.drawDraggedItem(guiGraphics, mouseX, mouseY)) { this.contents.drawTooltips(minecraft, guiGraphics, mouseX, mouseY); + this.historyOverlay.drawTooltips(minecraft, guiGraphics, mouseX, mouseY); } } if (this.screenPropertiesCache.hasValidScreen()) { @@ -158,7 +184,7 @@ public void drawTooltips(Minecraft minecraft, GuiGraphics guiGraphics, int mouse @Override public Stream> getIngredientUnderMouse(double mouseX, double mouseY) { if (isListDisplayed()) { - return this.contents.getIngredientUnderMouse(mouseX, mouseY); + return Stream.concat(this.contents.getIngredientUnderMouse(mouseX, mouseY),this.historyOverlay.getIngredientUnderMouse(mouseX, mouseY)); } return Stream.empty(); } @@ -166,7 +192,7 @@ public Stream> getIngredientUnderMouse(double mo @Override public Stream> getDraggableIngredientUnderMouse(double mouseX, double mouseY) { if (isListDisplayed()) { - return this.contents.getDraggableIngredientUnderMouse(mouseX, mouseY); + return Stream.concat(this.contents.getDraggableIngredientUnderMouse(mouseX, mouseY),this.historyOverlay.getDraggableIngredientUnderMouse(mouseX, mouseY)); } return Stream.empty(); } diff --git a/Gui/src/main/java/mezz/jei/gui/overlay/bookmarks/history/HistoryInputHandler.java b/Gui/src/main/java/mezz/jei/gui/overlay/bookmarks/history/HistoryInputHandler.java new file mode 100644 index 000000000..d63479dff --- /dev/null +++ b/Gui/src/main/java/mezz/jei/gui/overlay/bookmarks/history/HistoryInputHandler.java @@ -0,0 +1,35 @@ +package mezz.jei.gui.overlay.bookmarks.history; + +import mezz.jei.common.input.IInternalKeyMappings; +import mezz.jei.gui.input.CombinedRecipeFocusSource; +import mezz.jei.gui.input.IUserInputHandler; +import mezz.jei.gui.input.UserInput; +import mezz.jei.gui.input.handlers.FocusInputHandler; +import net.minecraft.client.gui.screens.Screen; + +import java.util.Optional; + +public class HistoryInputHandler implements IUserInputHandler { + + private final HistoryList historyList; + private final CombinedRecipeFocusSource focusSource; + private final FocusInputHandler focusInputHandler; + + public HistoryInputHandler(HistoryList historyList, CombinedRecipeFocusSource focusSource, FocusInputHandler focusInputHandler) { + this.historyList = historyList; + this.focusSource = focusSource; + this.focusInputHandler = focusInputHandler; + } + + @Override + public Optional handleUserInput(Screen screen, UserInput input, IInternalKeyMappings keyBindings) { + Optional result = focusInputHandler.handleUserInput(screen, input, keyBindings); + if ((input.is(keyBindings.getShowRecipe()) || input.is(keyBindings.getShowUses())) && result.isPresent()) { + focusSource.getIngredientUnderMouse(input, keyBindings) + .filter(clicked -> clicked.getElement().isVisible()) + .findFirst() + .ifPresent(clicked -> historyList.add(clicked.getElement())); + } + return result; + } +} diff --git a/Gui/src/main/java/mezz/jei/gui/overlay/bookmarks/history/HistoryList.java b/Gui/src/main/java/mezz/jei/gui/overlay/bookmarks/history/HistoryList.java new file mode 100644 index 000000000..b3a53210e --- /dev/null +++ b/Gui/src/main/java/mezz/jei/gui/overlay/bookmarks/history/HistoryList.java @@ -0,0 +1,52 @@ +package mezz.jei.gui.overlay.bookmarks.history; + +import mezz.jei.gui.overlay.IIngredientGridSource; +import mezz.jei.gui.overlay.elements.IElement; +import org.jetbrains.annotations.Unmodifiable; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +public class HistoryList implements IIngredientGridSource { + + private final List> elements = new ArrayList<>(); + private final List listeners = new ArrayList<>(); + private int maxSize; + + public void setMaxSize(int maxSize) { + this.maxSize = maxSize; + } + + public void add(IElement element) { + if (elements.contains(element)) { + return; + } + elements.addFirst(element); + if (elements.size() > maxSize) { + elements.removeLast(); + } + notifyListeners(); + } + + public void remove(IElement element) { + elements.remove(element); + notifyListeners(); + } + + @Override + public @Unmodifiable List> getElements() { + return Collections.unmodifiableList(elements); + } + + @Override + public void addSourceListChangedListener(SourceListChangedListener listener) { + listeners.add(listener); + } + + private void notifyListeners() { + for (SourceListChangedListener listener : listeners) { + listener.onSourceListChanged(); + } + } +} diff --git a/Gui/src/main/java/mezz/jei/gui/overlay/bookmarks/history/HistoryOverlay.java b/Gui/src/main/java/mezz/jei/gui/overlay/bookmarks/history/HistoryOverlay.java new file mode 100644 index 000000000..7150fc127 --- /dev/null +++ b/Gui/src/main/java/mezz/jei/gui/overlay/bookmarks/history/HistoryOverlay.java @@ -0,0 +1,163 @@ +package mezz.jei.gui.overlay.bookmarks.history; + +import com.mojang.blaze3d.systems.RenderSystem; +import com.mojang.blaze3d.vertex.BufferBuilder; +import com.mojang.blaze3d.vertex.BufferUploader; +import com.mojang.blaze3d.vertex.DefaultVertexFormat; +import com.mojang.blaze3d.vertex.PoseStack; +import com.mojang.blaze3d.vertex.Tesselator; +import com.mojang.blaze3d.vertex.VertexFormat; +import mezz.jei.api.helpers.IColorHelper; +import mezz.jei.api.runtime.IIngredientManager; +import mezz.jei.common.config.IClientConfig; +import mezz.jei.common.config.IClientToggleState; +import mezz.jei.common.config.IIngredientFilterConfig; +import mezz.jei.common.config.IIngredientGridConfig; +import mezz.jei.common.input.IInternalKeyMappings; +import mezz.jei.common.network.IConnectionToServer; +import mezz.jei.common.util.ImmutablePoint2i; +import mezz.jei.common.util.ImmutableRect2i; +import mezz.jei.gui.ingredients.GuiIngredientProperties; +import mezz.jei.gui.input.IClickableIngredientInternal; +import mezz.jei.gui.input.IDraggableIngredientInternal; +import mezz.jei.gui.input.IRecipeFocusSource; +import mezz.jei.gui.overlay.IngredientGrid; +import mezz.jei.gui.overlay.elements.IElement; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiGraphics; +import net.minecraft.client.renderer.GameRenderer; +import net.minecraft.util.Mth; +import org.jetbrains.annotations.Nullable; +import org.joml.Matrix4f; + +import java.util.List; +import java.util.Set; +import java.util.stream.Stream; + +public class HistoryOverlay implements IRecipeFocusSource { + + private static final int INGREDIENT_PADDING = 1; + public static final int ROWS = 2; + public static final int SLOT_WIDTH = GuiIngredientProperties.getWidth(INGREDIENT_PADDING); + public static final int SLOT_HEIGHT = GuiIngredientProperties.getHeight(INGREDIENT_PADDING); + + // display elements + private final IngredientGrid contents; + + // data + private final HistoryList historyList; + private final IClientConfig clientConfig; + private int rows; + + public HistoryOverlay( + IIngredientManager ingredientManager, + HistoryList historyList, + IInternalKeyMappings keyMappings, + IIngredientGridConfig historyListConfig, + IIngredientFilterConfig ingredientFilterConfig, + IClientConfig clientConfig, + IClientToggleState toggleState, + IConnectionToServer serverConnection, + IColorHelper colorHelper + ) { + this.clientConfig = clientConfig; + this.historyList = historyList; + this.contents = new IngredientGrid( + ingredientManager, + historyListConfig, + ingredientFilterConfig, + clientConfig, + toggleState, + serverConnection, + keyMappings, + colorHelper, + false + ); + historyList.addSourceListChangedListener(this::updateLayout); + } + + public boolean isListDisplayed() { + return clientConfig.isHistoryEnabled() && + contents.hasRoom(); + } + + public HistoryList getHistoryList() { + return historyList; + } + + public void updateBounds(final ImmutableRect2i availableArea, Set guiExclusionAreas, @Nullable ImmutablePoint2i mouseExclusionPoint) { + this.contents.updateBounds(availableArea, guiExclusionAreas, mouseExclusionPoint); + int rows = this.contents.getArea().getHeight() / SLOT_HEIGHT; + this.rows = Math.min(rows, clientConfig.getMaxHistoryRows()); + int maxSize = this.contents.getArea().getWidth() / SLOT_WIDTH * this.rows; + this.historyList.setMaxSize(maxSize); + } + + public void updateLayout() { + List> ingredientList = historyList.getElements(); + this.contents.set(0, ingredientList); + } + + private void drawLine(PoseStack poseStack, int x1, int x2, int y, int color) { + float offset = (System.currentTimeMillis() % 600) / 100.0F; + offset = 6 - offset; + RenderSystem.enableBlend(); + RenderSystem.defaultBlendFunc(); + RenderSystem.setShader(GameRenderer::getPositionColorShader); + Tesselator tesselator = Tesselator.getInstance(); + BufferBuilder builder = tesselator.begin(VertexFormat.Mode.QUADS, DefaultVertexFormat.POSITION_COLOR); + + float a = (float) (color >> 24 & 255) / 255.0F; + float r = (float) (color >> 16 & 255) / 255.0F; + float g = (float) (color >> 8 & 255) / 255.0F; + float b = (float) (color & 255) / 255.0F; + Matrix4f pose = poseStack.last().pose(); + + for (float x = x1 - offset; x < x2; x += 7) { + builder.addVertex(pose, Mth.clamp(x + 4, x1, x2), y, 0).setColor(r, g, b, a); + builder.addVertex(pose, Mth.clamp(x, x1, x2), y, 0).setColor(r, g, b, a); + builder.addVertex(pose, Mth.clamp(x, x1, x2), y + 1, 0).setColor(r, g, b, a); + builder.addVertex(pose, Mth.clamp(x + 4, x1, x2), y + 1, 0).setColor(r, g, b, a); + } + + BufferUploader.drawWithShader(builder.buildOrThrow()); + RenderSystem.disableBlend(); + } + + public void draw(Minecraft minecraft, GuiGraphics guiGraphics, int mouseX, int mouseY, float partialTicks) { + if (isListDisplayed()) { + this.contents.draw(minecraft, guiGraphics, mouseX, mouseY); + ImmutableRect2i area = this.contents.getArea(); + int endX = area.getX() + area.getWidth(); + int startY = area.getY() + area.getHeight() - rows * SLOT_HEIGHT - 3; + int colour = 0xFFFFFFFF; + drawLine(guiGraphics.pose(), area.getX(), endX, startY, colour); + } + } + + public void drawTooltips(Minecraft minecraft, GuiGraphics guiGraphics, int mouseX, int mouseY) { + if (isListDisplayed()) { + this.contents.drawTooltips(minecraft, guiGraphics, mouseX, mouseY); + } + } + + public ImmutableRect2i getArea() { + return this.contents.getArea(); + } + + @Override + public Stream> getIngredientUnderMouse(double mouseX, double mouseY) { + if (isListDisplayed()) { + return contents.getIngredientUnderMouse(mouseX, mouseY); + } + return Stream.empty(); + } + + @Override + public Stream> getDraggableIngredientUnderMouse(double mouseX, double mouseY) { + if (isListDisplayed()) { + return contents.getDraggableIngredientUnderMouse(mouseX, mouseY); + } + return Stream.empty(); + } +} diff --git a/Gui/src/main/java/mezz/jei/gui/overlay/bookmarks/history/package-info.java b/Gui/src/main/java/mezz/jei/gui/overlay/bookmarks/history/package-info.java new file mode 100644 index 000000000..94688d1f4 --- /dev/null +++ b/Gui/src/main/java/mezz/jei/gui/overlay/bookmarks/history/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@MethodsReturnNonnullByDefault +package mezz.jei.gui.overlay.bookmarks.history; + +import net.minecraft.MethodsReturnNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/Gui/src/main/java/mezz/jei/gui/recipes/RecipesGui.java b/Gui/src/main/java/mezz/jei/gui/recipes/RecipesGui.java index 35c7b14a8..80bdf7c70 100644 --- a/Gui/src/main/java/mezz/jei/gui/recipes/RecipesGui.java +++ b/Gui/src/main/java/mezz/jei/gui/recipes/RecipesGui.java @@ -39,6 +39,7 @@ import mezz.jei.gui.input.MouseUtil; import mezz.jei.gui.input.UserInput; import mezz.jei.gui.input.handlers.UserInputRouter; +import mezz.jei.gui.overlay.bookmarks.history.HistoryList; import mezz.jei.gui.recipes.lookups.IFocusedRecipes; import mezz.jei.gui.recipes.lookups.StaticFocusedRecipes; import net.minecraft.client.Minecraft; @@ -65,6 +66,7 @@ public class RecipesGui extends Screen implements IRecipesGui, IRecipeFocusSourc private final IInternalKeyMappings keyBindings; private final BookmarkList bookmarks; + private final HistoryList historyList; private final IFocusFactory focusFactory; private int headerHeight; @@ -112,10 +114,12 @@ public RecipesGui( IInternalKeyMappings keyBindings, IFocusFactory focusFactory, BookmarkList bookmarks, + HistoryList historyList, IGuiHelper guiHelper ) { super(Component.literal("Recipes")); this.bookmarks = bookmarks; + this.historyList = historyList; this.keyBindings = keyBindings; this.logic = new RecipeGuiLogic( recipeManager, diff --git a/Gui/src/main/java/mezz/jei/gui/startup/JeiGuiStarter.java b/Gui/src/main/java/mezz/jei/gui/startup/JeiGuiStarter.java index 18b90ce6b..581cb6be3 100644 --- a/Gui/src/main/java/mezz/jei/gui/startup/JeiGuiStarter.java +++ b/Gui/src/main/java/mezz/jei/gui/startup/JeiGuiStarter.java @@ -51,6 +51,8 @@ import mezz.jei.gui.input.handlers.UserInputRouter; import mezz.jei.gui.overlay.IngredientListOverlay; import mezz.jei.gui.overlay.bookmarks.BookmarkOverlay; +import mezz.jei.gui.overlay.bookmarks.history.HistoryInputHandler; +import mezz.jei.gui.overlay.bookmarks.history.HistoryList; import mezz.jei.gui.recipes.RecipesGui; import mezz.jei.gui.util.FocusUtil; import net.minecraft.client.Minecraft; @@ -157,11 +159,13 @@ public static JeiEventHandlers start(IRuntimeRegistration registration) { BookmarkList bookmarkList = new BookmarkList(recipeManager, focusFactory, ingredientManager, registryAccess, bookmarkConfig, clientConfig, guiHelper, codecHelper); bookmarkConfig.loadBookmarks(recipeManager, focusFactory, guiHelper, ingredientManager, registryAccess, bookmarkList, codecHelper); + HistoryList historyList = new HistoryList(); BookmarkOverlay bookmarkOverlay = OverlayHelper.createBookmarkOverlay( ingredientManager, screenHelper, bookmarkList, + historyList, keyMappings, bookmarkListConfig, ingredientFilterConfig, @@ -185,6 +189,7 @@ public static JeiEventHandlers start(IRuntimeRegistration registration) { keyMappings, focusFactory, bookmarkList, + historyList, guiHelper ); registration.setRecipesGui(recipesGui); @@ -207,7 +212,7 @@ public static JeiEventHandlers start(IRuntimeRegistration registration) { new EditInputHandler(recipeFocusSource, toggleState, editModeConfig), ingredientListOverlay.createInputHandler(), bookmarkOverlay.createInputHandler(), - new FocusInputHandler(recipeFocusSource, recipesGui, focusUtil, clientConfig, ingredientManager, toggleState, serverConnection), + new HistoryInputHandler(historyList, recipeFocusSource, new FocusInputHandler(recipeFocusSource, recipesGui, focusUtil, clientConfig, ingredientManager, toggleState, serverConnection)), new BookmarkInputHandler(recipeFocusSource, bookmarkList), new GlobalInputHandler(toggleState), new GuiAreaInputHandler(screenHelper, recipesGui, focusFactory) diff --git a/Gui/src/main/java/mezz/jei/gui/startup/OverlayHelper.java b/Gui/src/main/java/mezz/jei/gui/startup/OverlayHelper.java index ab268c2a1..437d489b8 100644 --- a/Gui/src/main/java/mezz/jei/gui/startup/OverlayHelper.java +++ b/Gui/src/main/java/mezz/jei/gui/startup/OverlayHelper.java @@ -18,6 +18,8 @@ import mezz.jei.gui.overlay.IngredientGridWithNavigation; import mezz.jei.gui.overlay.IngredientListOverlay; import mezz.jei.gui.overlay.bookmarks.BookmarkOverlay; +import mezz.jei.gui.overlay.bookmarks.history.HistoryList; +import mezz.jei.gui.overlay.bookmarks.history.HistoryOverlay; public final class OverlayHelper { private OverlayHelper() {} @@ -111,6 +113,7 @@ public static BookmarkOverlay createBookmarkOverlay( IIngredientManager ingredientManager, IScreenHelper screenHelper, BookmarkList bookmarkList, + HistoryList historyList, IInternalKeyMappings keyMappings, IIngredientGridConfig bookmarkListConfig, IIngredientFilterConfig ingredientFilterConfig, @@ -137,10 +140,24 @@ public static BookmarkOverlay createBookmarkOverlay( false ); + HistoryOverlay historyOverlay = new HistoryOverlay( + ingredientManager, + historyList, + keyMappings, + bookmarkListConfig, + ingredientFilterConfig, + clientConfig, + toggleState, + serverConnection, + colorHelper + ); + return new BookmarkOverlay( bookmarkList, bookmarkListGridNavigation, + historyOverlay, toggleState, + clientConfig, screenHelper, keyMappings ); diff --git a/NeoForge/src/test/java/mezz/jei/test/lib/TestClientConfig.java b/NeoForge/src/test/java/mezz/jei/test/lib/TestClientConfig.java index 6955457ed..601301cae 100644 --- a/NeoForge/src/test/java/mezz/jei/test/lib/TestClientConfig.java +++ b/NeoForge/src/test/java/mezz/jei/test/lib/TestClientConfig.java @@ -76,6 +76,16 @@ public boolean isDragToRearrangeBookmarksEnabled() { return false; } + @Override + public boolean isHistoryEnabled() { + return false; + } + + @Override + public int getMaxHistoryRows() { + return 0; + } + @Override public int getDragDelayMs() { return 0;