diff options
| author | shedaniel <daniel@shedaniel.me> | 2021-02-21 22:33:45 +0800 |
|---|---|---|
| committer | shedaniel <daniel@shedaniel.me> | 2021-02-21 22:33:45 +0800 |
| commit | a56baa875630ffac06e421a7389854b5301ed7f0 (patch) | |
| tree | 9469ff3f61f2aca622d6f86dbe8044769198e639 /runtime/src/main/java/me/shedaniel/rei/gui/RecipeViewingScreen.java | |
| parent | 5eae235995583e378a884a14118095c1fda08fab (diff) | |
| download | RoughlyEnoughItems-a56baa875630ffac06e421a7389854b5301ed7f0.tar.gz RoughlyEnoughItems-a56baa875630ffac06e421a7389854b5301ed7f0.tar.bz2 RoughlyEnoughItems-a56baa875630ffac06e421a7389854b5301ed7f0.zip | |
More
Signed-off-by: shedaniel <daniel@shedaniel.me>
Diffstat (limited to 'runtime/src/main/java/me/shedaniel/rei/gui/RecipeViewingScreen.java')
| -rw-r--r-- | runtime/src/main/java/me/shedaniel/rei/gui/RecipeViewingScreen.java | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/runtime/src/main/java/me/shedaniel/rei/gui/RecipeViewingScreen.java b/runtime/src/main/java/me/shedaniel/rei/gui/RecipeViewingScreen.java index b230b023e..ef265916a 100644 --- a/runtime/src/main/java/me/shedaniel/rei/gui/RecipeViewingScreen.java +++ b/runtime/src/main/java/me/shedaniel/rei/gui/RecipeViewingScreen.java @@ -261,7 +261,7 @@ public class RecipeViewingScreen extends Screen implements RecipeScreen { currentCategoryIndex = categories.size() - 1; ClientHelperImpl.getInstance().openRecipeViewingScreen(categoriesMap, categories.get(currentCategoryIndex).getIdentifier(), ingredientStackToNotice, resultStackToNotice); }).tooltipLine(I18n.get("text.rei.previous_category"))); - widgets.add(Widgets.createClickableLabel(new Point(bounds.getCenterX(), bounds.getY() + 7), new TextComponent(selectedCategory.getCategoryName()), clickableLabelWidget -> { + widgets.add(Widgets.createClickableLabel(new Point(bounds.getCenterX(), bounds.getY() + 7), selectedCategory.getTitle(), clickableLabelWidget -> { ClientHelper.getInstance().openView(ClientHelper.ViewSearchBuilder.builder().addAllCategories().fillPreferredOpenedCategory()); }).tooltipLine(I18n.get("text.rei.view_all_categories"))); widgets.add(categoryNext = Widgets.createButton(new Rectangle(bounds.getMaxX() - 17, bounds.getY() + 5, 12, 12), new TranslatableComponent("text.rei.right_arrow")) @@ -310,10 +310,10 @@ public class RecipeViewingScreen extends Screen implements RecipeScreen { ClientHelperImpl.getInstance().openRecipeViewingScreen(categoriesMap, categories.get(widget.getId() + categoryPages * tabsPerPage).getIdentifier(), ingredientStackToNotice, resultStackToNotice); return true; })); - tab.setRenderer(categories.get(j), categories.get(j).getLogo(), categories.get(j).getCategoryName(), tab.getId() + categoryPages * tabsPerPage == categories.indexOf(selectedCategory)); + tab.setRenderer(categories.get(j), categories.get(j).getIcon(), categories.get(j).getTitle(), tab.getId() + categoryPages * tabsPerPage == categories.indexOf(selectedCategory)); } } - Optional<ButtonAreaSupplier> supplier = RecipeRegistry.getInstance().getAutoCraftButtonArea(selectedCategory); + Optional<ButtonAreaSupplier> supplier = DisplayRegistry.getInstance().getAutoCraftButtonArea(selectedCategory); int recipeHeight = selectedCategory.getDisplayHeight(); List<Display> currentDisplayed = getCurrentDisplayed(); for (int i = 0; i < currentDisplayed.size(); i++) { @@ -389,10 +389,10 @@ public class RecipeViewingScreen extends Screen implements RecipeScreen { } private int getRecipesPerPage() { - if (selectedCategory.getFixedRecipesPerPage() > 0) - return selectedCategory.getFixedRecipesPerPage() - 1; + if (selectedCategory.getFixedDisplaysPerPage() > 0) + return selectedCategory.getFixedDisplaysPerPage() - 1; int height = selectedCategory.getDisplayHeight(); - return Mth.clamp(Mth.floor(((double) this.bounds.getHeight() - 36) / ((double) height + 4)) - 1, 0, Math.min(ConfigObject.getInstance().getMaxRecipePerPage() - 1, selectedCategory.getMaximumRecipePerPage() - 1)); + return Mth.clamp(Mth.floor(((double) this.bounds.getHeight() - 36) / ((double) height + 4)) - 1, 0, Math.min(ConfigObject.getInstance().getMaxRecipePerPage() - 1, selectedCategory.getMaximumDisplaysPerPage() - 1)); } @Override |
