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