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


Java GuiTextField.mouseClicked方法代码示例

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


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

示例1: mouseClicked

import net.minecraft.client.gui.GuiTextField; //导入方法依赖的package包/类
@Override
protected void mouseClicked(int x, int y, int mouseEvent) {
	super.mouseClicked(x, y, mouseEvent);
	boolean cont = false;
	try {
		cont = selectedButtons.get(this) == null;
	} catch (IllegalAccessException e) {
		e.printStackTrace();
	}
	for (GuiTextField text : textFields.values()) {
		boolean isFocused = text.isFocused();
		text.mouseClicked(x, y, mouseEvent);
		isFocused = text.isFocused() || isFocused;
		cont = !isFocused || cont;
	}
	if (cont)
		if (Mouse.getEventButtonState()) {
			String currentText = textFields.get("macros").getText();
			currentText = (currentText != null && currentText.length() >= 1 ? currentText+"," : "")+Mouse.getButtonName(Mouse.getEventButton());
			textFields.get("macros").setText(eliminateRepeats(currentText));
		}
}
 
开发者ID:austinv11,项目名称:MacroMaker,代码行数:23,代码来源:GuiMacro.java

示例2: mouseClicked

import net.minecraft.client.gui.GuiTextField; //导入方法依赖的package包/类
public void mouseClicked(int x, int y, int mouseButton) {
	try {
		super.mouseClicked(x, y, mouseButton);
	} catch (Exception e) {
		e.printStackTrace();
	}
	for(GuiTextField field : textFieldList) {
		field.mouseClicked(x, y, mouseButton);
	}
}
 
开发者ID:TealNerd,项目名称:CivRadar,代码行数:11,代码来源:GuiEditWaypoint.java

示例3: mouseClicked

import net.minecraft.client.gui.GuiTextField; //导入方法依赖的package包/类
@Override
protected void mouseClicked(int mouseX, int mouseY, int btn) throws IOException {
  super.mouseClicked(mouseX, mouseY, btn);// x/y pos is 33/30
  for (GuiTextField txt : txtBoxes) {
    txt.mouseClicked(mouseX, mouseY, btn);
    if (btn == 0) {//basically left click
      boolean flag = mouseX >= this.guiLeft + txt.x && mouseX < this.guiLeft + txt.x + txt.width
          && mouseY >= this.guiTop + txt.y && mouseY < this.guiTop + txt.y + txt.height;
      txt.setFocused(flag);
    }
  }
}
 
开发者ID:PrinceOfAmber,项目名称:Cyclic,代码行数:13,代码来源:GuiVector.java

示例4: mouseMovedOrUp

import net.minecraft.client.gui.GuiTextField; //导入方法依赖的package包/类
protected void mouseMovedOrUp(int mx, int my, int button)
{
    if (this.selectedButton != null && button == 0)
    {
        this.selectedButton.mouseReleased((int) (mx-currentTranslation), my);
        selectedButton.func_146113_a(this.mc.getSoundHandler());
        actionPerformed(mx,my,button,selectedButton);
        this.selectedButton = null;
    }
    
    for(GuiTextField field : secondPartFields)
    {
        field.mouseClicked((int) (mx+currentTranslation), my, button);
    }
}
 
开发者ID:jglrxavpok,项目名称:CustomAI,代码行数:16,代码来源:GuiCustomAI.java

示例5: mouseClicked

import net.minecraft.client.gui.GuiTextField; //导入方法依赖的package包/类
@Override
protected void mouseClicked(int x, int y, int mouseEvent) {
	super.mouseClicked(x, y, mouseEvent);
	for (GuiTextField text : textFields.values())
		text.mouseClicked(x, y, mouseEvent);
	PeripheralsPlusPlus.NETWORK.sendToServer(new InputEventPacket(UUID.fromString(Minecraft.getMinecraft().thePlayer.getCurrentArmor(3).getTagCompound().getString("identifier")), Mouse.getEventButton(), Mouse.getEventButtonState(), "mouseInput", Minecraft.getMinecraft().thePlayer.getDisplayName()));
}
 
开发者ID:austinv11,项目名称:PeripheralsPlusPlus,代码行数:8,代码来源:GuiHelmet.java

示例6: mouseClicked

import net.minecraft.client.gui.GuiTextField; //导入方法依赖的package包/类
@Override
public void mouseClicked(int xMouse, int yMouse, int mouseButton) throws IOException {
	super.mouseClicked(xMouse, yMouse, mouseButton);
	for (GuiTextField field : this.textfieldList) {
		field.mouseClicked(xMouse, yMouse, mouseButton);
	}
}
 
开发者ID:NovaViper,项目名称:ZeroQuest,代码行数:8,代码来源:GuiZertumInfo.java

示例7: mouseClicked

import net.minecraft.client.gui.GuiTextField; //导入方法依赖的package包/类
@Override
protected void mouseClicked(final int mouseX, final int mouseY, final int mouseEvent) throws IOException {
    for (final GuiButton button : this.buttonList) {
        if (button instanceof GuiNumericField) {
            final GuiNumericField numericField = (GuiNumericField) button;
            numericField.mouseClicked(mouseX, mouseY, mouseEvent);
        }
    }

    for (final GuiTextField textField : this.textFields) {
        textField.mouseClicked(mouseX, mouseY, mouseEvent);
    }

    super.mouseClicked(mouseX, mouseY, mouseEvent);
}
 
开发者ID:Lunatrius,项目名称:LunatriusCore,代码行数:16,代码来源:GuiScreenBase.java

示例8: mouseClicked

import net.minecraft.client.gui.GuiTextField; //导入方法依赖的package包/类
@Override
protected void mouseClicked(int x, int y, int button) {
  for (GuiTextField f : textFields) {
    f.mouseClicked(x, y, button);
  }
  if (!scrollbars.isEmpty()) {
    if (draggingScrollbar != null) {
      draggingScrollbar.mouseClicked(x, y, button);
      return;
    }
    for (VScrollbar vs : scrollbars) {
      if (vs.mouseClicked(x, y, button)) {
        draggingScrollbar = vs;
        return;
      }
    }
  }
  if (!ghostSlotHandler.getGhostSlots().isEmpty()) {
    GhostSlot slot = getGhostSlot(x, y);
    if (slot != null) {
      ghostSlotClicked(slot, x, y, button);
      return;
    }
  }
  // Right click field clearing
  if (button == 1) {
    for (TextFieldEnder tf : textFields) {
      if (tf.contains(x, y)) {
        setText(tf, "");
      }
    }
  }
  // Button events for non-left-clicks
  if (button >= 1) {
    for (Object obj : buttonList) {
      if (obj instanceof IconButton) {
        IconButton btn = (IconButton) obj;
        if (btn.mousePressedButton(mc, x, y, button)) {
          btn.func_146113_a(this.mc.getSoundHandler());
          actionPerformedButton(btn, button);
        }
      }
    }
  }
  super.mouseClicked(x, y, button);
}
 
开发者ID:SleepyTrousers,项目名称:EnderCore,代码行数:47,代码来源:GuiContainerBase.java

示例9: mouseClicked

import net.minecraft.client.gui.GuiTextField; //导入方法依赖的package包/类
@Override
protected void mouseClicked(int x, int y, int mouseEvent) {
	super.mouseClicked(x, y, mouseEvent);
	for (GuiTextField text : textFields.values())
		text.mouseClicked(x, y, mouseEvent);
}
 
开发者ID:austinv11,项目名称:MacroMaker,代码行数:7,代码来源:GuiWaypoint.java


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