Optimized Drawing, Finished Rabi-Race rainbow egg drawing isolation to

optimize module. Fixed major memory issue with Chat Log Module.
dev
sigonasr2 7 years ago
parent 413fab117b
commit 904a9925e2
  1. BIN
      sigIRCv2.jar
  2. 2
      src/sig/BackgroundColorButton.java
  3. 4
      src/sig/Module.java
  4. 2
      src/sig/TwitchEmote.java
  5. 2
      src/sig/modules/ChatLog/ChatLogMessage.java
  6. 2
      src/sig/modules/ChatLog/ChatLogTwitchEmote.java
  7. 8
      src/sig/modules/ChatLogModule.java
  8. 4
      src/sig/modules/Controller/ControlConfigurationWindow.java
  9. 4
      src/sig/modules/ControllerModule.java
  10. 2
      src/sig/modules/RabiRace/AvatarSelectionWindow.java
  11. 2
      src/sig/modules/RabiRace/ClickableButton.java
  12. 5
      src/sig/modules/RabiRace/JoinButton.java
  13. 53
      src/sig/modules/RabiRace/Profile.java
  14. 6
      src/sig/modules/RabiRace/SessionListWindow.java
  15. 23
      src/sig/modules/RabiRaceModule.java
  16. 2
      src/sig/modules/TouhouMother/TouhouMotherButton.java
  17. 2
      src/sig/modules/TouhouMotherModule.java
  18. 4
      src/sig/modules/Twitch/FancyNumber.java
  19. 7
      src/sig/modules/TwitchModule.java
  20. 4
      src/sig/utils/DrawUtils.java

Binary file not shown.

@ -35,7 +35,7 @@ public class BackgroundColorButton {
public void draw(Graphics g) {
if (buttonEnabled) {
g.drawImage(buttonimg, x, y, sigIRC.panel);
g.drawImage(buttonimg, x, y, null);
}
}

@ -145,10 +145,6 @@ public class Module extends JFrame implements ComponentListener, WindowListener,
updateFPSCounter();
}
public void ModuleDragEvent(int oldX, int oldY, int newX, int newY) {
}
public void windowClosed(WindowEvent ev) {
}

@ -40,7 +40,7 @@ public class TwitchEmote {
public void draw(Graphics g) {
if (WithinBounds((int)(text.getX()+x), (int)(text.getY()+y), emote.getImage().getWidth(), emote.getImage().getHeight())) {
g.drawImage(emote.getImage(), (int)(text.getX()+x), (int)(text.getY()+y), ScrollingChatModule.module.panel);
g.drawImage(emote.getImage(), (int)(text.getX()+x), (int)(text.getY()+y), null);
}
}

@ -227,7 +227,7 @@ public class ChatLogMessage {
DrawUtils.drawTextFont(g, sigIRC.userFont, position.getX(), position.getY()+(i*MESSAGE_SPACING)+32-Module.WINDOW_EXTRA_BORDER, Color.BLACK, displayMessage.get(i));
}
}
g.drawImage(Module.MSG_SEPARATOR, (int)(position.getX()+8), (int)(position.getY()+messageDisplaySize.getY()+8-Module.WINDOW_EXTRA_BORDER), (int)(messageDisplaySize.getX()-8), 1, sigIRC.panel);
g.drawImage(Module.MSG_SEPARATOR, (int)(position.getX()+8), (int)(position.getY()+messageDisplaySize.getY()+8-Module.WINDOW_EXTRA_BORDER), (int)(messageDisplaySize.getX()-8), 1, null);
//g.drawLine((int)(position.getX()+8), (int)(position.getY()+messageDisplaySize.getY()+32), (int)(position.getX()+messageDisplaySize.getX()-8), (int)(position.getY()+messageDisplaySize.getY()+32));
}
for (int i=0;i<sigIRC.chatlogtwitchemoticons.size();i++) {

@ -46,7 +46,7 @@ public class ChatLogTwitchEmote {
if (WithinBounds((int)(text.position.getX()+x), (int)(text.position.getY()+y-Module.WINDOW_EXTRA_BORDER), emote.getImage().getWidth(), emote.getImage().getHeight())) {
//g.drawString("Emote", (int)(text.position.getX()+x), (int)(text.position.getY()+y));
//System.out.println("Emote Pos: "+(int)(text.position.getX()+x)+","+(int)(text.position.getY()+y));
g.drawImage(emote.getImage(), (int)(text.position.getX()+x), (int)(text.position.getY()+y-Module.WINDOW_EXTRA_BORDER), text.refModule.panel);
g.drawImage(emote.getImage(), (int)(text.position.getX()+x), (int)(text.position.getY()+y-Module.WINDOW_EXTRA_BORDER), null);
}
}

@ -54,6 +54,7 @@ public class ChatLogModule extends Module{
if (logContents.length>messageHistoryCount) {
logContents = Arrays.copyOfRange(logContents, logContents.length-messageHistoryCount-1, logContents.length);
}
messageHistory.clear();
ChatLogMessage.importMessages(logContents);
}
}
@ -66,11 +67,6 @@ public class ChatLogModule extends Module{
}
if (delay>0 && sigIRC.subEmotesCompleted) {
delay--;
} else
if (!initialized)
{
Initialize();
initialized=true;
}
for (int i=0; i<messageHistory.size();i++) {
ChatLogMessage clm = messageHistory.get(i);
@ -97,7 +93,7 @@ public class ChatLogModule extends Module{
Initialize();
moveAllMessages(-scrolllog_yoffset);
scrolllog_yoffset=0;
repaint();
//repaint();
}
}

@ -269,7 +269,7 @@ public class ControlConfigurationWindow extends JFrame implements WindowListener
public void paintComponent(Graphics g) {
super.paintComponent(g);
try {
g.drawImage(ImageIO.read(new File(ControllerModule.CONTROLLERPATH+"4-way_axis.png")), 0, 0, this);
g.drawImage(ImageIO.read(new File(ControllerModule.CONTROLLERPATH+"4-way_axis.png")), 0, 0, null);
} catch (IOException e) {
e.printStackTrace();
}
@ -279,7 +279,7 @@ public class ControlConfigurationWindow extends JFrame implements WindowListener
public void paintComponent(Graphics g) {
super.paintComponent(g);
try {
g.drawImage(ImageIO.read(new File(ControllerModule.CONTROLLERPATH+"2-way_axis.png")), 0, 0, this);
g.drawImage(ImageIO.read(new File(ControllerModule.CONTROLLERPATH+"2-way_axis.png")), 0, 0, null);
} catch (IOException e) {
e.printStackTrace();
}

@ -595,7 +595,7 @@ public class ControllerModule extends Module{
}
}*/
}
g.drawImage(controller_img, (int)(position.getX()), (int)(position.getY()), sigIRC.panel);
g.drawImage(controller_img, (int)(position.getX()), (int)(position.getY()), null);
for (ClickableButton cb : click_buttons) {
cb.draw(g);
}
@ -653,7 +653,7 @@ public class ControllerModule extends Module{
g.setColor(color_identity);
}
}
g.drawImage(controller_overlay_img, (int)(position.getX()), (int)(position.getY()), sigIRC.panel);
g.drawImage(controller_overlay_img, (int)(position.getX()), (int)(position.getY()), null);
for (Axis a : axes) {
a.drawIndicator(g);

@ -83,7 +83,7 @@ class ImagePanel extends JPanel implements MouseListener{
g.setColor(new Color(0,0,64));
g.fillRect(0, 0, 50, 50);
}
g.drawImage(img, 0, 0, this);
g.drawImage(img, 0, 0, null);
if (selected) {
g.setColor(Color.YELLOW);
for (int i=0;i<2;i++) {

@ -13,7 +13,7 @@ import sig.utils.DrawUtils;
import sig.utils.TextUtils;
public class ClickableButton {
protected int x,y,width,height;
public int x,y,width,height;
protected String label;
protected RabiRaceModule module;

@ -25,6 +25,11 @@ public class JoinButton extends ClickableButton{
try {
org.apache.commons.io.FileUtils.copyURLToFile(new URL("http://45.33.13.215/rabirace/send.php?key=leavesession&name="+RabiRaceModule.module.myProfile.username+"&session="+RabiRaceModule.mySession.id),file);
RabiRaceModule.mySession=null;
if (
RabiRaceModule.module.myProfile!=null) {
RabiRaceModule.module.myProfile.image_display_update_required = true;
RabiRaceModule.module.myProfile.stat_update_required = true;
}
} catch (MalformedURLException e) {
e.printStackTrace();
} catch (IOException e) {

@ -101,13 +101,13 @@ public class Profile {
oldProfile.loop!=loop ||
oldProfile.itempct!=itempct ||
oldProfile.mappct!=mappct) {
System.out.println("Something has changed.");
//System.out.println("Something has changed.");
count++;
} else {
System.out.println("All values are the same... "+oldProfile.playtime+","+playtime+"|"
/*System.out.println("All values are the same... "+oldProfile.playtime+","+playtime+"|"
+oldProfile.avatarval+","+avatar.value+"|"+oldProfile.isPaused+","+isPaused+"|"
+oldProfile.difficulty+","+difficulty+"|"+oldProfile.loop+","+loop+"|"
+oldProfile.itempct+","+itempct+"|"+oldProfile.mappct+","+mappct+"|");
+oldProfile.itempct+","+itempct+"|"+oldProfile.mappct+","+mappct+"|");*/
}
return count;
}
@ -384,7 +384,7 @@ public class Profile {
g2.setColor(Color.BLACK);
//g2.fillRect(1, 1, 32, 32);
g2.drawImage(avatar.getAvatarImage(), 1, 1, parent.panel);
g2.drawImage(avatar.getAvatarImage(), 1, 1, null);
g2.setColor(ScrollingText.GetUserNameColor(displayName));
DrawUtils.drawOutlineText(g2, sigIRC.rabiRibiMoneyDisplayFont, 54, 26, 1, g2.getColor(), Color.BLACK, displayName);
DrawUtils.drawCenteredOutlineText(g2, sigIRC.rabiRibiTinyDisplayFont, (int)(tmp.getWidth()*0.2), 50, 1, GetDifficultyColor(), Color.BLACK, GetDifficultyName());
@ -494,7 +494,7 @@ public class Profile {
} else {
img = Profile.darkRainbowEggImage;
}
g2.drawImage(img, (int)(border+i*spacing-img.getWidth(parent.panel)/4),(int)(36), parent.panel);
g2.drawImage(img, (int)(border+i*spacing-img.getWidth(parent.panel)/4),(int)(36), null);
}
}break;
}
@ -537,10 +537,11 @@ public class Profile {
int counting=0;
for (Image img : imgs) {
if (counting++==5) {
g2.drawImage(img, (int)(+border+((i)*(spacing))-icon_size/2),(int)(+96+56)+shiftyval,(int)icon_size,(int)icon_size,parent.panel);
g2.drawImage(rainbowEggImage, (int)(+border+((i)*(spacing))-icon_size/2),(int)(+96+56)+shiftyval,(int)icon_size,(int)icon_size,null);
//DrawUtils.drawImageScaled(g2, img,(int)(+border+((i)*(spacing))-icon_size/2),(int)(+96+56)+shiftyval, (int)icon_size, (int)icon_size, RabiRaceModule.rainbowcycler.getCycleColor(), parent.panel);
}
DrawUtils.drawCenteredOutlineText(g2, sigIRC.programFont, (int)((+border+((i)*(spacing))-icon_size/2)+(spacing/2)+4), (int)(+96+56+icon_size+12)+shiftyval, 1, Color.WHITE, Color.BLUE, Integer.toString(amts[i++]));
//DrawUtils.drawCenteredOutlineText(g2, sigIRC.programFont, (int)((+border+((i)*(spacing))-icon_size/2)+(spacing/2)+4), (int)(+96+56+icon_size+12)+shiftyval, 1, Color.WHITE, Color.BLUE, Integer.toString(amts[i++]));
i++;
}
} catch (ConcurrentModificationException e) {
@ -549,6 +550,7 @@ public class Profile {
//g.drawImage(tmp, (int)parent.position.getX(), (int)parent.position.getY(), 120, 64, sigIRC.panel);
//image_display_update_required=false;
//System.out.println("Updated Image Display for user "+username+".");
return tmp.getScaledInstance(w, -1, Image.SCALE_AREA_AVERAGING);
}
public Image getStatPanel(int w, Session session) {
@ -576,12 +578,13 @@ public class Profile {
if (session.eggCount>0) {
spacing = width/session.eggCount;
rainbowEggLimit = session.eggCount;
//shiftyval+=RabiRaceModule.image_map.get("easter_egg.png").getHeight(parent.panel);
} else {
spacing = width/5;
rainbowEggLimit = session.eggCount;
}
//Image img = RabiRaceModule.image_map.get("easter_egg.png");
for (int i=0;i<session.eggCount;i++) {
/*for (int i=0;i<session.eggCount;i++) {
//Color col = (rainbowEggCount>i)?RabiRaceModule.rainbowcycler.getCycleColor():new Color(0,0,0,192);
//DrawUtils.drawImage(g2, img, (int)(border+i*spacing-img.getWidth(parent.panel)/4),(int)(36),col,parent.panel);
Image img;
@ -591,7 +594,7 @@ public class Profile {
img = Profile.darkRainbowEggImage;
}
g2.drawImage(img, (int)(border+i*spacing-img.getWidth(parent.panel)/4),(int)(36), parent.panel);
}
}*/
}break;
case 1:{ //Item Hunt.
spacing = width/session.itemHuntData.length;
@ -602,9 +605,9 @@ public class Profile {
(badges.containsKey(item) &&
badges.get(item)>=1)) {
//DrawUtils.drawImage(g2, item.getImage(), (int)(border+i*spacing-item.getImage().getWidth(sigIRC.panel)/4),(int)(36),col,sigIRC.panel);
g2.drawImage(item.getImage(), (int)(border+i*spacing),(int)(36+16), icon_size*2, icon_size*2, parent.panel);
g2.drawImage(item.getImage(), (int)(border+i*spacing),(int)(36+16), icon_size*2, icon_size*2, null);
} else {
DrawUtils.drawImageScaled(g2, item.getImage(), (int)(border+i*spacing),(int)(36+16),icon_size*2, icon_size*2,new Color(0,0,0,192),parent.panel);
DrawUtils.drawImageScaled(g2, item.getImage(), (int)(border+i*spacing),(int)(36+16),icon_size*2, icon_size*2,new Color(0,0,0,192),null);
}
}
spacing=width/5;
@ -629,15 +632,15 @@ public class Profile {
if (key_items.get(data)<0) {
Image img = data.getImage().getScaledInstance(icon_size, icon_size, Image.SCALE_DEFAULT);
if (size*icon_size<width) {
DrawUtils.drawImageScaled(g2, img, (int)(+border+((count++)*icon_size)), (int)(+96+8)+shiftyval, (int)icon_size*iconsize, (int)icon_size*iconsize, new Color(0,0,0,128), parent.panel);
DrawUtils.drawImageScaled(g2, img, (int)(+border+((count++)*icon_size)), (int)(+96+8)+shiftyval, (int)icon_size*iconsize, (int)icon_size*iconsize, new Color(0,0,0,128), null);
} else {
DrawUtils.drawImageScaled(g2, img, (int)(+border+((width/size)*(count++))), (int)(+96+8)+shiftyval, (int)icon_size*iconsize, (int)icon_size*iconsize, new Color(0,0,0,128), parent.panel);
DrawUtils.drawImageScaled(g2, img, (int)(+border+((width/size)*(count++))), (int)(+96+8)+shiftyval, (int)icon_size*iconsize, (int)icon_size*iconsize, new Color(0,0,0,128), null);
}
} else {
if (size*icon_size<width) {
g2.drawImage(data.getImage(), (int)(+border+((count++)*icon_size)), (int)(+96+8)+shiftyval, (int)(icon_size*iconsize), (int)(icon_size*iconsize), parent.panel);
g2.drawImage(data.getImage(), (int)(+border+((count++)*icon_size)), (int)(+96+8)+shiftyval, (int)(icon_size*iconsize), (int)(icon_size*iconsize), null);
} else {
g2.drawImage(data.getImage(), (int)(+border+((width/size)*(count++))), (int)(+96+8)+shiftyval, (int)(icon_size*iconsize), (int)(icon_size*iconsize), parent.panel);
g2.drawImage(data.getImage(), (int)(+border+((width/size)*(count++))), (int)(+96+8)+shiftyval, (int)(icon_size*iconsize), (int)(icon_size*iconsize), null);
}
}
}
@ -645,12 +648,12 @@ public class Profile {
size = badges.size();
for (MemoryData data : badges.keySet()) {
if (size*icon_size<width) {
g2.drawImage(data.getImage(), (int)(+border+((count++)*icon_size)), (int)(+96+32)+shiftyval, (int)(icon_size*iconsize), (int)(icon_size*iconsize), parent.panel);
g2.drawImage(data.getImage(), (int)(+border+((count++)*icon_size)), (int)(+96+32)+shiftyval, (int)(icon_size*iconsize), (int)(icon_size*iconsize), null);
if (badges.get(data)==2) {
DrawUtils.drawOutlineText(g2, sigIRC.smallFont, (int)(+border+((count-1)*icon_size))+4, (int)(+96+32)+icon_size+shiftyval, 1, Color.WHITE, TEAL, "E");
}
} else {
g2.drawImage(data.getImage(), (int)(+border+((width/size)*(count++))), (int)(+96+32)+shiftyval, (int)(icon_size*iconsize), (int)(icon_size*iconsize), parent.panel);
g2.drawImage(data.getImage(), (int)(+border+((width/size)*(count++))), (int)(+96+32)+shiftyval, (int)(icon_size*iconsize), (int)(icon_size*iconsize), null);
if (badges.get(data)==2) {
DrawUtils.drawOutlineText(g2, sigIRC.smallFont, (int)(+border+((width/size)*(count-1)))+4, (int)(+96+32)+icon_size+shiftyval, 1, Color.WHITE, TEAL, "E");
}
@ -679,11 +682,9 @@ public class Profile {
//g2.drawImage(RabiRaceModule.image_map.get("bunny_strike.png"),(int)(+border+(i++)*(spacing)-img2.getWidth(sigIRC.panel)/4),(int)(+96+56), (int)icon_size, (int)icon_size, sigIRC.panel);
int counting=0;
for (Image img : imgs) {
if (counting++==5) {
g2.drawImage(img, (int)(+border+((i)*(spacing))-icon_size/2),(int)(+96+56)+shiftyval,(int)icon_size,(int)icon_size,parent.panel);
//DrawUtils.drawImageScaled(g2, img,(int)(+border+((i)*(spacing))-icon_size/2),(int)(+96+56)+shiftyval, (int)icon_size, (int)icon_size, RabiRaceModule.rainbowcycler.getCycleColor(), parent.panel);
} else {
g2.drawImage(img,(int)(+border+((i)*(spacing))-icon_size/2),(int)(+96+56)+shiftyval, (int)icon_size, (int)icon_size, parent.panel);
if (counting++!=5) {
//Rainbow egg is drawn separately.
g2.drawImage(img,(int)(+border+((i)*(spacing))-icon_size/2),(int)(+96+56)+shiftyval, (int)icon_size, (int)icon_size, null);
}
DrawUtils.drawCenteredOutlineText(g2, sigIRC.programFont, (int)((+border+((i)*(spacing))-icon_size/2)+(spacing/2)+4), (int)(+96+56+icon_size+12)+shiftyval, 1, Color.WHITE, Color.BLUE, Integer.toString(amts[i++]));
}
@ -696,7 +697,7 @@ public class Profile {
imageDisplayUpdateImage = tmp.getScaledInstance(w, -1, Image.SCALE_AREA_AVERAGING);
//g.drawImage(tmp, (int)parent.position.getX(), (int)parent.position.getY(), 120, 64, sigIRC.panel);
image_display_update_required=false;
System.out.println("Updated Image Display for user "+username+".");
//System.out.println("Updated Image Display for user "+username+".");
}
return imageDisplayUpdateImage;
@ -763,8 +764,10 @@ public class Profile {
for (Profile p : players) {
Image panel = p.getStatPanel(w,session);
Image panel2 = p.getStatText(w,session);
g.drawImage(panel,(int)(x+xx*panel.getWidth(RabiRaceModule.module.panel)/((rows+cols)/2d)),(int)(y+yy*panel.getHeight(RabiRaceModule.module.panel)/((rows+cols)/2d)),(int)(panel.getWidth(RabiRaceModule.module.panel)/((rows+cols)/2d)),(int)(panel.getHeight(RabiRaceModule.module.panel)/((rows+cols)/2d)),RabiRaceModule.module.panel);
g.drawImage(panel2,(int)(x+xx*panel2.getWidth(RabiRaceModule.module.panel)/((rows+cols)/2d)),(int)(y+yy*panel2.getHeight(RabiRaceModule.module.panel)/((rows+cols)/2d)),(int)(panel2.getWidth(RabiRaceModule.module.panel)/((rows+cols)/2d)),(int)(panel2.getHeight(RabiRaceModule.module.panel)/((rows+cols)/2d)),RabiRaceModule.module.panel);
Image panel3 = p.getRainbowEggPanel(w,session);
g.drawImage(panel,(int)(x+xx*panel.getWidth(RabiRaceModule.module.panel)/((rows+cols)/2d)),(int)(y+yy*panel.getHeight(RabiRaceModule.module.panel)/((rows+cols)/2d)),(int)(panel.getWidth(RabiRaceModule.module.panel)/((rows+cols)/2d)),(int)(panel.getHeight(RabiRaceModule.module.panel)/((rows+cols)/2d)),null);
g.drawImage(panel2,(int)(x+xx*panel2.getWidth(RabiRaceModule.module.panel)/((rows+cols)/2d)),(int)(y+yy*panel2.getHeight(RabiRaceModule.module.panel)/((rows+cols)/2d)),(int)(panel2.getWidth(RabiRaceModule.module.panel)/((rows+cols)/2d)),(int)(panel2.getHeight(RabiRaceModule.module.panel)/((rows+cols)/2d)),null);
g.drawImage(panel3,(int)(x+xx*panel3.getWidth(RabiRaceModule.module.panel)/((rows+cols)/2d)),(int)(y+yy*panel3.getHeight(RabiRaceModule.module.panel)/((rows+cols)/2d)),(int)(panel3.getWidth(RabiRaceModule.module.panel)/((rows+cols)/2d)),(int)(panel3.getHeight(RabiRaceModule.module.panel)/((rows+cols)/2d)),null);
if (xx+1<cols) {
xx++;
} else {

@ -150,7 +150,11 @@ public class SessionListWindow extends JFrame{
File file = new File(sigIRC.BASEDIR+"sigIRC/tmp_session.data");
org.apache.commons.io.FileUtils.copyURLToFile(new URL("http://45.33.13.215/rabirace/send.php?key=joinsession&name="+RabiRaceModule.module.myProfile.username+"&session="+session.id+"&password="+hashedPass),file);
String[] data = FileUtils.readFromFile(sigIRC.BASEDIR+"sigIRC/tmp_session.data");
if (RabiRaceModule.module.myProfile!=null) {
RabiRaceModule.module.myProfile.image_display_update_required = true;
RabiRaceModule.module.myProfile.stat_update_required = true;
}
if (data.length==1) {
int errorCode = Integer.parseInt(data[0]);
switch (errorCode) {

@ -4,6 +4,7 @@ import java.awt.Color;
import java.awt.Graphics;
import java.awt.Image;
import java.awt.Rectangle;
import java.awt.event.ComponentEvent;
import java.awt.event.MouseEvent;
import java.awt.geom.Rectangle2D;
import java.awt.image.BufferedImage;
@ -166,8 +167,8 @@ public class RabiRaceModule extends Module{
//trimeadProfile.username = "trimead";
join_button = new JoinButton(new Rectangle(2,(int)(position.getHeight()-18),120,18),"Join Session (0)",this);
create_button = new CreateButton(new Rectangle(122,(int)(position.getHeight()-18),120,18),"Create Session",this);
join_button = new JoinButton(new Rectangle(2,(int)(position.getHeight()-Module.WINDOW_EXTRA_BORDER-36),120,18),"Join Session (0)",this);
create_button = new CreateButton(new Rectangle(122,(int)(position.getHeight()-Module.WINDOW_EXTRA_BORDER-36),120,18),"Create Session",this);
}
private void AddImagesToImageMap(File dir, String DIRECTORY) {
@ -301,6 +302,18 @@ public class RabiRaceModule extends Module{
}
}
public void componentResized(ComponentEvent e) {
super.componentResized(e);
if (myProfile!=null) {
myProfile.image_display_update_required=true;
myProfile.stat_update_required=true;
}
if (join_button!=null && create_button!=null) {
join_button.y=(int)(position.getHeight()-Module.WINDOW_EXTRA_BORDER-36);
create_button.y=(int)(position.getHeight()-Module.WINDOW_EXTRA_BORDER-36);
}
}
private void UpdateMyProfile() {
if (foundRabiRibi) {
//System.out.println("Called.");
@ -455,7 +468,6 @@ public class RabiRaceModule extends Module{
public void draw(Graphics g) {
super.draw(g);
if (!foundRabiRibi) {
DrawUtils.drawTextFont(g, sigIRC.userFont, 0, 0+26, Color.BLACK, "Rabi-Ribi not found! Please start it.");
} else {
@ -476,8 +488,9 @@ public class RabiRaceModule extends Module{
mouseoverAvatar=false;
}
g.drawImage(panel, (int)0, (int)0, module.panel);
g.drawImage(myProfile.getStatText((int)position.getWidth()-24,mySession), (int)0, (int)0, module.panel);
g.drawImage(panel, (int)0, (int)0, null);
g.drawImage(myProfile.getStatText((int)position.getWidth()-24,mySession), (int)0, (int)0, null);
g.drawImage(myProfile.getRainbowEggPanel((int)position.getWidth()-24,mySession), (int)0, (int)0, null);
//Profile.DrawMultiPanel(g, (int)(0), (int)(0)+panel.getHeight(sigIRC.panel), (int)position.getWidth(), testing);
if (mySession!=null) {

@ -35,7 +35,7 @@ public class TouhouMotherButton {
}
public void draw(Graphics g) {
g.drawImage(buttonimg, x, y, sigIRC.panel);
g.drawImage(buttonimg, x, y, null);
}
public void onClickEvent(MouseEvent ev) {

@ -144,7 +144,7 @@ public class TouhouMotherModule extends Module implements ActionListener{
}
public void DrawBossAndPlayerInfo(Graphics g) {
g.drawImage(bossImage, (int)position.getX()+4, (int)position.getY()+4, sigIRC.panel);
g.drawImage(bossImage, (int)position.getX()+4, (int)position.getY()+4, null);
DrawUtils.drawOutlineText(g, sigIRC.programFont, Math.min(bossImage.getWidth()+4,160)+(int)position.getX()+4, (int)position.getY()+4+16, 1, Color.WHITE, new Color(30,0,86,255),
currentBoss.getName());
DrawUtils.drawOutlineText(g, sigIRC.userFont, Math.min(bossImage.getWidth()+4,160)+(int)position.getX()+4, (int)position.getY()+4+48, 1, Color.WHITE, new Color(30,0,86,255),

@ -52,7 +52,7 @@ public class FancyNumber {
public Rectangle draw(Graphics g, int x, int y) {
int xoffset = 0;
int yoffset = 0;
g.drawImage(icon, x, y, sigIRC.panel);
g.drawImage(icon, x, y, null);
xoffset+=icon.getWidth()+4;
if (displayedValue!=lastValue) {
if (delayCount==0) {
@ -81,7 +81,7 @@ public class FancyNumber {
xoffset+=TextUtils.calculateStringBoundsFont(Integer.toString(displayedValue), sigIRC.userFont).getWidth()+4;
if (lastValueChange>0) {
lastValueChange--;
g.drawImage((upArrow)?TwitchModule.UPARROWIMAGE:TwitchModule.DOWNARROWIMAGE, x+xoffset, y+yoffset, sigIRC.panel);
g.drawImage((upArrow)?TwitchModule.UPARROWIMAGE:TwitchModule.DOWNARROWIMAGE, x+xoffset, y+yoffset, null);
}
xoffset+=((upArrow)?TwitchModule.UPARROWIMAGE.getWidth():TwitchModule.DOWNARROWIMAGE.getWidth())+4;
return new Rectangle(x,y,xoffset,yoffset+16);

@ -445,7 +445,8 @@ public class TwitchModule extends Module{
private Rectangle DrawUptime(Graphics g, int x, int y) {
int xoffset = 0;
int yoffset = 0;
g.drawImage(UPTIMEIMAGE, x+xoffset, y+yoffset-2, sigIRC.panel);xoffset+=UPTIMEIMAGE.getWidth()+4;
g.drawImage(UPTIMEIMAGE, x+xoffset, y+yoffset-2, null);
xoffset+=UPTIMEIMAGE.getWidth()+4;
String timediff = TimeUtils.GetTimeDifferenceFromCurrentDate(uptime);
if (timediff.length()>0) {
DrawUtils.drawTextFont(g, sigIRC.userFont, x+xoffset, y+yoffset+TextUtils.calculateStringBoundsFont(timediff, sigIRC.userFont).getHeight()/2+3,new Color(184,181,192),timediff);xoffset+=TextUtils.calculateStringBoundsFont(timediff, sigIRC.userFont).getWidth()+12;
@ -477,7 +478,7 @@ public class TwitchModule extends Module{
//g.drawImage(follower_img, (int)bounds.getX()+xAlteration, (int)bounds.getY()+yAlteration, sigIRC.panel);
//g.drawImage(follower_img, (int)bounds.getX(), (int)bounds.getY(), , , sigIRC.panel)
g.drawImage(follower_img, (int)position.getX(), (int)position.getY()+canvasYOffset, (int)position.getX()+follower_img.getWidth()+canvasXOffset, (int)position.getY()+follower_img.getHeight(),
-xAlteration, 0, follower_img.getWidth(), follower_img.getHeight()-yAlteration, sigIRC.panel);
-xAlteration, 0, follower_img.getWidth(), follower_img.getHeight()-yAlteration, null);
Rectangle2D usernameTextsize = TextUtils.calculateStringBoundsFont(announcedFollowerUser.getDisplayName(), sigIRC.programFont);
int textY = (int)position.getY()+sigIRC.twitchmodule_followerText_Y+yAlteration;
int textX = (int)position.getX()+sigIRC.twitchmodule_followerText_centerX+xAlteration;
@ -491,7 +492,7 @@ public class TwitchModule extends Module{
int img_starty = (int)(position.getY()+follower_img.getHeight()+2-image_size/2);
//g.setColor(Color.BLACK);
//g.drawRect(img_startx, img_starty, image_size, image_size);
g.drawImage(followerUserLogo, img_startx, img_starty, img_startx+image_size, img_starty+image_size, 0, 0, followerUserLogo.getWidth(), followerUserLogo.getHeight(), TextUtils.convertStringToColor(sigIRC.twitchmodule_newfollowerImgBackgroundColor), sigIRC.panel);
g.drawImage(followerUserLogo, img_startx, img_starty, img_startx+image_size, img_starty+image_size, 0, 0, followerUserLogo.getWidth(), followerUserLogo.getHeight(), TextUtils.convertStringToColor(sigIRC.twitchmodule_newfollowerImgBackgroundColor),null);
}
if (announcedFollowerUser.getBio()!=null && announcedFollowerUser.getBio().length()>0) {
DrawUtils.drawOutlineText(g, sigIRC.userFont, position.getX()+position.getWidth()-ticksPassed*3, position.getY()+follower_img.getHeight()+2+8, 2, TextUtils.convertStringToColor(sigIRC.twitchmodule_newfollowerTextColor), TextUtils.convertStringToColor(sigIRC.twitchmodule_newfollowerShadowTextColor), announcedFollowerUser.getBio());

@ -125,7 +125,7 @@ public class DrawUtils {
g2.setColor(blend_col);
g2.fillRect(0, 0, img.getWidth(source), img.getHeight(source));
g2.dispose();
g.drawImage(tmp,(int)x,(int)y,source);
g.drawImage(tmp,(int)x,(int)y,null);
}
public static void drawImageScaled(Graphics g, Image img, double x, double y, double xsize, double ysize, Color blend_col, ImageObserver source) {
@ -136,7 +136,7 @@ public class DrawUtils {
g2.setColor(blend_col);
g2.fillRect(0, 0, img.getWidth(source), img.getHeight(source));
g2.dispose();
g.drawImage(tmp,(int)x,(int)y,(int)xsize,(int)ysize,source);
g.drawImage(tmp,(int)x,(int)y,(int)xsize,(int)ysize,null);
}
public static Color invertColor(Color c) {

Loading…
Cancel
Save