|
|
@ -45,7 +45,6 @@ public class Panel extends JPanel implements Runnable,KeyListener { |
|
|
|
final long TARGET_FRAMETIME = 8333333l; |
|
|
|
final long TARGET_FRAMETIME = 8333333l; |
|
|
|
public double nanaX = 0; |
|
|
|
public double nanaX = 0; |
|
|
|
public double nanaY = 0; |
|
|
|
public double nanaY = 0; |
|
|
|
public Point mousePos=new Point(0,0); |
|
|
|
|
|
|
|
public int button = 0; |
|
|
|
public int button = 0; |
|
|
|
public HashMap<Integer,Boolean> MOUSE = new HashMap<>(); |
|
|
|
public HashMap<Integer,Boolean> MOUSE = new HashMap<>(); |
|
|
|
public static byte[] generalPalette = new byte[]{ |
|
|
|
public static byte[] generalPalette = new byte[]{ |
|
|
@ -129,7 +128,7 @@ public class Panel extends JPanel implements Runnable,KeyListener { |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void mousePressed(MouseEvent e) { |
|
|
|
public void mousePressed(MouseEvent e) { |
|
|
|
MOUSE.put(e.getButton(),true); |
|
|
|
MOUSE.put(e.getButton(),true); |
|
|
|
mousePos.set(e.getX()/RabiClone.SIZE_MULTIPLIER,e.getY()/RabiClone.SIZE_MULTIPLIER); |
|
|
|
RabiClone.MOUSE_POS.set(e.getX()/RabiClone.SIZE_MULTIPLIER,e.getY()/RabiClone.SIZE_MULTIPLIER); |
|
|
|
//System.out.println("Mouse List: "+MOUSE);
|
|
|
|
//System.out.println("Mouse List: "+MOUSE);
|
|
|
|
|
|
|
|
|
|
|
|
for(int i=0; i<RabiClone.OBJ.size();i++){ |
|
|
|
for(int i=0; i<RabiClone.OBJ.size();i++){ |
|
|
@ -140,7 +139,7 @@ public class Panel extends JPanel implements Runnable,KeyListener { |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void mouseReleased(MouseEvent e) { |
|
|
|
public void mouseReleased(MouseEvent e) { |
|
|
|
MOUSE.put(e.getButton(),false); |
|
|
|
MOUSE.put(e.getButton(),false); |
|
|
|
mousePos.set(e.getX()/RabiClone.SIZE_MULTIPLIER,e.getY()/RabiClone.SIZE_MULTIPLIER); |
|
|
|
RabiClone.MOUSE_POS.set(e.getX()/RabiClone.SIZE_MULTIPLIER,e.getY()/RabiClone.SIZE_MULTIPLIER); |
|
|
|
|
|
|
|
|
|
|
|
for(int i=0; i<RabiClone.OBJ.size();i++){ |
|
|
|
for(int i=0; i<RabiClone.OBJ.size();i++){ |
|
|
|
RabiClone.OBJ.get(i).MouseReleased(e); |
|
|
|
RabiClone.OBJ.get(i).MouseReleased(e); |
|
|
@ -166,12 +165,12 @@ public class Panel extends JPanel implements Runnable,KeyListener { |
|
|
|
this.addMouseMotionListener(new MouseMotionListener(){ |
|
|
|
this.addMouseMotionListener(new MouseMotionListener(){ |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void mouseDragged(MouseEvent e) { |
|
|
|
public void mouseDragged(MouseEvent e) { |
|
|
|
mousePos.set(e.getX()/RabiClone.SIZE_MULTIPLIER,e.getY()/RabiClone.SIZE_MULTIPLIER); |
|
|
|
RabiClone.MOUSE_POS.set(e.getX()/RabiClone.SIZE_MULTIPLIER,e.getY()/RabiClone.SIZE_MULTIPLIER); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void mouseMoved(MouseEvent e) { |
|
|
|
public void mouseMoved(MouseEvent e) { |
|
|
|
mousePos.set(e.getX()/RabiClone.SIZE_MULTIPLIER,e.getY()/RabiClone.SIZE_MULTIPLIER); |
|
|
|
RabiClone.MOUSE_POS.set(e.getX()/RabiClone.SIZE_MULTIPLIER,e.getY()/RabiClone.SIZE_MULTIPLIER); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
this.addMouseWheelListener(new MouseWheelListener(){ |
|
|
|
this.addMouseWheelListener(new MouseWheelListener(){ |
|
|
|