Added debug message for avatar mouseover.
This commit is contained in:
parent
c34fce1029
commit
38b8ebd5ff
BIN
sigIRCv2.jar
BIN
sigIRCv2.jar
Binary file not shown.
@ -52,6 +52,10 @@ public class Profile {
|
|||||||
Profile oldProfile;
|
Profile oldProfile;
|
||||||
public boolean isArchive = false;
|
public boolean isArchive = false;
|
||||||
final static Color TEAL = new Color(0,128,128);
|
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 Profile(RabiRaceModule module) {
|
public Profile(RabiRaceModule module) {
|
||||||
this(module,true);
|
this(module,true);
|
||||||
@ -81,55 +85,92 @@ public class Profile {
|
|||||||
oldProfile.playtime = playtime;
|
oldProfile.playtime = playtime;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int compareAllChangedValues() {
|
||||||
|
int count=0;
|
||||||
|
if (oldProfile.healthUps!=healthUps) {
|
||||||
|
count++;
|
||||||
|
}
|
||||||
|
if (oldProfile.attackUps!=attackUps) {
|
||||||
|
count++;
|
||||||
|
}
|
||||||
|
if (oldProfile.manaUps!=manaUps) {
|
||||||
|
count++;
|
||||||
|
}
|
||||||
|
if (oldProfile.regenUps!=regenUps) {
|
||||||
|
count++;
|
||||||
|
}
|
||||||
|
if (oldProfile.packUps!=packUps) {
|
||||||
|
count++;
|
||||||
|
}
|
||||||
|
if (oldProfile.rainbowEggCount!=rainbowEggCount) {
|
||||||
|
count++;
|
||||||
|
}
|
||||||
|
for (MemoryData md : key_items.keySet()) {
|
||||||
|
if ((!oldProfile.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)
|
||||||
|
) {
|
||||||
|
count++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (MemoryData md : badges.keySet()) {
|
||||||
|
if ((!oldProfile.badges.containsKey(md) &&
|
||||||
|
badges.containsKey(md)) || (
|
||||||
|
oldProfile.badges.containsKey(md) &&
|
||||||
|
badges.containsKey(md)) &&
|
||||||
|
oldProfile.badges.get(md)!=badges.get(md)
|
||||||
|
) {
|
||||||
|
count++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return count;
|
||||||
|
}
|
||||||
|
|
||||||
public void compareAndAnnounceAllChangedValues() {
|
public void compareAndAnnounceAllChangedValues() {
|
||||||
//System.out.println(oldProfile.key_items.get(MemoryData.HAMMER)+","+key_items.get(MemoryData.HAMMER));
|
//System.out.println(oldProfile.key_items.get(MemoryData.HAMMER)+","+key_items.get(MemoryData.HAMMER));
|
||||||
|
int changedValueCount = compareAllChangedValues();
|
||||||
|
if (changedValueCount==0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
String announcement = "";
|
String announcement = "";
|
||||||
int count=0;
|
|
||||||
if (oldProfile.healthUps==healthUps-1) {
|
if (oldProfile.healthUps==healthUps-1) {
|
||||||
announcement = "has obtained a Health Up! ("+healthUps+" total)";
|
announcement = "has obtained a Health Up! ("+healthUps+" total)";
|
||||||
count++;
|
|
||||||
}
|
}
|
||||||
if (oldProfile.attackUps==attackUps-1) {
|
if (oldProfile.attackUps==attackUps-1) {
|
||||||
announcement = "has obtained an Attack Up! ("+attackUps+" total)";
|
announcement = "has obtained an Attack Up! ("+attackUps+" total)";
|
||||||
count++;
|
|
||||||
}
|
}
|
||||||
if (oldProfile.manaUps==manaUps-1) {
|
if (oldProfile.manaUps==manaUps-1) {
|
||||||
announcement = "has obtained a Mana Up! ("+manaUps+" total)";
|
announcement = "has obtained a Mana Up! ("+manaUps+" total)";
|
||||||
count++;
|
|
||||||
}
|
}
|
||||||
if (oldProfile.regenUps==regenUps-1) {
|
if (oldProfile.regenUps==regenUps-1) {
|
||||||
announcement = "has obtained a Regen Up! ("+regenUps+" total)";
|
announcement = "has obtained a Regen Up! ("+regenUps+" total)";
|
||||||
count++;
|
|
||||||
}
|
}
|
||||||
if (oldProfile.packUps==packUps-1) {
|
if (oldProfile.packUps==packUps-1) {
|
||||||
announcement = "has obtained a Pack Up! ("+packUps+" total)";
|
announcement = "has obtained a Pack Up! ("+packUps+" total)";
|
||||||
count++;
|
|
||||||
}
|
}
|
||||||
if (oldProfile.rainbowEggCount==rainbowEggCount-1) {
|
if (oldProfile.rainbowEggCount==rainbowEggCount-1) {
|
||||||
if (5-rainbowEggCount==0) {
|
if (5-rainbowEggCount==0) {
|
||||||
announcement = "has obtained 5 Rainbow Eggs! (NAME) has completed the race!";
|
announcement = "has obtained 5 Rainbow Eggs! (NAME) has completed the race!";
|
||||||
count++;
|
|
||||||
} else if (5-rainbowEggCount>0)
|
} else if (5-rainbowEggCount>0)
|
||||||
{
|
{
|
||||||
announcement = "has obtained a Rainbow Egg! ("+Math.max(5-rainbowEggCount, 0)+" to go!)";
|
announcement = "has obtained a Rainbow Egg! ("+Math.max(5-rainbowEggCount, 0)+" to go!)";
|
||||||
count++;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (MemoryData md : key_items.keySet()) {
|
for (MemoryData md : key_items.keySet()) {
|
||||||
if (!oldProfile.key_items.containsKey(md) &&
|
if (!oldProfile.key_items.containsKey(md) &&
|
||||||
key_items.containsKey(md)) {
|
key_items.containsKey(md)) {
|
||||||
announcement = "has obtained "+md.name+"!";
|
announcement = "has obtained "+md.name+"!";
|
||||||
count++;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (MemoryData md : badges.keySet()) {
|
for (MemoryData md : badges.keySet()) {
|
||||||
if (!oldProfile.badges.containsKey(md) &&
|
if (!oldProfile.badges.containsKey(md) &&
|
||||||
badges.containsKey(md)) {
|
badges.containsKey(md)) {
|
||||||
announcement = "has obtained the "+md.name+" badge!";
|
announcement = "has obtained the "+md.name+" badge!";
|
||||||
count++;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (count==1) {
|
if (changedValueCount!=0) {
|
||||||
SendAnnouncement(announcement);
|
SendAnnouncement(announcement);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -285,6 +326,8 @@ public class Profile {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Image getStatText(int w, Session session) {
|
public Image getStatText(int w, Session session) {
|
||||||
|
|
||||||
|
if (statUpdateCacheImage==null || stat_update_required) {
|
||||||
BufferedImage tmp = new BufferedImage(400,175,BufferedImage.TYPE_INT_ARGB);
|
BufferedImage tmp = new BufferedImage(400,175,BufferedImage.TYPE_INT_ARGB);
|
||||||
Graphics2D g2 = tmp.createGraphics();
|
Graphics2D g2 = tmp.createGraphics();
|
||||||
|
|
||||||
@ -305,7 +348,11 @@ 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.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.panel.rabiRibiTinyDisplayFont, (int)(tmp.getWidth()*0.6), 50, 2, Color.WHITE, Color.BLACK, text);
|
DrawUtils.drawCenteredOutlineText(g2, sigIRC.panel.rabiRibiTinyDisplayFont, (int)(tmp.getWidth()*0.6), 50, 2, Color.WHITE, Color.BLACK, text);
|
||||||
|
|
||||||
return tmp.getScaledInstance(w, -1, Image.SCALE_AREA_AVERAGING);
|
statUpdateCacheImage = tmp.getScaledInstance(w, -1, Image.SCALE_AREA_AVERAGING);
|
||||||
|
//stat_update_required = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return statUpdateCacheImage;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Color GetDifficultyColor() {
|
private Color GetDifficultyColor() {
|
||||||
@ -347,6 +394,8 @@ public class Profile {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Image getStatPanel(int w, Session session) {
|
public Image getStatPanel(int w, Session session) {
|
||||||
|
|
||||||
|
if (imageDisplayUpdateImage==null || image_display_update_required) {
|
||||||
//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));
|
//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));
|
||||||
BufferedImage tmp = new BufferedImage(400,175,BufferedImage.TYPE_INT_ARGB);
|
BufferedImage tmp = new BufferedImage(400,175,BufferedImage.TYPE_INT_ARGB);
|
||||||
Graphics2D g2 = tmp.createGraphics();
|
Graphics2D g2 = tmp.createGraphics();
|
||||||
@ -366,8 +415,12 @@ public class Profile {
|
|||||||
if (gamemode!=-1) {
|
if (gamemode!=-1) {
|
||||||
switch (gamemode) {
|
switch (gamemode) {
|
||||||
case 0:{ //Egg Hunt.
|
case 0:{ //Egg Hunt.
|
||||||
|
try {
|
||||||
spacing = width/session.eggCount;
|
spacing = width/session.eggCount;
|
||||||
rainbowEggLimit = session.eggCount;
|
rainbowEggLimit = session.eggCount;
|
||||||
|
} catch (java.lang.ArithmeticException e) {
|
||||||
|
|
||||||
|
}
|
||||||
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++) {
|
for (int i=0;i<session.eggCount;i++) {
|
||||||
Color col = (rainbowEggCount>i)?RabiRaceModule.rainbowcycler.getCycleColor():new Color(0,0,0,192);
|
Color col = (rainbowEggCount>i)?RabiRaceModule.rainbowcycler.getCycleColor():new Color(0,0,0,192);
|
||||||
@ -469,8 +522,13 @@ public class Profile {
|
|||||||
} catch (ConcurrentModificationException e) {
|
} catch (ConcurrentModificationException e) {
|
||||||
|
|
||||||
}
|
}
|
||||||
return tmp.getScaledInstance(w, -1, Image.SCALE_AREA_AVERAGING);
|
imageDisplayUpdateImage = tmp.getScaledInstance(w, -1, Image.SCALE_AREA_AVERAGING);
|
||||||
//g.drawImage(tmp, (int)parent.position.getX(), (int)parent.position.getY(), 120, 64, sigIRC.panel);
|
//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.");
|
||||||
|
}
|
||||||
|
|
||||||
|
return imageDisplayUpdateImage;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String toString() {
|
public String toString() {
|
||||||
|
@ -304,9 +304,7 @@ public class RabiRaceModule extends Module{
|
|||||||
myProfile.isPaused = paused==1;
|
myProfile.isPaused = paused==1;
|
||||||
//System.out.println(itempct+","+paused);
|
//System.out.println(itempct+","+paused);
|
||||||
if (paused==0 && itempct>=0) {
|
if (paused==0 && itempct>=0) {
|
||||||
if (mySession!=null) {
|
|
||||||
myProfile.archiveAllValues();
|
myProfile.archiveAllValues();
|
||||||
}
|
|
||||||
myProfile.rainbowEggCount = readIntFromMemory(MemoryOffset.RAINBOW_EGG_COUNT);
|
myProfile.rainbowEggCount = readIntFromMemory(MemoryOffset.RAINBOW_EGG_COUNT);
|
||||||
myProfile.attackUps = readItemCountFromMemory(MemoryOffset.ATTACKUP_START,MemoryOffset.ATTACKUP_END);
|
myProfile.attackUps = readItemCountFromMemory(MemoryOffset.ATTACKUP_START,MemoryOffset.ATTACKUP_END);
|
||||||
myProfile.healthUps = readItemCountFromMemory(MemoryOffset.HEALTHUP_START,MemoryOffset.HEALTHUP_END);
|
myProfile.healthUps = readItemCountFromMemory(MemoryOffset.HEALTHUP_START,MemoryOffset.HEALTHUP_END);
|
||||||
@ -322,6 +320,10 @@ public class RabiRaceModule extends Module{
|
|||||||
if (mySession!=null && !firstUpdate) {
|
if (mySession!=null && !firstUpdate) {
|
||||||
myProfile.compareAndAnnounceAllChangedValues();
|
myProfile.compareAndAnnounceAllChangedValues();
|
||||||
}
|
}
|
||||||
|
if (myProfile.compareAllChangedValues()>0) {
|
||||||
|
myProfile.image_display_update_required=true;
|
||||||
|
}
|
||||||
|
myProfile.stat_update_required=true;
|
||||||
firstUpdate=false;
|
firstUpdate=false;
|
||||||
}
|
}
|
||||||
if (mySession!=null) {
|
if (mySession!=null) {
|
||||||
@ -450,6 +452,7 @@ public class RabiRaceModule extends Module{
|
|||||||
g.setColor(new Color(196,196,196,128));
|
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)(position.getX()+1), (int)(position.getY()+1), (int)((position.getWidth()/400)*50), (int)((position.getWidth()/400)*50));
|
||||||
g.setColor(ident);
|
g.setColor(ident);
|
||||||
|
System.out.println("Mouse over avatar.");
|
||||||
} else {
|
} else {
|
||||||
mouseoverAvatar=false;
|
mouseoverAvatar=false;
|
||||||
}
|
}
|
||||||
|
@ -159,6 +159,8 @@ public class sigIRC{
|
|||||||
public static int lastSubEmoteUpdate = -1;
|
public static int lastSubEmoteUpdate = -1;
|
||||||
public static boolean autoUpdateProgram = true;
|
public static boolean autoUpdateProgram = true;
|
||||||
public static Image programIcon;
|
public static Image programIcon;
|
||||||
|
final public static int MAX_CONNECTION_RETRIES = 100;
|
||||||
|
public static int retryCounter = 0;
|
||||||
|
|
||||||
public static int subchannelCount = 0;
|
public static int subchannelCount = 0;
|
||||||
public static HashMap<Long,String> subchannelIds = new HashMap<Long,String>();
|
public static HashMap<Long,String> subchannelIds = new HashMap<Long,String>();
|
||||||
@ -407,6 +409,7 @@ public class sigIRC{
|
|||||||
|
|
||||||
public static void InitializeIRCConnection(final String server,final String nickname,final String channel,final String oauth) {
|
public static void InitializeIRCConnection(final String server,final String nickname,final String channel,final String oauth) {
|
||||||
Socket socket;
|
Socket socket;
|
||||||
|
retryCounter++;
|
||||||
try {
|
try {
|
||||||
socket = new Socket(server, 6667);
|
socket = new Socket(server, 6667);
|
||||||
BufferedWriter writer = new BufferedWriter(
|
BufferedWriter writer = new BufferedWriter(
|
||||||
@ -429,7 +432,12 @@ public class sigIRC{
|
|||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
if (retryCounter<MAX_CONNECTION_RETRIES) {
|
||||||
InitializeIRCConnection(server,nickname,channel,oauth);
|
InitializeIRCConnection(server,nickname,channel,oauth);
|
||||||
|
} else {
|
||||||
|
sigIRC.panel.addMessage("Connection timed out. Please restart and try again.");
|
||||||
|
System.out.println("Connection timed out. Please restart and try again.");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void WriteBreakToLogFile() {
|
public static void WriteBreakToLogFile() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user