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


Java GuiContainerManager.shouldShowTooltip方法代码示例

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


在下文中一共展示了GuiContainerManager.shouldShowTooltip方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: handleItemTooltip

import codechicken.nei.guihook.GuiContainerManager; //导入方法依赖的package包/类
@Override
public List<String> handleItemTooltip(GuiContainer guiContainer, ItemStack itemStack, int i, int i2, List<String> strings) {
    if (guiContainer != null && GuiContainerManager.shouldShowTooltip(guiContainer) && itemStack != null) {
        NBTTagCompound n = itemStack.getTagCompound();
        if (n != null) {
            NBTHandler.flag = 2;
            NBTHandler.id = Item.itemRegistry.getNameForObject(itemStack.getItem());
            List<String> tips = NBTHandler.getTipsFromNBT(n, "tooltip");
            for (String tip:tips){
                strings.add(1, "\u00a77" + tip);
            }
            return strings;
        }
    }
    return strings;
}
 
开发者ID:exzhawk,项目名称:wailanbt,代码行数:17,代码来源:TooltipHandler.java

示例3: handleTooltip

import codechicken.nei.guihook.GuiContainerManager; //导入方法依赖的package包/类
@Override
public List<String> handleTooltip(GuiRecipe guiRecipe, List<String> currenttip, int recipe){
    //  super.handleTooltip(guiRecipe, currenttip, recipe);
    MultipleInputOutputRecipe r = (MultipleInputOutputRecipe)arecipes.get(recipe);
    if(GuiContainerManager.shouldShowTooltip(guiRecipe)) {
        Point mouse = GuiDraw.getMousePosition();
        Point offset = guiRecipe.getRecipePosition(recipe);
        Point relMouse = new Point(mouse.x - (guiRecipe.width - 176) / 2 - offset.x, mouse.y - (guiRecipe.height - 166) / 2 - offset.y);

        for(IGuiWidget widget : r.tooltipWidgets) {
            if(widget.getBounds().contains(relMouse)) {
                widget.addTooltip(mouse.x, mouse.y, currenttip, false);
            }
        }
        if(r.tempWidget != null) {
            if(r.tempWidget.getBounds().contains(relMouse)) {
                r.heatExchanger.setTemperature(r.tempWidget.getScales()[0]);
                r.tempWidget.addTooltip(mouse.x, mouse.y, currenttip, false);
            }
        }
    }
    return currenttip;
}
 
开发者ID:MineMaarten,项目名称:PneumaticCraft,代码行数:24,代码来源:PneumaticCraftPlugins.java

示例4: 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);
        currenttip = TemplateRecipeHandler.transferRectTooltip(gui, guiMap.get(gui.getClass()), offset[0], offset[1], currenttip);
    }
    return currenttip;
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:12,代码来源:TemplateRecipeHandler.java

示例5: 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);
        currenttip = TemplateRecipeHandler.transferRectTooltip(gui, guiMap.get(gui.getClass()), offset[0], offset[1], currenttip);
    }
    return currenttip;
}
 
开发者ID:TheCBProject,项目名称:NotEnoughItems,代码行数:13,代码来源:TemplateRecipeHandler.java

示例6: handleTooltip

import codechicken.nei.guihook.GuiContainerManager; //导入方法依赖的package包/类
@Override
    public List<String> handleTooltip(GuiRecipe guiRecipe, List<String> currenttip, int recipe) {
        super.handleTooltip(guiRecipe, currenttip, recipe);
        CachedMachineRecipe crecipe = (CachedMachineRecipe) this.arecipes.get(recipe);
        if (GuiContainerManager.shouldShowTooltip(guiRecipe)) {
            Point mouse = GuiDraw.getMousePosition();
            Point offset = guiRecipe.getRecipePosition(recipe);
            Point relMouse = new Point(mouse.x - (guiRecipe.width - 176) / 2 - offset.x, mouse.y - (guiRecipe.height - 166) / 2 - offset.y);
            
            currenttip = this.provideTooltip(guiRecipe, currenttip, crecipe, relMouse);
        }
        return currenttip;
}
 
开发者ID:zmaster587,项目名称:AdvancedRocketry,代码行数:14,代码来源:TemplateNEI.java

示例7: handleItemTooltip

import codechicken.nei.guihook.GuiContainerManager; //导入方法依赖的package包/类
@Override
public List<String> handleItemTooltip(GuiContainer guiContainer, ItemStack itemStack, int i, int i2, List<String> currenttip) {
    if (guiContainer != null && GuiContainerManager.shouldShowTooltip(guiContainer) && itemStack != null) {
        NBTTagCompound n = itemStack.getTagCompound();

        //accessor.getTileEntity().writeToNBT(n);
        if (n != null) {
            currenttip.addAll(1, JSHandler.getBody(ConfigHandler.tooltipPattern, n, Item.itemRegistry.getNameForObject(itemStack.getItem()), guiContainer.mc.thePlayer));

        }
    }
    return currenttip;
}
 
开发者ID:exzhawk,项目名称:OmniOcular,代码行数:14,代码来源:TooltipHandler.java

示例8: handleTooltip

import codechicken.nei.guihook.GuiContainerManager; //导入方法依赖的package包/类
@Override
public List<String> handleTooltip(GuiRecipe guiRecipe, List<String> currenttip, int recipe) {
    super.handleTooltip(guiRecipe, currenttip, recipe);
    CachedBaseRecipe crecipe = (CachedBaseRecipe) this.arecipes.get(recipe);
    if (GuiContainerManager.shouldShowTooltip(guiRecipe)) {
        Point mouse = GuiDraw.getMousePosition();
        Point offset = guiRecipe.getRecipePosition(recipe);
        Point relMouse = new Point(mouse.x - (guiRecipe.width - 176) / 2 - offset.x, mouse.y - (guiRecipe.height - 166) / 2 - offset.y);
        
        currenttip = this.provideTooltip(guiRecipe, currenttip, crecipe, relMouse);
    }
    return currenttip;
}
 
开发者ID:Tonius,项目名称:NEI-Integration,代码行数:14,代码来源:RecipeHandlerBase.java

示例9: handleTooltip

import codechicken.nei.guihook.GuiContainerManager; //导入方法依赖的package包/类
@Override
public List<String> handleTooltip(GuiRecipe gui, List<String> currenttip, int recipe) {
			
	CachedMissileFactoryRecipe curRecipe = (CachedMissileFactoryRecipe) arecipes.get(recipe);
	
       if (GuiContainerManager.shouldShowTooltip(gui) && currenttip.size() == 0) {
       	
           Point offset = gui.getRecipePosition(recipe);
           Point pos = GuiDraw.getMousePosition();
           Point relMouse = new Point(pos.x - (gui.width - 176) / 2 - offset.x, pos.y - (gui.height - 166) / 2 - offset.y);
           
           Rectangle energyRect = new Rectangle(27 - 5, 26 - 11, 6, 34);
           
           if (energyRect.contains(relMouse)) {

           	currenttip.add("Cost: " + MissileUtil.getEnergyCost(curRecipe.chip.item, curRecipe.fuel.item, curRecipe.armor.item) + " RF");
               return currenttip;
           }
       }
	
	return super.handleTooltip(gui, currenttip, recipe);
}
 
开发者ID:TeamMonumental,项目名称:FissionWarfare,代码行数:23,代码来源:MissileFactoryRecipeHandler.java

示例10: handleTooltip

import codechicken.nei.guihook.GuiContainerManager; //导入方法依赖的package包/类
@Override
public List<String> handleTooltip(GuiRecipe gui, List<String> currenttip, int recipe) {
			
       if (GuiContainerManager.shouldShowTooltip(gui) && currenttip.size() == 0) {
       	
           Point offset = gui.getRecipePosition(recipe);
           Point pos = GuiDraw.getMousePosition();
           Point relMouse = new Point(pos.x - (gui.width - 176) / 2 - offset.x, pos.y - (gui.height - 166) / 2 - offset.y);
           
           Rectangle energyRect = new Rectangle(24 - 5, 18 - 11, 14, 50);
           
           if (energyRect.contains(relMouse)) {

           	currenttip.add("FE: " + TileEntityEnergeticFurnace.energyCost);
               return currenttip;
           }
           
           Rectangle progressRect = new Rectangle(85 - 5, 37 - 11, 23, 12);
           
           if (progressRect.contains(relMouse)) {

           	currenttip.add("Time: " + (100 / 20) + "s");
               return currenttip;
           }
       }
	
	return super.handleTooltip(gui, currenttip, recipe);
}
 
开发者ID:TeamMonumental,项目名称:FusionWarfare,代码行数:29,代码来源:EnergeticFurnaceRecipeHandler.java

示例11: handleTooltip

import codechicken.nei.guihook.GuiContainerManager; //导入方法依赖的package包/类
@Override
public List<String> handleTooltip(GuiRecipe gui, List<String> currenttip, int recipe) {
			
	CachedInfusionRecipe rec = (CachedInfusionRecipe) arecipes.get(recipe);
	
       if (GuiContainerManager.shouldShowTooltip(gui) && currenttip.size() == 0) {
       	
           Point offset = gui.getRecipePosition(recipe);
           Point pos = GuiDraw.getMousePosition();
           Point relMouse = new Point(pos.x - (gui.width - 176) / 2 - offset.x, pos.y - (gui.height - 166) / 2 - offset.y);
           
           Rectangle energyRect = new Rectangle(24 - 5, 18 - 11, 14, 50);
           
           if (energyRect.contains(relMouse)) {

           	currenttip.add("FE: " + rec.energy);
               return currenttip;
           }
           
           Rectangle progressRect = new Rectangle(85 - 5, 37 - 11, 23, 12);
           
           if (progressRect.contains(relMouse)) {

           	currenttip.add("Time: " + (rec.time / 20) + "s");
               return currenttip;
           }
       }
	
	return super.handleTooltip(gui, currenttip, recipe);
}
 
开发者ID:TeamMonumental,项目名称:FusionWarfare,代码行数:31,代码来源:TwoInputRecipeHandlerBase.java

示例12: handleTooltip

import codechicken.nei.guihook.GuiContainerManager; //导入方法依赖的package包/类
@Override
public List<String> handleTooltip(GuiRecipe gui, List<String> currenttip, int recipe) {
			
       if (GuiContainerManager.shouldShowTooltip(gui) && currenttip.size() == 0) {
       	
           Point offset = gui.getRecipePosition(recipe);
           Point pos = GuiDraw.getMousePosition();
           Point relMouse = new Point(pos.x - (gui.width - 176) / 2 - offset.x, pos.y - (gui.height - 166) / 2 - offset.y);
           
           Rectangle energyRect = new Rectangle(24 - 5, 18 - 11, 14, 50);
           
           if (energyRect.contains(relMouse)) {

           	currenttip.add("FE: " + TileEntityOreEnricher.energyCost);
               return currenttip;
           }
           
           Rectangle progressRect = new Rectangle(85 - 5, 37 - 11, 23, 12);
           
           if (progressRect.contains(relMouse)) {

           	currenttip.add("Time: " + (100 / 20) + "s");
               return currenttip;
           }
       }
	
	return super.handleTooltip(gui, currenttip, recipe);
}
 
开发者ID:TeamMonumental,项目名称:FusionWarfare,代码行数:29,代码来源:OreEnricherRecipeHandler.java


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