diff options
| author | shedaniel <daniel@shedaniel.me> | 2022-12-13 00:35:36 +0800 |
|---|---|---|
| committer | shedaniel <daniel@shedaniel.me> | 2022-12-13 00:35:36 +0800 |
| commit | 6448265ab59b41af623ff3770c6b11aded9ee677 (patch) | |
| tree | 15478db26adbd5a11633de5fab493eaeebcac41a /runtime | |
| parent | fa9d5ddf8f815629907ae4d3171574b7a0312bfa (diff) | |
| download | RoughlyEnoughItems-feature/favorites-groups.tar.gz RoughlyEnoughItems-feature/favorites-groups.tar.bz2 RoughlyEnoughItems-feature/favorites-groups.zip | |
Fix Merge Conflictsfeature/favorites-groups
Diffstat (limited to 'runtime')
| -rw-r--r-- | runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/favorites/FavoritesEntriesManager.java | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/favorites/FavoritesEntriesManager.java b/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/favorites/FavoritesEntriesManager.java index 8dfd0b076..878582fa3 100644 --- a/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/favorites/FavoritesEntriesManager.java +++ b/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/favorites/FavoritesEntriesManager.java @@ -36,6 +36,7 @@ import net.minecraft.network.chat.TranslatableComponent; import java.util.AbstractList; import java.util.ArrayList; +import java.util.Collection; import java.util.List; import java.util.function.Supplier; import java.util.stream.Collectors; @@ -70,9 +71,17 @@ public class FavoritesEntriesManager { config.getHiddenFavoriteEntries().add(entry); FavoritesListWidget widget = ScreenOverlayImpl.getFavoritesListWidget(); if (widget != null) { - Supplier<Rectangle> buttonBounds = widget.togglePanelButton::getBounds; - ScreenOverlayImpl.getInstance().getHintsContainer().addHint(12, () -> new Point(buttonBounds.get().getCenterX(), buttonBounds.get().getCenterY()), - "text.rei.hint.favorites.discover", List.of(new TranslatableComponent("text.rei.hint.favorites.discover"))); + if (!widget.getExclusionZones().isEmpty()) { + Rectangle[] bounds = new Rectangle[]{widget.getExclusionZones().iterator().next()}; + Supplier<Rectangle> buttonBounds = () -> { + Collection<Rectangle> exclusionZones = widget.getExclusionZones(); + if (exclusionZones.isEmpty()) + return bounds[0]; + return bounds[0] = exclusionZones.iterator().next(); + }; + ScreenOverlayImpl.getInstance().getHintsContainer().addHint(12, () -> new Point(buttonBounds.get().getCenterX(), buttonBounds.get().getCenterY()), + "text.rei.hint.favorites.discover", List.of(new TranslatableComponent("text.rei.hint.favorites.discover"))); + } } } |
