本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}