mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-13 21:54:08 +00:00
Fixed textfield focus event running when textfield is unfocused
This commit is contained in:
1 parent
0aef0827ec
commit
6a6548845b
1 file changed
+4
-2
@@ -76,12 +76,14 @@ public class CustomGuiTextField extends GuiTextField implements IKeyListener, ID
|
||||
}
|
||||
|
||||
public boolean mouseClicked(GuiCustom gui, int mouseX, int mouseY, int mouseButton) {
|
||||
this.mouseClicked(mouseX, mouseY, mouseButton);
|
||||
boolean flag = mouseX >= this.xPosition && mouseX < this.xPosition + this.width && mouseY >= this.yPosition && mouseY < this.yPosition + this.height;
|
||||
|
||||
if (!this.isFocused() && mouseButton == 0){
|
||||
if (this.isFocused() && mouseButton == 0 && !flag){
|
||||
parent.onTextFieldUnfocused(this);
|
||||
}
|
||||
|
||||
this.mouseClicked(mouseX, mouseY, mouseButton);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user