Search in sources :

Example 1 with Focus

use of mezz.jei.gui.Focus in project GregTech by GregTechCEu.

the class RGNode method init.

private void init(RGContainer container) {
    this.container = container;
    textWidget = new SimpleTextWidget(9, -5, "", -1, () -> {
        if (head instanceof ItemStack) {
            return ((ItemStack) head).getDisplayName();
        } else if (head instanceof FluidStack) {
            return ((FluidStack) head).getLocalizedName();
        }
        return "terminal.recipe_chart.drag";
    }, true).setShadow(true);
    textWidget.setVisible(false);
    textWidget.setActive(false);
    this.addWidget(textWidget);
    inputsGroup = new WidgetGroup(0, 0, 0, 0);
    this.addWidget(inputsGroup);
    toolGroup = new WidgetGroup(0, 0, 0, 0);
    this.addWidget(toolGroup);
    toolGroup.addWidget(new CircleButtonWidget(-11, 9, 8, 1, 12).setColors(0, TerminalTheme.COLOR_7.getColor(), TerminalTheme.COLOR_3.getColor()).setIcon(GuiTextures.ICON_REMOVE).setHoverText("terminal.guide_editor.remove").setClickListener(cd -> remove()));
    toolGroup.addWidget(new CircleButtonWidget(-11, 29, 8, 1, 12).setColors(0, TerminalTheme.COLOR_7.getColor(), 0).setIcon(GuiTextures.ICON_VISIBLE).setHoverText("terminal.recipe_chart.visible").setClickListener(cd -> {
        textWidget.setActive(!textWidget.isActive());
        textWidget.setVisible(!textWidget.isVisible());
    }));
    toolGroup.addWidget(new CircleButtonWidget(9, 29, 8, 1, 12).setColors(0, TerminalTheme.COLOR_7.getColor(), 0).setIcon(GuiTextures.ICON_LOCATION).setHoverText("terminal.recipe_chart.jei").setClickListener(cd -> {
        if (GTJeiPlugin.jeiRuntime != null && head != null) {
            GTJeiPlugin.jeiRuntime.getRecipesGui().show(new Focus<>(IFocus.Mode.OUTPUT, head));
        }
    }));
    inputsGroup.setVisible(false);
    inputsGroup.setActive(false);
    toolGroup.setVisible(false);
    toolGroup.setActive(false);
    parentNodes = new HashMap<>();
    // important
    children = new LinkedHashMap<>();
}
Also used : SimpleTextWidget(gregtech.api.gui.widgets.SimpleTextWidget) java.util(java.util) IRenderContext(gregtech.api.gui.IRenderContext) Constants(net.minecraftforge.common.util.Constants) IDraggable(gregtech.api.terminal.gui.IDraggable) TerminalTheme(gregtech.api.terminal.os.TerminalTheme) TerminalDialogWidget(gregtech.api.terminal.os.TerminalDialogWidget) IRecipeWrapper(mezz.jei.api.recipe.IRecipeWrapper) ItemStack(net.minecraft.item.ItemStack) NBTTagList(net.minecraft.nbt.NBTTagList) Widget(gregtech.api.gui.Widget) TankWidget(gregtech.api.gui.widgets.TankWidget) SimpleMachineMetaTileEntity(gregtech.api.metatileentity.SimpleMachineMetaTileEntity) ObfuscationReflectionHelper(net.minecraftforge.fml.common.ObfuscationReflectionHelper) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) Fluid(net.minecraftforge.fluids.Fluid) Focus(mezz.jei.gui.Focus) MachineItemBlock(gregtech.api.block.machines.MachineItemBlock) IRecipeLayout(mezz.jei.api.gui.IRecipeLayout) SlotWidget(gregtech.api.gui.widgets.SlotWidget) MetaTileEntity(gregtech.api.metatileentity.MetaTileEntity) NBTTagCompound(net.minecraft.nbt.NBTTagCompound) ModularUIContainer(gregtech.api.gui.impl.ModularUIContainer) Recipe(gregtech.api.recipes.Recipe) IFluidHandler(net.minecraftforge.fluids.capability.IFluidHandler) CapabilityFluidHandler(net.minecraftforge.fluids.capability.CapabilityFluidHandler) WidgetGroup(gregtech.api.gui.widgets.WidgetGroup) NBTBase(net.minecraft.nbt.NBTBase) NBTTagIntArray(net.minecraft.nbt.NBTTagIntArray) Collectors(java.util.stream.Collectors) GuiTextures(gregtech.api.gui.GuiTextures) IFocus(mezz.jei.api.recipe.IFocus) Position(gregtech.api.util.Position) ItemStackHandler(net.minecraftforge.items.ItemStackHandler) EntityPlayer(net.minecraft.entity.player.EntityPlayer) MathHelper(net.minecraft.util.math.MathHelper) IFluidHandlerItem(net.minecraftforge.fluids.capability.IFluidHandlerItem) CircleButtonWidget(gregtech.api.terminal.gui.widgets.CircleButtonWidget) FluidStack(net.minecraftforge.fluids.FluidStack) FluidTank(net.minecraftforge.fluids.FluidTank) IRecipeCategory(mezz.jei.api.recipe.IRecipeCategory) GTUtility(gregtech.api.util.GTUtility) GTJeiPlugin(gregtech.integration.jei.GTJeiPlugin) GTRecipeWrapper(gregtech.integration.jei.recipe.GTRecipeWrapper) RecipeLayout(mezz.jei.gui.recipes.RecipeLayout) CircleButtonWidget(gregtech.api.terminal.gui.widgets.CircleButtonWidget) FluidStack(net.minecraftforge.fluids.FluidStack) Focus(mezz.jei.gui.Focus) IFocus(mezz.jei.api.recipe.IFocus) WidgetGroup(gregtech.api.gui.widgets.WidgetGroup) ItemStack(net.minecraft.item.ItemStack) SimpleTextWidget(gregtech.api.gui.widgets.SimpleTextWidget)

Aggregations

MachineItemBlock (gregtech.api.block.machines.MachineItemBlock)1 GuiTextures (gregtech.api.gui.GuiTextures)1 IRenderContext (gregtech.api.gui.IRenderContext)1 Widget (gregtech.api.gui.Widget)1 ModularUIContainer (gregtech.api.gui.impl.ModularUIContainer)1 SimpleTextWidget (gregtech.api.gui.widgets.SimpleTextWidget)1 SlotWidget (gregtech.api.gui.widgets.SlotWidget)1 TankWidget (gregtech.api.gui.widgets.TankWidget)1 WidgetGroup (gregtech.api.gui.widgets.WidgetGroup)1 MetaTileEntity (gregtech.api.metatileentity.MetaTileEntity)1 SimpleMachineMetaTileEntity (gregtech.api.metatileentity.SimpleMachineMetaTileEntity)1 Recipe (gregtech.api.recipes.Recipe)1 IDraggable (gregtech.api.terminal.gui.IDraggable)1 CircleButtonWidget (gregtech.api.terminal.gui.widgets.CircleButtonWidget)1 TerminalDialogWidget (gregtech.api.terminal.os.TerminalDialogWidget)1 TerminalTheme (gregtech.api.terminal.os.TerminalTheme)1 GTUtility (gregtech.api.util.GTUtility)1 Position (gregtech.api.util.Position)1 GTJeiPlugin (gregtech.integration.jei.GTJeiPlugin)1 GTRecipeWrapper (gregtech.integration.jei.recipe.GTRecipeWrapper)1