Added ability to change/select avatar icon. Can click on avatar image to
change it.
This commit is contained in:
parent
ad5ad80c61
commit
381e58b504
BIN
sigIRCv2.jar
BIN
sigIRCv2.jar
Binary file not shown.
61
src/sig/modules/RabiRace/Avatar.java
Normal file
61
src/sig/modules/RabiRace/Avatar.java
Normal file
@ -0,0 +1,61 @@
|
|||||||
|
package sig.modules.RabiRace;
|
||||||
|
|
||||||
|
import java.awt.Image;
|
||||||
|
|
||||||
|
import sig.modules.RabiRaceModule;
|
||||||
|
|
||||||
|
public enum Avatar {
|
||||||
|
ERINA("Erina","small_erina.png",0),
|
||||||
|
RIBBON("Ribbon","small_ribbon.png",1),
|
||||||
|
IRISU("Irisu","small_irisu.png",2),
|
||||||
|
GREEN_KOTRI("Kotri (Green)","small_green_kotri.png",3),
|
||||||
|
BLUE_KOTRI("Kotri (Blue)","small_blue_kotri.png",4),
|
||||||
|
RED_KOTRI("Kotri (Red)","small_kotri.png",5),
|
||||||
|
ARURAUNE("Aruraune","small_aruraune.png",6),
|
||||||
|
ASHURI("Ashuri","small_ashuri.png",7),
|
||||||
|
CICINI("Cicini","small_cicini.png",8),
|
||||||
|
COCOA("Cocoa","small_cocoa.png",9),
|
||||||
|
ILLUSION_ALIUS("Illusion Alius","small_illusion_alius.png",10),
|
||||||
|
KEKE_BUNNY("Keke Bunny","small_keke_bunny.png",11),
|
||||||
|
LILITH("Lilith","small_lilith.png",12),
|
||||||
|
LILLI("Lilli","small_lilli.png",13),
|
||||||
|
MIRIAM("Miriam","small_miriam.png",14),
|
||||||
|
MIRU("Miru","small_miru.png",15),
|
||||||
|
NIEVE("Nieve","small_nieve.png",16),
|
||||||
|
NIXIE("Nixie","small_nixie.png",17),
|
||||||
|
NOAH("Noah","small_noah.png",18),
|
||||||
|
PANDORA("Pandora","small_pandora.png",19),
|
||||||
|
SHADOW_PANDORA("Pandora (Shadow)","small_shadow_pandora.png",20),
|
||||||
|
PIXIE("Pixie","small_pixie.png",21),
|
||||||
|
RITA("Rita","small_rita.png",22),
|
||||||
|
SHADOW_RITA("Rita (Shadow)","small_shadow_rita.png",23),
|
||||||
|
RUMI("Rumi","small_rumi.png",24),
|
||||||
|
SAYA("Saya","small_saya.png",25),
|
||||||
|
SEANA("Seana","small_seana.png",26),
|
||||||
|
SYARO("Syaro","small_syaro.png",27),
|
||||||
|
VANILLA("Vanilla","small_vanilla.png",28),
|
||||||
|
;
|
||||||
|
|
||||||
|
public String displayName;
|
||||||
|
public String fileName;
|
||||||
|
public int value;
|
||||||
|
|
||||||
|
Avatar(String displayName, String fileName, int value) {
|
||||||
|
this.displayName = displayName;
|
||||||
|
this.fileName = fileName;
|
||||||
|
this.value = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Avatar getAvatarFromID(int value) {
|
||||||
|
for (Avatar a : Avatar.values()) {
|
||||||
|
if (a.value == value) {
|
||||||
|
return a;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ERINA;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Image getAvatarImage() {
|
||||||
|
return RabiRaceModule.image_map.get(fileName);
|
||||||
|
}
|
||||||
|
}
|
156
src/sig/modules/RabiRace/AvatarSelectionWindow.java
Normal file
156
src/sig/modules/RabiRace/AvatarSelectionWindow.java
Normal file
@ -0,0 +1,156 @@
|
|||||||
|
package sig.modules.RabiRace;
|
||||||
|
|
||||||
|
import java.awt.Color;
|
||||||
|
import java.awt.Dimension;
|
||||||
|
import java.awt.Graphics;
|
||||||
|
import java.awt.Image;
|
||||||
|
import java.awt.LayoutManager;
|
||||||
|
import java.awt.event.MouseEvent;
|
||||||
|
import java.awt.event.MouseListener;
|
||||||
|
import java.lang.reflect.Field;
|
||||||
|
|
||||||
|
import javax.swing.Box;
|
||||||
|
import javax.swing.BoxLayout;
|
||||||
|
import javax.swing.JFrame;
|
||||||
|
import javax.swing.JPanel;
|
||||||
|
|
||||||
|
import sig.sigIRC;
|
||||||
|
import sig.modules.RabiRaceModule;
|
||||||
|
import sig.utils.ReflectUtils;
|
||||||
|
|
||||||
|
public class AvatarSelectionWindow extends JFrame{
|
||||||
|
static ImagePanel[] avatars = new ImagePanel[Avatar.values().length];
|
||||||
|
static AvatarSelectionWindow avatarwindow;
|
||||||
|
final static int WINDOW_WIDTH = 350;
|
||||||
|
final static int COLUMNS = WINDOW_WIDTH/50;
|
||||||
|
final static int WINDOW_HEIGHT = ((Avatar.values().length/COLUMNS)+1)*50;
|
||||||
|
static boolean mousePressed = false;
|
||||||
|
|
||||||
|
public AvatarSelectionWindow() {
|
||||||
|
this.setVisible(false);
|
||||||
|
this.setTitle("Avatar Selection");
|
||||||
|
this.setIconImage(sigIRC.programIcon);
|
||||||
|
avatarwindow = this;
|
||||||
|
JPanel panels = new JPanel();
|
||||||
|
JPanel container = new JPanel();
|
||||||
|
panels.setLayout(new BoxLayout(panels,BoxLayout.PAGE_AXIS));
|
||||||
|
container.setLayout(new BoxLayout(container,BoxLayout.LINE_AXIS));
|
||||||
|
container.setSize(WINDOW_WIDTH, 50);
|
||||||
|
int i=0;
|
||||||
|
panels.add(container);
|
||||||
|
for (int k=0;k<avatars.length;k++) {
|
||||||
|
ImagePanel j = new ImagePanel(RabiRaceModule.image_map.get(Avatar.values()[i].fileName),i%COLUMNS,i/COLUMNS,Avatar.values()[i].value);
|
||||||
|
avatars[k] = j;
|
||||||
|
j.setSize(50,50);
|
||||||
|
j.setPreferredSize(new Dimension(50,50));
|
||||||
|
container.add(j);
|
||||||
|
i++;
|
||||||
|
if (i%COLUMNS==0) {
|
||||||
|
container = new JPanel();
|
||||||
|
container.setLayout(new BoxLayout(container,BoxLayout.LINE_AXIS));
|
||||||
|
container.setSize(WINDOW_WIDTH, 50);
|
||||||
|
panels.add(container);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
while (i%COLUMNS!=0) {
|
||||||
|
container.add(Box.createRigidArea(new Dimension(50,50)));
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
this.add(panels);
|
||||||
|
this.setSize(WINDOW_WIDTH, WINDOW_HEIGHT+48);
|
||||||
|
this.setResizable(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class ImagePanel extends JPanel implements MouseListener{
|
||||||
|
Image img;
|
||||||
|
int x,y;
|
||||||
|
public boolean selected=false;
|
||||||
|
int myID = 0;
|
||||||
|
|
||||||
|
public ImagePanel(Image img, int x, int y, int myID) {
|
||||||
|
this.img = img;
|
||||||
|
this.setSize(50,50);
|
||||||
|
this.x=x;
|
||||||
|
this.y=y;
|
||||||
|
this.myID = myID;
|
||||||
|
addMouseListener(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void paintComponent(Graphics g) {
|
||||||
|
super.paintComponent(g);
|
||||||
|
if (selected) {
|
||||||
|
g.setColor(new Color(0,0,64));
|
||||||
|
g.fillRect(0, 0, 50, 50);
|
||||||
|
}
|
||||||
|
g.drawImage(img, 0, 0, this);
|
||||||
|
if (selected) {
|
||||||
|
g.setColor(Color.YELLOW);
|
||||||
|
for (int i=0;i<2;i++) {
|
||||||
|
g.drawRect(i, i, 50-i, 50-i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public String toString() {
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
sb.append(this.getClass().getName()+"(");
|
||||||
|
boolean first=false;
|
||||||
|
for (Field f : this.getClass().getDeclaredFields()) {
|
||||||
|
if (!first) {
|
||||||
|
try {
|
||||||
|
sb.append(f.getName()+"="+f.get(this));
|
||||||
|
first=true;
|
||||||
|
} catch (IllegalArgumentException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
} catch (IllegalAccessException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
try {
|
||||||
|
sb.append(","+f.getName()+"="+f.get(this));
|
||||||
|
} catch (IllegalArgumentException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
} catch (IllegalAccessException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
sb.append(")");
|
||||||
|
return sb.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void mousePressed(MouseEvent arg0) {
|
||||||
|
for (ImagePanel i : AvatarSelectionWindow.avatars) {
|
||||||
|
if (i!=null) {
|
||||||
|
i.selected = false;
|
||||||
|
i.repaint();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
selected = true;
|
||||||
|
AvatarSelectionWindow.mousePressed=true;
|
||||||
|
RabiRaceModule.module.myProfile.avatar = Avatar.getAvatarFromID(myID);
|
||||||
|
repaint();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void mouseClicked(MouseEvent e) {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void mouseEntered(MouseEvent e) {
|
||||||
|
if (AvatarSelectionWindow.mousePressed) {
|
||||||
|
mousePressed(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void mouseExited(MouseEvent e) {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void mouseReleased(MouseEvent e) {
|
||||||
|
AvatarSelectionWindow.mousePressed=false;
|
||||||
|
}
|
||||||
|
}
|
@ -18,6 +18,7 @@ import java.util.ConcurrentModificationException;
|
|||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.LinkedHashMap;
|
import java.util.LinkedHashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
import sig.ScrollingText;
|
import sig.ScrollingText;
|
||||||
import sig.sigIRC;
|
import sig.sigIRC;
|
||||||
@ -29,7 +30,7 @@ import sig.utils.TextUtils;
|
|||||||
public class Profile {
|
public class Profile {
|
||||||
public String username = sigIRC.nickname.toLowerCase();
|
public String username = sigIRC.nickname.toLowerCase();
|
||||||
public String displayName = sigIRC.nickname;
|
public String displayName = sigIRC.nickname;
|
||||||
public int avatar = 0;
|
public Avatar avatar;
|
||||||
public int playtime = 0;
|
public int playtime = 0;
|
||||||
public int healthUps = 0;
|
public int healthUps = 0;
|
||||||
public int attackUps = 0;
|
public int attackUps = 0;
|
||||||
@ -61,6 +62,7 @@ public class Profile {
|
|||||||
oldProfile = new Profile(module,true);
|
oldProfile = new Profile(module,true);
|
||||||
}
|
}
|
||||||
this.parent = module;
|
this.parent = module;
|
||||||
|
this.avatar = GetSeededAvatar(username);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Profile getArchive() {
|
public Profile getArchive() {
|
||||||
@ -195,7 +197,7 @@ public class Profile {
|
|||||||
if (data.length>=18) {
|
if (data.length>=18) {
|
||||||
int i=0;
|
int i=0;
|
||||||
displayName = data[i++];
|
displayName = data[i++];
|
||||||
avatar = Integer.parseInt(data[i++]);
|
avatar = Avatar.getAvatarFromID(Integer.parseInt(data[i++]));
|
||||||
playtime = Integer.parseInt(data[i++]);
|
playtime = Integer.parseInt(data[i++]);
|
||||||
healthUps = Integer.parseInt(data[i++]);
|
healthUps = Integer.parseInt(data[i++]);
|
||||||
manaUps = Integer.parseInt(data[i++]);
|
manaUps = Integer.parseInt(data[i++]);
|
||||||
@ -239,7 +241,7 @@ public class Profile {
|
|||||||
private String getDataString() {
|
private String getDataString() {
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
appendData(sigIRC.nickname,sb);
|
appendData(sigIRC.nickname,sb);
|
||||||
appendData(avatar,sb);
|
appendData(avatar.value,sb);
|
||||||
appendData(playtime,sb);
|
appendData(playtime,sb);
|
||||||
appendData(healthUps,sb);
|
appendData(healthUps,sb);
|
||||||
appendData(manaUps,sb);
|
appendData(manaUps,sb);
|
||||||
@ -274,14 +276,22 @@ public class Profile {
|
|||||||
str.append(data);
|
str.append(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static Avatar GetSeededAvatar(String username) {
|
||||||
|
Random r = new Random();
|
||||||
|
r.setSeed(username.toLowerCase().hashCode());
|
||||||
|
int randomnumb = r.nextInt(28);
|
||||||
|
return Avatar.getAvatarFromID(randomnumb);
|
||||||
|
}
|
||||||
|
|
||||||
public Image getStatText(int w) {
|
public Image getStatText(int w) {
|
||||||
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();
|
||||||
|
|
||||||
g2.setColor(Color.BLACK);
|
g2.setColor(Color.BLACK);
|
||||||
g2.fillRect(1, 1, 32, 32);
|
//g2.fillRect(1, 1, 32, 32);
|
||||||
|
g2.drawImage(avatar.getAvatarImage(), 1, 1, sigIRC.panel);
|
||||||
g2.setColor(ScrollingText.GetUserNameColor(displayName));
|
g2.setColor(ScrollingText.GetUserNameColor(displayName));
|
||||||
DrawUtils.drawOutlineText(g2, sigIRC.panel.rabiRibiMoneyDisplayFont, 36, 26, 1, g2.getColor(), Color.BLACK, 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());
|
DrawUtils.drawCenteredOutlineText(g2, sigIRC.panel.rabiRibiTinyDisplayFont, (int)(tmp.getWidth()*0.2), 50, 1, GetDifficultyColor(), Color.BLACK, GetDifficultyName());
|
||||||
String text = TextUtils.convertSecondsToTimeFormat(playtime/60);
|
String text = TextUtils.convertSecondsToTimeFormat(playtime/60);
|
||||||
if (isPaused) {
|
if (isPaused) {
|
||||||
|
@ -38,6 +38,7 @@ public class Session {
|
|||||||
for (String s : playerlist) {
|
for (String s : playerlist) {
|
||||||
Profile p = new Profile(RabiRaceModule.module,true);
|
Profile p = new Profile(RabiRaceModule.module,true);
|
||||||
p.username=s;
|
p.username=s;
|
||||||
|
p.avatar = Profile.GetSeededAvatar(p.username);
|
||||||
//System.out.println("Player "+p.username);
|
//System.out.println("Player "+p.username);
|
||||||
if (p.downloadProfile()) {
|
if (p.downloadProfile()) {
|
||||||
if (RabiRaceModule.mySession==null && p.username.equalsIgnoreCase(RabiRaceModule.module.myProfile.username)) {
|
if (RabiRaceModule.mySession==null && p.username.equalsIgnoreCase(RabiRaceModule.module.myProfile.username)) {
|
||||||
@ -50,6 +51,7 @@ public class Session {
|
|||||||
} else {
|
} else {
|
||||||
Profile p = new Profile(RabiRaceModule.module,true);
|
Profile p = new Profile(RabiRaceModule.module,true);
|
||||||
p.username=val;
|
p.username=val;
|
||||||
|
p.avatar = Profile.GetSeededAvatar(p.username);
|
||||||
//System.out.println("Player "+p.username);
|
//System.out.println("Player "+p.username);
|
||||||
if (p.downloadProfile()) {
|
if (p.downloadProfile()) {
|
||||||
if (RabiRaceModule.mySession==null && p.username.equalsIgnoreCase(RabiRaceModule.module.myProfile.username)) {
|
if (RabiRaceModule.mySession==null && p.username.equalsIgnoreCase(RabiRaceModule.module.myProfile.username)) {
|
||||||
|
@ -31,6 +31,8 @@ import com.sun.jna.platform.win32.WinNT.HANDLE;
|
|||||||
import sig.FileManager;
|
import sig.FileManager;
|
||||||
import sig.Module;
|
import sig.Module;
|
||||||
import sig.sigIRC;
|
import sig.sigIRC;
|
||||||
|
import sig.modules.RabiRace.Avatar;
|
||||||
|
import sig.modules.RabiRace.AvatarSelectionWindow;
|
||||||
import sig.modules.RabiRace.ClickableButton;
|
import sig.modules.RabiRace.ClickableButton;
|
||||||
import sig.modules.RabiRace.ColorCycler;
|
import sig.modules.RabiRace.ColorCycler;
|
||||||
import sig.modules.RabiRace.CreateButton;
|
import sig.modules.RabiRace.CreateButton;
|
||||||
@ -50,6 +52,7 @@ import sig.utils.TextUtils;
|
|||||||
|
|
||||||
public class RabiRaceModule extends Module{
|
public class RabiRaceModule extends Module{
|
||||||
final static String ITEMS_DIRECTORY = sigIRC.BASEDIR+"sigIRC/rabi-ribi/items/";
|
final static String ITEMS_DIRECTORY = sigIRC.BASEDIR+"sigIRC/rabi-ribi/items/";
|
||||||
|
final static String AVATAR_DIRECTORY = sigIRC.BASEDIR+"sigIRC/rabi-ribi/characters/";
|
||||||
final int PROCESS_PERMISSIONS = WinNT.PROCESS_QUERY_INFORMATION | WinNT.PROCESS_VM_READ;
|
final int PROCESS_PERMISSIONS = WinNT.PROCESS_QUERY_INFORMATION | WinNT.PROCESS_VM_READ;
|
||||||
boolean foundRabiRibi = false;
|
boolean foundRabiRibi = false;
|
||||||
int rabiRibiPID = -1;
|
int rabiRibiPID = -1;
|
||||||
@ -61,11 +64,13 @@ public class RabiRaceModule extends Module{
|
|||||||
public static RabiRaceModule module;
|
public static RabiRaceModule module;
|
||||||
public static SessionListWindow window;
|
public static SessionListWindow window;
|
||||||
public static SessionCreateWindow createwindow;
|
public static SessionCreateWindow createwindow;
|
||||||
|
public static AvatarSelectionWindow avatarwindow;
|
||||||
public static Session mySession;
|
public static Session mySession;
|
||||||
boolean firstCheck=false;
|
boolean firstCheck=false;
|
||||||
public List<ScrollingText> messages = new ArrayList<ScrollingText>();
|
public List<ScrollingText> messages = new ArrayList<ScrollingText>();
|
||||||
public static int lastScrollX = 0;
|
public static int lastScrollX = 0;
|
||||||
boolean firstUpdate=true;
|
boolean firstUpdate=true;
|
||||||
|
boolean mouseoverAvatar=false;
|
||||||
|
|
||||||
public SessionListData session_listing = new SessionListData();
|
public SessionListData session_listing = new SessionListData();
|
||||||
|
|
||||||
@ -83,6 +88,8 @@ public class RabiRaceModule extends Module{
|
|||||||
window.setVisible(false);
|
window.setVisible(false);
|
||||||
createwindow = new SessionCreateWindow();
|
createwindow = new SessionCreateWindow();
|
||||||
createwindow.setVisible(false);
|
createwindow.setVisible(false);
|
||||||
|
avatarwindow = new AvatarSelectionWindow();
|
||||||
|
avatarwindow.setVisible(false);
|
||||||
//System.out.println("Money value is: "+readIntFromMemory(MemoryOffset.MONEY));
|
//System.out.println("Money value is: "+readIntFromMemory(MemoryOffset.MONEY));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -123,6 +130,9 @@ public class RabiRaceModule extends Module{
|
|||||||
//Attempt to fetch from server.
|
//Attempt to fetch from server.
|
||||||
new FileManager("sigIRC/rabi-ribi/items/"+data.img_path).verifyAndFetchFileFromServer();
|
new FileManager("sigIRC/rabi-ribi/items/"+data.img_path).verifyAndFetchFileFromServer();
|
||||||
}
|
}
|
||||||
|
for (Avatar avatar : Avatar.values()) {
|
||||||
|
new FileManager("sigIRC/rabi-ribi/characters/"+avatar.fileName).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/health_up.png").verifyAndFetchFileFromServer();
|
||||||
new FileManager("sigIRC/rabi-ribi/items/mana_up.png").verifyAndFetchFileFromServer();
|
new FileManager("sigIRC/rabi-ribi/items/mana_up.png").verifyAndFetchFileFromServer();
|
||||||
@ -130,23 +140,9 @@ public class RabiRaceModule extends Module{
|
|||||||
new FileManager("sigIRC/rabi-ribi/items/pack_up.png").verifyAndFetchFileFromServer();
|
new FileManager("sigIRC/rabi-ribi/items/pack_up.png").verifyAndFetchFileFromServer();
|
||||||
new FileManager("sigIRC/rabi-ribi/items/attack_up.png").verifyAndFetchFileFromServer();
|
new FileManager("sigIRC/rabi-ribi/items/attack_up.png").verifyAndFetchFileFromServer();
|
||||||
|
|
||||||
String[] images = dir.list();
|
AddImagesToImageMap(dir,ITEMS_DIRECTORY);
|
||||||
List<String> filtered_images = new ArrayList<String>();
|
dir = new File(AVATAR_DIRECTORY);
|
||||||
for (String file : images) {
|
AddImagesToImageMap(dir,AVATAR_DIRECTORY);
|
||||||
File f = new File(ITEMS_DIRECTORY+file);
|
|
||||||
if (!f.isDirectory()) {
|
|
||||||
filtered_images.add(file);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
images = filtered_images.toArray(new String[filtered_images.size()]);
|
|
||||||
for (String image : images) {
|
|
||||||
try {
|
|
||||||
//System.out.println("Loaded "+image);
|
|
||||||
image_map.put(image, ImageIO.read(new File(ITEMS_DIRECTORY+image)));
|
|
||||||
} catch (IOException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (MemoryData md : MemoryData.values()) {
|
for (MemoryData md : MemoryData.values()) {
|
||||||
if (md.key_item) {
|
if (md.key_item) {
|
||||||
@ -162,6 +158,26 @@ public class RabiRaceModule extends Module{
|
|||||||
create_button = new CreateButton(new Rectangle(122,(int)(position.getHeight()-18),120,18),"Create Session",this);
|
create_button = new CreateButton(new Rectangle(122,(int)(position.getHeight()-18),120,18),"Create Session",this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void AddImagesToImageMap(File dir, String DIRECTORY) {
|
||||||
|
String[] images = dir.list();
|
||||||
|
List<String> filtered_images = new ArrayList<String>();
|
||||||
|
for (String file : images) {
|
||||||
|
File f = new File(DIRECTORY+file);
|
||||||
|
if (!f.isDirectory()) {
|
||||||
|
filtered_images.add(file);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
images = filtered_images.toArray(new String[filtered_images.size()]);
|
||||||
|
for (String image : images) {
|
||||||
|
try {
|
||||||
|
//System.out.println("Loaded "+image);
|
||||||
|
image_map.put(image, ImageIO.read(new File(DIRECTORY+image)));
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void getMessageUpdates() {
|
private void getMessageUpdates() {
|
||||||
File file = new File(sigIRC.BASEDIR+"sigIRC/messages");
|
File file = new File(sigIRC.BASEDIR+"sigIRC/messages");
|
||||||
try {
|
try {
|
||||||
@ -204,6 +220,9 @@ public class RabiRaceModule extends Module{
|
|||||||
if (firstCheck && mySession==null && create_button.mouseInsideBounds(ev)) {
|
if (firstCheck && mySession==null && create_button.mouseInsideBounds(ev)) {
|
||||||
create_button.onClickEvent(ev);
|
create_button.onClickEvent(ev);
|
||||||
}
|
}
|
||||||
|
if (mouseoverAvatar) {
|
||||||
|
avatarwindow.setVisible(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void CheckRabiRibiClient() {
|
private void CheckRabiRibiClient() {
|
||||||
@ -411,6 +430,18 @@ public class RabiRaceModule extends Module{
|
|||||||
} else {
|
} else {
|
||||||
//myProfile.draw(g);
|
//myProfile.draw(g);
|
||||||
Image panel = myProfile.getStatPanel((int)position.getWidth());
|
Image panel = myProfile.getStatPanel((int)position.getWidth());
|
||||||
|
|
||||||
|
if (sigIRC.panel.lastMouseX>=position.getX() &&
|
||||||
|
sigIRC.panel.lastMouseX<=position.getX()+(int)(position.getWidth()/400)*50 &&
|
||||||
|
sigIRC.panel.lastMouseY>=position.getY() &&
|
||||||
|
sigIRC.panel.lastMouseY<=position.getY()+(int)((position.getWidth()/400)*50)) {
|
||||||
|
mouseoverAvatar=true;
|
||||||
|
Color ident = g.getColor();
|
||||||
|
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.setColor(ident);
|
||||||
|
}
|
||||||
|
|
||||||
g.drawImage(panel, (int)position.getX(), (int)position.getY(), sigIRC.panel);
|
g.drawImage(panel, (int)position.getX(), (int)position.getY(), sigIRC.panel);
|
||||||
g.drawImage(myProfile.getStatText((int)position.getWidth()), (int)position.getX(), (int)position.getY(), sigIRC.panel);
|
g.drawImage(myProfile.getStatText((int)position.getWidth()), (int)position.getX(), (int)position.getY(), sigIRC.panel);
|
||||||
|
|
||||||
|
@ -23,7 +23,6 @@ public class JavaUtils {
|
|||||||
sb.append(this.getClass().getName()+"(");
|
sb.append(this.getClass().getName()+"(");
|
||||||
boolean first=false;
|
boolean first=false;
|
||||||
for (Field f : this.getClass().getDeclaredFields()) {
|
for (Field f : this.getClass().getDeclaredFields()) {
|
||||||
if (!ReflectUtils.isCloneable(f)) {
|
|
||||||
if (!first) {
|
if (!first) {
|
||||||
try {
|
try {
|
||||||
sb.append(f.getName()+"="+f.get(this));
|
sb.append(f.getName()+"="+f.get(this));
|
||||||
@ -43,7 +42,6 @@ public class JavaUtils {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
sb.append(")");
|
sb.append(")");
|
||||||
return sb.toString();
|
return sb.toString();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user