Fixed issues with images not displaying.

dev
sigonasr2 7 years ago
parent 4c596055e3
commit 53c5b598e6
  1. BIN
      sigIRCv2.jar
  2. 9
      src/sig/modules/RabiRace/MemoryData.java
  3. 2
      src/sig/modules/RabiRace/Profile.java
  4. 47
      src/sig/modules/RabiRaceModule.java
  5. 5
      src/sig/modules/RabiRibi/MemoryOffset.java

Binary file not shown.

@ -44,8 +44,9 @@ public enum MemoryData {
SUPER_CARROT(MemoryOffset.SUPER_CARROT,"Super Carrot","super_carrot.png",true), SUPER_CARROT(MemoryOffset.SUPER_CARROT,"Super Carrot","super_carrot.png",true),
/*DLC_ITEM1(MemoryOffset.DLC_ITEM1,"","",true), /*DLC_ITEM1(MemoryOffset.DLC_ITEM1,"","",true),
DLC_ITEM2(MemoryOffset.DLC_ITEM2,"","",true), DLC_ITEM2(MemoryOffset.DLC_ITEM2,"","",true),
DLC_ITEM3(MemoryOffset.DLC_ITEM3,"","",true),
DLC_ITEM4(MemoryOffset.DLC_ITEM4,"","",true),*/ DLC_ITEM4(MemoryOffset.DLC_ITEM4,"","",true),*/
BUNNY_CLOVER(MemoryOffset.BUNNY_CLOVER,"Bunny Clover","bunny_clover.png",true),
FAIRYS_FLUTE(MemoryOffset.FAIRYS_FLUTE,"Fairy's Flute","fairy_s_flute.png",true),
BADGE_HEALTH_PLUS(MemoryOffset.BADGE_HEALTH_PLUS,"Health Plus","health_plus.png",false), BADGE_HEALTH_PLUS(MemoryOffset.BADGE_HEALTH_PLUS,"Health Plus","health_plus.png",false),
BADGE_HEALTH_SURGE(MemoryOffset.BADGE_HEALTH_SURGE,"Health Surge","health_surge.png",false), BADGE_HEALTH_SURGE(MemoryOffset.BADGE_HEALTH_SURGE,"Health Surge","health_surge.png",false),
BADGE_MANA_PLUS(MemoryOffset.BADGE_MANA_PLUS,"Mana Plus","mana_plus.png",false), BADGE_MANA_PLUS(MemoryOffset.BADGE_MANA_PLUS,"Mana Plus","mana_plus.png",false),
@ -83,17 +84,19 @@ public enum MemoryData {
public MemoryOffset mem; public MemoryOffset mem;
public String name; public String name;
public String img_path; public String img_path;
public Image img;
public boolean key_item; //Set to true if it's a key item. False if it's a badge. public boolean key_item; //Set to true if it's a key item. False if it's a badge.
MemoryData(MemoryOffset mem, String name, String icon_name, boolean isKeyItem) { MemoryData(MemoryOffset mem, String name, String icon_name, boolean isKeyItem) {
this.mem = mem; this.mem = mem;
this.name = name; this.name = name;
this.img = RabiRaceModule.image_map.get(icon_name);
this.img_path = icon_name; this.img_path = icon_name;
this.key_item = isKeyItem; this.key_item = isKeyItem;
} }
public Image getImage() {
return RabiRaceModule.image_map.get(img_path);
}
public String getDisplayName() { public String getDisplayName() {
return (key_item)?name:name+" Badge"; return (key_item)?name:name+" Badge";
} }

@ -40,7 +40,7 @@ public class Profile {
badges.put(md.name, md); badges.put(md.name, md);
//System.out.println("Obtained "+md.getDisplayName()); //System.out.println("Obtained "+md.getDisplayName());
} else { } else {
key_items.remove(md.name); badges.remove(md.name);
} }
} }
} }

@ -72,6 +72,11 @@ public class RabiRaceModule extends Module{
new FileManager("sigIRC/rabi-ribi/items/"+data.img_path).verifyAndFetchFileFromServer(); new FileManager("sigIRC/rabi-ribi/items/"+data.img_path).verifyAndFetchFileFromServer();
} }
new FileManager("sigIRC/rabi-ribi/items/easter_egg.png").verifyAndFetchFileFromServer(); new FileManager("sigIRC/rabi-ribi/items/easter_egg.png").verifyAndFetchFileFromServer();
new FileManager("sigIRC/rabi-ribi/items/health_up.png").verifyAndFetchFileFromServer();
new FileManager("sigIRC/rabi-ribi/items/mana_up.png").verifyAndFetchFileFromServer();
new FileManager("sigIRC/rabi-ribi/items/regen_up.png").verifyAndFetchFileFromServer();
new FileManager("sigIRC/rabi-ribi/items/pack_up.png").verifyAndFetchFileFromServer();
new FileManager("sigIRC/rabi-ribi/items/attack_up.png").verifyAndFetchFileFromServer();
String[] images = dir.list(); String[] images = dir.list();
List<String> filtered_images = new ArrayList<String>(); List<String> filtered_images = new ArrayList<String>();
@ -84,6 +89,7 @@ public class RabiRaceModule extends Module{
images = filtered_images.toArray(new String[filtered_images.size()]); images = filtered_images.toArray(new String[filtered_images.size()]);
for (String image : images) { for (String image : images) {
try { try {
//System.out.println("Loaded "+image);
image_map.put(image, ImageIO.read(new File(ITEMS_DIRECTORY+image))); image_map.put(image, ImageIO.read(new File(ITEMS_DIRECTORY+image)));
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
@ -260,7 +266,7 @@ public class RabiRaceModule extends Module{
if (!foundRabiRibi) { if (!foundRabiRibi) {
DrawUtils.drawTextFont(g, sigIRC.panel.userFont, position.getX(), position.getY()+26, Color.BLACK, "Rabi-Ribi not found! Please start it."); DrawUtils.drawTextFont(g, sigIRC.panel.userFont, position.getX(), position.getY()+26, Color.BLACK, "Rabi-Ribi not found! Please start it.");
} else { } else {
DrawUtils.drawTextFont(g, sigIRC.panel.userFont, position.getX(), 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, position.getX(), position.getY()+26, Color.BLACK, "Values: "+readIntFromMemory(MemoryOffset.DLC_ITEM1)+","+readIntFromMemory(MemoryOffset.DLC_ITEM2)+","+readIntFromMemory(MemoryOffset.DLC_ITEM3)+","+readIntFromMemory(MemoryOffset.DLC_ITEM4));
final int border=20; final int border=20;
final int width=(int)(position.getWidth()-border*2); final int width=(int)(position.getWidth()-border*2);
final int spacing=width/5; final int spacing=width/5;
@ -275,23 +281,48 @@ public class RabiRaceModule extends Module{
try { try {
for (String key : myProfile.key_items.keySet()) { for (String key : myProfile.key_items.keySet()) {
MemoryData data = myProfile.key_items.get(key); MemoryData data = myProfile.key_items.get(key);
if (readIntFromMemory(data.mem)<0) {
Image img = data.getImage().getScaledInstance(icon_size, icon_size, Image.SCALE_DEFAULT);
if (size*icon_size<width) {
DrawUtils.drawImage(g, img, (int)(position.getX()+border+((count++)*icon_size)), (int)(position.getY()+96+8), new Color(0,0,0,128), sigIRC.panel);
} else {
DrawUtils.drawImage(g, img, (int)(position.getX()+border+((width/size)*(count++))), (int)(position.getY()+96+8), new Color(0,0,0,128), sigIRC.panel);
}
} else {
if (size*icon_size<width) { if (size*icon_size<width) {
g.drawImage(data.img, (int)(position.getX()+border+((count++)*icon_size)), (int)(position.getY()+96+8), (int)icon_size, (int)icon_size, sigIRC.panel); g.drawImage(data.getImage(), (int)(position.getX()+border+((count++)*icon_size)), (int)(position.getY()+96+8), (int)icon_size, (int)icon_size, sigIRC.panel);
} else { } else {
g.drawImage(data.img, (int)(position.getX()+border+((width/size)*(count++))), (int)(position.getY()+96+8), (int)icon_size, (int)icon_size, sigIRC.panel); g.drawImage(data.getImage(), (int)(position.getX()+border+((width/size)*(count++))), (int)(position.getY()+96+8), (int)icon_size, (int)icon_size, sigIRC.panel);
}
} }
} }
count=0; count=0;
size = myProfile.badges.size(); size = myProfile.badges.size();
for (String key : myProfile.badges.keySet()) { for (String key : myProfile.badges.keySet()) {
MemoryData data = myProfile.badges.get(key); MemoryData data = myProfile.badges.get(key);
if (size*icon_size<width) { if (size*icon_size<width) {
g.drawImage(data.img, (int)(position.getX()+border+((count++)*icon_size)), (int)(position.getY()+96+32), (int)icon_size, (int)icon_size, sigIRC.panel); g.drawImage(data.getImage(), (int)(position.getX()+border+((count++)*icon_size)), (int)(position.getY()+96+32), (int)icon_size, (int)icon_size, sigIRC.panel);
} else { } else {
g.drawImage(data.img, (int)(position.getX()+border+((width/size)*(count++))), (int)(position.getY()+96+32), (int)icon_size, (int)icon_size, sigIRC.panel); g.drawImage(data.getImage(), (int)(position.getX()+border+((width/size)*(count++))), (int)(position.getY()+96+32), (int)icon_size, (int)icon_size, sigIRC.panel);
} }
}
int i=0;
Image[] imgs = new Image[]{image_map.get("health_up.png"),
image_map.get("mana_up.png"),
image_map.get("regen_up.png"),
image_map.get("pack_up.png"),
image_map.get("attack_up.png")};
int[] amts = new int[]{
myProfile.healthUps,
myProfile.manaUps,
myProfile.regenUps,
myProfile.packUps,
myProfile.attackUps,
};
//g.drawImage(image_map.get("bunny_strike.png"),(int)(position.getX()+border+(i++)*(spacing)-img.getWidth(sigIRC.panel)/4),(int)(position.getY()+96+56), (int)icon_size, (int)icon_size, sigIRC.panel);
for (Image img : imgs) {
g.drawImage(img,(int)(position.getX()+border+((i)*(spacing))-icon_size/2),(int)(position.getY()+96+56), (int)icon_size, (int)icon_size, sigIRC.panel);
DrawUtils.drawCenteredOutlineText(g, sigIRC.panel.userFont, (int)((position.getX()+border+((i)*(spacing))-icon_size/2)+(spacing/2)), (int)(position.getY()+96+56+icon_size+6), 1, Color.WHITE, Color.BLUE, "x"+amts[i++]);
} }
} catch (ConcurrentModificationException e) { } catch (ConcurrentModificationException e) {

@ -61,7 +61,7 @@ public enum MemoryOffset {
WATER_ORB(0xD632F4,0xD632F4+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185), WATER_ORB(0xD632F4,0xD632F4+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),
FIRE_ORB(0xD632F8,0xD632F8+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185), FIRE_ORB(0xD632F8,0xD632F8+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),
NATURE_ORB(0xD632FC,0xD632FC+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185), NATURE_ORB(0xD632FC,0xD632FC+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),
P_HAIRPIN(0xD63300,0xD632B0+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185), P_HAIRPIN(0xD63300,0x12D87D0),
SUNNY_BEAM(0xD63304,0xD63304+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185), SUNNY_BEAM(0xD63304,0xD63304+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),
PLUS_NECKLACE(0xD63308,0xD63308+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185), PLUS_NECKLACE(0xD63308,0xD63308+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),
CYBER_FLOWER(0xD6330C,0xD6330C+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185), CYBER_FLOWER(0xD6330C,0xD6330C+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),
@ -100,7 +100,8 @@ public enum MemoryOffset {
UNKNOWN_ITEM14(0xD63390,0xD63390+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185), UNKNOWN_ITEM14(0xD63390,0xD63390+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),
DLC_ITEM1(0xD63394,0xD63394+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185), DLC_ITEM1(0xD63394,0xD63394+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),
DLC_ITEM2(0xD63398,0xD63398+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185), DLC_ITEM2(0xD63398,0xD63398+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),
DLC_ITEM3(0xD6339C,0xD6339C+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185), BUNNY_CLOVER(0xD6339C,0xD6339C+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),
FAIRYS_FLUTE(0,0x12D8874),
DLC_ITEM4(0xD633A0,0xD633A0+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185), DLC_ITEM4(0xD633A0,0xD633A0+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),
BADGE_HEALTH_PLUS(0xD633AC,0xD633AC+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185), BADGE_HEALTH_PLUS(0xD633AC,0xD633AC+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),
BADGE_HEALTH_SURGE(0xD633B0,0xD633B0+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185), BADGE_HEALTH_SURGE(0xD633B0,0xD633B0+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),

Loading…
Cancel
Save