aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/me/shedaniel/rei/gui/widget/RecipeViewingWidget.java
diff options
context:
space:
mode:
authorUnknown <shekwancheung0528@gmail.com>2019-01-11 22:24:25 +0800
committerUnknown <shekwancheung0528@gmail.com>2019-01-11 22:24:25 +0800
commit380007c729d954eb97b7c5479ca114d610b0c0e0 (patch)
tree4ee208a4619d49b8b2536c36086bef40f323ef09 /src/main/java/me/shedaniel/rei/gui/widget/RecipeViewingWidget.java
parentc9292fa51e69e051569caa9bd6f61572ac8fdeea (diff)
downloadRoughlyEnoughItems-380007c729d954eb97b7c5479ca114d610b0c0e0.tar.gz
RoughlyEnoughItems-380007c729d954eb97b7c5479ca114d610b0c0e0.tar.bz2
RoughlyEnoughItems-380007c729d954eb97b7c5479ca114d610b0c0e0.zip
Fixed Lots of bugs
Diffstat (limited to 'src/main/java/me/shedaniel/rei/gui/widget/RecipeViewingWidget.java')
-rw-r--r--src/main/java/me/shedaniel/rei/gui/widget/RecipeViewingWidget.java18
1 files changed, 6 insertions, 12 deletions
diff --git a/src/main/java/me/shedaniel/rei/gui/widget/RecipeViewingWidget.java b/src/main/java/me/shedaniel/rei/gui/widget/RecipeViewingWidget.java
index 949e4062d..90bde332d 100644
--- a/src/main/java/me/shedaniel/rei/gui/widget/RecipeViewingWidget.java
+++ b/src/main/java/me/shedaniel/rei/gui/widget/RecipeViewingWidget.java
@@ -5,7 +5,7 @@ import com.mojang.blaze3d.platform.GlStateManager;
import me.shedaniel.rei.api.IRecipeCategory;
import me.shedaniel.rei.api.IRecipeDisplay;
import me.shedaniel.rei.client.ClientHelper;
-import me.shedaniel.rei.gui.ContainerGuiOverlay;
+import me.shedaniel.rei.client.GuiHelper;
import me.shedaniel.rei.listeners.IMixinContainerGui;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.audio.PositionedSoundInstance;
@@ -36,7 +36,6 @@ public class RecipeViewingWidget extends Gui {
private List<IRecipeCategory> categories;
private IRecipeCategory selectedCategory;
private IMixinContainerGui parent;
- private ContainerGuiOverlay overlay;
private int page, categoryPages;
private ButtonWidget recipeBack, recipeNext, categoryBack, categoryNext;
@@ -50,7 +49,6 @@ public class RecipeViewingWidget extends Gui {
this.categories = new LinkedList<>(categoriesMap.keySet());
Collections.reverse(categories);
this.selectedCategory = categories.get(0);
- this.overlay = parent.getOverlay();
this.tabs = new ArrayList<>();
}
@@ -58,10 +56,6 @@ public class RecipeViewingWidget extends Gui {
return parent;
}
- public ContainerGuiOverlay getOverlay() {
- return overlay;
- }
-
@Override
public boolean keyPressed(int int_1, int int_2, int int_3) {
if (int_1 == 256 && this.doesEscapeKeyClose()) {
@@ -76,7 +70,7 @@ public class RecipeViewingWidget extends Gui {
@Override
public void onClosed() {
- parent.setOverlay(overlay);
+ GuiHelper.resetOverlay();
}
@Override
@@ -178,10 +172,10 @@ public class RecipeViewingWidget extends Gui {
widgets.addAll(selectedCategory.setupDisplay(getParent(), middleDisplay, new Rectangle((int) getBounds().getCenterX() - 75, getBounds().y + 108, 150, 66)));
}
}
-
- overlay.onInitialized();
+
+ GuiHelper.getOverlay(parent.getContainerGui()).onInitialized();
listeners.addAll(tabs);
- listeners.add(overlay);
+ listeners.add(GuiHelper.getOverlay(parent.getContainerGui()));
listeners.addAll(widgets);
}
@@ -206,7 +200,7 @@ public class RecipeViewingWidget extends Gui {
GlStateManager.color4f(1.0F, 1.0F, 1.0F, 1.0F);
GuiLighting.disable();
tabs.stream().filter(TabWidget::isSelected).forEach(tabWidget -> tabWidget.draw(mouseX, mouseY, partialTicks));
- overlay.render(mouseX, mouseY, partialTicks);
+ GuiHelper.getOverlay(parent.getContainerGui()).render(mouseX, mouseY, partialTicks);
}
@Override