当前位置: 首页>>代码示例>>Java>>正文


Java GuiContainerManager类代码示例

本文整理汇总了Java中codechicken.nei.guihook.GuiContainerManager的典型用法代码示例。如果您正苦于以下问题:Java GuiContainerManager类的具体用法?Java GuiContainerManager怎么用?Java GuiContainerManager使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


GuiContainerManager类属于codechicken.nei.guihook包,在下文中一共展示了GuiContainerManager类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: handleTooltip

import codechicken.nei.guihook.GuiContainerManager; //导入依赖的package包/类
@Override
public List<String> handleTooltip(GuiContainer gui, int mousex, int mousey, List<String> currenttip) {
    if (!canHandle(gui))
        return currenttip;

    if (GuiContainerManager.shouldShowTooltip(gui) && currenttip.size() == 0) {
        int[] offset = RecipeInfo.getGuiOffset(gui);
        try {
            Class clazzTemplateRecipeHandler = Class.forName("codechicken.nei.recipe.TemplateRecipeHandler");
            Method methodTransferRect = clazzTemplateRecipeHandler.getDeclaredMethod("transferRectTooltip", GuiContainer.class, Collection.class, int.class, int.class, List.class);
            methodTransferRect.setAccessible(true);
            currenttip = (List<String>) methodTransferRect.invoke(null, gui, getRecieTransferRect(gui), offset[0], offset[1], currenttip);
        } catch (Exception e) {}
    }
    return currenttip;
}
 
开发者ID:GWYOG,项目名称:CustomNEIPlugins,代码行数:17,代码来源:PluginMachineRecipe.java

示例2: keyTyped

import codechicken.nei.guihook.GuiContainerManager; //导入依赖的package包/类
public boolean keyTyped(final GuiContainer guiContainer, final char c, final int i) {
    final int keyBinding = NEIClientConfig.getKeyBinding("gui.xu_ping");
    if (i != keyBinding) {
        return false;
    }
    final LayoutManager layout = LayoutManager.instance();
    if (layout == null || LayoutManager.itemPanel == null || NEIClientConfig.isHidden()) {
        return false;
    }
    final ItemStack stackMouseOver = GuiContainerManager.getStackMouseOver(guiContainer);
    if (stackMouseOver == null || stackMouseOver.getItem() == null) {
        return false;
    }
    NetworkHandler.sendPacketToServer(new PacketNEIPing(stackMouseOver));
    return true;
}
 
开发者ID:sameer,项目名称:ExtraUtilities,代码行数:17,代码来源:NEIPing.java

示例3: draw

import codechicken.nei.guihook.GuiContainerManager; //导入依赖的package包/类
@Override
public void draw(int mousex, int mousey) {
    if (itemsPerPage == 0)
        return;

    GuiContainerManager.enableMatrixStackLogging();
    int index = firstIndex;
    for (int i = 0; i < rows * columns && index < items.size(); i++) {
        if (validSlotMap[i]) {
            Rectangle4i rect = getSlotRect(i);
            if (rect.contains(mousex, mousey))
                drawRect(rect.x, rect.y, rect.w, rect.h, 0xee555555);//highlight

            GuiContainerManager.drawItem(rect.x + 1, rect.y + 1, items.get(index));

            index++;
        }
    }
    GuiContainerManager.disableMatrixStackLogging();
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:21,代码来源:ItemPanel.java

示例4: lastKeyTyped

import codechicken.nei.guihook.GuiContainerManager; //导入依赖的package包/类
@Override
public boolean lastKeyTyped(GuiContainer gui, char keyChar, int keyCode) {
    if (!NEIClientConfig.isEnabled() ||
            GuiInfo.hasCustomSlots(gui) ||
            isSpreading(gui))
        return false;

    Slot slot = GuiContainerManager.getSlotMouseOver(gui);
    if (slot == null)
        return false;

    int slotIndex = slot.slotNumber;

    if (keyCode == NEIClientUtils.mc().gameSettings.keyBindDrop.getKeyCode() && NEIClientUtils.shiftKey()) {
        FastTransferManager.clickSlot(gui, slotIndex);
        fastTransferManager.throwAll(gui, slotIndex);
        FastTransferManager.clickSlot(gui, slotIndex);

        return true;
    }

    return false;
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:24,代码来源:NEIController.java

示例5: renderOverlay

import codechicken.nei.guihook.GuiContainerManager; //导入依赖的package包/类
@Override
public void renderOverlay(GuiContainerManager gui, Slot slot)
{
    GL11.glEnable(GL11.GL_BLEND);
    GL11.glBlendFunc(770, 1);
    GL11.glColor4d(0.6, 0.6, 0.6, 0.7);
    
    GuiContainerManager.setColouredItemRender(true);
    for(PositionedStack stack : ingreds)
    {
        if(stack.relx == slot.xDisplayPosition && stack.rely == slot.yDisplayPosition)
            GuiContainerManager.drawItem(stack.relx, stack.rely, stack.item);
    }
    GuiContainerManager.setColouredItemRender(false);
    
    GL11.glColor4f(1, 1, 1, 1);
    GL11.glDisable(GL11.GL_BLEND);
    GL11.glEnable(GL11.GL_LIGHTING);
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:20,代码来源:DefaultOverlayRenderer.java

示例6: drawSlot

import codechicken.nei.guihook.GuiContainerManager; //导入依赖的package包/类
@Override
protected void drawSlot(int slot, int x, int y, int mx, int my, float frame) {
    int w = windowBounds().width;
    Rectangle4i r = new Rectangle4i(x, y, w, getSlotHeight(slot));
    if(slot < sorted.size()) {
        SubsetTag tag = sorted.get(slot);
        LayoutManager.getLayoutStyle().drawSubsetTag(tag.displayName(), x, y, r.w, r.h, tag.state.state, r.contains(mx, my));
    }
    else {
        ItemStack stack = state.items.get(slot-sorted.size());
        boolean hidden = SubsetWidget.isHidden(stack);

        int itemx = w/2-8;
        int itemy = 1;

        LayoutManager.getLayoutStyle().drawSubsetTag(null, x, y, r.w, r.h, hidden ? 0 : 2, false);

        GuiContainerManager.drawItem(x+itemx, y+itemy, stack);
        if(new Rectangle4i(itemx, itemy, 16, 16).contains(mx, my))
            SubsetWidget.hoverStack = stack;
    }
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:23,代码来源:SubsetWidget.java

示例7: keyTyped

import codechicken.nei.guihook.GuiContainerManager; //导入依赖的package包/类
@Override
public void keyTyped(char c, int i) {
    if (i == 1)//esc
    {
        mc.displayGuiScreen(firstGui);
        return;
    }
    if (GuiContainerManager.getManager(this).lastKeyTyped(i, c))
        return;

    IRecipeHandler recipehandler = currenthandlers.get(recipetype);
    for (int recipe = page * recipehandler.recipiesPerPage(); recipe < recipehandler.numRecipes() && recipe < (page + 1) * recipehandler.recipiesPerPage(); recipe++)
        if (recipehandler.keyTyped(this, c, i, recipe))
            return;

    if (i == mc.gameSettings.keyBindInventory.getKeyCode())
        mc.displayGuiScreen(firstGui);
    else if (i == NEIClientConfig.getKeyBinding("gui.back"))
        mc.displayGuiScreen(prevGui);

}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:22,代码来源:GuiRecipe.java

示例8: drawGuiContainerForegroundLayer

import codechicken.nei.guihook.GuiContainerManager; //导入依赖的package包/类
@Override
protected void drawGuiContainerForegroundLayer(int par1, int par2) {
    GuiContainerManager.enable2DRender();

    IRecipeHandler recipehandler = currenthandlers.get(recipetype);
    String s = recipehandler.getRecipeName();
    fontRendererObj.drawString(s, (xSize - fontRendererObj.getStringWidth(s)) / 2, 5, 0x404040);
    s = NEIClientUtils.translate("recipe.page", page + 1, (currenthandlers.get(recipetype).numRecipes() - 1) / recipehandler.recipiesPerPage() + 1);
    fontRendererObj.drawString(s, (xSize - fontRendererObj.getStringWidth(s)) / 2, ySize - 16, 0x404040);

    GL11.glPushMatrix();
    GL11.glTranslatef(5, 16, 0);
    for (int i = page * recipehandler.recipiesPerPage(); i < recipehandler.numRecipes() && i < (page + 1) * recipehandler.recipiesPerPage(); i++) {
        recipehandler.drawForeground(i);
        GL11.glTranslatef(0, 65, 0);
    }
    GL11.glPopMatrix();
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:19,代码来源:GuiRecipe.java

示例9: drawIcons

import codechicken.nei.guihook.GuiContainerManager; //导入依赖的package包/类
@Override
public void drawIcons()
{
    int x = buttonX();
    LayoutManager.drawIcon(x+4, 4, new Image(120, 24, 12, 12)); x+=24;
    LayoutManager.drawIcon(x+4, 4, new Image(120, 12, 12, 12)); x+=24;
    LayoutManager.drawIcon(x+4, 4, new Image(168, 24, 12, 12)); x+=24;
    LayoutManager.drawIcon(x+4, 4, new Image(144, 12, 12, 12)); x+=24;
    LayoutManager.drawIcon(x+4, 4, new Image(180, 24, 12, 12)); x+=24;
    LayoutManager.drawIcon(x+4, 4, new Image(132, 12, 12, 12)); x+=24;
    RenderHelper.enableGUIStandardItemLighting();
    GL11.glEnable(GL12.GL_RESCALE_NORMAL);
    ItemStack sword = new ItemStack(Items.diamond_sword);
    sword.addEnchantment(Enchantment.sharpness, 1);
    GuiContainerManager.drawItem(x+2, 2, sword); x+=24;
    GuiContainerManager.drawItem(x+2, 2, new ItemStack(Items.potionitem)); x+=24;
    GuiContainerManager.drawItem(x+2, 2, new ItemStack(Blocks.stone)); x+=24;
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:19,代码来源:OptionUtilities.java

示例10: lastKeyTyped

import codechicken.nei.guihook.GuiContainerManager; //导入依赖的package包/类
@Override
public boolean lastKeyTyped(GuiContainer gui, char keyChar, int keyCode) {
    if (!NEIClientConfig.isEnabled() ||
            GuiInfo.hasCustomSlots(gui) ||
            isSpreading(gui))
        return false;

    Slot slot = GuiContainerManager.getSlotMouseOver(gui);
    if (slot == null)
        return false;

    int slotIndex = slot.slotNumber;

    if (keyCode == Minecraft.getMinecraft().gameSettings.keyBindDrop.getKeyCode() && NEIClientUtils.shiftKey()) {
        FastTransferManager.clickSlot(gui, slotIndex);
        fastTransferManager.throwAll(gui, slotIndex);
        FastTransferManager.clickSlot(gui, slotIndex);

        return true;
    }

    return false;
}
 
开发者ID:SneakyTactician,项目名称:BIGB,代码行数:24,代码来源:NEIController.java

示例11: drawGuiContainerForegroundLayer

import codechicken.nei.guihook.GuiContainerManager; //导入依赖的package包/类
@Override
protected void drawGuiContainerForegroundLayer(int par1, int par2) {
    GuiContainerManager.enable2DRender();

    IRecipeHandler recipehandler = currenthandlers.get(recipetype);
    String s = recipehandler.getRecipeName();
    fontRendererObj.drawString(s, (xSize - fontRendererObj.getStringWidth(s)) / 2, 5, 0x404040);
    s = NEIClientUtils.translate("recipe.page", page + 1, (currenthandlers.get(recipetype).numRecipes() - 1) / recipehandler.recipiesPerPage() + 1);
    fontRendererObj.drawString(s, (xSize - fontRendererObj.getStringWidth(s)) / 2, ySize - 16, 0x404040);

    GlStateManager.pushMatrix();
    GlStateManager.translate(5, 16, 0);
    for (int i = page * recipehandler.recipiesPerPage(); i < recipehandler.numRecipes() && i < (page + 1) * recipehandler.recipiesPerPage(); i++) {
        recipehandler.drawForeground(i);
        GlStateManager.translate(0, 65, 0);
    }
    GlStateManager.popMatrix();
}
 
开发者ID:SneakyTactician,项目名称:BIGB,代码行数:19,代码来源:GuiRecipe.java

示例12: drawIcons

import codechicken.nei.guihook.GuiContainerManager; //导入依赖的package包/类
@Override
public void drawIcons()
{
    int x = buttonX();
    LayoutManager.drawIcon(x+4, 4, new Image(120, 24, 12, 12)); x+=24;
    LayoutManager.drawIcon(x+4, 4, new Image(120, 12, 12, 12)); x+=24;
    LayoutManager.drawIcon(x+4, 4, new Image(168, 24, 12, 12)); x+=24;
    LayoutManager.drawIcon(x+4, 4, new Image(144, 12, 12, 12)); x+=24;
    LayoutManager.drawIcon(x+4, 4, new Image(180, 24, 12, 12)); x+=24;
    LayoutManager.drawIcon(x+4, 4, new Image(132, 12, 12, 12)); x+=24;
    RenderHelper.enableGUIStandardItemLighting();
    GlStateManager.enableRescaleNormal();
    ItemStack sword = new ItemStack(Items.diamond_sword);
    sword.addEnchantment(Enchantment.sharpness, 1);
    GuiContainerManager.drawItem(x+2, 2, sword); x+=24;
    GuiContainerManager.drawItem(x+2, 2, new ItemStack(Items.potionitem)); x+=24;
    GuiContainerManager.drawItem(x+2, 2, new ItemStack(Blocks.stone)); x+=24;
}
 
开发者ID:SneakyTactician,项目名称:BIGB,代码行数:19,代码来源:OptionUtilities.java

示例13: drawItems

import codechicken.nei.guihook.GuiContainerManager; //导入依赖的package包/类
private void drawItems() {
    Dimension d = GuiDraw.displayRes();

    GlStateManager.matrixMode(GL11.GL_PROJECTION);
    GlStateManager.loadIdentity();
    GlStateManager.ortho(0, d.width*16D/iconSize, d.height*16D/iconSize, 0, 1000, 3000);
    GlStateManager.matrixMode(GL11.GL_MODELVIEW);
    GlStateManager.clearColor(0, 0, 0, 0);
    GlStateManager.clear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT);

    int rows = d.height / boxSize;
    int cols = d.width / boxSize;
    int fit = rows*cols;

    RenderHelper.enableGUIStandardItemLighting();
    GlStateManager.enableRescaleNormal();
    GlStateManager.color(1, 1, 1, 1);

    for(int i = 0; drawIndex < ItemPanel.items.size() && i < fit; drawIndex++, i++) {
        int x = i%cols * 18;
        int y = i/cols * 18;
        GuiContainerManager.drawItem(x+1, y+1, ItemPanel.items.get(drawIndex));
    }

    GL11.glFlush();
}
 
开发者ID:SneakyTactician,项目名称:BIGB,代码行数:27,代码来源:GuiItemIconDumper.java

示例14: renderOverlay

import codechicken.nei.guihook.GuiContainerManager; //导入依赖的package包/类
@Override
public void renderOverlay(GuiContainerManager gui, Slot slot) {
    GlStateManager.enableBlend();
    GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE);

    GuiContainerManager.setItemRenderColour(0xA0A0A0B0);
    for (PositionedStack stack : ingreds) {
        if (stack.relx == slot.xPos && stack.rely == slot.yPos) {
            GuiContainerManager.drawItem(stack.relx, stack.rely, stack.item);
        }
    }
    GuiContainerManager.setItemRenderColour(-1);

    GlStateManager.disableBlend();
    GlStateManager.enableLighting();
}
 
开发者ID:TheCBProject,项目名称:NotEnoughItems,代码行数:17,代码来源:DefaultOverlayRenderer.java

示例15: keyTyped

import codechicken.nei.guihook.GuiContainerManager; //导入依赖的package包/类
@Override
public void keyTyped(char c, int i) {
    if (i == 1)//esc
    {
        mc.displayGuiScreen(firstGui);
        return;
    }
    if (GuiContainerManager.getManager(this).lastKeyTyped(c, i)) {
        return;
    }

    IRecipeHandler recipehandler = currenthandlers.get(recipetype);
    for (int recipe = page * recipehandler.recipiesPerPage(); recipe < recipehandler.numRecipes() && recipe < (page + 1) * recipehandler.recipiesPerPage(); recipe++) {
        if (recipehandler.keyTyped(this, c, i, recipe)) {
            return;
        }
    }

    if (mc.gameSettings.keyBindInventory.isActiveAndMatches(i)) {
        mc.displayGuiScreen(firstGui);
    } else if (KeyBindings.get("nei.options.keys.gui.back").isActiveAndMatches(i)) {
        mc.displayGuiScreen(prevGui);
    }

}
 
开发者ID:TheCBProject,项目名称:NotEnoughItems,代码行数:26,代码来源:GuiRecipe.java


注:本文中的codechicken.nei.guihook.GuiContainerManager类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。