Large update for interface upgrade for sigIRC
This commit is contained in:
parent
79bb1e576b
commit
413fab117b
BIN
sigIRCv2.jar
BIN
sigIRCv2.jar
Binary file not shown.
@ -67,9 +67,9 @@ public class Module extends JFrame implements ComponentListener, WindowListener,
|
||||
this.addKeyListener(this);
|
||||
|
||||
this.position = bounds;
|
||||
System.out.println(position);
|
||||
this.name = moduleName;
|
||||
this.enabled=true;
|
||||
this.setVisible(true);
|
||||
this.setTitle(moduleName);
|
||||
panel = new ListenerPanel(this){
|
||||
public void paintComponent(Graphics g) {
|
||||
@ -81,16 +81,18 @@ public class Module extends JFrame implements ComponentListener, WindowListener,
|
||||
|
||||
this.titleHeight = (int)TextUtils.calculateStringBoundsFont(this.name, sigIRC.userFont).getHeight();
|
||||
|
||||
this.setSize(new Dimension((int)position.getWidth(), (int)position.getHeight()));
|
||||
|
||||
this.setMinimumSize(new Dimension((int)position.getWidth(), (int)position.getHeight()));
|
||||
panel.setMinimumSize(this.getMinimumSize());
|
||||
panel.setSize(this.getSize());
|
||||
//System.out.println("Module "+moduleName+": "+position);
|
||||
|
||||
this.add(panel);
|
||||
//this.pack();
|
||||
repaint();
|
||||
this.setVisible(true);
|
||||
|
||||
ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1);
|
||||
scheduler.scheduleWithFixedDelay(()->{
|
||||
updateFPSCounter();
|
||||
run();
|
||||
panel.repaint();
|
||||
},(long)((1d/(sigIRC.framerate+1))*1000),(long)((1d/(sigIRC.framerate+1))*1000),TimeUnit.MILLISECONDS);
|
||||
@ -140,6 +142,7 @@ public class Module extends JFrame implements ComponentListener, WindowListener,
|
||||
public void draw(Graphics g) {
|
||||
//g.fillRect(0, 0, (int)position.getWidth(), (int)position.getHeight());
|
||||
//DrawUtils.drawText(g, 0, 16, Color.WHITE, "Test");
|
||||
updateFPSCounter();
|
||||
}
|
||||
|
||||
public void ModuleDragEvent(int oldX, int oldY, int newX, int newY) {
|
||||
@ -194,8 +197,10 @@ public class Module extends JFrame implements ComponentListener, WindowListener,
|
||||
|
||||
@Override
|
||||
public void componentMoved(ComponentEvent e) {
|
||||
if (this.isVisible()) {
|
||||
UpdatePosition(e);
|
||||
}
|
||||
}
|
||||
|
||||
private void UpdatePosition(ComponentEvent e) {
|
||||
position = new Rectangle((int)e.getComponent().getLocationOnScreen().getX(),(int)e.getComponent().getLocationOnScreen().getY(),e.getComponent().getWidth(),e.getComponent().getHeight());
|
||||
@ -206,8 +211,10 @@ public class Module extends JFrame implements ComponentListener, WindowListener,
|
||||
|
||||
@Override
|
||||
public void componentResized(ComponentEvent e) {
|
||||
if (this.isVisible()) {
|
||||
UpdatePosition(e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void componentShown(ComponentEvent e) {
|
||||
|
@ -35,9 +35,6 @@ import sig.modules.ChatLog.ChatLogMessage;
|
||||
import sig.utils.FileUtils;
|
||||
|
||||
public class MyPanel extends JPanel{
|
||||
public int lastMouseX = 0;
|
||||
public int lastMouseY = 0;
|
||||
|
||||
public MyPanel() {
|
||||
//setBorder(BorderFactory.createLineBorder(Color.black));
|
||||
setFocusable(true);
|
||||
@ -51,11 +48,6 @@ public class MyPanel extends JPanel{
|
||||
super.paintComponent(g);
|
||||
// Draw Text
|
||||
//int counter=18;
|
||||
if (sigIRC.panel!=null) {
|
||||
lastMouseX = (int)(MouseInfo.getPointerInfo().getLocation().getX());
|
||||
lastMouseY = (int)(MouseInfo.getPointerInfo().getLocation().getY());
|
||||
//System.out.println("("+lastMouseX+","+lastMouseY+")");
|
||||
}
|
||||
/*if (sigIRC.window!=null && sigIRC.window.getMousePosition(true)!=null && sigIRC.overlayMode) {
|
||||
lastMouseX = (int)sigIRC.window.getMousePosition(true).getX();
|
||||
lastMouseY = (int)sigIRC.window.getMousePosition(true).getY();
|
||||
|
@ -24,7 +24,7 @@ import sig.utils.DrawUtils;
|
||||
import sig.utils.FileUtils;
|
||||
|
||||
public class ChatLogModule extends Module{
|
||||
public static int messageHistoryCount = 20;
|
||||
public static int messageHistoryCount = 50;
|
||||
public List<ChatLogMessage> messageHistory = new ArrayList<ChatLogMessage>();
|
||||
int delay = 150;
|
||||
boolean initialized=false;
|
||||
|
@ -37,19 +37,19 @@ public class ClickableButton {
|
||||
}
|
||||
|
||||
public boolean mouseInsideBounds(MouseEvent ev) {
|
||||
return ev.getX()>=module.getPosition().getX()+x && ev.getX()<=module.getPosition().getX()+x+width &&
|
||||
ev.getY()>=module.getPosition().getY()+y && ev.getY()<=module.getPosition().getY()+y+height;
|
||||
return ev.getX()>=0+x && ev.getX()<=0+x+width &&
|
||||
ev.getY()>=0+y && ev.getY()<=0+y+height;
|
||||
}
|
||||
|
||||
public void draw(Graphics g) {
|
||||
Color color_identity = g.getColor();
|
||||
g.setColor(Color.WHITE);
|
||||
g.drawRect((int)module.getPosition().getX()+x,
|
||||
(int)module.getPosition().getY()+y, width, height);
|
||||
g.drawRect((int)0+x,
|
||||
(int)0+y, width, height);
|
||||
g.setColor(Color.BLACK);
|
||||
g.fillRect((int)module.getPosition().getX()+x+1,
|
||||
(int)module.getPosition().getY()+y+1, width-1, height-1);
|
||||
DrawUtils.drawTextFont(g, sigIRC.userFont, module.getPosition().getX()+x-TextUtils.calculateStringBoundsFont(label, sigIRC.userFont).getWidth()/2+width/2, module.getPosition().getY()+y+height-1, Color.WHITE, label);
|
||||
g.fillRect((int)0+x+1,
|
||||
(int)0+y+1, width-1, height-1);
|
||||
DrawUtils.drawTextFont(g, sigIRC.userFont, 0+x-TextUtils.calculateStringBoundsFont(label, sigIRC.userFont).getWidth()/2+width/2, 0+y+height-1, Color.WHITE, label);
|
||||
g.setColor(color_identity);
|
||||
}
|
||||
}
|
||||
|
@ -42,6 +42,7 @@ public enum MemoryData {
|
||||
CHARGE_RING(MemoryOffset.CHARGE_RING,"Charge Ring","charge_ring.png",true),
|
||||
CARROT_SHOOTER(MemoryOffset.CARROT_SHOOTER,"Carrot Shooter","carrot_shooter.png",true),
|
||||
SUPER_CARROT(MemoryOffset.SUPER_CARROT,"Super Carrot","super_carrot.png",true),
|
||||
GOLD_CARROT(MemoryOffset.GOLD_CARROT,"Gold Carrot","gold_carrot.png",true),
|
||||
/*DLC_ITEM1(MemoryOffset.DLC_ITEM1,"","",true),
|
||||
DLC_ITEM2(MemoryOffset.DLC_ITEM2,"","",true),
|
||||
DLC_ITEM4(MemoryOffset.DLC_ITEM4,"","",true),*/
|
||||
|
@ -49,13 +49,16 @@ public class Profile {
|
||||
RabiRaceModule parent;
|
||||
public long lastWebUpdate = System.currentTimeMillis();
|
||||
DecimalFormat df = new DecimalFormat("0.0");
|
||||
Profile oldProfile;
|
||||
public Profile oldProfile;
|
||||
public boolean isArchive = false;
|
||||
final static Color TEAL = new Color(0,128,128);
|
||||
public Image statUpdateCacheImage;
|
||||
public Image imageDisplayUpdateImage;
|
||||
public boolean stat_update_required = true;
|
||||
public boolean image_display_update_required = true;
|
||||
public int avatarval = 0;
|
||||
public static Image rainbowEggImage;
|
||||
public static Image darkRainbowEggImage;
|
||||
|
||||
public Profile(RabiRaceModule module) {
|
||||
this(module,true);
|
||||
@ -83,35 +86,71 @@ public class Profile {
|
||||
oldProfile.key_items = (LinkedHashMap<MemoryData, Integer>)key_items.clone();
|
||||
oldProfile.badges = (LinkedHashMap<MemoryData, Integer>)badges.clone();
|
||||
oldProfile.playtime = playtime;
|
||||
oldProfile.difficulty = difficulty;
|
||||
oldProfile.loop = loop;
|
||||
oldProfile.itempct = itempct;
|
||||
oldProfile.mappct = mappct;
|
||||
}
|
||||
|
||||
public int compareAllChangedStatValues() {
|
||||
int count=0;
|
||||
if (oldProfile.playtime/60!=playtime/60 ||
|
||||
oldProfile.avatarval!=avatar.value ||
|
||||
oldProfile.isPaused!=isPaused ||
|
||||
oldProfile.difficulty!=difficulty ||
|
||||
oldProfile.loop!=loop ||
|
||||
oldProfile.itempct!=itempct ||
|
||||
oldProfile.mappct!=mappct) {
|
||||
System.out.println("Something has changed.");
|
||||
count++;
|
||||
} else {
|
||||
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+"|");
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
public int compareAllChangedValues() {
|
||||
int count=0;
|
||||
if (oldProfile.healthUps!=healthUps) {
|
||||
count++;
|
||||
//System.out.println("Health ups changed. "+(healthUps-oldProfile.healthUps));
|
||||
}
|
||||
if (oldProfile.attackUps!=attackUps) {
|
||||
count++;
|
||||
//System.out.println("Attack ups changed. "+(attackUps-oldProfile.attackUps));
|
||||
}
|
||||
if (oldProfile.manaUps!=manaUps) {
|
||||
count++;
|
||||
//System.out.println("Mana ups changed. "+(manaUps-oldProfile.manaUps));
|
||||
}
|
||||
if (oldProfile.regenUps!=regenUps) {
|
||||
count++;
|
||||
//System.out.println("Regen ups changed. "+(regenUps-oldProfile.regenUps));
|
||||
}
|
||||
if (oldProfile.packUps!=packUps) {
|
||||
count++;
|
||||
//System.out.println("Pack ups changed. "+(packUps-oldProfile.packUps));
|
||||
}
|
||||
if (oldProfile.rainbowEggCount!=rainbowEggCount) {
|
||||
//System.out.println("Rainbow Egg Count changed. "+(rainbowEggCount-oldProfile.rainbowEggCount));
|
||||
count++;
|
||||
}
|
||||
for (MemoryData md : key_items.keySet()) {
|
||||
if ((!oldProfile.key_items.containsKey(md) &&
|
||||
key_items.containsKey(md)) || (
|
||||
key_items.containsKey(md)) || ((
|
||||
oldProfile.key_items.containsKey(md) &&
|
||||
key_items.containsKey(md)) &&
|
||||
oldProfile.key_items.get(md)!=key_items.get(md)
|
||||
oldProfile.key_items.get(md).compareTo(key_items.get(md))!=0)
|
||||
) {
|
||||
/*if (!oldProfile.key_items.containsKey(md) &&
|
||||
key_items.containsKey(md)) {
|
||||
System.out.println("Key item difference: "+(md));
|
||||
} else {
|
||||
System.out.println("Key item value difference: "+md+":"+(oldProfile.key_items.get(md)+"->"+key_items.get(md)));
|
||||
}*/
|
||||
count++;
|
||||
}
|
||||
}
|
||||
@ -120,8 +159,14 @@ public class Profile {
|
||||
badges.containsKey(md)) || (
|
||||
oldProfile.badges.containsKey(md) &&
|
||||
badges.containsKey(md)) &&
|
||||
oldProfile.badges.get(md)!=badges.get(md)
|
||||
oldProfile.badges.get(md).compareTo(badges.get(md))!=0
|
||||
) {
|
||||
/*if (!oldProfile.badges.containsKey(md) &&
|
||||
badges.containsKey(md)) {
|
||||
System.out.println("Badge difference: "+(md));
|
||||
} else {
|
||||
System.out.println("Badge value difference: "+md+":"+(oldProfile.badges.get(md)+"->"+badges.get(md)));
|
||||
}*/
|
||||
count++;
|
||||
}
|
||||
}
|
||||
@ -339,7 +384,7 @@ public class Profile {
|
||||
|
||||
g2.setColor(Color.BLACK);
|
||||
//g2.fillRect(1, 1, 32, 32);
|
||||
g2.drawImage(avatar.getAvatarImage(), 1, 1, sigIRC.panel);
|
||||
g2.drawImage(avatar.getAvatarImage(), 1, 1, parent.panel);
|
||||
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());
|
||||
@ -354,8 +399,13 @@ public class Profile {
|
||||
//DrawUtils.drawOutlineText(g2, sigIRC.panel.rabiRibiMoneyDisplayFont, (int)(parent.position.getWidth() - TextUtils.calculateStringBoundsFont(text, sigIRC.panel.rabiRibiMoneyDisplayFont).getWidth()) - 2, 16, 1, g2.getColor(), Color.GRAY, text);
|
||||
DrawUtils.drawCenteredOutlineText(g2, sigIRC.rabiRibiTinyDisplayFont, (int)(tmp.getWidth()*0.6), 50, 2, Color.WHITE, Color.BLACK, text);
|
||||
|
||||
if (statUpdateCacheImage!=null) {
|
||||
statUpdateCacheImage.flush();
|
||||
}
|
||||
g2.dispose();
|
||||
statUpdateCacheImage = tmp.getScaledInstance(w, -1, Image.SCALE_AREA_AVERAGING);
|
||||
//stat_update_required = false;
|
||||
stat_update_required = false;
|
||||
System.out.println("Updated stat text for user "+username+".");
|
||||
}
|
||||
|
||||
return statUpdateCacheImage;
|
||||
@ -399,6 +449,108 @@ public class Profile {
|
||||
return diffstring;
|
||||
}
|
||||
|
||||
public Image getRainbowEggPanel(int w, Session session) {
|
||||
BufferedImage tmp = new BufferedImage(400,175,BufferedImage.TYPE_INT_ARGB);
|
||||
Graphics2D g2 = tmp.createGraphics();
|
||||
if (Profile.darkRainbowEggImage==null) {
|
||||
Profile.darkRainbowEggImage = DrawUtils.getBlendedImage(g2, RabiRaceModule.image_map.get("easter_egg.png"), new Color(0,0,0,192), RabiRaceModule.window);
|
||||
Profile.rainbowEggImage = DrawUtils.getBlendedImage(g2, RabiRaceModule.image_map.get("easter_egg.png"), RabiRaceModule.rainbowcycler.getCycleColor(), RabiRaceModule.window);
|
||||
} else {
|
||||
Profile.rainbowEggImage.flush();
|
||||
Profile.rainbowEggImage = DrawUtils.getBlendedImage(g2, RabiRaceModule.image_map.get("easter_egg.png"), RabiRaceModule.rainbowcycler.getCycleColor(), RabiRaceModule.window);
|
||||
//System.out.println("Rainbow egg color is "+RabiRaceModule.rainbowcycler.getCycleColor());
|
||||
}
|
||||
//DrawUtils.drawTextFont(g, sigIRC.panel.userFont, parent.position.getX(), parent.position.getY()+26, Color.BLACK, "Values: "+readIntFromMemory(MemoryOffset.DLC_ITEM1)+","+readIntFromMemory(MemoryOffset.DLC_ITEM2)+","+readIntFromMemory(MemoryOffset.DLC_ITEM3)+","+readIntFromMemory(MemoryOffset.DLC_ITEM4));
|
||||
final int border=20;
|
||||
final int width=(int)(tmp.getWidth()-border*2);
|
||||
int spacing=width/5;
|
||||
int shiftyval = 0;
|
||||
double iconsize = 1;
|
||||
final int icon_size = 24;
|
||||
int rainbowEggLimit = 0;
|
||||
|
||||
int gamemode = -1;
|
||||
if (RabiRaceModule.mySession!=null) {
|
||||
gamemode = RabiRaceModule.mySession.gamemode;
|
||||
}
|
||||
|
||||
if (gamemode!=-1) {
|
||||
switch (gamemode) {
|
||||
case 0:{ //Egg Hunt.
|
||||
if (session.eggCount>0) {
|
||||
spacing = width/session.eggCount;
|
||||
rainbowEggLimit = session.eggCount;
|
||||
} else {
|
||||
spacing = width/5;
|
||||
rainbowEggLimit = session.eggCount;
|
||||
}
|
||||
//Image img = RabiRaceModule.image_map.get("easter_egg.png");
|
||||
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;
|
||||
if (rainbowEggCount>i) {
|
||||
img = Profile.rainbowEggImage;
|
||||
} else {
|
||||
img = Profile.darkRainbowEggImage;
|
||||
}
|
||||
g2.drawImage(img, (int)(border+i*spacing-img.getWidth(parent.panel)/4),(int)(36), parent.panel);
|
||||
}
|
||||
}break;
|
||||
}
|
||||
} else {
|
||||
shiftyval = -RabiRaceModule.image_map.get("easter_egg.png").getWidth(parent.panel)/2;
|
||||
iconsize = 1;
|
||||
}
|
||||
/*
|
||||
{
|
||||
Image img = RabiRaceModule.image_map.get("easter_egg.png");
|
||||
Color col = RabiRaceModule.rainbowcycler.getCycleColor();
|
||||
DrawUtils.drawImage(g2, img, (int)(border+((1.5)*spacing)-img.getWidth(sigIRC.panel)/4),(int)(36),col,sigIRC.panel);
|
||||
DrawUtils.drawCenteredOutlineText(g2, sigIRC.panel.programFont, (int)(border+((3)*spacing)-img.getWidth(sigIRC.panel)/4),(int)12+img.getHeight(sigIRC.panel), 1, Color.WHITE, Color.BLUE,"x"+rainbowEggCount);
|
||||
}
|
||||
*/
|
||||
int size = key_items.size();
|
||||
int count = 0;
|
||||
try {
|
||||
int i=0;
|
||||
Image[] imgs = new Image[]{RabiRaceModule.image_map.get("health_up.png"),
|
||||
RabiRaceModule.image_map.get("mana_up.png"),
|
||||
RabiRaceModule.image_map.get("regen_up.png"),
|
||||
RabiRaceModule.image_map.get("pack_up.png"),
|
||||
RabiRaceModule.image_map.get("attack_up.png")};
|
||||
int[] amts = new int[]{
|
||||
healthUps,
|
||||
manaUps,
|
||||
regenUps,
|
||||
packUps,
|
||||
attackUps,
|
||||
};
|
||||
if (rainbowEggCount>rainbowEggLimit) {
|
||||
imgs = Arrays.copyOf(imgs, imgs.length+1);
|
||||
imgs[imgs.length-1] = RabiRaceModule.image_map.get("easter_egg.png");
|
||||
amts = Arrays.copyOf(amts, amts.length+1);
|
||||
amts[amts.length-1] = rainbowEggCount;
|
||||
spacing = width/6;
|
||||
}
|
||||
//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);
|
||||
}
|
||||
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++]));
|
||||
}
|
||||
} catch (ConcurrentModificationException e) {
|
||||
|
||||
}
|
||||
g2.dispose();
|
||||
//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+".");
|
||||
}
|
||||
|
||||
public Image getStatPanel(int w, Session session) {
|
||||
|
||||
if (imageDisplayUpdateImage==null || image_display_update_required) {
|
||||
@ -428,10 +580,17 @@ public class Profile {
|
||||
spacing = width/5;
|
||||
rainbowEggLimit = session.eggCount;
|
||||
}
|
||||
Image img = RabiRaceModule.image_map.get("easter_egg.png");
|
||||
//Image img = RabiRaceModule.image_map.get("easter_egg.png");
|
||||
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(sigIRC.panel)/4),(int)(36),col,sigIRC.panel);
|
||||
//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;
|
||||
if (rainbowEggCount>i) {
|
||||
img = Profile.rainbowEggImage;
|
||||
} else {
|
||||
img = Profile.darkRainbowEggImage;
|
||||
}
|
||||
g2.drawImage(img, (int)(border+i*spacing-img.getWidth(parent.panel)/4),(int)(36), parent.panel);
|
||||
}
|
||||
}break;
|
||||
case 1:{ //Item Hunt.
|
||||
@ -443,16 +602,16 @@ 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, sigIRC.panel);
|
||||
g2.drawImage(item.getImage(), (int)(border+i*spacing),(int)(36+16), icon_size*2, icon_size*2, parent.panel);
|
||||
} 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),sigIRC.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),parent.panel);
|
||||
}
|
||||
}
|
||||
spacing=width/5;
|
||||
}break;
|
||||
}
|
||||
} else {
|
||||
shiftyval = -RabiRaceModule.image_map.get("easter_egg.png").getWidth(sigIRC.panel)/2;
|
||||
shiftyval = -RabiRaceModule.image_map.get("easter_egg.png").getWidth(parent.panel)/2;
|
||||
iconsize = 1;
|
||||
}
|
||||
/*
|
||||
@ -470,15 +629,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), sigIRC.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), parent.panel);
|
||||
} 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), sigIRC.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), parent.panel);
|
||||
}
|
||||
} 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), sigIRC.panel);
|
||||
g2.drawImage(data.getImage(), (int)(+border+((count++)*icon_size)), (int)(+96+8)+shiftyval, (int)(icon_size*iconsize), (int)(icon_size*iconsize), parent.panel);
|
||||
} else {
|
||||
g2.drawImage(data.getImage(), (int)(+border+((width/size)*(count++))), (int)(+96+8)+shiftyval, (int)(icon_size*iconsize), (int)(icon_size*iconsize), sigIRC.panel);
|
||||
g2.drawImage(data.getImage(), (int)(+border+((width/size)*(count++))), (int)(+96+8)+shiftyval, (int)(icon_size*iconsize), (int)(icon_size*iconsize), parent.panel);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -486,12 +645,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), sigIRC.panel);
|
||||
g2.drawImage(data.getImage(), (int)(+border+((count++)*icon_size)), (int)(+96+32)+shiftyval, (int)(icon_size*iconsize), (int)(icon_size*iconsize), parent.panel);
|
||||
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), sigIRC.panel);
|
||||
g2.drawImage(data.getImage(), (int)(+border+((width/size)*(count++))), (int)(+96+32)+shiftyval, (int)(icon_size*iconsize), (int)(icon_size*iconsize), parent.panel);
|
||||
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");
|
||||
}
|
||||
@ -521,19 +680,23 @@ public class Profile {
|
||||
int counting=0;
|
||||
for (Image img : imgs) {
|
||||
if (counting++==5) {
|
||||
DrawUtils.drawImageScaled(g2, img,(int)(+border+((i)*(spacing))-icon_size/2),(int)(+96+56)+shiftyval, (int)icon_size, (int)icon_size, RabiRaceModule.rainbowcycler.getCycleColor(), sigIRC.panel);
|
||||
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, sigIRC.panel);
|
||||
g2.drawImage(img,(int)(+border+((i)*(spacing))-icon_size/2),(int)(+96+56)+shiftyval, (int)icon_size, (int)icon_size, 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++]));
|
||||
}
|
||||
} catch (ConcurrentModificationException e) {
|
||||
|
||||
}
|
||||
if (imageDisplayUpdateImage!=null) {
|
||||
imageDisplayUpdateImage.flush();
|
||||
}
|
||||
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.");
|
||||
image_display_update_required=false;
|
||||
System.out.println("Updated Image Display for user "+username+".");
|
||||
}
|
||||
|
||||
return imageDisplayUpdateImage;
|
||||
@ -600,8 +763,8 @@ 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(sigIRC.panel)/((rows+cols)/2d)),(int)(y+yy*panel.getHeight(sigIRC.panel)/((rows+cols)/2d)),(int)(panel.getWidth(sigIRC.panel)/((rows+cols)/2d)),(int)(panel.getHeight(sigIRC.panel)/((rows+cols)/2d)),sigIRC.panel);
|
||||
g.drawImage(panel2,(int)(x+xx*panel2.getWidth(sigIRC.panel)/((rows+cols)/2d)),(int)(y+yy*panel2.getHeight(sigIRC.panel)/((rows+cols)/2d)),(int)(panel2.getWidth(sigIRC.panel)/((rows+cols)/2d)),(int)(panel2.getHeight(sigIRC.panel)/((rows+cols)/2d)),sigIRC.panel);
|
||||
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);
|
||||
if (xx+1<cols) {
|
||||
xx++;
|
||||
} else {
|
||||
|
@ -49,6 +49,7 @@ import sig.modules.utils.PsapiTools;
|
||||
import sig.utils.DrawUtils;
|
||||
import sig.utils.FileUtils;
|
||||
import sig.utils.TextUtils;
|
||||
import sig.windows.ProgramWindow;
|
||||
|
||||
public class RabiRaceModule extends Module{
|
||||
final static String ITEMS_DIRECTORY = sigIRC.BASEDIR+"sigIRC/rabi-ribi/items/";
|
||||
@ -80,7 +81,7 @@ public class RabiRaceModule extends Module{
|
||||
public static List<MemoryData> key_items_list = new ArrayList<MemoryData>();
|
||||
public static List<MemoryData> badges_list = new ArrayList<MemoryData>();
|
||||
|
||||
public RabiRaceModule(Rectangle2D bounds, String moduleName) {
|
||||
public RabiRaceModule(Rectangle bounds, String moduleName) {
|
||||
super(bounds, moduleName);
|
||||
//Initialize();
|
||||
Initialize();
|
||||
@ -281,8 +282,11 @@ public class RabiRaceModule extends Module{
|
||||
}
|
||||
|
||||
public void run() {
|
||||
super.run();
|
||||
if (foundRabiRibi) {
|
||||
rainbowcycler.run();
|
||||
//Profile.rainbowEggImage.flush();
|
||||
//Profile.rainbowEggImage = DrawUtils.getBlendedImage(RabiRaceModule.module.panel.getGraphics().create(), RabiRaceModule.image_map.get("easter_egg.png"), RabiRaceModule.rainbowcycler.getCycleColor(), RabiRaceModule.window);
|
||||
if (window!=null) {
|
||||
window.run();
|
||||
}
|
||||
@ -302,6 +306,7 @@ public class RabiRaceModule extends Module{
|
||||
//System.out.println("Called.");
|
||||
int paused = readIntFromMemory(MemoryOffset.PAUSED);
|
||||
float itempct = readFloatFromMemory(MemoryOffset.ITEM_PERCENT);
|
||||
myProfile.oldProfile.isPaused = myProfile.isPaused;
|
||||
myProfile.isPaused = paused==1;
|
||||
//System.out.println(itempct+","+paused);
|
||||
if (paused==0 && itempct>=0) {
|
||||
@ -324,8 +329,16 @@ public class RabiRaceModule extends Module{
|
||||
if (myProfile.compareAllChangedValues()>0) {
|
||||
myProfile.image_display_update_required=true;
|
||||
}
|
||||
if (myProfile.compareAllChangedStatValues()>0) {
|
||||
myProfile.stat_update_required=true;
|
||||
}
|
||||
myProfile.oldProfile.avatarval = myProfile.avatar.value;
|
||||
firstUpdate=false;
|
||||
} else
|
||||
if (myProfile.compareAllChangedStatValues()>0) {
|
||||
myProfile.archiveAllValues();
|
||||
myProfile.oldProfile.avatarval = myProfile.avatar.value;
|
||||
myProfile.stat_update_required=true;
|
||||
}
|
||||
if (mySession!=null) {
|
||||
for (Profile p : mySession.getPlayers()) {
|
||||
@ -342,8 +355,13 @@ public class RabiRaceModule extends Module{
|
||||
public void ApplyConfigWindowProperties() {
|
||||
sigIRC.rabiracemodule_X=(int)position.getX();
|
||||
sigIRC.rabiracemodule_Y=(int)position.getY();
|
||||
sigIRC.rabiracemodule_width=(int)position.getWidth();
|
||||
sigIRC.rabiracemodule_height=(int)position.getHeight();
|
||||
sigIRC.config.setInteger("RABIRACE_module_X", sigIRC.rabiracemodule_X);
|
||||
sigIRC.config.setInteger("RABIRACE_module_Y", sigIRC.rabiracemodule_Y);
|
||||
sigIRC.config.setInteger("RABIRACE_module_width", sigIRC.rabiracemodule_width);
|
||||
sigIRC.config.setInteger("RABIRACE_module_height", sigIRC.rabiracemodule_height);
|
||||
sigIRC.config.saveProperties();
|
||||
}
|
||||
|
||||
/*public int readIntFromErinaData(MemoryOffset val) {
|
||||
@ -439,29 +457,29 @@ public class RabiRaceModule extends Module{
|
||||
super.draw(g);
|
||||
|
||||
if (!foundRabiRibi) {
|
||||
DrawUtils.drawTextFont(g, sigIRC.userFont, position.getX(), position.getY()+26, Color.BLACK, "Rabi-Ribi not found! Please start it.");
|
||||
DrawUtils.drawTextFont(g, sigIRC.userFont, 0, 0+26, Color.BLACK, "Rabi-Ribi not found! Please start it.");
|
||||
} else {
|
||||
//myProfile.draw(g);
|
||||
Image panel = myProfile.getStatPanel((int)position.getWidth(),mySession);
|
||||
|
||||
if (sigIRC.panel.lastMouseX>=position.getX() &&
|
||||
sigIRC.panel.lastMouseX<=position.getX()+(int)((position.getWidth()/400)*50) &&
|
||||
sigIRC.panel.lastMouseY>=position.getY() &&
|
||||
sigIRC.panel.lastMouseY<=position.getY()+(int)(((position.getWidth()/400)*50))) {
|
||||
Image panel = myProfile.getStatPanel((int)position.getWidth()-24,mySession);
|
||||
//System.out.println(ProgramWindow.frame.lastMouseX+","+ProgramWindow.frame.lastMouseY+";"+position.getX()+","+position.getY());
|
||||
if (ProgramWindow.frame.lastMouseX>=position.getX() &&
|
||||
ProgramWindow.frame.lastMouseX<=position.getX()+(int)((position.getWidth()/400)*50) &&
|
||||
ProgramWindow.frame.lastMouseY>=position.getY()+Module.WINDOW_EXTRA_BORDER &&
|
||||
ProgramWindow.frame.lastMouseY<=position.getY()+Module.WINDOW_EXTRA_BORDER+(int)(((position.getWidth()/400)*50))) {
|
||||
mouseoverAvatar=true;
|
||||
Color ident = g.getColor();
|
||||
g.setColor(new Color(196,196,196,128));
|
||||
g.fillRect((int)(position.getX()+1), (int)(position.getY()+1), (int)((position.getWidth()/400)*50), (int)((position.getWidth()/400)*50));
|
||||
g.fillRect((int)(0+1), (int)(0+1), (int)((position.getWidth()/400)*50), (int)((position.getWidth()/400)*50));
|
||||
g.setColor(ident);
|
||||
//System.out.println("Mouse over avatar.");
|
||||
} else {
|
||||
mouseoverAvatar=false;
|
||||
}
|
||||
|
||||
g.drawImage(panel, (int)position.getX(), (int)position.getY(), sigIRC.panel);
|
||||
g.drawImage(myProfile.getStatText((int)position.getWidth(),mySession), (int)position.getX(), (int)position.getY(), sigIRC.panel);
|
||||
g.drawImage(panel, (int)0, (int)0, module.panel);
|
||||
g.drawImage(myProfile.getStatText((int)position.getWidth()-24,mySession), (int)0, (int)0, module.panel);
|
||||
|
||||
//Profile.DrawMultiPanel(g, (int)(position.getX()), (int)(position.getY())+panel.getHeight(sigIRC.panel), (int)position.getWidth(), testing);
|
||||
//Profile.DrawMultiPanel(g, (int)(0), (int)(0)+panel.getHeight(sigIRC.panel), (int)position.getWidth(), testing);
|
||||
if (mySession!=null) {
|
||||
List<Profile> sessionPlayers = new ArrayList<Profile>();
|
||||
for (Profile p : mySession.getPlayers()) {
|
||||
@ -470,7 +488,7 @@ public class RabiRaceModule extends Module{
|
||||
//System.out.println("Found unique player "+p);
|
||||
}
|
||||
}
|
||||
Profile.DrawMultiPanel(g, (int)(position.getX()), (int)(position.getY())+panel.getHeight(sigIRC.panel), (int)position.getWidth(), mySession);
|
||||
Profile.DrawMultiPanel(g, (int)(0), (int)(0)+panel.getHeight(module.panel), (int)position.getWidth()-24, mySession);
|
||||
}
|
||||
|
||||
if (firstCheck) {
|
||||
@ -480,7 +498,7 @@ public class RabiRaceModule extends Module{
|
||||
}
|
||||
}
|
||||
g.setColor(Color.BLACK);
|
||||
g.fillRect((int)(position.getX()), (int)(position.getY()+position.getHeight()-28-20), (int)(position.getWidth()), 20);
|
||||
g.fillRect((int)(0), (int)(0+position.getHeight()-28-20), (int)(position.getWidth()), 20);
|
||||
for (int i=0;i<messages.size();i++) {
|
||||
messages.get(i).draw(g);
|
||||
}
|
||||
@ -512,7 +530,7 @@ public class RabiRaceModule extends Module{
|
||||
|
||||
public void draw(Graphics g) {
|
||||
if (x<position.getWidth()) {
|
||||
DrawUtils.drawOutlineText(g, sigIRC.rabiRibiTinyDisplayFont, position.getX()+x, position.getY()+y-6, 2, Color.WHITE, Color.GRAY, msg);
|
||||
DrawUtils.drawOutlineText(g, sigIRC.rabiRibiTinyDisplayFont, 0+x, 0+y-6, 2, Color.WHITE, Color.GRAY, msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -14,6 +14,7 @@ import sig.Module;
|
||||
import sig.TextRow;
|
||||
import sig.sigIRC;
|
||||
import sig.utils.FileUtils;
|
||||
import sig.windows.ProgramWindow;
|
||||
|
||||
public class ScrollingChatModule extends Module{
|
||||
|
||||
@ -76,7 +77,7 @@ public class ScrollingChatModule extends Module{
|
||||
for (int i=0;i<sigIRC.textobj.size();i++) {
|
||||
if (sigIRC.textobj.get(i).isActive()) {
|
||||
if (sigIRC.overlayMode) {
|
||||
if (!sigIRC.textobj.get(i).intersects((int)(sigIRC.panel.lastMouseX-position.getX()),(int)(sigIRC.panel.lastMouseY-position.getY()))) {
|
||||
if (!sigIRC.textobj.get(i).intersects((int)(ProgramWindow.frame.lastMouseX-position.getX()),(int)(ProgramWindow.frame.lastMouseY-position.getY()))) {
|
||||
sigIRC.textobj.get(i).setVisible(true);
|
||||
sigIRC.textobj.get(i).draw(g);
|
||||
} else {
|
||||
|
@ -377,6 +377,7 @@ public class sigIRC{
|
||||
public static void DownloadProgramUpdate() {
|
||||
//System.out.println("Last commit size was "+GithubUtils.getSizeOfFileFromLatestGithubCommit("sigIRCv2.jar")+"B");
|
||||
if (autoUpdateProgram==0) {
|
||||
Thread t = new Thread(()->{
|
||||
File updatedir = new File(sigIRC.BASEDIR+"sigIRC/updates/");
|
||||
updatedir.mkdirs();
|
||||
File controllerdir = new File(ControllerModule.CONTROLLERPATH);
|
||||
@ -398,6 +399,8 @@ public class sigIRC{
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
});
|
||||
t.start();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -106,6 +106,17 @@ public class DrawUtils {
|
||||
}
|
||||
}
|
||||
|
||||
public static Image getBlendedImage(Graphics g, Image img, Color blend_col, ImageObserver source) {
|
||||
BufferedImage tmp = new BufferedImage(img.getWidth(source),img.getHeight(source),BufferedImage.TYPE_INT_ARGB);
|
||||
Graphics2D g2 = tmp.createGraphics();
|
||||
g2.drawImage(img, 0, 0, null);
|
||||
g2.setComposite(AlphaComposite.SrcAtop);
|
||||
g2.setColor(blend_col);
|
||||
g2.fillRect(0, 0, img.getWidth(source), img.getHeight(source));
|
||||
g2.dispose();
|
||||
return tmp;
|
||||
}
|
||||
|
||||
public static void drawImage(Graphics g, Image img, double x, double y, Color blend_col, ImageObserver source) {
|
||||
BufferedImage tmp = new BufferedImage(img.getWidth(source),img.getHeight(source),BufferedImage.TYPE_INT_ARGB);
|
||||
Graphics2D g2 = tmp.createGraphics();
|
||||
|
@ -108,6 +108,7 @@ public class IntroDialog extends JFrame{
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
|
||||
moduleButtons = new ModuleButton[]{
|
||||
new ModuleButton("Scrolling Chat"),
|
||||
new ModuleButton("Chat Log"),
|
||||
|
@ -10,11 +10,11 @@ import javax.swing.event.ChangeListener;
|
||||
import sig.Module;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
class ModuleButton extends JToggleButton{
|
||||
class ModuleSelectButton extends JToggleButton{
|
||||
String label = "";
|
||||
ModuleButton button;
|
||||
ModuleSelectButton button;
|
||||
Module myModule;
|
||||
public ModuleButton(String label, Module module) {
|
||||
public ModuleSelectButton(String label, Module module) {
|
||||
this.label=label;
|
||||
this.button=this;
|
||||
this.myModule=module;
|
@ -3,6 +3,7 @@ package sig.windows;
|
||||
import java.awt.Color;
|
||||
import java.awt.GridLayout;
|
||||
import java.awt.Image;
|
||||
import java.awt.MouseInfo;
|
||||
import java.awt.Rectangle;
|
||||
import java.awt.geom.Rectangle2D;
|
||||
import java.io.File;
|
||||
@ -33,6 +34,7 @@ import sig.Module;
|
||||
import sig.MyPanel;
|
||||
import sig.sigIRC;
|
||||
import sig.modules.ChatLogModule;
|
||||
import sig.modules.RabiRaceModule;
|
||||
import sig.modules.ScrollingChatModule;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
@ -40,9 +42,16 @@ public class ProgramWindow extends JFrame{
|
||||
|
||||
public static Icon deselected_icon,selected_icon;
|
||||
|
||||
List<ModuleButton> buttons = new ArrayList<ModuleButton>();
|
||||
List<ModuleSelectButton> buttons = new ArrayList<ModuleSelectButton>();
|
||||
|
||||
public int lastMouseX = 0;
|
||||
|
||||
public int lastMouseY = 0;
|
||||
|
||||
public static ProgramWindow frame;
|
||||
|
||||
public ProgramWindow() {
|
||||
ProgramWindow.frame=this;
|
||||
ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1);
|
||||
scheduler.scheduleWithFixedDelay(()->{
|
||||
if (sigIRC.configNeedsUpdating>0 &&
|
||||
@ -51,6 +60,10 @@ public class ProgramWindow extends JFrame{
|
||||
sigIRC.configNeedsUpdating=0;
|
||||
}
|
||||
},1000,1000,TimeUnit.MILLISECONDS);
|
||||
scheduler.scheduleWithFixedDelay(()->{
|
||||
lastMouseX = (int)(MouseInfo.getPointerInfo().getLocation().getX());
|
||||
lastMouseY = (int)(MouseInfo.getPointerInfo().getLocation().getY());
|
||||
},(long)((1d/(sigIRC.framerate+1))*1000),(long)((1d/(sigIRC.framerate+1))*1000),TimeUnit.MILLISECONDS);
|
||||
|
||||
try {
|
||||
sigIRC.programIcon = ImageIO.read(sigIRC.class.getResource("/resource/sigIRCicon.png"));
|
||||
@ -69,6 +82,7 @@ public class ProgramWindow extends JFrame{
|
||||
JFrame.setDefaultLookAndFeelDecorated(true);
|
||||
}
|
||||
System.setProperty("sun.java2d.opengl", Boolean.toString(sigIRC.hardwareAcceleration));
|
||||
System.setProperty("sun.java2d.d3d",Boolean.toString(true));
|
||||
JFrame f = new JFrame("sigIRCv2");
|
||||
this.setAutoRequestFocus(true);
|
||||
this.toFront();
|
||||
@ -93,28 +107,29 @@ public class ProgramWindow extends JFrame{
|
||||
|
||||
if (!sigIRC.disableChatMessages) {
|
||||
ScrollingChatModule mod = new ScrollingChatModule(new Rectangle((int)sigIRC.scrollingchatmodule_X,(int)sigIRC.scrollingchatmodule_Y,(int)sigIRC.scrollingchatmodule_width,(int)sigIRC.scrollingchatmodule_height),"Scrolling Chat");
|
||||
ModuleButton button = new ModuleButton("Scrolling Chat",mod);
|
||||
ModuleSelectButton button = new ModuleSelectButton("Scrolling Chat",mod);
|
||||
sigIRC.panel.add(button);
|
||||
}
|
||||
if (sigIRC.chatlogmodule_enabled) {
|
||||
ChatLogModule mod = new ChatLogModule(new Rectangle(sigIRC.chatlogmodule_X,sigIRC.chatlogmodule_Y,sigIRC.chatlogmodule_width,sigIRC.chatlogmodule_height),"Chat Log");
|
||||
ModuleButton button = new ModuleButton("Chat Log",mod);
|
||||
ModuleSelectButton button = new ModuleSelectButton("Chat Log",mod);
|
||||
sigIRC.panel.add(button);
|
||||
}
|
||||
if (sigIRC.controllermodule_enabled) {
|
||||
ModuleButton button = new ModuleButton("Controller",new Module(new Rectangle(0,0,0,0),"Test"));
|
||||
ModuleSelectButton button = new ModuleSelectButton("Controller",new Module(new Rectangle(0,0,0,0),"Test"));
|
||||
sigIRC.panel.add(button);
|
||||
}
|
||||
if (sigIRC.twitchmodule_enabled) {
|
||||
ModuleButton button = new ModuleButton("Twitch",new Module(new Rectangle(0,0,0,0),"Test"));
|
||||
ModuleSelectButton button = new ModuleSelectButton("Twitch",new Module(new Rectangle(0,0,0,0),"Test"));
|
||||
sigIRC.panel.add(button);
|
||||
}
|
||||
if (sigIRC.rabiracemodule_enabled) {
|
||||
ModuleButton button = new ModuleButton("Rabi-Race",new Module(new Rectangle(0,0,0,0),"Test"));
|
||||
RabiRaceModule mod = new RabiRaceModule(new Rectangle((int)sigIRC.rabiracemodule_X,(int)sigIRC.rabiracemodule_Y,(int)sigIRC.rabiracemodule_width,(int)sigIRC.rabiracemodule_height),"Rabi Race");
|
||||
ModuleSelectButton button = new ModuleSelectButton("Rabi-Race",mod);
|
||||
sigIRC.panel.add(button);
|
||||
}
|
||||
if (sigIRC.touhoumothermodule_enabled) {
|
||||
ModuleButton button = new ModuleButton("Touhou Mother",new Module(new Rectangle(0,0,0,0),"Test"));
|
||||
ModuleSelectButton button = new ModuleSelectButton("Touhou Mother",new Module(new Rectangle(0,0,0,0),"Test"));
|
||||
sigIRC.panel.add(button);
|
||||
}
|
||||
GridLayout myLayout = new GridLayout(0,1);
|
||||
@ -133,7 +148,8 @@ public class ProgramWindow extends JFrame{
|
||||
//this.add(colorpanel);
|
||||
this.setLocationByPlatform(true);
|
||||
this.add(sigIRC.panel);
|
||||
this.pack();
|
||||
//this.pack();
|
||||
this.setSize(240, 640);
|
||||
this.setVisible(true);
|
||||
//this.setLocation(sigIRC.windowX, sigIRC.windowY);
|
||||
//this.setSize(sigIRC.windowWidth, sigIRC.windowHeight);
|
||||
|
Loading…
x
Reference in New Issue
Block a user