-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added Left Mouse Button Up Listener.
Added a listener that will fire when the left mouse button is raised after being pressed. With this, you can now move HUD elements again. Performance when moving these HUD elements has likely improved.
- Loading branch information
1 parent
8e5b3cc
commit 9ebc902
Showing
17 changed files
with
219 additions
and
111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package net.aoba.event.events; | ||
|
||
import java.util.ArrayList; | ||
import net.aoba.event.listeners.AbstractListener; | ||
import net.aoba.event.listeners.LeftMouseUpListener; | ||
|
||
public class LeftMouseUpEvent extends AbstractEvent{ | ||
|
||
double mouseX; | ||
double mouseY; | ||
|
||
public LeftMouseUpEvent(double mouseX2, double mouseY2) { | ||
super(); | ||
this.mouseX = mouseX2; | ||
this.mouseY = mouseY2; | ||
} | ||
|
||
public double GetMouseX() { | ||
return mouseX; | ||
} | ||
|
||
public double GetMouseY() { | ||
return mouseY; | ||
} | ||
|
||
@Override | ||
public void Fire(ArrayList<? extends AbstractListener> listeners) { | ||
for(AbstractListener listener : listeners) { | ||
LeftMouseUpListener mouseLeftClickListener = (LeftMouseUpListener) listener; | ||
mouseLeftClickListener.OnLeftMouseUp(this); | ||
} | ||
} | ||
|
||
@SuppressWarnings("unchecked") | ||
@Override | ||
public Class<LeftMouseUpListener> GetListenerClassType() { | ||
return LeftMouseUpListener.class; | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
src/main/java/net/aoba/event/listeners/LeftMouseDownListener.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package net.aoba.event.listeners; | ||
|
||
import net.aoba.event.events.LeftMouseDownEvent; | ||
|
||
public interface LeftMouseDownListener extends AbstractListener { | ||
public abstract void OnLeftMouseDown(LeftMouseDownEvent event); | ||
} |
7 changes: 7 additions & 0 deletions
7
src/main/java/net/aoba/event/listeners/LeftMouseUpListener.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package net.aoba.event.listeners; | ||
|
||
import net.aoba.event.events.LeftMouseUpEvent; | ||
|
||
public interface LeftMouseUpListener extends AbstractListener { | ||
public abstract void OnLeftMouseUp(LeftMouseUpEvent event); | ||
} |
7 changes: 0 additions & 7 deletions
7
src/main/java/net/aoba/event/listeners/MouseLeftClickListener.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.