|
|
@ -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,27 +326,33 @@ public class Profile { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public Image getStatText(int w, Session session) { |
|
|
|
public Image getStatText(int w, Session session) { |
|
|
|
BufferedImage tmp = new BufferedImage(400,175,BufferedImage.TYPE_INT_ARGB); |
|
|
|
|
|
|
|
Graphics2D g2 = tmp.createGraphics(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
g2.setColor(Color.BLACK); |
|
|
|
if (statUpdateCacheImage==null || stat_update_required) { |
|
|
|
//g2.fillRect(1, 1, 32, 32);
|
|
|
|
BufferedImage tmp = new BufferedImage(400,175,BufferedImage.TYPE_INT_ARGB); |
|
|
|
g2.drawImage(avatar.getAvatarImage(), 1, 1, sigIRC.panel); |
|
|
|
Graphics2D g2 = tmp.createGraphics(); |
|
|
|
g2.setColor(ScrollingText.GetUserNameColor(displayName)); |
|
|
|
|
|
|
|
DrawUtils.drawOutlineText(g2, sigIRC.panel.rabiRibiMoneyDisplayFont, 54, 26, 1, g2.getColor(), Color.BLACK, displayName); |
|
|
|
|
|
|
|
DrawUtils.drawCenteredOutlineText(g2, sigIRC.panel.rabiRibiTinyDisplayFont, (int)(tmp.getWidth()*0.2), 50, 1, GetDifficultyColor(), Color.BLACK, GetDifficultyName()); |
|
|
|
|
|
|
|
String text = TextUtils.convertSecondsToTimeFormat(playtime/60); |
|
|
|
|
|
|
|
if (isPaused) { |
|
|
|
|
|
|
|
g2.setColor(new Color(128,96,0)); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
g2.setColor(Color.BLACK); |
|
|
|
g2.setColor(Color.BLACK); |
|
|
|
|
|
|
|
//g2.fillRect(1, 1, 32, 32);
|
|
|
|
|
|
|
|
g2.drawImage(avatar.getAvatarImage(), 1, 1, sigIRC.panel); |
|
|
|
|
|
|
|
g2.setColor(ScrollingText.GetUserNameColor(displayName)); |
|
|
|
|
|
|
|
DrawUtils.drawOutlineText(g2, sigIRC.panel.rabiRibiMoneyDisplayFont, 54, 26, 1, g2.getColor(), Color.BLACK, displayName); |
|
|
|
|
|
|
|
DrawUtils.drawCenteredOutlineText(g2, sigIRC.panel.rabiRibiTinyDisplayFont, (int)(tmp.getWidth()*0.2), 50, 1, GetDifficultyColor(), Color.BLACK, GetDifficultyName()); |
|
|
|
|
|
|
|
String text = TextUtils.convertSecondsToTimeFormat(playtime/60); |
|
|
|
|
|
|
|
if (isPaused) { |
|
|
|
|
|
|
|
g2.setColor(new Color(128,96,0)); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
g2.setColor(Color.BLACK); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
DrawUtils.drawOutlineText(g2, sigIRC.panel.rabiRibiMoneyDisplayFont, (int)(tmp.getWidth() - TextUtils.calculateStringBoundsFont(text, sigIRC.panel.rabiRibiMoneyDisplayFont).getWidth()) - 2, 16, 1, g2.getColor(), Color.GRAY, text); |
|
|
|
|
|
|
|
text = "Map "+df.format(mappct)+"% Item "+df.format(itempct)+"%"; |
|
|
|
|
|
|
|
//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); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
statUpdateCacheImage = tmp.getScaledInstance(w, -1, Image.SCALE_AREA_AVERAGING); |
|
|
|
|
|
|
|
//stat_update_required = false;
|
|
|
|
} |
|
|
|
} |
|
|
|
DrawUtils.drawOutlineText(g2, sigIRC.panel.rabiRibiMoneyDisplayFont, (int)(tmp.getWidth() - TextUtils.calculateStringBoundsFont(text, sigIRC.panel.rabiRibiMoneyDisplayFont).getWidth()) - 2, 16, 1, g2.getColor(), Color.GRAY, text); |
|
|
|
|
|
|
|
text = "Map "+df.format(mappct)+"% Item "+df.format(itempct)+"%"; |
|
|
|
|
|
|
|
//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); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return tmp.getScaledInstance(w, -1, Image.SCALE_AREA_AVERAGING); |
|
|
|
return statUpdateCacheImage; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private Color GetDifficultyColor() { |
|
|
|
private Color GetDifficultyColor() { |
|
|
@ -347,130 +394,141 @@ public class Profile { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public Image getStatPanel(int w, Session session) { |
|
|
|
public Image getStatPanel(int w, Session session) { |
|
|
|
//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); |
|
|
|
|
|
|
|
Graphics2D g2 = tmp.createGraphics(); |
|
|
|
|
|
|
|
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) { |
|
|
|
if (imageDisplayUpdateImage==null || image_display_update_required) { |
|
|
|
switch (gamemode) { |
|
|
|
//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));
|
|
|
|
case 0:{ //Egg Hunt.
|
|
|
|
BufferedImage tmp = new BufferedImage(400,175,BufferedImage.TYPE_INT_ARGB); |
|
|
|
spacing = width/session.eggCount; |
|
|
|
Graphics2D g2 = tmp.createGraphics(); |
|
|
|
rainbowEggLimit = session.eggCount; |
|
|
|
final int border=20; |
|
|
|
Image img = RabiRaceModule.image_map.get("easter_egg.png"); |
|
|
|
final int width=(int)(tmp.getWidth()-border*2); |
|
|
|
for (int i=0;i<session.eggCount;i++) { |
|
|
|
int spacing=width/5; |
|
|
|
Color col = (rainbowEggCount>i)?RabiRaceModule.rainbowcycler.getCycleColor():new Color(0,0,0,192); |
|
|
|
int shiftyval = 0; |
|
|
|
DrawUtils.drawImage(g2, img, (int)(border+i*spacing-img.getWidth(sigIRC.panel)/4),(int)(36),col,sigIRC.panel); |
|
|
|
double iconsize = 1; |
|
|
|
} |
|
|
|
final int icon_size = 24; |
|
|
|
}break; |
|
|
|
int rainbowEggLimit = 0; |
|
|
|
case 1:{ //Item Hunt.
|
|
|
|
|
|
|
|
spacing = width/session.itemHuntData.length; |
|
|
|
int gamemode = -1; |
|
|
|
for (int i=0;i<session.itemHuntData.length;i++) { |
|
|
|
if (RabiRaceModule.mySession!=null) { |
|
|
|
MemoryData item = MemoryData.valueOf(session.itemHuntData[i]); |
|
|
|
gamemode = RabiRaceModule.mySession.gamemode; |
|
|
|
if ((key_items.containsKey(item) && |
|
|
|
} |
|
|
|
key_items.get(item)>=1) || |
|
|
|
|
|
|
|
(badges.containsKey(item) && |
|
|
|
if (gamemode!=-1) { |
|
|
|
badges.get(item)>=1)) { |
|
|
|
switch (gamemode) { |
|
|
|
//DrawUtils.drawImage(g2, item.getImage(), (int)(border+i*spacing-item.getImage().getWidth(sigIRC.panel)/4),(int)(36),col,sigIRC.panel);
|
|
|
|
case 0:{ //Egg Hunt.
|
|
|
|
g2.drawImage(item.getImage(), (int)(border+i*spacing),(int)(36+16), icon_size*2, icon_size*2, sigIRC.panel); |
|
|
|
try { |
|
|
|
} else { |
|
|
|
spacing = width/session.eggCount; |
|
|
|
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); |
|
|
|
rainbowEggLimit = session.eggCount; |
|
|
|
|
|
|
|
} catch (java.lang.ArithmeticException e) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
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); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}break; |
|
|
|
|
|
|
|
case 1:{ //Item Hunt.
|
|
|
|
|
|
|
|
spacing = width/session.itemHuntData.length; |
|
|
|
|
|
|
|
for (int i=0;i<session.itemHuntData.length;i++) { |
|
|
|
|
|
|
|
MemoryData item = MemoryData.valueOf(session.itemHuntData[i]); |
|
|
|
|
|
|
|
if ((key_items.containsKey(item) && |
|
|
|
|
|
|
|
key_items.get(item)>=1) || |
|
|
|
|
|
|
|
(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); |
|
|
|
|
|
|
|
} 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); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
shiftyval = -RabiRaceModule.image_map.get("easter_egg.png").getWidth(sigIRC.panel)/2; |
|
|
|
|
|
|
|
iconsize = 1; |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
/* |
|
|
|
shiftyval = -RabiRaceModule.image_map.get("easter_egg.png").getWidth(sigIRC.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); |
|
|
|
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); |
|
|
|
int size = key_items.size(); |
|
|
|
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 count = 0; |
|
|
|
} |
|
|
|
try { |
|
|
|
*/ |
|
|
|
for (MemoryData data : key_items.keySet()) { |
|
|
|
int size = key_items.size(); |
|
|
|
if (key_items.get(data)<0) { |
|
|
|
int count = 0; |
|
|
|
Image img = data.getImage().getScaledInstance(icon_size, icon_size, Image.SCALE_DEFAULT); |
|
|
|
try { |
|
|
|
if (size*icon_size<width) { |
|
|
|
for (MemoryData data : key_items.keySet()) { |
|
|
|
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); |
|
|
|
if (key_items.get(data)<0) { |
|
|
|
} else { |
|
|
|
Image img = data.getImage().getScaledInstance(icon_size, icon_size, Image.SCALE_DEFAULT); |
|
|
|
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); |
|
|
|
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); |
|
|
|
|
|
|
|
} else { |
|
|
|
} 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); |
|
|
|
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); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
g2.drawImage(data.getImage(), (int)(+border+((width/size)*(count++))), (int)(+96+8)+shiftyval, (int)(icon_size*iconsize), (int)(icon_size*iconsize), sigIRC.panel); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
} |
|
|
|
|
|
|
|
count=0; |
|
|
|
|
|
|
|
size = badges.size(); |
|
|
|
|
|
|
|
for (MemoryData data : badges.keySet()) { |
|
|
|
if (size*icon_size<width) { |
|
|
|
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+32)+shiftyval, (int)(icon_size*iconsize), (int)(icon_size*iconsize), sigIRC.panel); |
|
|
|
|
|
|
|
if (badges.get(data)==2) { |
|
|
|
|
|
|
|
DrawUtils.drawOutlineText(g2, sigIRC.panel.smallFont, (int)(+border+((count-1)*icon_size))+4, (int)(+96+32)+icon_size+shiftyval, 1, Color.WHITE, TEAL, "E"); |
|
|
|
|
|
|
|
} |
|
|
|
} else { |
|
|
|
} 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+32)+shiftyval, (int)(icon_size*iconsize), (int)(icon_size*iconsize), sigIRC.panel); |
|
|
|
|
|
|
|
if (badges.get(data)==2) { |
|
|
|
|
|
|
|
DrawUtils.drawOutlineText(g2, sigIRC.panel.smallFont, (int)(+border+((width/size)*(count-1)))+4, (int)(+96+32)+icon_size+shiftyval, 1, Color.WHITE, TEAL, "E"); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
int i=0; |
|
|
|
count=0; |
|
|
|
Image[] imgs = new Image[]{RabiRaceModule.image_map.get("health_up.png"), |
|
|
|
size = badges.size(); |
|
|
|
RabiRaceModule.image_map.get("mana_up.png"), |
|
|
|
for (MemoryData data : badges.keySet()) { |
|
|
|
RabiRaceModule.image_map.get("regen_up.png"), |
|
|
|
if (size*icon_size<width) { |
|
|
|
RabiRaceModule.image_map.get("pack_up.png"), |
|
|
|
g2.drawImage(data.getImage(), (int)(+border+((count++)*icon_size)), (int)(+96+32)+shiftyval, (int)(icon_size*iconsize), (int)(icon_size*iconsize), sigIRC.panel); |
|
|
|
RabiRaceModule.image_map.get("attack_up.png")}; |
|
|
|
if (badges.get(data)==2) { |
|
|
|
int[] amts = new int[]{ |
|
|
|
DrawUtils.drawOutlineText(g2, sigIRC.panel.smallFont, (int)(+border+((count-1)*icon_size))+4, (int)(+96+32)+icon_size+shiftyval, 1, Color.WHITE, TEAL, "E"); |
|
|
|
healthUps, |
|
|
|
} |
|
|
|
manaUps, |
|
|
|
} else { |
|
|
|
regenUps, |
|
|
|
g2.drawImage(data.getImage(), (int)(+border+((width/size)*(count++))), (int)(+96+32)+shiftyval, (int)(icon_size*iconsize), (int)(icon_size*iconsize), sigIRC.panel); |
|
|
|
packUps, |
|
|
|
if (badges.get(data)==2) { |
|
|
|
attackUps, |
|
|
|
DrawUtils.drawOutlineText(g2, sigIRC.panel.smallFont, (int)(+border+((width/size)*(count-1)))+4, (int)(+96+32)+icon_size+shiftyval, 1, Color.WHITE, TEAL, "E"); |
|
|
|
}; |
|
|
|
} |
|
|
|
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 i=0; |
|
|
|
int counting=0; |
|
|
|
Image[] imgs = new Image[]{RabiRaceModule.image_map.get("health_up.png"), |
|
|
|
for (Image img : imgs) { |
|
|
|
RabiRaceModule.image_map.get("mana_up.png"), |
|
|
|
if (counting++==5) { |
|
|
|
RabiRaceModule.image_map.get("regen_up.png"), |
|
|
|
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); |
|
|
|
RabiRaceModule.image_map.get("pack_up.png"), |
|
|
|
} else { |
|
|
|
RabiRaceModule.image_map.get("attack_up.png")}; |
|
|
|
g2.drawImage(img,(int)(+border+((i)*(spacing))-icon_size/2),(int)(+96+56)+shiftyval, (int)icon_size, (int)icon_size, sigIRC.panel); |
|
|
|
int[] amts = new int[]{ |
|
|
|
} |
|
|
|
healthUps, |
|
|
|
DrawUtils.drawCenteredOutlineText(g2, sigIRC.panel.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++])); |
|
|
|
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) { |
|
|
|
|
|
|
|
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); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
g2.drawImage(img,(int)(+border+((i)*(spacing))-icon_size/2),(int)(+96+56)+shiftyval, (int)icon_size, (int)icon_size, sigIRC.panel); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
DrawUtils.drawCenteredOutlineText(g2, sigIRC.panel.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) { |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} catch (ConcurrentModificationException e) { |
|
|
|
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.");
|
|
|
|
} |
|
|
|
} |
|
|
|
return tmp.getScaledInstance(w, -1, Image.SCALE_AREA_AVERAGING); |
|
|
|
|
|
|
|
//g.drawImage(tmp, (int)parent.position.getX(), (int)parent.position.getY(), 120, 64, sigIRC.panel);
|
|
|
|
return imageDisplayUpdateImage; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public String toString() { |
|
|
|
public String toString() { |
|
|
|