Touhou Mother Module. Removed constant dinging sound when oAuth token does not authenticate properly.dev
parent
d91c705403
commit
9251d09aa7
Binary file not shown.
@ -0,0 +1,66 @@ |
|||||||
|
package sig.modules.TouhouMother; |
||||||
|
|
||||||
|
import java.awt.Graphics; |
||||||
|
import java.awt.event.KeyEvent; |
||||||
|
import java.awt.event.MouseEvent; |
||||||
|
import java.awt.event.MouseWheelEvent; |
||||||
|
import java.awt.image.BufferedImage; |
||||||
|
import java.io.File; |
||||||
|
import java.io.IOException; |
||||||
|
|
||||||
|
import javax.imageio.ImageIO; |
||||||
|
|
||||||
|
import sig.sigIRC; |
||||||
|
import sig.modules.TouhouMotherModule; |
||||||
|
|
||||||
|
public class TouhouMotherButton { |
||||||
|
protected BufferedImage buttonimg; |
||||||
|
protected int x=0; |
||||||
|
protected int y=0; |
||||||
|
protected TouhouMotherModule module; |
||||||
|
|
||||||
|
public TouhouMotherButton(TouhouMotherModule parentmodule, File filename, int x, int y) { |
||||||
|
this.x=x; |
||||||
|
this.y=y; |
||||||
|
this.module=parentmodule; |
||||||
|
try { |
||||||
|
buttonimg = ImageIO.read(filename); |
||||||
|
} catch (IOException e) { |
||||||
|
e.printStackTrace(); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
public void run() { |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
public void draw(Graphics g) { |
||||||
|
g.drawImage(buttonimg, x, y, sigIRC.panel); |
||||||
|
} |
||||||
|
|
||||||
|
public void onClickEvent(MouseEvent ev) { |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
public void keyPressEvent(KeyEvent ev) { |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
public void keyReleaseEvent(KeyEvent ev) { |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
public void onMouseWheelEvent(MouseWheelEvent ev) { |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
public void updatePosition(int oldX, int oldY, int newX, int newY) { |
||||||
|
int diffx = x - oldX; |
||||||
|
int diffy = y - oldY; |
||||||
|
x = newX + diffx; |
||||||
|
y = newY + diffy; |
||||||
|
/*System.out.println("Old: "+oldX+","+oldY); |
||||||
|
System.out.println("New: "+newX+","+newY); |
||||||
|
System.out.println("Diffs: "+diffx+","+diffy);*/ |
||||||
|
} |
||||||
|
} |
@ -1,4 +1,4 @@ |
|||||||
package sig; |
package sig.utils; |
||||||
import java.io.BufferedReader; |
import java.io.BufferedReader; |
||||||
import java.io.File; |
import java.io.File; |
||||||
import java.io.FileInputStream; |
import java.io.FileInputStream; |
@ -1,4 +1,4 @@ |
|||||||
package sig; |
package sig.utils; |
||||||
import java.io.File; |
import java.io.File; |
||||||
import java.io.IOException; |
import java.io.IOException; |
||||||
|
|
@ -1,8 +1,10 @@ |
|||||||
package sig; |
package sig.utils; |
||||||
import java.awt.Font; |
import java.awt.Font; |
||||||
import java.awt.font.FontRenderContext; |
import java.awt.font.FontRenderContext; |
||||||
import java.awt.geom.Rectangle2D; |
import java.awt.geom.Rectangle2D; |
||||||
|
|
||||||
|
import sig.sigIRC; |
||||||
|
|
||||||
public class TextUtils { |
public class TextUtils { |
||||||
|
|
||||||
public static Rectangle2D calculateStringBoundsFont(String msg, Font font) { |
public static Rectangle2D calculateStringBoundsFont(String msg, Font font) { |
Loading…
Reference in new issue