diff --git a/.classpath b/.classpath
index 2c36777..64f67fc 100644
--- a/.classpath
+++ b/.classpath
@@ -5,15 +5,15 @@
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
diff --git a/sigIRCv2.jar b/sigIRCv2.jar
index c5390b5..b37344f 100644
Binary files a/sigIRCv2.jar and b/sigIRCv2.jar differ
diff --git a/src/sig/Module.java b/src/sig/Module.java
index 2e1ca5e..911d686 100644
--- a/src/sig/Module.java
+++ b/src/sig/Module.java
@@ -11,14 +11,20 @@ import java.awt.event.WindowEvent;
import java.awt.geom.Rectangle2D;
import java.awt.image.BufferedImage;
import java.util.Vector;
+import java.util.concurrent.Executors;
+import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.TimeUnit;
+import javax.swing.JFrame;
+import javax.swing.JPanel;
import javax.swing.SwingUtilities;
import sig.utils.DrawUtils;
import sig.utils.TextUtils;
-public class Module {
- public Rectangle2D position;
+public class Module extends JFrame{
+ public JPanel panel;
+ public Rectangle position;
protected boolean enabled;
protected String name;
public static BufferedImage IMG_DRAGBAR;
@@ -30,16 +36,34 @@ public class Module {
Point dragOffset;
boolean dragging=false;
public static boolean DRAGGING=false;
+ public Graphics myGraphics;
- public Module(Rectangle2D bounds, String moduleName) {
+ public Module(Rectangle bounds, String moduleName) {
this.position = bounds;
this.name = moduleName;
this.enabled=true;
+ this.setVisible(true);
+ panel = new JPanel(){
+ public void paintComponent(Graphics g) {
+ super.paintComponent(g);
+ draw(g);
+ }
+ };
this.titleHeight = (int)TextUtils.calculateStringBoundsFont(this.name, sigIRC.userFont).getHeight();
+
+ this.setSize((int)position.getWidth(), (int)position.getHeight());
+ panel.setSize(this.getSize());
+
+ this.add(panel);
+
+ ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1);
+ scheduler.scheduleWithFixedDelay(()->{
+ panel.repaint();
+ },(long)((1d/sigIRC.framerate)*1000),(long)((1d/sigIRC.framerate)*1000),TimeUnit.MILLISECONDS);
}
- public Module(Rectangle2D bounds, String moduleName, boolean enabled) {
+ public Module(Rectangle bounds, String moduleName, boolean enabled) {
this(bounds, moduleName);
this.enabled=enabled;
}
@@ -132,12 +156,9 @@ public class Module {
}
public void draw(Graphics g) {
- drawModuleHeader(g);
- /*SwingUtilities.invokeLater(new Runnable() {
- public void run() {
- sigIRC.panel.repaint(getDrawBounds().getBounds());
- }
- });*/
+ g.fillRect(0, 0, (int)position.getWidth(), (int)position.getHeight());
+ DrawUtils.drawText(g, 0, 16, Color.WHITE, "Test");
+ System.out.println("Test");
}
private void drawModuleHeader(Graphics g) {
diff --git a/src/sig/MyPanel.java b/src/sig/MyPanel.java
index 9aa8e8e..4e80787 100644
--- a/src/sig/MyPanel.java
+++ b/src/sig/MyPanel.java
@@ -46,9 +46,9 @@ public class MyPanel extends JPanel implements MouseListener, ActionListener, Mo
setFocusable(true);
}
- public Dimension getPreferredSize() {
+ /*public Dimension getPreferredSize() {
return new Dimension(1280,480);
- }
+ }*/
public void paintComponent(Graphics g) {
super.paintComponent(g);
@@ -68,6 +68,7 @@ public class MyPanel extends JPanel implements MouseListener, ActionListener, Mo
lastMouseY = -1;
}*/
//
+ /*
for (Module m : sigIRC.modules) {
m.draw(g);
}
@@ -98,10 +99,7 @@ public class MyPanel extends JPanel implements MouseListener, ActionListener, Mo
} else {
break;
}
- }
- if (!sigIRC.overlayMode && sigIRC.button!=null) {
- sigIRC.button.draw(g);
- }
+ }*/
}
public void addMessage(String message) {
@@ -125,7 +123,6 @@ public class MyPanel extends JPanel implements MouseListener, ActionListener, Mo
for (Module m : sigIRC.modules) {
m.mouseModuleMousePress(ev);
}
- sigIRC.button.onClickEvent(ev);
}
@Override
@@ -192,10 +189,6 @@ public class MyPanel extends JPanel implements MouseListener, ActionListener, Mo
sigIRC.config.setInteger("windowY", sigIRC.windowY);
sigIRC.config.setInteger("windowWidth", sigIRC.windowWidth);
sigIRC.config.setInteger("windowHeight", sigIRC.windowHeight);
- if (sigIRC.button!=null) {
- sigIRC.button.x = sigIRC.panel.getX()+sigIRC.panel.getWidth()-96;
- sigIRC.button.y = 64+sigIRC.rowobj.size()*sigIRC.rowSpacing;
- }
//com.repaint();
//sigIRC.panel.repaint();
sigIRC.config.saveProperties();
diff --git a/src/sig/sigIRC.java b/src/sig/sigIRC.java
index d598de1..708ae27 100644
--- a/src/sig/sigIRC.java
+++ b/src/sig/sigIRC.java
@@ -102,7 +102,7 @@ public class sigIRC{
static boolean dingEnabled=true;
static int dingThreshold;
public static Color backgroundcol;
- public static BackgroundColorButton button;
+ //public static BackgroundColorButton button;
public static ProgramWindow window;
public static boolean overlayMode=false;
public static boolean showWindowControls=false;
@@ -165,6 +165,7 @@ public class sigIRC{
public final static String SUBEMOTELISTFILE = "sigIRC/subemotes.json";
public static long channel_id = -1;
public static int lastSubEmoteUpdate = -1;
+ public static int framerate = 30;
public static int autoUpdateProgram = 0; //0 = Auto Update, 1 = Notify, 2 = Disabled
public static Image programIcon;
final public static int MAX_CONNECTION_RETRIES = 100;
@@ -182,6 +183,17 @@ public class sigIRC{
static int lastWindowX = 0;
static int lastWindowY = 0;
+ final public static Font rabiRibiTinyDisplayFont = new Font("CP Font",0,12);
+
+ final public static Font rabiRibiMoneyDisplayFont = new Font("CP Font",0,16);
+
+ final public static Font smallFont = new Font(touhoumotherConsoleFont,0,12);
+
+ final public static Font userFont = new Font(usernameFont,0,16);
+
+ //List messages = new ArrayList();
+ final public static Font programFont = new Font(messageFont,0,24);
+
public static Twitch manager = new Twitch();
public static void main(String[] args) {
@@ -249,6 +261,7 @@ public class sigIRC{
autoUpdateProgram = config.getInteger("Auto_Update_Program", 0);
disableChatMessages = config.getBoolean("Disable_Chat_Messages", false);
lastSubEmoteUpdate = config.getInteger("lastSubEmote_APIUpdate",Calendar.getInstance().get(Calendar.DAY_OF_YEAR));
+ framerate = config.getInteger("Max_FPS",30);
manager.setClientId("o4c2x0l3e82scgar4hpxg6m5dfjbem");
//System.out.println(manager.auth().hasAccessToken());
@@ -622,7 +635,7 @@ public class sigIRC{
f.setIconImage(programIcon);
- button = new BackgroundColorButton(new File(sigIRC.BASEDIR+"backcolor.png"),panel.getX()+panel.getWidth()-96,64+rowobj.size()*rowSpacing);
+ //button = new BackgroundColorButton(new File(sigIRC.BASEDIR+"backcolor.png"),panel.getX()+panel.getWidth()-96,64+rowobj.size()*rowSpacing);
if (sigIRC.overlayMode) {
f.setBackground(new Color(0,0,0,0));
f.setAlwaysOnTop(true);
@@ -652,15 +665,4 @@ public class sigIRC{
public static void createEmoticon(Emoticon emote, ChatLogMessage textref, int x, int y) {
chatlogtwitchemoticons.add(new ChatLogTwitchEmote(emote,textref,x,y));
}
-
- final public static Font rabiRibiTinyDisplayFont = new Font("CP Font",0,12);
-
- final public static Font rabiRibiMoneyDisplayFont = new Font("CP Font",0,16);
-
- final public static Font smallFont = new Font(touhoumotherConsoleFont,0,12);
-
- final public static Font userFont = new Font(usernameFont,0,16);
-
- //List messages = new ArrayList();
- final public static Font programFont = new Font(messageFont,0,24);
}
diff --git a/src/sig/windows/ProgramWindow.java b/src/sig/windows/ProgramWindow.java
index 87dab75..27227c3 100644
--- a/src/sig/windows/ProgramWindow.java
+++ b/src/sig/windows/ProgramWindow.java
@@ -1,22 +1,30 @@
package sig.windows;
import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.GridLayout;
+import java.awt.Image;
+import java.awt.Rectangle;
+import java.awt.geom.Rectangle2D;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import javax.imageio.ImageIO;
+import javax.swing.BoxLayout;
import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JFrame;
+import javax.swing.JLabel;
import javax.swing.JToggleButton;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import sig.BackgroundColorButton;
import sig.ColorPanel;
+import sig.Module;
import sig.MyPanel;
import sig.sigIRC;
@@ -27,6 +35,13 @@ public class ProgramWindow extends JFrame{
List buttons = new ArrayList();
public ProgramWindow() {
+
+ try {
+ sigIRC.programIcon = ImageIO.read(new File(sigIRC.BASEDIR+"/sigIRC/sigIRCicon.png"));
+ } catch (IOException e1) {
+ e1.printStackTrace();
+ }
+
try {
deselected_icon = new ImageIcon(ImageIO.read(sigIRC.class.getResource("/resource/deselected_button.png")));
selected_icon = new ImageIcon(ImageIO.read(sigIRC.class.getResource("/resource/selected_button.png")));
@@ -45,23 +60,57 @@ public class ProgramWindow extends JFrame{
if (sigIRC.overlayMode && !sigIRC.showWindowControls) {
this.setUndecorated(true);
}
+
+
sigIRC.panel = new MyPanel();
+
+ JLabel myLabel = new JLabel("Module Control:");
if (sigIRC.overlayMode) {
sigIRC.panel.setOpaque(false);
}
- sigIRC.panel.setBackground(sigIRC.backgroundcol);
+ sigIRC.panel.setBackground(Color.BLACK);
+ myLabel.setBackground(sigIRC.panel.getBackground());
+ myLabel.setForeground(Color.WHITE);
+ myLabel.setIcon(new ImageIcon(sigIRC.programIcon.getScaledInstance(48, 48, Image.SCALE_AREA_AVERAGING)));
+
+ sigIRC.panel.add(myLabel);
if (!sigIRC.disableChatMessages) {
-
+ ModuleButton button = new ModuleButton("Scrolling Chat");
+ sigIRC.panel.add(button);
+ }
+ if (sigIRC.chatlogmodule_enabled) {
+ ModuleButton button = new ModuleButton("Chat Log");
+ sigIRC.panel.add(button);
+ }
+ if (sigIRC.controllermodule_enabled) {
+ ModuleButton button = new ModuleButton("Controller");
+ sigIRC.panel.add(button);
+ }
+ if (sigIRC.twitchmodule_enabled) {
+ ModuleButton button = new ModuleButton("Twitch");
+ sigIRC.panel.add(button);
}
+ if (sigIRC.rabiracemodule_enabled) {
+ ModuleButton button = new ModuleButton("Rabi-Race");
+ sigIRC.panel.add(button);
+ sigIRC.panel.add(new ModuleButton("Rabi-Race"));
+ }
+ if (sigIRC.touhoumothermodule_enabled) {
+ ModuleButton button = new ModuleButton("Touhou Mother");
+ sigIRC.panel.add(button);
+ }
+ GridLayout myLayout = new GridLayout(0,1);
+ sigIRC.panel.setLayout(myLayout);
//colorpanel = new ColorPanel();
//this.add(colorpanel);
+ this.setLocationByPlatform(true);
this.add(sigIRC.panel);
this.pack();
this.setVisible(true);
- this.setLocation(sigIRC.windowX, sigIRC.windowY);
- this.setSize(sigIRC.windowWidth, sigIRC.windowHeight);
+ //this.setLocation(sigIRC.windowX, sigIRC.windowY);
+ //this.setSize(sigIRC.windowWidth, sigIRC.windowHeight);
this.setIconImage(sigIRC.programIcon);
@@ -72,6 +121,8 @@ public class ProgramWindow extends JFrame{
}
//this.setOpacity(0.5f);
this.addWindowListener(sigIRC.panel);
+
+ Module testMod = new Module(new Rectangle(0,0,640,480),"Test");
}
}
@@ -82,10 +133,15 @@ class ModuleButton extends JToggleButton {
this.label=label;
this.button=this;
this.setBackground(Color.DARK_GRAY);
- button.setForeground(Color.GRAY);
- button.setIconTextGap(4);
- button.setIcon(IntroDialog.deselected_icon);
- button.setSelectedIcon(IntroDialog.selected_icon);
+ this.setText(label);
+ this.setToolTipText("Click to enable and disable the \n"+label+" module.");
+ this.setPreferredSize(new Dimension(160,56));
+ this.setForeground(Color.GRAY);
+ this.setIconTextGap(4);
+ this.setIcon(ProgramWindow.deselected_icon);
+ this.setSelectedIcon(ProgramWindow.selected_icon);
+ this.setSelected(true);
+ button.setForeground(Color.BLUE);
this.addChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {