Make ItemZoom work properly as well on crafting preview window. Fixes #1844
This commit is contained in:
@@ -40,7 +40,7 @@ NOTE: Worlds that used Refined Storage 1.5.x are fully compatible with Refined S
|
|||||||
- Fixed bug where External Storage doesn't detect new inventory when rotating (raoulvdberge)
|
- Fixed bug where External Storage doesn't detect new inventory when rotating (raoulvdberge)
|
||||||
- Fixed JEI recipe transferring in Pattern Grid allowing non-processing recipes in processing mode and vice-versa (raoulvdberge)
|
- Fixed JEI recipe transferring in Pattern Grid allowing non-processing recipes in processing mode and vice-versa (raoulvdberge)
|
||||||
- Fixed using Interfaces for minimum stock levels failing when requester is also an Interface (raoulvdberge)
|
- Fixed using Interfaces for minimum stock levels failing when requester is also an Interface (raoulvdberge)
|
||||||
- Fixed ItemZoom incompatibility in Grid (raoulvdberge)
|
- Fixed ItemZoom incompatibility in Grid and crafting preview window (raoulvdberge)
|
||||||
- Fixed shift clicking upgrades into Interface making upgrades go to import slots (raoulvdberge)
|
- Fixed shift clicking upgrades into Interface making upgrades go to import slots (raoulvdberge)
|
||||||
- Prevent accidental Grid scrollbar click after clicking JEI recipe transfer button (raoulvdberge)
|
- Prevent accidental Grid scrollbar click after clicking JEI recipe transfer button (raoulvdberge)
|
||||||
- Added a missing config option for Crafter Manager energy usage (raoulvdberge)
|
- Added a missing config option for Crafter Manager energy usage (raoulvdberge)
|
||||||
|
|||||||
@@ -56,6 +56,9 @@ public class GuiCraftingPreview extends GuiBase {
|
|||||||
private GuiButton startButton;
|
private GuiButton startButton;
|
||||||
private GuiButton cancelButton;
|
private GuiButton cancelButton;
|
||||||
|
|
||||||
|
private ItemStack hoveringStack;
|
||||||
|
private FluidStack hoveringFluid;
|
||||||
|
|
||||||
private IElementDrawers drawers = new CraftingPreviewElementDrawers();
|
private IElementDrawers drawers = new CraftingPreviewElementDrawers();
|
||||||
|
|
||||||
public GuiCraftingPreview(GuiScreen parent, List<ICraftingPreviewElement> stacks, int hash, int quantity) {
|
public GuiCraftingPreview(GuiScreen parent, List<ICraftingPreviewElement> stacks, int hash, int quantity) {
|
||||||
@@ -176,8 +179,8 @@ public class GuiCraftingPreview extends GuiBase {
|
|||||||
RenderHelper.enableGUIStandardItemLighting();
|
RenderHelper.enableGUIStandardItemLighting();
|
||||||
GlStateManager.enableDepth();
|
GlStateManager.enableDepth();
|
||||||
|
|
||||||
ItemStack hoveringStack = null;
|
this.hoveringStack = null;
|
||||||
FluidStack hoveringFluid = null;
|
this.hoveringFluid = null;
|
||||||
|
|
||||||
for (int i = 0; i < 8; ++i) {
|
for (int i = 0; i < 8; ++i) {
|
||||||
if (slot < stacks.size()) {
|
if (slot < stacks.size()) {
|
||||||
@@ -186,9 +189,10 @@ public class GuiCraftingPreview extends GuiBase {
|
|||||||
stack.draw(x, y + 5, drawers);
|
stack.draw(x, y + 5, drawers);
|
||||||
|
|
||||||
if (inBounds(x + 5, y + 7, 16, 16, mouseX, mouseY)) {
|
if (inBounds(x + 5, y + 7, 16, 16, mouseX, mouseY)) {
|
||||||
hoveringStack = stack.getId().equals(CraftingPreviewElementItemStack.ID) ? (ItemStack) stack.getElement() : null;
|
this.hoveringStack = stack.getId().equals(CraftingPreviewElementItemStack.ID) ? (ItemStack) stack.getElement() : null;
|
||||||
if (hoveringStack == null) {
|
|
||||||
hoveringFluid = stack.getId().equals(CraftingPreviewElementFluidStack.ID) ? (FluidStack) stack.getElement() : null;
|
if (this.hoveringStack == null) {
|
||||||
|
this.hoveringFluid = stack.getId().equals(CraftingPreviewElementFluidStack.ID) ? (FluidStack) stack.getElement() : null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -203,16 +207,21 @@ public class GuiCraftingPreview extends GuiBase {
|
|||||||
slot++;
|
slot++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!startButton.enabled && inBounds(85, 144, 50, 20, mouseX, mouseY)) {
|
||||||
|
drawTooltip(mouseX, mouseY, t("gui.refinedstorage:crafting_preview.force_start"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void drawScreen(int mouseX, int mouseY, float partialTicks) {
|
||||||
|
super.drawScreen(mouseX, mouseY, partialTicks);
|
||||||
|
|
||||||
if (hoveringStack != null) {
|
if (hoveringStack != null) {
|
||||||
drawTooltip(hoveringStack, mouseX, mouseY, hoveringStack.getTooltip(Minecraft.getMinecraft().player, Minecraft.getMinecraft().gameSettings.advancedItemTooltips ? ITooltipFlag.TooltipFlags.ADVANCED : ITooltipFlag.TooltipFlags.NORMAL));
|
drawTooltip(hoveringStack, mouseX, mouseY, hoveringStack.getTooltip(Minecraft.getMinecraft().player, Minecraft.getMinecraft().gameSettings.advancedItemTooltips ? ITooltipFlag.TooltipFlags.ADVANCED : ITooltipFlag.TooltipFlags.NORMAL));
|
||||||
} else if (hoveringFluid != null) {
|
} else if (hoveringFluid != null) {
|
||||||
drawTooltip(mouseX, mouseY, hoveringFluid.getLocalizedName());
|
drawTooltip(mouseX, mouseY, hoveringFluid.getLocalizedName());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!startButton.enabled && inBounds(85, 144, 50, 20, mouseX, mouseY)) {
|
|
||||||
drawTooltip(mouseX, mouseY, t("gui.refinedstorage:crafting_preview.force_start"));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user