From c7a9d4a6bd53ed7d61731770f2f10e8b9fd435f9 Mon Sep 17 00:00:00 2001 From: Fuwn Date: Thu, 12 Feb 2026 22:33:32 -0800 Subject: Initial commit --- NET/worlds/console/WorldButtonBullet.java | 74 +++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 NET/worlds/console/WorldButtonBullet.java (limited to 'NET/worlds/console/WorldButtonBullet.java') diff --git a/NET/worlds/console/WorldButtonBullet.java b/NET/worlds/console/WorldButtonBullet.java new file mode 100644 index 0000000..f033aa4 --- /dev/null +++ b/NET/worlds/console/WorldButtonBullet.java @@ -0,0 +1,74 @@ +package NET.worlds.console; + +import java.awt.Color; +import java.awt.Component; +import java.awt.Graphics; +import java.awt.event.MouseEvent; + +class WorldButtonBullet extends Component { + private static final long serialVersionUID = -3330973936286182409L; + int circleX; + int circleY; + WorldButton button; + + public WorldButtonBullet(int x, int y, WorldButton button) { + this.circleX = x - 2; + this.circleY = y - 2; + this.button = button; + this.setSize(6, 6); + this.enableEvents(16L); + this.enableEvents(32L); + } + + @Override + public void update(Graphics g) { + this.paint(g); + } + + @Override + public void paint(Graphics g) { + if (g != null) { + if (this.button.isLoaded) { + if (WorldButton.currentPackageName.equalsIgnoreCase(this.button.pkg)) { + g.setColor(Color.green); + } else { + g.setColor(Color.red); + } + + g.drawOval(0, 0, 3, 3); + g.fillOval(0, 0, 3, 3); + } else { + g.setColor(Color.red); + g.drawOval(0, 0, 3, 3); + } + } + } + + @Override + public void processMouseMotionEvent(MouseEvent e) { + switch (e.getID()) { + case 503: + case 506: + this.button.buttonAction(0, e.getID()); + case 504: + case 505: + default: + super.processMouseEvent(e); + } + } + + @Override + public void processMouseEvent(MouseEvent e) { + switch (e.getID()) { + case 501: + case 502: + case 504: + case 505: + this.button.buttonAction(0, e.getID()); + return; + case 503: + default: + super.processMouseEvent(e); + } + } +} -- cgit v1.2.3