Code:
public static void listing(TextDrawingArea[] tda) {
RSInterface rsi = addTabInterface(22600);
loadListings(22601);
rsi.totalChildren(1);
rsi.child(0, 22601, 16, 8);
}
public static void loadListings(int index) {
RSInterface rsi = interfaceCache[index] = new RSInterface();
rsi.actions = new String[10];
rsi.spritesX = new int[20];
rsi.invStackSizes = new int[30];
rsi.inv = new int[30];
rsi.spritesY = new int[20];
rsi.children = new int[0];
rsi.childX = new int[0];
rsi.childY = new int[0];
rsi.centerText = true;
rsi.aBoolean227 = false;
rsi.aBoolean235 = false;
rsi.usableItemInterface = false;
rsi.isInventoryInterface = false;
rsi.aBoolean259 = true;
rsi.textShadow = false;
rsi.invSpritePadX = 10;
rsi.invSpritePadY = 4;
rsi.height = 7;
rsi.width = 4;
rsi.parentID = index+1;
rsi.id = index;
rsi.type = 2;
}
public static void addOffer(int index) {
RSInterface rsi = interfaceCache[index] = new RSInterface();
rsi.actions = new String[10];
rsi.spritesX = new int[20];
rsi.invStackSizes = new int[30];
rsi.inv = new int[30];
rsi.spritesY = new int[20];
rsi.children = new int[0];
rsi.childX = new int[0];
rsi.childY = new int[0];
rsi.actions[0] = "Offer 1";
rsi.actions[1] = "Offer 5";
rsi.actions[2] = "Offer 10";
rsi.actions[3] = "Offer All";
rsi.actions[4] = "Offer X";
rsi.centerText = true;
rsi.aBoolean227 = false;
rsi.aBoolean235 = false;
rsi.usableItemInterface = false;
rsi.isInventoryInterface = false;
rsi.aBoolean259 = true;
rsi.textShadow = false;
rsi.invSpritePadX = 10;
rsi.invSpritePadY = 4;
rsi.height = 7;
rsi.width = 4;
rsi.parentID = index+1;
rsi.id = index;
rsi.type = 2;
}
public static void allListingsExchance(TextDrawingArea[] tda) {
RSInterface widget = addInterface(22400);
String dir = "Interfaces/POS/SPRITE";
addSprite(22401, 11, dir);
newHoverButton(22402, "Go back", 14, 15, dir);
newHoverButton(22405, "Prev Page", 14, 15, dir);
newHoverButton(22408, "Next Page", 14, 15, dir);
addText(22411, "Go back", 0xff9933, false, true, -1, tda, 2);
addText(22412, "Prev\\nPage", 0xff9933, false, true, -1, tda, 2);
addText(22413, "Next\\nPage", 0xff9933, false, true, -1, tda, 2);
addText(22450, "Quantity", 0xff9933, false, true, -1, tda, 0);
addText(22451, "Name", 0xff9933, false, true, -1, tda, 0);
addText(22452, "Price (each)", 0xff9933, false, true, -1, tda, 0);
addText(22453, "Seller", 0xff9933, false, true, -1, tda, 0);
addText(22454, "Purchase", 0xff9933, false, true, -1, tda, 0);
RSInterface listings = addTabInterface(22414);
listings.width = 452;
listings.height = 200;
listings.scrollMax = 252;
for(int i = 0, start = 22415; i < 6; i++, start++) {
addSprite(start, i % 2 == 0 ? 13 : 12, dir);
}
addListing(22421, true);
for(int i = 0, start = 22422; i < 6; i++) {
addText(start, "Abyssal whip", 0xff9933, true, true, -1, tda, 1);
addText(start+1, "1,111,152,206", 0x008000, true, true, -1, tda, 1);
addText(start+2, "Mobjunk", 0x808080, true, true, -1, tda, 1);
addClickableText(start+3, "Buy", "Buy listing", tda, 1, 0xffff00, false, true, 150);
System.out.println("start+3 - " + (start+3));
start += 4;
}
setChildren(31, listings);
for(int i = 0, start = 22415, y = 0; i < 6; i++, start++) {
setBounds(start, 0, y, i, listings);
y += 42;
}
setBounds(22421, 10, 5, 6, listings); //Item
for(int i = 0, start = 22422, y = 14, index = 7; i < 6; i++) {
setBounds(start, 118, y, index, listings);
setBounds(start+1, 233, y, index+1, listings);
setBounds(start+2, 331, y, index+2, listings);
setBounds(start+3, 403, y, index+3, listings);
start += 4;
index += 4;
y += 42;
}
setChildren(15, widget);
setBounds(22401, 16, 16, 0, widget);
setBounds(22215, 207, 27, 1, widget); //Title
setBounds(22212, 476, 23, 2, widget); //Close
//setBounds(22213, 476, 23, 3, widget);
setBounds(22402, 25, 277, 3, widget); //Go back
//setBounds(22403, 25, 277, 4, widget);
setBounds(22405, 309, 277, 4, widget); //Prev page
//setBounds(22406, 309, 277, 6, widget);
setBounds(22408, 407, 277, 5, widget); //Next page
//setBounds(22409, 407, 277, 8, widget);
setBounds(22411, 43, 286, 6, widget); //Go back
setBounds(22412, 337, 281, 7, widget); //Prev Page
setBounds(22413, 435, 281, 8, widget); //Next page
setBounds(22450, 31, 59, 9, widget); //Quantity
setBounds(22451, 131, 59, 10, widget); //Name
setBounds(22452, 231, 59, 11, widget); //Price (each)
setBounds(22453, 341, 59, 12, widget); //Seller
setBounds(22454, 421, 59, 13, widget); //Purchase
setBounds(22414, 26, 73, 14, widget);
}
public static void listExchance(TextDrawingArea[] tda) {
RSInterface widget = addInterface(22300);
String dir = "Interfaces/POS/SPRITE";
addSprite(22301, 0, dir);
newHoverButton(22302, "Cancel listing", 7, 8, dir);
//addHoverButton(22302, dir, 7, 150, 32, "Cancel listing", -1, 22303, 1);
//addHoveredButton(22303, dir, 8, 150, 32, 22304);
addText(22305, "Cancel Listing", 0xff9933, false, true, -1, tda, 2);
addSprite(22306, 9, dir);
addListing(22307);
addText(22308, "Abyssal Whip", 0xff9933, true, true, -1, tda, 2);
addText(22309, "Price (each) 15,000,000 GP", 0xff9933, true, true, -1, tda, 1);
addText(22310, "Quantity: 1", 0xff9933, true, true, -1, tda, 1);
addText(22311, "", 0xff9933, true, true, -1, tda, 0); //Guide: 50M
addText(22312, "", 0xff9933, true, true, -1, tda, 0); // Listed: 0
newHoverButton(22313, "Set price", 3, 4, dir);
newHoverButton(22316, "Set quantity", 3, 4, dir);
newHoverButton(22319, "Confirm offer", 3, 4, dir);
addText(22322, "Set\\nprice", 0xff9933, true, true, -1, tda, 2);
addText(22323, "Set\\nquantity", 0xff9933, true, true, -1, tda, 2);
addText(22324, "Confirm", 0xff9933, true, true, -1, tda, 2);
setChildren(20, widget);
setBounds(21901, 16, 16, 0, widget);
setBounds(22215, 207, 27, 1, widget); //Title
setBounds(22212, 476, 23, 2, widget); //Close
setBounds(22302, 303, 265, 3, widget); //Cancel listing
setBounds(22305, 332, 274, 4, widget); //Cancel text
setBounds(22306, 267, 60, 5, widget); //Sprite
setBounds(22307, 363, 71, 6, widget); //Item
setBounds(22308, 378, 115, 7, widget); //name 260, 75
setBounds(22309, 378, 135, 8, widget); //price ea
setBounds(22310, 378, 150, 9, widget); //quantity
setBounds(22311, 435, 70, 10, widget); //guide
setBounds(22312, 435, 85, 11, widget); //listed
setBounds(22313, 302, 170, 12, widget); //Set price button
setBounds(22316, 382, 170, 13, widget); //Set quantity button
setBounds(22319, 342, 207, 14, widget); //confirm button
setBounds(22322, 337, 171, 15, widget);
setBounds(22323, 417, 171, 16, widget);
setBounds(22324, 376, 215, 17, widget);
setBounds(21902, 31, 60, 18, widget); //History
setBounds(22000, 31, 190, 19, widget); //Last
}
public static void addListing(int i) {
RSInterface rsinterface = interfaceCache[i] = new RSInterface();
rsinterface.actions = new String[5];
rsinterface.spritesX = new int[20];
rsinterface.invStackSizes = new int[30];
rsinterface.inv = new int[30];
rsinterface.spritesY = new int[20];
rsinterface.children = new int[0];
rsinterface.childX = new int[0];
rsinterface.childY = new int[0];
rsinterface.spritesY[0] = 0;
for(int i2 = 0; i2 < 30; i2++)
rsinterface.invStackSizes[i2] = 0;
rsinterface.inv[0] = 0;
rsinterface.spritesX[0] = 0;
rsinterface.centerText = false;
rsinterface.aBoolean227 = false;
rsinterface.aBoolean235 = false;
rsinterface.usableItemInterface = false;
rsinterface.isInventoryInterface = false;
rsinterface.aBoolean259 = false;
rsinterface.textShadow = false;
rsinterface.width = 3;
rsinterface.hoverType = -1;
rsinterface.invSpritePadX = 10; //24
rsinterface.parentID = i;
rsinterface.invSpritePadY = 10;
rsinterface.type = 2;
rsinterface.height = 4;
rsinterface.id = i;
}
public static void mainExchance(TextDrawingArea[] tda) {
RSInterface widget = addInterface(21900);
String dir = "Interfaces/POS/SPRITE";
addSprite(21901, 0, dir);
newHoverButton(22200, "Search for item", 3, 4, dir);
newHoverButton(22203, "Search for player", 3, 4, dir);
newHoverButton(22206, "Search for recent listings", 3, 4, dir);
addText(22209, "Item", tda, 2, 0xff9933, false, true);
addText(22210, "Player", tda, 2, 0xff9933, false, true);
addText(22211, "Recent", tda, 2, 0xff9933, false, true);
newHoverButton(22212, "Close", 5, 6, dir);
addText(22215, "Exotic Exchange!", tda, 2, 0xff9933, false, true);
addText(22216, "Search for...", tda, 2, 0xff9933, false, true);
RSInterface history = addTabInterface(21902);
history.width = 198;
history.height = 116;
history.scrollMax = 420;
for(int i = 0, start = 21903; i < 10; i++, start++) {
addSprite(start, i % 2 == 0 ? 2 : 1, dir);
}
for(int i = 0, start = 21913; i < 10; i++, start++) {
addText(start, "3,000 x Dwarf Reamins", tda, 0, 0xff9933, true, true);
}
for(int i = 0, start = 21923; i < 10; i++, start++) {
addText(start, "sold for 220 each.", tda, 0, 0xff9933, true, true);
}
setChildren(30, history);
for(int i = 0, start = 21903, y = 0; i < 10; i++, start++) {
setBounds(start, 0, y, i, history);
y += 42;
}
for(int i = 10, start = 21913, y = 10; i < 20; i++, start++) {
setBounds(start, 100, y, i, history);
y += 42;
}
for(int i = 20, start = 21923, y = 20; i < 30; i++, start++) {
setBounds(start, 100, y, i, history);
y += 42;
}
RSInterface last = addTabInterface(22000);
last.width = 198;
last.height = 116;
last.scrollMax = 420;
for(int i = 0, start = 22001; i < 10; i++, start++) {
addSprite(start, i % 2 == 0 ? 2 : 1, dir);
}
for(int i = 0, start = 22011; i < 10; i++, start++) {
addText(start, "1000x Dwarf remains", tda, 0, 0xff9933, true, true);
}
for(int i = 0, start = 22021; i < 10; i++, start++) {
addText(start, "put for sale for 300 each.", tda, 0, 0xff9933, true, true);
}
setChildren(30, last);
for(int i = 0, start = 22001, y = 0; i < 10; i++, start++) {
setBounds(start, 0, y, i, last);
y += 42;
}
for(int i = 10, start = 22011, y = 10; i < 20; i++, start++) {
setBounds(start, 100, y, i, last);
y += 42;
}
for(int i = 20, start = 22021, y = 20; i < 30; i++, start++) {
setBounds(start, 100, y, i, last);
y += 42;
}
RSInterface listings = addTabInterface(22100);
listings.width = 206;
listings.height = 181;
listings.scrollMax = 420;
addListing(22101, false);
for(int i = 0, start = 22102; i < 10; i++) {
addPixels(start, 0x000000, 107, 15, 0, false);
addPixels(start+1, 0xff9933, 52, 13, 0, true);
addText(start+2, "Dwarf remains", tda, 0, 0xffffff, true, true);
addText(start+3, "999/1000", tda, 0, 0xffffff, true, true);
addText(start+4, "1.6k", tda, 0, 0xffffff, true, true);
start += 5;
}
setChildren(51, listings);
setBounds(22101, 25, 1, 0, listings);
for(int i = 0, start = 22102, y1 = 20, y2 = 21, y3 = 5, y4 = 22, y5 = 31, index = 1; i < 10; i++) {
setBounds(start, 69, y1, index, listings);
setBounds(start+1, 70, y2, index+1, listings);
setBounds(start+2, 120, y3, index+2, listings);
setBounds(start+3, 120, y4, index+3, listings);
setBounds(start+4, 40, y5, index+4, listings);
start += 5;
index += 5;
y1 += 42;
y2 += 42;
y3 += 42;
y4 += 42;
y5 += 42;
}
setChildren(13, widget);
setBounds(21901, 16, 16, 0, widget);
setBounds(22200, 261, 265, 1, widget); //Button 1
setBounds(22209, 282, 273, 2, widget); //Text 1
setBounds(22203, 342, 265, 3, widget); //Button 2
setBounds(22210, 357, 273, 4, widget); //Text 2
setBounds(22206, 423, 265, 5, widget); //Button 3
setBounds(22211, 436, 273, 6, widget); //Text 3
setBounds(22212, 476, 23, 7, widget); //Close
setBounds(22215, 207, 27, 8, widget); //Title
setBounds(22216, 261, 249, 9, widget); //Search for...
setBounds(21902, 31, 60, 10, widget); //History
setBounds(22000, 31, 190, 11, widget); //Last
setBounds(22100, 267, 60, 12, widget); //Listings
}
public static void addPixels(int id, int color, int width, int height, int alpha, boolean filled) {
RSInterface rsi = addInterface(id);
rsi.type = 3;
rsi.opacity = (byte)alpha;
rsi.textColor = color;
rsi.anInt216 = color;
rsi.anInt219 = color;
rsi.anInt239 = color;
rsi.aBoolean227 = filled;
rsi.width = width;
rsi.height = height;
}
public static void addListing(int index, boolean search)
{
RSInterface rsi = interfaceCache[index] = new RSInterface();
rsi.actions = new String[10];
rsi.spritesX = new int[20];
rsi.invStackSizes = new int[30];
rsi.inv = new int[30];
rsi.spritesY = new int[20];
rsi.children = new int[0];
rsi.childX = new int[0];
rsi.childY = new int[0];
if(!search)
rsi.actions[0] = "Cancel";
rsi.centerText = true;
rsi.aBoolean227 = false;
rsi.aBoolean235 = false;
rsi.usableItemInterface = false;
rsi.isInventoryInterface = false;
rsi.aBoolean259 = true;
rsi.textShadow = false; //42, 82
if(!search) {
rsi.invSpritePadX = 0;
rsi.invSpritePadY = 10;
} else {
rsi.invSpritePadX = 0;
rsi.invSpritePadY = 10;
}
if(!search)
rsi.height = 10;
else
rsi.height = 6;
rsi.width = 1;
rsi.parentID = index+1;
rsi.id = index;
rsi.type = 2;
}