diff --git a/sigIRCv2.jar b/sigIRCv2.jar index 3d9cf33..128d61f 100644 Binary files a/sigIRCv2.jar and b/sigIRCv2.jar differ diff --git a/src/sig/Module.java b/src/sig/Module.java index 2558a6e..fb45b4f 100644 --- a/src/sig/Module.java +++ b/src/sig/Module.java @@ -53,7 +53,7 @@ public class Module { } private void enableWindowDrag(int mouseX, int mouseY) { - if (!dragging && inDragBounds(mouseX,mouseY) && !DRAGGING) { + if (!sigIRC.overlayMode && !dragging && inDragBounds(mouseX,mouseY) && !DRAGGING) { //Enable dragging. dragOffset = new Point((int)position.getX() - mouseX,(int)position.getY()-mouseY); dragging=DRAGGING=true; @@ -87,13 +87,15 @@ public class Module { } private void modifyCursor() { - int cursortype = sigIRC.panel.getCursor().getType(); - if (inDragZone && - cursortype!=Cursor.MOVE_CURSOR) { - sigIRC.panel.setCursor(new Cursor(Cursor.MOVE_CURSOR)); - } else - if (!inDragZone && cursortype!=Cursor.DEFAULT_CURSOR) { - sigIRC.panel.setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); + if (!sigIRC.overlayMode) { + int cursortype = sigIRC.panel.getCursor().getType(); + if (inDragZone && + cursortype!=Cursor.MOVE_CURSOR) { + sigIRC.panel.setCursor(new Cursor(Cursor.MOVE_CURSOR)); + } else + if (!inDragZone && cursortype!=Cursor.DEFAULT_CURSOR) { + sigIRC.panel.setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); + } } } @@ -135,13 +137,15 @@ public class Module { } private void drawModuleHeader(Graphics g) { - g.drawImage(Module.IMG_DRAGBAR, - (int)position.getX()+2, - (int)position.getY()-Module.IMG_DRAGBAR.getHeight(), - (int)position.getWidth()-4, - Module.IMG_DRAGBAR.getHeight(), - sigIRC.panel); - DrawUtils.drawTextFont(g, sigIRC.panel.smallFont, (int)position.getX(), (int)position.getY()-titleHeight/2+4, Color.BLACK, this.name); + if (!sigIRC.overlayMode) { + g.drawImage(Module.IMG_DRAGBAR, + (int)position.getX()+2, + (int)position.getY()-Module.IMG_DRAGBAR.getHeight(), + (int)position.getWidth()-4, + Module.IMG_DRAGBAR.getHeight(), + sigIRC.panel); + DrawUtils.drawTextFont(g, sigIRC.panel.smallFont, (int)position.getX(), (int)position.getY()-titleHeight/2+4, Color.BLACK, this.name); + } } private Rectangle2D getDrawBounds() { diff --git a/src/sig/MyPanel.java b/src/sig/MyPanel.java index b586101..fe49d42 100644 --- a/src/sig/MyPanel.java +++ b/src/sig/MyPanel.java @@ -81,6 +81,9 @@ public class MyPanel extends JPanel implements MouseListener, ActionListener, Mo lastMouseY = -1; }*/ // + for (Module m : sigIRC.modules) { + m.draw(g); + } for (int i=0;i messages) { + private String DetectUsername(List messages) { if (messages.size()>0) { String username = GetUsername(messages.get(0)); if (username!=null) { - this.username = username; + return username; } } + return null; } private Color GetUserNameColor(String username) { @@ -221,10 +223,12 @@ public class ChatLogMessage { public static void importMessages(String...logContents) { for (String s : logContents) { - if (ChatLogModule.chatlogmodule.messageHistory.size()>=ChatLogModule.messageHistoryCount) { - ChatLogModule.chatlogmodule.messageHistory.remove(0).cleanup(); + if (s!=null) { + if (ChatLogModule.chatlogmodule.messageHistory.size()>=ChatLogModule.messageHistoryCount) { + ChatLogModule.chatlogmodule.messageHistory.remove(0).cleanup(); + } + ChatLogModule.chatlogmodule.messageHistory.add(new ChatLogMessage(s)); } - ChatLogModule.chatlogmodule.messageHistory.add(new ChatLogMessage(s)); } } diff --git a/src/sig/modules/ChatLogModule.java b/src/sig/modules/ChatLogModule.java index d48c88a..dd93eb4 100644 --- a/src/sig/modules/ChatLogModule.java +++ b/src/sig/modules/ChatLogModule.java @@ -18,6 +18,7 @@ import javax.swing.SwingUtilities; import sig.Module; import sig.sigIRC; import sig.modules.ChatLog.ChatLogMessage; +import sig.utils.DrawUtils; import sig.utils.FileUtils; public class ChatLogModule extends Module{ @@ -27,11 +28,13 @@ public class ChatLogModule extends Module{ boolean initialized=false; public static ChatLogModule chatlogmodule; public int scrolllog_yoffset = 0; + public Color backgroundColor; public ChatLogModule(Rectangle2D bounds, String moduleName) { super(bounds, moduleName); //Initialize(); chatlogmodule = this; + backgroundColor = DrawUtils.convertStringToColor(sigIRC.chatlogmodule_backgroundColor); } private void Initialize() { @@ -45,7 +48,7 @@ public class ChatLogModule extends Module{ logContents = Arrays.copyOfRange(logContents, logContents.length-messageHistoryCount-1, logContents.length); } ChatLogMessage.importMessages(logContents); - } + } } public void run() { @@ -72,7 +75,7 @@ public class ChatLogModule extends Module{ public void draw(Graphics g) { super.draw(g); - g.setColor(new Color(195,195,195,255)); + g.setColor(backgroundColor); g.fill3DRect((int)position.getX(), (int)position.getY(), (int)position.getWidth(), (int)position.getHeight(), true); g.setColor(Color.BLACK); for (int i=0; i