-
New Quest Tab
This is not really a huge interface, but its just an updated version of the old one, meant to resemble a higher revision one(revision unknown).
Code:
public static void questTab(){
RSInterface Interface = addTabInterface(638);
setChildren(6,Interface);
addTextCached(640, "Quest Journal", 0xFF981F, false, true, 52, 2);
addTextCached(643, "Quest Points: 206", 0xFF981F, false, true, 52, 0);
addSprite(641, 0, "QUEST");
addSprite(642, 4, "QUEST");
setBounds(640, 4, 2, 0, Interface);
setBounds(641, 0, 26, 1, Interface);
setBounds(642, 0, 23, 2, Interface);
setBounds(642, 0, 242, 3, Interface);
setBounds(639, 0, 24, 4, Interface);
setBounds(643, 4, 246, 5, Interface);
RSInterface edit = RSInterface.interfaceCache[639];
edit.height = 218;
edit.width = 174;
}
public static void addTextCached(int i, String s, int k, boolean l, boolean m, int a, int j) {
RSInterface rsinterface = addTabInterface(i);
rsinterface.parentID = i;
rsinterface.id = i;
rsinterface.type = 4;
rsinterface.atActionType = 0;
rsinterface.width = 0;
rsinterface.height = 0;
rsinterface.anInt214 = 0;
rsinterface.opacity = 0;
rsinterface.anInt230 = a;
rsinterface.textCentered = l;
rsinterface.textShadowed = m;
rsinterface.font = RSInterface.fonts[j];
rsinterface.disabledMessage = s;
rsinterface.disabledColor = k;
}
public static void addSprite(int ID, int i, String name) {
RSInterface Tab = RSInterface.interfaceCache[ID] = new RSInterface();
Tab.id = ID;
Tab.parentID = ID;
Tab.width = 512;
Tab.height = 600;
Tab.type = 5;
Tab.sprite1 = loadSprite(name, i);
}
public void setBounds(int ID, int X, int Y, int frame,
RSInterface RSinterface) {
RSinterface.children[frame] = ID;
RSinterface.childX[frame] = X;
RSinterface.childY[frame] = Y;
}
public void setChildren(int total, RSInterface i) {
i.children = new int[total];
i.childX = new int[total];
i.childY = new int[total];
}
public Sprite loadSprite(String s, int i) {
Sprite sprite;
try {
sprite = new Sprite(s,i);
if (sprite != null) {
return sprite;
}
} catch (Exception e) {
e.printStackTrace();
return null;
}
return null;
}
public RSInterface addTabInterface(int id) {
RSInterface i = RSInterface.interfaceCache[id] = new RSInterface();
i.parentID = id;
i.id = id;
i.type = 0;
i.atActionType = 0;
i.width = 191;
i.height = 261;
i.scrollMax = 0;
i.aByte254 = 0;
return i;
}
Thats it for RSInterface.
Now open Sprite.java and add these imports:
Code:
import java.io.DataInputStream;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
import java.awt.Toolkit;
import java.awt.Component;
import java.awt.Image;
Now add these constructors in Sprite.java as well.
Code:
public Sprite(String imageName, int requestIndex) {
try {
loadCustom(imageName, requestIndex);
} catch (Exception e) {
// e.printStackTrace();
}
}
public void loadCustom(String imageName, int requestIndex) {
try {
int index = -1;
int fileCount;
long[] fileSizes;
String[] fileNames;
byte[] fileBytes = null;
ZipFile zipfile = new ZipFile("C:/317/Images/Images.dat");
DataInputStream datainputstream = new DataInputStream(zipfile
.getInputStream(new ZipEntry("Images.data")));
int version = datainputstream.readInt();
fileCount = datainputstream.readInt();
fileSizes = new long[fileCount];
fileNames = new String[fileCount];
for (int i = 0; i < fileCount; i++) {
fileNames[i] = datainputstream.readUTF();
fileSizes[i] = datainputstream.readLong();
}
for (int i = 0; i < fileNames.length; i++) {
if (fileNames[i].equalsIgnoreCase(imageName + "_"
+ requestIndex)) {
index = i;
break;
}
}
for (int i = 0; i < fileCount; i++) {
fileBytes = new byte[(int) (fileSizes[i])];
datainputstream.readFully(fileBytes, 0, fileBytes.length);
if (i == index) {
datainputstream.close();
break;
}
}
// spriteB = fileBytes;
javax.swing.ImageIcon icon = new javax.swing.ImageIcon(fileBytes);
Image image = Toolkit.getDefaultToolkit().createImage(fileBytes);
myWidth = icon.getIconWidth();
myHeight = icon.getIconHeight();
maxWidth = myWidth;
maxHeight = myHeight;
xOffset = 0;
yOffset = 0;
myPixels = new int[myWidth * myHeight];
PixelGrabber pixelgrabber = new PixelGrabber(image, 0, 0, myWidth,
myHeight, myPixels, 0, myWidth);
pixelgrabber.grabPixels();
} catch (Exception e) {
// e.printStackTrace();
}
}
Now download these sprites:
[Only registered and activated users can see links. Click Here To Register...]
Result:
[Only registered and activated users can see links. Click Here To Register...]
ALMOST FORGOT. In RSInterface add this:
Code:
public static TextDrawingArea[] fonts;
Then open client.java and find this:
Code:
TextDrawingArea aclass30_sub2_sub1_sub4s[]
Below that add this:
RSInterface.fonts = aclass30_sub2_sub1_sub4s;
-
Please nename this, i am despirate need of this :S
-
Wow, this is great. I'd also like it renamed. Good job.
-
Very nice, and these constructors can be used for your combat interfaces?
-
-
K4rn4ge,the sprite constructors are not the same as my combat interfaces. This uses Palidino's Sprite Cache that he released with his Client.
-
O ok, should of read the sprite stuff anyways
-
Lol. I have redone all my interfaces to use palis sprite stuff.
-
Hey Stewie, i got a question to ask you? Got a MSN(Your PM box is full)
-
Non-Renamed for free anal.