Fixed bugs with message displays / emote display. Reordered depth of

drawn elements.
dev
sigonasr2 7 years ago
parent 222de35e80
commit 38c354df54
  1. BIN
      sigIRCv2.jar
  2. 23
      src/sig/MyPanel.java
  3. 11
      src/sig/modules/ChatLog/ChatLogMessage.java

Binary file not shown.

@ -59,14 +59,6 @@ public class MyPanel extends JPanel implements MouseListener, ActionListener, Mo
super.paintComponent(g); super.paintComponent(g);
// Draw Text // Draw Text
//int counter=18; //int counter=18;
for (int i=0;i<sigIRC.twitchemoticons.size();i++) {
if (sigIRC.twitchemoticons.get(i).isActive() &&
sigIRC.twitchemoticons.get(i).textRefIsVisible()) {
sigIRC.twitchemoticons.get(i).draw(g);
} else {
break;
}
}
if (sigIRC.panel!=null) { if (sigIRC.panel!=null) {
lastMouseX = (int)(MouseInfo.getPointerInfo().getLocation().getX()-sigIRC.panel.getLocationOnScreen().getX()); lastMouseX = (int)(MouseInfo.getPointerInfo().getLocation().getX()-sigIRC.panel.getLocationOnScreen().getX());
lastMouseY = (int)(MouseInfo.getPointerInfo().getLocation().getY()-sigIRC.panel.getLocationOnScreen().getY()); lastMouseY = (int)(MouseInfo.getPointerInfo().getLocation().getY()-sigIRC.panel.getLocationOnScreen().getY());
@ -84,6 +76,11 @@ public class MyPanel extends JPanel implements MouseListener, ActionListener, Mo
for (Module m : sigIRC.modules) { for (Module m : sigIRC.modules) {
m.draw(g); m.draw(g);
} }
for (int i=0;i<sigIRC.chatlogtwitchemoticons.size();i++) {
if (sigIRC.chatlogtwitchemoticons.get(i).textRefIsVisible()) {
sigIRC.chatlogtwitchemoticons.get(i).draw(g);
}
}
for (int i=0;i<sigIRC.textobj.size();i++) { for (int i=0;i<sigIRC.textobj.size();i++) {
if (sigIRC.textobj.get(i).isActive()) { if (sigIRC.textobj.get(i).isActive()) {
if (sigIRC.overlayMode) { if (sigIRC.overlayMode) {
@ -99,9 +96,12 @@ public class MyPanel extends JPanel implements MouseListener, ActionListener, Mo
} }
} }
} }
for (int i=0;i<sigIRC.chatlogtwitchemoticons.size();i++) { for (int i=0;i<sigIRC.twitchemoticons.size();i++) {
if (sigIRC.chatlogtwitchemoticons.get(i).textRefIsVisible()) { if (sigIRC.twitchemoticons.get(i).isActive() &&
sigIRC.chatlogtwitchemoticons.get(i).draw(g); sigIRC.twitchemoticons.get(i).textRefIsVisible()) {
sigIRC.twitchemoticons.get(i).draw(g);
} else {
break;
} }
} }
if (!sigIRC.overlayMode) { if (!sigIRC.overlayMode) {
@ -161,7 +161,6 @@ public class MyPanel extends JPanel implements MouseListener, ActionListener, Mo
@Override @Override
public void keyTyped(KeyEvent e) { public void keyTyped(KeyEvent e) {
} }
@Override @Override

@ -49,7 +49,9 @@ public class ChatLogMessage {
usernameWidth = (int)TextUtils.calculateStringBoundsFont(this.username, sigIRC.panel.userFont).getWidth(); usernameWidth = (int)TextUtils.calculateStringBoundsFont(this.username, sigIRC.panel.userFont).getWidth();
} }
for (int i=0;i<displayMessage.size();i++) { for (int i=0;i<displayMessage.size();i++) {
displayMessage.set(i, ReplaceMessageWithEmoticons(displayMessage.get(i)+" ",(i==0)?usernameWidth:0,i*MESSAGE_SPACING)); //System.out.println("displayMessage["+i+"] before: "+displayMessage.get(i));
displayMessage.set(i, ReplaceMessageWithEmoticons(" "+displayMessage.get(i)+" ",(i==0)?usernameWidth:0,i*MESSAGE_SPACING));
//System.out.println("displayMessage["+i+"] after: "+displayMessage.get(i));
} }
} }
@ -58,9 +60,10 @@ public class ChatLogMessage {
while (marker<basemsg.length()) { while (marker<basemsg.length()) {
//Find a space. //Find a space.
int space = basemsg.indexOf(" ", marker+1); int space = basemsg.indexOf(" ", marker+1);
//System.out.println(" Marker is at position "+space+" for word \""+basemsg+"\"");
if (space>0) { if (space>0) {
String word = basemsg.substring(marker+1, space); String word = basemsg.substring(marker+1, space);
//System.out.println("Word is '"+word+"'"); //System.out.println(" Word is '"+word+"'");
sigIRC.emoticons.addAll(sigIRC.emoticon_queue); sigIRC.emoticons.addAll(sigIRC.emoticon_queue);
sigIRC.emoticon_queue.clear(); sigIRC.emoticon_queue.clear();
for (Emoticon e : sigIRC.emoticons) { for (Emoticon e : sigIRC.emoticons) {
@ -156,7 +159,7 @@ public class ChatLogMessage {
int textWidth = (int)TextUtils.calculateStringBoundsFont(rawmessage, sigIRC.panel.userFont).getWidth(); int textWidth = (int)TextUtils.calculateStringBoundsFont(rawmessage, sigIRC.panel.userFont).getWidth();
int maxWidth = (int)refModule.getPosition().getWidth()-BORDER_SPACING; int maxWidth = (int)refModule.getPosition().getWidth()-BORDER_SPACING;
do { do {
rawmessage = BreakTextAtNextSection(rawmessage,maxWidth); rawmessage = BreakTextAtNextSection(rawmessage+" ",maxWidth);
textWidth = (int)TextUtils.calculateStringBoundsFont(rawmessage, sigIRC.panel.userFont).getWidth(); textWidth = (int)TextUtils.calculateStringBoundsFont(rawmessage, sigIRC.panel.userFont).getWidth();
} while (textWidth>maxWidth); } while (textWidth>maxWidth);
if (rawmessage.length()>0) { if (rawmessage.length()>0) {
@ -177,7 +180,7 @@ public class ChatLogMessage {
if (textWidth<maxWidth) { if (textWidth<maxWidth) {
marker = tempmarker+1; marker = tempmarker+1;
} }
//System.out.println(msg.substring(0, marker)+" | "+textWidth); System.out.println(msg.substring(0, marker)+" | "+textWidth);
} else { } else {
marker=msg.length(); marker=msg.length();
break; break;

Loading…
Cancel
Save