當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。