From 0d7431e4981226aba9d8011d76eabfb03d134499 Mon Sep 17 00:00:00 2001 From: Unknown Date: Thu, 21 Mar 2019 21:15:10 +0800 Subject: Large v2.5 Update --- .../java/me/shedaniel/rei/client/ScreenHelper.java | 28 ++++------------------ 1 file changed, 5 insertions(+), 23 deletions(-) (limited to 'src/main/java/me/shedaniel/rei/client/ScreenHelper.java') diff --git a/src/main/java/me/shedaniel/rei/client/ScreenHelper.java b/src/main/java/me/shedaniel/rei/client/ScreenHelper.java index 5c7112d41..fa109b98d 100644 --- a/src/main/java/me/shedaniel/rei/client/ScreenHelper.java +++ b/src/main/java/me/shedaniel/rei/client/ScreenHelper.java @@ -1,7 +1,6 @@ package me.shedaniel.rei.client; import com.google.common.collect.Lists; -import com.mojang.blaze3d.platform.GlStateManager; import me.shedaniel.rei.RoughlyEnoughItemsCore; import me.shedaniel.rei.gui.ContainerScreenOverlay; import me.shedaniel.rei.gui.widget.TextFieldWidget; @@ -10,13 +9,12 @@ import net.fabricmc.api.ClientModInitializer; import net.fabricmc.fabric.api.event.client.ClientTickCallback; import net.minecraft.client.MinecraftClient; import net.minecraft.client.gui.ContainerScreen; -import net.minecraft.client.gui.Drawable; import net.minecraft.client.gui.InputListener; import net.minecraft.client.gui.widget.ButtonWidget; import net.minecraft.client.gui.widget.RecipeBookButtonWidget; -import net.minecraft.client.render.GuiLighting; import net.minecraft.client.util.Window; import net.minecraft.item.ItemStack; +import org.apache.logging.log4j.util.TriConsumer; import java.awt.*; import java.util.List; @@ -71,35 +69,19 @@ public class ScreenHelper implements ClientModInitializer { return (ContainerScreenHooks) lastContainerScreen; } - public static void drawHoveringWidget(int x, int y, Drawable drawable, int width, int height, float delta) { + public static void drawHoveringWidget(int x, int y, TriConsumer consumer, int width, int height, float delta) { Window window = MinecraftClient.getInstance().window; - drawHoveringWidget(new Dimension(window.getScaledWidth(), window.getScaledHeight()), x, y, drawable, width, height, delta); + drawHoveringWidget(new Dimension(window.getScaledWidth(), window.getScaledHeight()), x, y, consumer, width, height, delta); } - public static void drawHoveringWidget(Dimension dimension, int x, int y, Drawable drawable, int width, int height, float delta) { + public static void drawHoveringWidget(Dimension dimension, int x, int y, TriConsumer consumer, int width, int height, float delta) { int int_5 = x + 12; int int_6 = y - 12; - if (int_5 + width > dimension.width) int_5 -= 28 + width; if (int_6 + height + 6 > dimension.height) int_6 = dimension.height - height - 6; - - drawable.draw(int_5, int_6, delta); - // zOffset = 300.0F; - // itemRenderer.zOffset = 300.0F; - // int int_9 = -267386864; - // drawGradientRect(int_5 - 3, int_6 - 4, int_5 + width + 3, int_6 - 3, -267386864, -267386864); - // drawGradientRect(int_5 - 3, int_6 + height + 3, int_5 + width + 3, int_6 + height + 4, -267386864, -267386864); - // drawGradientRect(int_5 - 3, int_6 - 3, int_5 + width + 3, int_6 + height + 3, -267386864, -267386864); - // drawGradientRect(int_5 - 4, int_6 - 3, int_5 - 3, int_6 + height + 3, -267386864, -267386864); - // drawGradientRect(int_5 + width + 3, int_6 - 3, int_5 + width + 4, int_6 + height + 3, -267386864, -267386864); - // int int_10 = 1347420415; - // int int_11 = 1344798847; - // drawGradientRect(int_5 - 3, int_6 - 3 + 1, int_5 - 3 + 1, int_6 + height + 3 - 1, 1347420415, 1344798847); - // drawGradientRect(int_5 + width + 2, int_6 - 3 + 1, int_5 + width + 3, int_6 + height + 3 - 1, 1347420415, 1344798847); - // drawGradientRect(int_5 - 3, int_6 - 3, int_5 + width + 3, int_6 - 3 + 1, 1347420415, 1347420415); - // drawGradientRect(int_5 - 3, int_6 + height + 2, int_5 + width + 3, int_6 + height + 3, 1344798847, 1344798847); + consumer.accept(int_5, int_6, delta); } @Override -- cgit