diff options
| author | shedaniel <daniel@shedaniel.me> | 2022-05-21 20:29:08 +0800 |
|---|---|---|
| committer | shedaniel <daniel@shedaniel.me> | 2022-05-21 20:29:08 +0800 |
| commit | a4884f1e31083a05b48ea238ce8792842e691444 (patch) | |
| tree | 5284d9cc68d5d21f74a6dc84f8004d42061c8831 /runtime/src | |
| parent | e48b5b7a9eec72fcaf202d1ffe53765da6aad503 (diff) | |
| parent | 8589dfa9b7e382c2eff22bb1c5bea5d7759007d5 (diff) | |
| download | RoughlyEnoughItems-a4884f1e31083a05b48ea238ce8792842e691444.tar.gz RoughlyEnoughItems-a4884f1e31083a05b48ea238ce8792842e691444.tar.bz2 RoughlyEnoughItems-a4884f1e31083a05b48ea238ce8792842e691444.zip | |
Merge remote-tracking branch 'origin/8.x-1.18.2' into 9.x-1.19
# Conflicts:
# gradle.properties
# runtime/src/main/java/me/shedaniel/rei/impl/client/entry/filtering/rules/SearchFilteringRule.java
# runtime/src/main/java/me/shedaniel/rei/impl/client/gui/ScreenOverlayImpl.java
# runtime/src/main/java/me/shedaniel/rei/impl/client/gui/performance/PerformanceScreen.java
# runtime/src/main/java/me/shedaniel/rei/impl/client/gui/screen/DefaultDisplayViewingScreen.java
# runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/EntryWidget.java
# runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/FavoritesListWidget.java
# runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/InternalWidgets.java
# runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/entrylist/EntryListWidget.java
Diffstat (limited to 'runtime/src')
73 files changed, 3290 insertions, 1451 deletions
diff --git a/runtime/src/main/java/me/shedaniel/rei/impl/client/ClientHelperImpl.java b/runtime/src/main/java/me/shedaniel/rei/impl/client/ClientHelperImpl.java index 2e476749c..fd13d30fb 100644 --- a/runtime/src/main/java/me/shedaniel/rei/impl/client/ClientHelperImpl.java +++ b/runtime/src/main/java/me/shedaniel/rei/impl/client/ClientHelperImpl.java @@ -269,7 +269,7 @@ public class ClientHelperImpl implements ClientHelper { } @ApiStatus.Internal - public void openRecipeViewingScreen(Map<DisplayCategory<?>, List<DisplaySpec>> map, @Nullable CategoryIdentifier<?> category, List<EntryStack<?>> ingredientNotice, List<EntryStack<?>> resultNotice) { + public void openDisplayViewingScreen(Map<DisplayCategory<?>, List<DisplaySpec>> map, @Nullable CategoryIdentifier<?> category, List<EntryStack<?>> ingredientNotice, List<EntryStack<?>> resultNotice) { LegacyWrapperViewSearchBuilder builder = new LegacyWrapperViewSearchBuilder(map); for (EntryStack<?> stack : ingredientNotice) { builder.addInputNotice(stack); diff --git a/runtime/src/main/java/me/shedaniel/rei/impl/client/REIRuntimeImpl.java b/runtime/src/main/java/me/shedaniel/rei/impl/client/REIRuntimeImpl.java index 792c66586..8791301b0 100644 --- a/runtime/src/main/java/me/shedaniel/rei/impl/client/REIRuntimeImpl.java +++ b/runtime/src/main/java/me/shedaniel/rei/impl/client/REIRuntimeImpl.java @@ -58,7 +58,7 @@ import org.jetbrains.annotations.Nullable; import java.util.*; -import static me.shedaniel.rei.impl.client.gui.widget.EntryListWidget.entrySize; +import static me.shedaniel.rei.impl.client.gui.widget.entrylist.EntryListWidget.entrySize; @ApiStatus.Internal @Environment(EnvType.CLIENT) diff --git a/runtime/src/main/java/me/shedaniel/rei/impl/client/config/ConfigObjectImpl.java b/runtime/src/main/java/me/shedaniel/rei/impl/client/config/ConfigObjectImpl.java index 0f273b7e8..28f45277b 100644 --- a/runtime/src/main/java/me/shedaniel/rei/impl/client/config/ConfigObjectImpl.java +++ b/runtime/src/main/java/me/shedaniel/rei/impl/client/config/ConfigObjectImpl.java @@ -167,11 +167,11 @@ public class ConfigObjectImpl implements ConfigObject, ConfigData { @Override public boolean isCraftableFilterEnabled() { - return appearance.layout.enableCraftableOnlyButton; + return appearance.layout.showCraftableOnlyButton; } public void setCraftableFilterEnabled(boolean enabled) { - appearance.layout.enableCraftableOnlyButton = enabled; + appearance.layout.showCraftableOnlyButton = enabled; } @Override @@ -249,7 +249,7 @@ public class ConfigObjectImpl implements ConfigObject, ConfigData { @Override public boolean doesSnapToRows() { - return advanced.accessibility.snapToRows; + return false; } @Override @@ -570,7 +570,7 @@ public class ConfigObjectImpl implements ConfigObject, ConfigData { private SearchFieldLocation searchFieldLocation = SearchFieldLocation.CENTER; @Comment("Declares the position of the config button.") @ConfigEntry.Gui.EnumHandler(option = ConfigEntry.Gui.EnumHandler.EnumDisplayOption.BUTTON) private ConfigButtonPosition configButtonLocation = ConfigButtonPosition.LOWER; - @Comment("Declares whether the craftable filter button is enabled.") private boolean enableCraftableOnlyButton = true; + @Comment("Declares whether the craftable filter button is enabled.") private boolean showCraftableOnlyButton = true; } @UsePercentage(min = 0.1, max = 1.0, prefix = "Limit: ") private double horizontalEntriesBoundaries = 1.0; @@ -633,7 +633,6 @@ public class ConfigObjectImpl implements ConfigObject, ConfigData { @UsePercentage(min = 0.25, max = 4.0) private double entrySize = 1.0; @Comment("Declares the position of the entry panel.") @ConfigEntry.Gui.EnumHandler(option = ConfigEntry.Gui.EnumHandler.EnumDisplayOption.BUTTON) private DisplayPanelLocation displayPanelLocation = DisplayPanelLocation.RIGHT; - @Comment("Declares whether scrolled entry panel should snap to rows.") private boolean snapToRows = false; @Comment("Declares how the scrollbar in composite screen should act.") private boolean compositeScrollBarPermanent = false; private boolean toastDisplayedOnCopyIdentifier = true; @Comment("Declares whether REI should use compact tabs for categories.") private boolean useCompactTabs = true; diff --git a/runtime/src/main/java/me/shedaniel/rei/impl/client/config/entries/FilteringScreen.java b/runtime/src/main/java/me/shedaniel/rei/impl/client/config/entries/FilteringScreen.java index 4abc68318..2106e0e36 100644 --- a/runtime/src/main/java/me/shedaniel/rei/impl/client/config/entries/FilteringScreen.java +++ b/runtime/src/main/java/me/shedaniel/rei/impl/client/config/entries/FilteringScreen.java @@ -35,7 +35,6 @@ import me.shedaniel.math.Point; import me.shedaniel.math.Rectangle; import me.shedaniel.math.impl.PointHelper; import me.shedaniel.rei.api.client.REIRuntime; -import me.shedaniel.rei.api.client.config.ConfigObject; import me.shedaniel.rei.api.client.gui.widgets.Tooltip; import me.shedaniel.rei.api.client.registry.entry.EntryRegistry; import me.shedaniel.rei.api.client.search.SearchFilter; @@ -46,6 +45,7 @@ import me.shedaniel.rei.impl.client.gui.ScreenOverlayImpl; import me.shedaniel.rei.impl.client.gui.widget.BatchedEntryRendererManager; import me.shedaniel.rei.impl.client.gui.widget.EntryWidget; import me.shedaniel.rei.impl.client.gui.widget.search.OverlaySearchField; +import net.minecraft.ChatFormatting; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.components.Button; import net.minecraft.client.gui.components.events.GuiEventListener; @@ -56,11 +56,13 @@ import net.minecraft.util.Mth; import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.Nullable; +import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.Set; +import java.util.function.Predicate; -import static me.shedaniel.rei.impl.client.gui.widget.EntryListWidget.entrySize; +import static me.shedaniel.rei.impl.client.gui.widget.entrylist.EntryListWidget.entrySize; @ApiStatus.Internal public class FilteringScreen extends Screen { @@ -87,11 +89,12 @@ public class FilteringScreen extends Screen { private Tooltip tooltip = null; private List<EntryStack<?>> entryStacks = null; private Rectangle innerBounds; - private List<EntryListEntry> entries = Collections.emptyList(); + private List<FilteringListEntry> entries = Collections.emptyList(); private List<GuiEventListener> elements = Collections.emptyList(); - private Point selectionPoint = null; - private Point secondPoint = null; + private record PointPair(Point firstPoint, @Nullable Point secondPoint) {} + + private List<PointPair> points = new ArrayList<>(); private OverlaySearchField searchField; private Button selectAllButton; @@ -99,7 +102,7 @@ public class FilteringScreen extends Screen { private Button hideButton; private Button showButton; private Button backButton; - private Rectangle selectionCache; + private Predicate<Rectangle> selectionCache; private SearchFilter lastFilter = SearchFilter.matchAll(); @@ -110,15 +113,14 @@ public class FilteringScreen extends Screen { { Component selectAllText = Component.translatable("config.roughlyenoughitems.filteredEntries.selectAll"); this.selectAllButton = new Button(0, 0, Minecraft.getInstance().font.width(selectAllText) + 10, 20, selectAllText, button -> { - this.selectionPoint = new Point(-Integer.MAX_VALUE / 2, -Integer.MAX_VALUE / 2); - this.secondPoint = new Point(Integer.MAX_VALUE / 2, Integer.MAX_VALUE / 2); + this.points.clear(); + this.points.add(new PointPair(new Point(-Integer.MAX_VALUE / 2, -Integer.MAX_VALUE / 2), new Point(Integer.MAX_VALUE / 2, Integer.MAX_VALUE / 2))); }); } { Component selectNoneText = Component.translatable("config.roughlyenoughitems.filteredEntries.selectNone"); this.selectNoneButton = new Button(0, 0, Minecraft.getInstance().font.width(selectNoneText) + 10, 20, selectNoneText, button -> { - this.selectionPoint = new Point(Integer.MAX_VALUE, Integer.MAX_VALUE); - this.secondPoint = new Point(Integer.MAX_VALUE, Integer.MAX_VALUE); + this.points.clear(); }); } { |
