aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/io/github/moulberry/notenoughupdates/mbgui/MBGuiGroup.java
diff options
context:
space:
mode:
authorIRONM00N <64110067+IRONM00N@users.noreply.github.com>2021-10-16 15:50:41 -0400
committerGitHub <noreply@github.com>2021-10-16 15:50:41 -0400
commit7c00af18febf6c0b833c7633b4fb60a9a1bb93af (patch)
treef02de145362d6a1399651ade4a130d565d7f0ba3 /src/main/java/io/github/moulberry/notenoughupdates/mbgui/MBGuiGroup.java
parentb11742988dec635b5c5da7c2363803cbfafb37b1 (diff)
downloadnotenoughupdates-7c00af18febf6c0b833c7633b4fb60a9a1bb93af.tar.gz
notenoughupdates-7c00af18febf6c0b833c7633b4fb60a9a1bb93af.tar.bz2
notenoughupdates-7c00af18febf6c0b833c7633b4fb60a9a1bb93af.zip
Code Clean Up (#2)
* intellij code clean up * optimize imports * format * intellij suggestions * fix empty catch issues
Diffstat (limited to 'src/main/java/io/github/moulberry/notenoughupdates/mbgui/MBGuiGroup.java')
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/mbgui/MBGuiGroup.java19
1 files changed, 8 insertions, 11 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/mbgui/MBGuiGroup.java b/src/main/java/io/github/moulberry/notenoughupdates/mbgui/MBGuiGroup.java
index 86ff7278..9b27f229 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/mbgui/MBGuiGroup.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/mbgui/MBGuiGroup.java
@@ -13,8 +13,7 @@ public abstract class MBGuiGroup extends MBGuiElement {
public int height;
protected HashMap<MBGuiElement, Vector2f> childrenPosition = new HashMap<>();
- public MBGuiGroup() {
- }
+ public MBGuiGroup() {}
public abstract Collection<MBGuiElement> getChildren();
@@ -32,16 +31,15 @@ public abstract class MBGuiGroup extends MBGuiElement {
return height;
}
-
@Override
public void mouseClick(float x, float y, int mouseX, int mouseY) {
Map<MBGuiElement, Vector2f> childrenPos = getChildrenPosition();
- for(MBGuiElement child : getChildren()) {
+ for (MBGuiElement child : getChildren()) {
Vector2f childPos = childrenPos.get(child);
- if(mouseX > x+childPos.x && mouseX < x+childPos.x+child.getWidth()) {
- if(mouseY > y+childPos.y && mouseY < y+childPos.y+child.getHeight()) {
- child.mouseClick(x+childPos.x, y+childPos.y, mouseX, mouseY);
+ if (mouseX > x + childPos.x && mouseX < x + childPos.x + child.getWidth()) {
+ if (mouseY > y + childPos.y && mouseY < y + childPos.y + child.getHeight()) {
+ child.mouseClick(x + childPos.x, y + childPos.y, mouseX, mouseY);
}
}
}
@@ -49,7 +47,7 @@ public abstract class MBGuiGroup extends MBGuiElement {
@Override
public void mouseClickOutside() {
- for(MBGuiElement child : getChildren()) {
+ for (MBGuiElement child : getChildren()) {
child.mouseClickOutside();
}
}
@@ -58,11 +56,10 @@ public abstract class MBGuiGroup extends MBGuiElement {
public void render(float x, float y) {
Map<MBGuiElement, Vector2f> childrenPos = getChildrenPosition();
- for(MBGuiElement child : getChildren()) {
+ for (MBGuiElement child : getChildren()) {
Vector2f childPos = childrenPos.get(child);
- child.render(x+childPos.x, y+childPos.y);
+ child.render(x + childPos.x, y + childPos.y);
}
}
-
}