本文整理匯總了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);
}