• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java HoverChecker类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: ShapelessMoarSignsRecipeWrapper

import net.minecraftforge.fml.client.config.HoverChecker; //导入依赖的package包/类
public ShapelessMoarSignsRecipeWrapper(IMoarSignsRecipe recipe, IGuiHelper guiHelper) {
    super(recipe);
    ResourceLocation shapelessIconLocation = new ResourceLocation("jei", "textures/gui/recipeBackground2.png");
    shapelessIcon = guiHelper.createDrawable(shapelessIconLocation, 196, 0, 19, 15);

    int iconBottom = (int) (shapelessIcon.getHeight() * shapelessIconScale);
    int iconLeft = 116 - (int) (shapelessIcon.getWidth() * shapelessIconScale);
    int iconRight = iconLeft + (int) (shapelessIcon.getWidth() * shapelessIconScale);
    shapelessIconHoverChecker = new HoverChecker(0, iconBottom, iconLeft, iconRight, 0);

    this.recipe = recipe;
    for (Object input : this.recipe.getInput()) {
        if (input instanceof ItemStack) {
            ItemStack itemStack = (ItemStack) input;
            if (itemStack.stackSize != 1) {
                itemStack.stackSize = 1;
            }
        }
    }
}
 
开发者ID:GoryMoon,项目名称:MoarSigns,代码行数:21,代码来源:ShapelessMoarSignsRecipeWrapper.java


示例2: GuiDrafter

import net.minecraftforge.fml.client.config.HoverChecker; //导入依赖的package包/类
public GuiDrafter(int x, int y, int z)
{
	super();
	this.pos = new BlockPos(x, y, z);
	this.Tabs.trayWidth = 320;
	this.roomButtons = new ArrayList<GuiRoomInfoButton>();
	this.roomHovers = new ArrayList<HoverChecker>();
	this.selectedRoomType = AvailableRoomType.Field;
}
 
开发者ID:Brian-Wuest,项目名称:MC-Prefab,代码行数:10,代码来源:GuiDrafter.java


示例3: CommandSlotCheckbox

import net.minecraftforge.fml.client.config.HoverChecker; //导入依赖的package包/类
/**
 * Constructs a checkbox with the specified text and the specified hover
 * text. If you don't want text but want hover text, pass null into the
 * first argument
 * 
 * @param text
 * @param hoverText
 */
public CommandSlotCheckbox(String text, String hoverText) {
	super(text == null || text.isEmpty() ? 11 : 13 + Minecraft.getMinecraft().fontRendererObj.getStringWidth(text),
			11);
	this.checkbox = new GuiCheckBox(0, 0, 0, text == null ? "" : text, false);
	if (hoverText != null)
		this.hoverChecker = new HoverChecker(checkbox, 1000);
	this.hoverText = hoverText;
}
 
开发者ID:Earthcomputer,项目名称:Easy-Editors,代码行数:17,代码来源:CommandSlotCheckbox.java


示例4: drawTooltips

import net.minecraftforge.fml.client.config.HoverChecker; //导入依赖的package包/类
private void drawTooltips(NBTTagCompound nbt, int mouseX, int mouseY)
{	
	for (int i = 0; i < attributes.length; i++)
	{
		HoverChecker checker = new HoverChecker(attributes[i], 0);

		if (checker.checkHover(mouseX, mouseY))
		{
			int cost = 1;
			
			if (ShieldAttribute.SHIELD_ATTRIBUTES.get(i).getRarity() == Rarity.UNCOMMON && !ShieldAttribute.SHIELD_ATTRIBUTES.get(i).hasAttribute(nbt)) cost = 1;
			else if (ShieldAttribute.SHIELD_ATTRIBUTES.get(i).getRarity() == Rarity.RARE && !ShieldAttribute.SHIELD_ATTRIBUTES.get(i).hasAttribute(nbt)) cost = 2;
			else if (ShieldAttribute.SHIELD_ATTRIBUTES.get(i).getRarity() == Rarity.LEGENDARY && !ShieldAttribute.SHIELD_ATTRIBUTES.get(i).hasAttribute(nbt)) cost = 3;
			else if (ShieldAttribute.SHIELD_ATTRIBUTES.get(i).getAttributeTier(nbt) == 3) cost = 0;
			
			List<String> list = new ArrayList<String>();
			list.add(ShieldAttribute.SHIELD_ATTRIBUTES.get(i).getColor() + ShieldAttribute.SHIELD_ATTRIBUTES.get(i).getName(nbt));
			list.add(TextFormatting.GRAY + "Cost: " + cost + " token(s)");
			list.add("");
			list.add(I18n.format("levels.attributes.shields.info." + ShieldAttribute.SHIELD_ATTRIBUTES.get(i).ordinal()));
			list.add("");
			list.add("Tiers:");
			list.add(" I - " + ShieldAttribute.SHIELD_ATTRIBUTES.get(i).getColor() + I18n.format("levels.attributes.shields.info." + ShieldAttribute.SHIELD_ATTRIBUTES.get(i).ordinal() + ".tier1"));
			list.add(" II - " + ShieldAttribute.SHIELD_ATTRIBUTES.get(i).getColor() + I18n.format("levels.attributes.shields.info." + ShieldAttribute.SHIELD_ATTRIBUTES.get(i).ordinal() + ".tier2"));
			list.add(" III - " + ShieldAttribute.SHIELD_ATTRIBUTES.get(i).getColor() + I18n.format("levels.attributes.shields.info." + ShieldAttribute.SHIELD_ATTRIBUTES.get(i).ordinal() + ".tier3"));
			drawHoveringText(list, mouseX + 3, mouseY + 3);
		}
	}
}
 
开发者ID:TheXFactor117,项目名称:Levels,代码行数:30,代码来源:GuiShieldSelection.java


示例5: drawTooltips

import net.minecraftforge.fml.client.config.HoverChecker; //导入依赖的package包/类
private void drawTooltips(NBTTagCompound nbt, int mouseX, int mouseY)
{	
	for (int i = 0; i < attributes.length; i++)
	{
		HoverChecker checker = new HoverChecker(attributes[i], 0);

		if (checker.checkHover(mouseX, mouseY))
		{
			int cost = 1;
			
			if (WeaponAttribute.WEAPON_ATTRIBUTES.get(i).getRarity() == Rarity.UNCOMMON && !WeaponAttribute.WEAPON_ATTRIBUTES.get(i).hasAttribute(nbt)) cost = 1;
			else if (WeaponAttribute.WEAPON_ATTRIBUTES.get(i).getRarity() == Rarity.RARE && !WeaponAttribute.WEAPON_ATTRIBUTES.get(i).hasAttribute(nbt)) cost = 2;
			else if (WeaponAttribute.WEAPON_ATTRIBUTES.get(i).getRarity() == Rarity.LEGENDARY && !WeaponAttribute.WEAPON_ATTRIBUTES.get(i).hasAttribute(nbt)) cost = 3;
			else if (WeaponAttribute.WEAPON_ATTRIBUTES.get(i).getAttributeTier(nbt) == 3) cost = 0;
			
			List<String> list = new ArrayList<String>();
			list.add(WeaponAttribute.WEAPON_ATTRIBUTES.get(i).getColor() + WeaponAttribute.WEAPON_ATTRIBUTES.get(i).getName(nbt));
			list.add(TextFormatting.GRAY + "Cost: " + cost + " token(s)");
			list.add("");
			list.add(I18n.format("levels.attributes.weapons.info." + WeaponAttribute.WEAPON_ATTRIBUTES.get(i).ordinal()));
			list.add("");
			list.add("Tiers:");
			list.add(" I - " + WeaponAttribute.WEAPON_ATTRIBUTES.get(i).getColor() + I18n.format("levels.attributes.weapons.info." + WeaponAttribute.WEAPON_ATTRIBUTES.get(i).ordinal() + ".tier1"));
			list.add(" II - " + WeaponAttribute.WEAPON_ATTRIBUTES.get(i).getColor() + I18n.format("levels.attributes.weapons.info." + WeaponAttribute.WEAPON_ATTRIBUTES.get(i).ordinal() + ".tier2"));
			list.add(" III - " + WeaponAttribute.WEAPON_ATTRIBUTES.get(i).getColor() + I18n.format("levels.attributes.weapons.info." + WeaponAttribute.WEAPON_ATTRIBUTES.get(i).ordinal() + ".tier3"));
			drawHoveringText(list, mouseX + 3, mouseY + 3);
		}
	}
}
 
开发者ID:TheXFactor117,项目名称:Levels,代码行数:30,代码来源:GuiWeaponSelection.java


示例6: drawTooltips

import net.minecraftforge.fml.client.config.HoverChecker; //导入依赖的package包/类
private void drawTooltips(NBTTagCompound nbt, int mouseX, int mouseY)
{	
	for (int i = 0; i < attributes.length; i++)
	{
		HoverChecker checker = new HoverChecker(attributes[i], 0);

		if (checker.checkHover(mouseX, mouseY))
		{
			int cost = 1;
			
			if (BowAttribute.BOW_ATTRIBUTES.get(i).getRarity() == Rarity.UNCOMMON && !BowAttribute.BOW_ATTRIBUTES.get(i).hasAttribute(nbt)) cost = 1;
			else if (BowAttribute.BOW_ATTRIBUTES.get(i).getRarity() == Rarity.RARE && !BowAttribute.BOW_ATTRIBUTES.get(i).hasAttribute(nbt)) cost = 2;
			else if (BowAttribute.BOW_ATTRIBUTES.get(i).getRarity() == Rarity.LEGENDARY && !BowAttribute.BOW_ATTRIBUTES.get(i).hasAttribute(nbt)) cost = 3;
			else if (BowAttribute.BOW_ATTRIBUTES.get(i).getAttributeTier(nbt) == 3) cost = 0;
			
			List<String> list = new ArrayList<String>();
			list.add(BowAttribute.BOW_ATTRIBUTES.get(i).getColor() + BowAttribute.BOW_ATTRIBUTES.get(i).getName(nbt));
			list.add(TextFormatting.GRAY + "Cost: " + cost + " token(s)");
			list.add("");
			list.add(I18n.format("levels.attributes.bows.info." + BowAttribute.BOW_ATTRIBUTES.get(i).ordinal()));
			list.add("");
			list.add("Tiers:");
			list.add(" I - " + BowAttribute.BOW_ATTRIBUTES.get(i).getColor() + I18n.format("levels.attributes.bows.info." + BowAttribute.BOW_ATTRIBUTES.get(i).ordinal() + ".tier1"));
			list.add(" II - " + BowAttribute.BOW_ATTRIBUTES.get(i).getColor() + I18n.format("levels.attributes.bows.info." + BowAttribute.BOW_ATTRIBUTES.get(i).ordinal() + ".tier2"));
			list.add(" III - " + BowAttribute.BOW_ATTRIBUTES.get(i).getColor() + I18n.format("levels.attributes.bows.info." + BowAttribute.BOW_ATTRIBUTES.get(i).ordinal() + ".tier3"));
			drawHoveringText(list, mouseX + 3, mouseY + 3);
		}
	}
}
 
开发者ID:TheXFactor117,项目名称:Levels,代码行数:30,代码来源:GuiBowSelection.java


示例7: drawTooltips

import net.minecraftforge.fml.client.config.HoverChecker; //导入依赖的package包/类
private void drawTooltips(NBTTagCompound nbt, int mouseX, int mouseY)
{	
	for (int i = 0; i < attributes.length; i++)
	{
		HoverChecker checker = new HoverChecker(attributes[i], 0);

		if (checker.checkHover(mouseX, mouseY))
		{
			int cost = 1;
			
			if (ArmorAttribute.ARMOR_ATTRIBUTES.get(i).getRarity() == Rarity.UNCOMMON && !ArmorAttribute.ARMOR_ATTRIBUTES.get(i).hasAttribute(nbt)) cost = 1;
			else if (ArmorAttribute.ARMOR_ATTRIBUTES.get(i).getRarity() == Rarity.RARE && !ArmorAttribute.ARMOR_ATTRIBUTES.get(i).hasAttribute(nbt)) cost = 2;
			else if (ArmorAttribute.ARMOR_ATTRIBUTES.get(i).getRarity() == Rarity.LEGENDARY && !ArmorAttribute.ARMOR_ATTRIBUTES.get(i).hasAttribute(nbt)) cost = 3;
			else if (ArmorAttribute.ARMOR_ATTRIBUTES.get(i).getAttributeTier(nbt) == 3) cost = 0;
			
			List<String> list = new ArrayList<String>();
			list.add(ArmorAttribute.ARMOR_ATTRIBUTES.get(i).getColor() + ArmorAttribute.ARMOR_ATTRIBUTES.get(i).getName(nbt));
			list.add(TextFormatting.GRAY + "Cost: " + cost + " token(s)");
			list.add("");
			list.add(I18n.format("levels.attributes.armors.info." + ArmorAttribute.ARMOR_ATTRIBUTES.get(i).ordinal()));
			list.add("");
			list.add("Tiers:");
			list.add(" I - " + ArmorAttribute.ARMOR_ATTRIBUTES.get(i).getColor() + I18n.format("levels.attributes.armors.info." + ArmorAttribute.ARMOR_ATTRIBUTES.get(i).ordinal() + ".tier1"));
			list.add(" II - " + ArmorAttribute.ARMOR_ATTRIBUTES.get(i).getColor() + I18n.format("levels.attributes.armors.info." + ArmorAttribute.ARMOR_ATTRIBUTES.get(i).ordinal() + ".tier2"));
			list.add(" III - " + ArmorAttribute.ARMOR_ATTRIBUTES.get(i).getColor() + I18n.format("levels.attributes.armors.info." + ArmorAttribute.ARMOR_ATTRIBUTES.get(i).ordinal() + ".tier3"));
			drawHoveringText(list, mouseX + 3, mouseY + 3);
		}
	}
}
 
开发者ID:TheXFactor117,项目名称:Levels,代码行数:30,代码来源:GuiArmorSelection.java


示例8: initGui

import net.minecraftforge.fml.client.config.HoverChecker; //导入依赖的package包/类
@Override
public void initGui(){
	super.initGui();

	for(int i = 0; i < tileEntity.getNumberOfCustomizableOptions(); i++){
		descriptionButtons[i] = new GuiItemButton(i, guiLeft + 130, (guiTop + 10) + (i * 25), 20, 20, "", itemRender, new ItemStack(tileEntity.acceptedModules()[i].getItem()));
		buttonList.add(descriptionButtons[i]);
		hoverCheckers[i] = new HoverChecker(descriptionButtons[i], 20);
	}

	if(tileEntity.customOptions() != null)
		for(int i = 0; i < tileEntity.customOptions().length; i++){
			Option option = tileEntity.customOptions()[i];

			if(option instanceof OptionDouble && ((OptionDouble)option).isSlider())
			{
				optionButtons[i] = new GuiSlider((ClientUtils.localize("option." + blockName + "." + option.getName()) + " ").replace("#", option.toString()), blockName, i, guiLeft + 178, (guiTop + 10) + (i * 25), 120, 20, "", "", (double)option.getMin(), (double)option.getMax(), (double)option.getValue(), true, true, (OptionDouble)option);
				optionButtons[i].packedFGColour = 14737632;
			}
			else
			{
				optionButtons[i] = new GuiButton(i, guiLeft + 178, (guiTop + 10) + (i * 25), 120, 20, getOptionButtonTitle(option));
				optionButtons[i].packedFGColour = option.toString().matches(option.getDefaultValue().toString()) ? 16777120 : 14737632;
			}

			buttonList.add(optionButtons[i]);
			hoverCheckers[i + tileEntity.getNumberOfCustomizableOptions()] = new HoverChecker(optionButtons[i], 20);
		}
}
 
开发者ID:Geforce132,项目名称:SecurityCraft,代码行数:30,代码来源:GuiCustomizeBlock.java


示例9: initGui

import net.minecraftforge.fml.client.config.HoverChecker; //导入依赖的package包/类
@Override
public void initGui(){
	super.initGui();

	for(int i = 0; i < tileEntity.getNumberOfCustomizableOptions(); i++){
		descriptionButtons[i] = new GuiItemButton(i, guiLeft + 130, (guiTop + 10) + (i * 25), 20, 20, "", itemRender, new ItemStack(tileEntity.acceptedModules()[i].getItem()));
		buttonList.add(descriptionButtons[i]);
		hoverCheckers[i] = new HoverChecker(descriptionButtons[i], 20);
	}

	if(tileEntity.customOptions() != null)
		for(int i = 0; i < tileEntity.customOptions().length; i++){
			Option option = tileEntity.customOptions()[i];

			if(option instanceof OptionDouble && ((OptionDouble)option).isSlider())
			{
				optionButtons[i] = new GuiSlider((StatCollector.translateToLocal("option." + blockName + "." + option.getName()) + " ").replace("#", option.toString()), blockName, i, guiLeft + 178, (guiTop + 10) + (i * 25), 120, 20, "", "", (Double)option.getMin(), (Double)option.getMax(), (Double)option.getValue(), true, true, (OptionDouble)option);
				optionButtons[i].packedFGColour = 14737632;
			}
			else
			{
				optionButtons[i] = new GuiButton(i, guiLeft + 178, (guiTop + 10) + (i * 25), 120, 20, getOptionButtonTitle(option));
				optionButtons[i].packedFGColour = option.toString().matches(option.getDefaultValue().toString()) ? 16777120 : 14737632;
			}

			buttonList.add(optionButtons[i]);
			hoverCheckers[i + tileEntity.getNumberOfCustomizableOptions()] = new HoverChecker(optionButtons[i], 20);
		}
}
 
开发者ID:Geforce132,项目名称:SecurityCraft,代码行数:30,代码来源:GuiCustomizeBlock.java


示例10: drawTooltips

import net.minecraftforge.fml.client.config.HoverChecker; //导入依赖的package包/类
/**
 * Check to see if mouse is hovering over a BUTTON. If so, display tooltip of button.
 * @param mouseX
 * @param mouseY
 */
private void drawTooltips(int mouseX, int mouseY)
{
	HoverChecker warriorCheck = new HoverChecker(warrior, 0);
	HoverChecker mageCheck = new HoverChecker(mage, 0);
	HoverChecker hunterCheck = new HoverChecker(hunter, 0);
	
	List<String> list = new ArrayList<String>();
	
	if (warriorCheck.checkHover(mouseX, mouseY))
	{
		list.add(TextFormatting.RED + I18n.format("gui.class.warrior.title")); // title
		list.add(TextFormatting.GRAY + I18n.format("gui.class.warrior.info")); // information about class
		list.add("");
		list.add(TextFormatting.ITALIC  + "" + TextFormatting.GRAY + I18n.format("gui.class.abilities")); // Abilities title
		
		// add specific ability information.
		
		drawHoveringText(list, mouseX + 3, mouseY + 3); // draw tooltip box; offset from center of mouse.
	}
	else if (mageCheck.checkHover(mouseX, mouseY))
	{
		list.add(TextFormatting.BLUE + I18n.format("gui.class.mage.title")); // title
		list.add(TextFormatting.GRAY + I18n.format("gui.class.mage.info")); // information about class
		list.add("");
		list.add(TextFormatting.ITALIC  + "" + TextFormatting.GRAY + I18n.format("gui.class.abilities")); // Abilities title
		
		// add specific ability information.
		
		drawHoveringText(list, mouseX + 3, mouseY + 3); // draw tooltip box; offset from center of mouse.
	}
	else if (hunterCheck.checkHover(mouseX, mouseY))
	{
		list.add(TextFormatting.DARK_GREEN + I18n.format("gui.class.hunter.title")); // title
		list.add(TextFormatting.GRAY + I18n.format("gui.class.hunter.info")); // information about class
		list.add("");
		list.add(TextFormatting.ITALIC  + "" + TextFormatting.GRAY + I18n.format("gui.class.abilities")); // Abilities title
		
		// add specific ability information.
		
		drawHoveringText(list, mouseX + 3, mouseY + 3); // draw tooltip box; offset from center of mouse.
	}
}
 
开发者ID:TheXFactor117,项目名称:Loot-Slash-Conquer,代码行数:48,代码来源:GuiClassSelection.java


示例11: SoundConfigEntry

import net.minecraftforge.fml.client.config.HoverChecker; //导入依赖的package包/类
public SoundConfigEntry(@Nonnull final GuiConfig owningScreen, @Nonnull final GuiConfigEntries owningEntryList,
		@Nonnull final IConfigElement configElement) {
	super(owningScreen, owningEntryList, new ConfigElementSliderAdapter(configElement));

	final String soundName = configElement.getName();

	// Parse out our parameter string
	String parms = (String) configElement.get();
	final boolean culled = parms.contains(GuiConstants.TOKEN_CULL);
	final boolean blocked = parms.contains(GuiConstants.TOKEN_BLOCK);

	this.cull = new CheckBoxButton(ID_CULLED, GuiConstants.TEXT_CULL, culled, false);
	this.block = new CheckBoxButton(ID_BLOCKED, GuiConstants.TEXT_BLOCK, blocked, false);
	this.play = new PlaySoundButton(ID_PLAY, soundName);

	this.cullHover = new HoverChecker(this.cull, 800);
	this.blockHover = new HoverChecker(this.block, 800);
	this.playHover = new HoverChecker(this.play, 800);
	this.sliderHover = new HoverChecker(null, 800);

	// Replace the slider tooltip with our own version
	final List<String> text = Lists.newArrayList();
	final ResourceLocation soundResource = new ResourceLocation(soundName);
	text.add(TextFormatting.GREEN + ForgeUtils.getModName(soundResource));
	text.add(TextFormatting.GOLD + soundName);

	final SoundMetadata data = SoundRegistry.getSoundMetadata(soundResource);
	if (data != null) {
		boolean spaceAdded = false;
		final String title = data.getTitle();
		if (!StringUtils.isEmpty(title)) {
			spaceAdded = true;
			text.add("");
			text.add(TextFormatting.YELLOW + title);
		}

		final List<String> credits = data.getCredits();
		if (credits != null && credits.size() > 0) {
			if (!spaceAdded)
				text.add("");
			for (final String s : credits)
				text.add(s);
		}
	}

	this.toolTip = ImmutableList.copyOf(text);

	this.realConfig = configElement;

}
 
开发者ID:OreCruncher,项目名称:DynamicSurroundings,代码行数:51,代码来源:SoundConfigEntry.java


示例12: GuiTooltip

import net.minecraftforge.fml.client.config.HoverChecker; //导入依赖的package包/类
public GuiTooltip(@Nonnull final ITooltipRenderer renderer, @Nonnull GuiButton button, @Nonnull final String tipText, final int width) {
	final FontRenderer font = Minecraft.getMinecraft().fontRenderer;
	this.renderer = renderer;
	this.checker = new HoverChecker(button, 800);
	this.tooltip = generateTooltip(font, tipText, width);
}
 
开发者ID:OreCruncher,项目名称:DynamicSurroundings,代码行数:7,代码来源:GuiTooltip.java


示例13: createGeneralTabControls

import net.minecraftforge.fml.client.config.HoverChecker; //导入依赖的package包/类
private int createGeneralTabControls(int grayBoxX, int grayBoxY, int uiComponentID)
{
	int roomX = grayBoxX + 40;
	int roomY = grayBoxY + 30;
	
	// Create the 49 room buttons.
	for (int i = 1; i < 50; i++)
	{
		GuiRoomInfoButton roomButton = new GuiRoomInfoButton(uiComponentID++, roomX, roomY, 18, 18, "");
		HoverChecker hoverChecker = new HoverChecker(roomButton, 800);
		this.roomHovers.add(hoverChecker);
		this.buttonList.add(roomButton);
		this.roomButtons.add(roomButton);
		roomX = roomX + 18;
		
		if (i % 7 == 0)
		{
			roomX = grayBoxX + 40;
			roomY = roomY + 18;
		}
	}
	
	this.btnBasement2 = new GuiButtonExt(uiComponentID++, grayBoxX + 10, grayBoxY + 145, 20, 20, "B2");
	this.buttonList.add(this.btnBasement2);
	
	this.btnBasement1 = new GuiButtonExt(uiComponentID++, grayBoxX + 10, grayBoxY + 120, 20, 20, "B1");
	this.buttonList.add(this.btnBasement1);
	
	this.btnGroundFloor = new GuiButtonExt(uiComponentID++, grayBoxX + 10, grayBoxY + 95, 20, 20, "G");
	this.btnGroundFloor.enabled = false;
	
	this.buttonList.add(this.btnGroundFloor);
	
	this.btnSecondFloor = new GuiButtonExt(uiComponentID++, grayBoxX + 10, grayBoxY + 70, 20, 20, "2");
	this.buttonList.add(this.btnSecondFloor);
	
	this.btnThirdFloor = new GuiButtonExt(uiComponentID++, grayBoxX + 10, grayBoxY + 45, 20, 20, "3");
	this.buttonList.add(this.btnThirdFloor);
	
	this.btnClearPending = new GuiButtonExt(uiComponentID++, grayBoxX + 110, grayBoxY + 186, 80, 20, "Clear Pending");
	this.buttonList.add(this.btnClearPending);
	
	this.btnBuild = new GuiButtonExt(uiComponentID++, grayBoxX + 195, grayBoxY + 186, 50, 20, GuiLangKeys.translateString(GuiLangKeys.GUI_BUTTON_BUILD));
	this.buttonList.add(this.btnBuild);
	
	this.btnCancel = new GuiButtonExt(uiComponentID++, grayBoxX + 250, grayBoxY + 186, 50, 20, "Close");
	this.buttonList.add(this.btnCancel);
	
	// Tabs:
	this.tabGeneral = new GuiTab(this.Tabs, GuiLangKeys.translateString(GuiLangKeys.STARTER_TAB_GENERAL), grayBoxX + 5, grayBoxY - 10);
	this.Tabs.AddTab(this.tabGeneral);
	
	this.tabDesignRoom = new GuiTab(this.Tabs, "Design Room", grayBoxX + 58, grayBoxY - 10);
	this.tabDesignRoom.width = 90;
	this.tabDesignRoom.visible = false;
	this.Tabs.AddTab(tabDesignRoom);
	
	this.tabPendingChanges = new GuiTab(this.Tabs, "Pending Changes", grayBoxX + 151, grayBoxY - 10);
	this.tabPendingChanges.width = 100;
	this.tabPendingChanges.visible = false;
	this.Tabs.AddTab(this.tabPendingChanges);
	
	try
	{
		this.actionPerformed(this.btnGroundFloor);
		this.roomButtons.get(45).roomInfo.StructureName = AvailableRoomType.Foyer;
		this.actionPerformed(this.btnGroundFloor);
	}
	catch (IOException e)
	{
		// TODO Auto-generated catch block
		e.printStackTrace();
	}
	
	return uiComponentID;
}
 
开发者ID:Brian-Wuest,项目名称:MC-Prefab,代码行数:77,代码来源:GuiDrafter.java


示例14: initGui

import net.minecraftforge.fml.client.config.HoverChecker; //导入依赖的package包/类
@Override
public void initGui(){
	super.initGui();

	prevPageButton = new GuiButton(-1, width / 2 - 68, height / 2 + 40, 20, 20, "<");
	nextPageButton = new GuiButton(0, width / 2 + 52, height / 2 + 40, 20, 20, ">");
	buttonList.add(prevPageButton);
	buttonList.add(nextPageButton);

	cameraButtons[0] = new GuiButton(1, width / 2 - 38, height / 2 - 60 + 10, 20, 20, "#");
	cameraButtons[1] = new GuiButton(2, width / 2 - 8, height / 2 - 60 + 10, 20, 20, "#");
	cameraButtons[2] = new GuiButton(3, width / 2 + 22, height / 2 - 60 + 10, 20, 20, "#");
	cameraButtons[3] = new GuiButton(4, width / 2 - 38, height / 2 - 30 + 10, 20, 20, "#");
	cameraButtons[4] = new GuiButton(5, width / 2 - 8, height / 2 - 30 + 10, 20, 20, "#");
	cameraButtons[5] = new GuiButton(6, width / 2 + 22, height / 2 - 30 + 10, 20, 20, "#");
	cameraButtons[6] = new GuiButton(7, width / 2 - 38, height / 2 + 10, 20, 20, "#");
	cameraButtons[7] = new GuiButton(8, width / 2 - 8, height / 2 + 10, 20, 20, "#");
	cameraButtons[8] = new GuiButton(9, width / 2 + 22, height / 2 + 10, 20, 20, "#");
	cameraButtons[9] = new GuiButton(10, width / 2 - 38, height / 2 + 40, 80, 20, "#");

	unbindButtons[0] = new GuiButton(11, width / 2 - 19, height / 2 - 68 + 10, 8, 8, "x");
	unbindButtons[1] = new GuiButton(12, width / 2 + 11, height / 2 - 68 + 10, 8, 8, "x");
	unbindButtons[2] = new GuiButton(13, width / 2 + 41, height / 2 - 68 + 10, 8, 8, "x");
	unbindButtons[3] = new GuiButton(14, width / 2 - 19, height / 2 - 38 + 10, 8, 8, "x");
	unbindButtons[4] = new GuiButton(15, width / 2 + 11, height / 2 - 38 + 10, 8, 8, "x");
	unbindButtons[5] = new GuiButton(16, width / 2 + 41, height / 2 - 38 + 10, 8, 8, "x");
	unbindButtons[6] = new GuiButton(17, width / 2 - 19, height / 2 + 2, 8, 8, "x");
	unbindButtons[7] = new GuiButton(18, width / 2 + 11, height / 2 + 2, 8, 8, "x");
	unbindButtons[8] = new GuiButton(19, width / 2 + 41, height / 2 + 2, 8, 8, "x");
	unbindButtons[9] = new GuiButton(20, width / 2 + 41, height / 2 + 32, 8, 8, "x");

	for(int i = 0; i < 10; i++) {
		GuiButton button = cameraButtons[i];
		int camID = (button.id + ((page - 1) * 10));
		ArrayList<CameraView> views = cameraMonitor.getCameraPositions(nbtTag);
		CameraView view;

		button.displayString += camID;
		buttonList.add(button);

		if((view = views.get(camID - 1)) != null) {
			if(view.dimension != Minecraft.getMinecraft().thePlayer.dimension) {
				hoverCheckers[button.id - 1] = new HoverChecker(button, 20);
				cameraViewDim[button.id - 1] = view.dimension;
			}

			if(BlockUtils.getBlock(Minecraft.getMinecraft().theWorld, view.getLocation()) != SCContent.securityCamera) {
				button.enabled = false;
				cameraTEs[button.id - 1] = null;
				continue;
			}

			cameraTEs[button.id - 1] = (TileEntitySCTE) Minecraft.getMinecraft().theWorld.getTileEntity(view.getLocation());
			hoverCheckers[button.id - 1] = new HoverChecker(button, 20);
		}
		else
		{
			button.enabled = false;
			unbindButtons[button.id - 1].enabled = false;
			cameraTEs[button.id - 1] = null;
			continue;
		}
	}

	for(int i = 0; i < 10; i++)
		buttonList.add(unbindButtons[i]);

	if(page == 1)
		prevPageButton.enabled = false;

	if(page == 3 || cameraMonitor.getCameraPositions(nbtTag).size() < (page * 10) + 1)
		nextPageButton.enabled = false;

	for(int i = cameraMonitor.getCameraPositions(nbtTag).size() + 1; i <= (page * 10); i++)
		cameraButtons[(i - 1) - ((page - 1) * 10)].enabled = false;

}
 
开发者ID:Geforce132,项目名称:SecurityCraft,代码行数:78,代码来源:GuiCameraMonitor.java


示例15: initGui

import net.minecraftforge.fml.client.config.HoverChecker; //导入依赖的package包/类
@Override
public void initGui(){
	super.initGui();

	prevPageButton = new GuiButton(-1, width / 2 - 68, height / 2 + 40, 20, 20, "<");
	nextPageButton = new GuiButton(0, width / 2 + 52, height / 2 + 40, 20, 20, ">");
	buttonList.add(prevPageButton);
	buttonList.add(nextPageButton);

	cameraButtons[0] = new GuiButton(1, width / 2 - 38, height / 2 - 60 + 10, 20, 20, "#");
	cameraButtons[1] = new GuiButton(2, width / 2 - 8, height / 2 - 60 + 10, 20, 20, "#");
	cameraButtons[2] = new GuiButton(3, width / 2 + 22, height / 2 - 60 + 10, 20, 20, "#");
	cameraButtons[3] = new GuiButton(4, width / 2 - 38, height / 2 - 30 + 10, 20, 20, "#");
	cameraButtons[4] = new GuiButton(5, width / 2 - 8, height / 2 - 30 + 10, 20, 20, "#");
	cameraButtons[5] = new GuiButton(6, width / 2 + 22, height / 2 - 30 + 10, 20, 20, "#");
	cameraButtons[6] = new GuiButton(7, width / 2 - 38, height / 2 + 10, 20, 20, "#");
	cameraButtons[7] = new GuiButton(8, width / 2 - 8, height / 2 + 10, 20, 20, "#");
	cameraButtons[8] = new GuiButton(9, width / 2 + 22, height / 2 + 10, 20, 20, "#");
	cameraButtons[9] = new GuiButton(10, width / 2 - 38, height / 2 + 40, 80, 20, "#");

	unbindButtons[0] = new GuiButton(11, width / 2 - 19, height / 2 - 68 + 10, 8, 8, "x");
	unbindButtons[1] = new GuiButton(12, width / 2 + 11, height / 2 - 68 + 10, 8, 8, "x");
	unbindButtons[2] = new GuiButton(13, width / 2 + 41, height / 2 - 68 + 10, 8, 8, "x");
	unbindButtons[3] = new GuiButton(14, width / 2 - 19, height / 2 - 38 + 10, 8, 8, "x");
	unbindButtons[4] = new GuiButton(15, width / 2 + 11, height / 2 - 38 + 10, 8, 8, "x");
	unbindButtons[5] = new GuiButton(16, width / 2 + 41, height / 2 - 38 + 10, 8, 8, "x");
	unbindButtons[6] = new GuiButton(17, width / 2 - 19, height / 2 + 2, 8, 8, "x");
	unbindButtons[7] = new GuiButton(18, width / 2 + 11, height / 2 + 2, 8, 8, "x");
	unbindButtons[8] = new GuiButton(19, width / 2 + 41, height / 2 + 2, 8, 8, "x");
	unbindButtons[9] = new GuiButton(20, width / 2 + 41, height / 2 + 32, 8, 8, "x");

	for(int i = 0; i < 10; i++) {
		GuiButton button = cameraButtons[i];
		int camID = (button.id + ((page - 1) * 10));
		ArrayList<CameraView> views = cameraMonitor.getCameraPositions(nbtTag);
		CameraView view;

		button.displayString += camID;
		buttonList.add(button);

		if((view = views.get(camID - 1)) != null) {
			if(view.dimension != Minecraft.getMinecraft().player.dimension) {
				hoverCheckers[button.id - 1] = new HoverChecker(button, 20);
				cameraViewDim[button.id - 1] = view.dimension;
			}

			if(BlockUtils.getBlock(Minecraft.getMinecraft().world, view.getLocation()) != SCContent.securityCamera) {
				button.enabled = false;
				cameraTEs[button.id - 1] = null;
				continue;
			}

			cameraTEs[button.id - 1] = (TileEntitySCTE) Minecraft.getMinecraft().world.getTileEntity(view.getLocation());
			hoverCheckers[button.id - 1] = new HoverChecker(button, 20);
		}
		else
		{
			button.enabled = false;
			unbindButtons[button.id - 1].enabled = false;
			cameraTEs[button.id - 1] = null;
			continue;
		}
	}

	for(int i = 0; i < 10; i++)
		buttonList.add(unbindButtons[i]);

	if(page == 1)
		prevPageButton.enabled = false;

	if(page == 3 || cameraMonitor.getCameraPositions(nbtTag).size() < (page * 10) + 1)
		nextPageButton.enabled = false;

	for(int i = cameraMonitor.getCameraPositions(nbtTag).size() + 1; i <= (page * 10); i++)
		cameraButtons[(i - 1) - ((page - 1) * 10)].enabled = false;

}
 
开发者ID:Geforce132,项目名称:SecurityCraft,代码行数:78,代码来源:GuiCameraMonitor.java


示例16: initGui

import net.minecraftforge.fml.client.config.HoverChecker; //导入依赖的package包/类
@Override
public void initGui(){
	super.initGui();

	prevPageButton = new GuiButton(-1, width / 2 - 68, height / 2 + 40, 20, 20, "<");
	nextPageButton = new GuiButton(0, width / 2 + 52, height / 2 + 40, 20, 20, ">");
	buttonList.add(prevPageButton);
	buttonList.add(nextPageButton);

	cameraButtons[0] = new GuiButton(1, width / 2 - 38, height / 2 - 60 + 10, 20, 20, "#");
	cameraButtons[1] = new GuiButton(2, width / 2 - 8, height / 2 - 60 + 10, 20, 20, "#");
	cameraButtons[2] = new GuiButton(3, width / 2 + 22, height / 2 - 60 + 10, 20, 20, "#");
	cameraButtons[3] = new GuiButton(4, width / 2 - 38, height / 2 - 30 + 10, 20, 20, "#");
	cameraButtons[4] = new GuiButton(5, width / 2 - 8, height / 2 - 30 + 10, 20, 20, "#");
	cameraButtons[5] = new GuiButton(6, width / 2 + 22, height / 2 - 30 + 10, 20, 20, "#");
	cameraButtons[6] = new GuiButton(7, width / 2 - 38, height / 2 + 10, 20, 20, "#");
	cameraButtons[7] = new GuiButton(8, width / 2 - 8, height / 2 + 10, 20, 20, "#");
	cameraButtons[8] = new GuiButton(9, width / 2 + 22, height / 2 + 10, 20, 20, "#");
	cameraButtons[9] = new GuiButton(10, width / 2 - 38, height / 2 + 40, 80, 20, "#");

	unbindButtons[0] = new GuiButton(11, width / 2 - 19, height / 2 - 68 + 10, 8, 8, "x");
	unbindButtons[1] = new GuiButton(12, width / 2 + 11, height / 2 - 68 + 10, 8, 8, "x");
	unbindButtons[2] = new GuiButton(13, width / 2 + 41, height / 2 - 68 + 10, 8, 8, "x");
	unbindButtons[3] = new GuiButton(14, width / 2 - 19, height / 2 - 38 + 10, 8, 8, "x");
	unbindButtons[4] = new GuiButton(15, width / 2 + 11, height / 2 - 38 + 10, 8, 8, "x");
	unbindButtons[5] = new GuiButton(16, width / 2 + 41, height / 2 - 38 + 10, 8, 8, "x");
	unbindButtons[6] = new GuiButton(17, width / 2 - 19, height / 2 + 2, 8, 8, "x");
	unbindButtons[7] = new GuiButton(18, width / 2 + 11, height / 2 + 2, 8, 8, "x");
	unbindButtons[8] = new GuiButton(19, width / 2 + 41, height / 2 + 2, 8, 8, "x");
	unbindButtons[9] = new GuiButton(20, width / 2 + 41, height / 2 + 32, 8, 8, "x");

	for(int i = 0; i < 10; i++) {
		GuiButton button = cameraButtons[i];
		int camID = (button.id + ((page - 1) * 10));
		ArrayList<CameraView> views = cameraMonitor.getCameraPositions(nbtTag);
		CameraView view;

		button.displayString += camID;
		buttonList.add(button);

		if((view = views.get(camID - 1)) != null) {
			if(view.dimension != Minecraft.getMinecraft().thePlayer.dimension) {
				hoverCheckers[button.id - 1] = new HoverChecker(button, 20);
				cameraViewDim[button.id - 1] = view.dimension;
			}

			if(BlockUtils.getBlock(Minecraft.getMinecraft().theWorld, view.getLocation()) != SCContent.securityCamera) {
				button.enabled = false;
				cameraTEs[button.id - 1] = null;
				continue;
			}

			cameraTEs[button.id - 1] = (TileEntitySCTE) Minecraft.getMinecraft().theWorld.getTileEntity(view.getLocation());
			hoverCheckers[button.id - 1] = new HoverChecker(button, 20);
		}
		else
		{
			button.enabled = false;
			unbindButtons[button.id - 1].enabled = false;
			cameraTEs[button.id - 1] = null;
			continue;
		}
	}

	for(int i = 0; i < 10; i++)
		buttonList.add(unbindButtons[i]);

	if(page == 1)
		prevPageButton.enabled = false;

	if(page == 3 || cameraMonitor.getCameraPositions(nbtTag).size() < (page * 10) + 1)
		nextPageButton.enabled = false;

	for(int i = cameraMonitor.getCameraPositions(nbtTag).size() + 1; i <= (page * 10); i++)
		cameraButtons[(i - 1) - ((page - 1) * 10)].enabled = false;
}
 
开发者ID:Geforce132,项目名称:SecurityCraft,代码行数:77,代码来源:GuiCameraMonitor.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java MetricsReplicationSource类代码示例发布时间:2022-05-23
下一篇:
Java EphemeralKeyPairGenerator类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap