IF YOU DID THIS BEFORE 9/28/2013 REDO IT FOR HOVERBUTTON SUPPORT!
This was the first interface, I have ever made from scratch. It needs some work, I'm still trying to find out how to drawClickedButtons but I think it's pretty nice for my first one.
What You're Adding:
Download these Sprites
[REUPLOADED 8/18/14]
MoneyVault.zip - 141 KB
Okay now for the tutorial:
First, In RSInterface.java add this Interface
Code:
public static void moneyTab(TextDrawingArea[] TDA) {
RSInterface intmoneyTab = addTab(8000);
intmoneyTab.children = new int[11];
intmoneyTab.childX = new int[11];
intmoneyTab.childY = new int[11];
intmoneyTab.children[0] = 8001;
intmoneyTab.childX[0] = 0;
intmoneyTab.childY[0] = 0;
//Main sprite
addSprite(8001, 0, "Interfaces/MoneyVault/sidebar");
intmoneyTab.children[1] = 8002;
intmoneyTab.childX[1] = 87;
intmoneyTab.childY[1] = 75;
addText(8002, "1", TDA, 0, 16750623, true, true);
intmoneyTab.children[2] = 8003;
intmoneyTab.childX[2] = 130;
intmoneyTab.childY[2] = 92;
addHoverButton(8003, "Interfaces/MoneyVault/deposit", 0, 32, 32, "Deposit to Vault", 1803, 8004, 1);
intmoneyTab.children[3] = 8004;
intmoneyTab.childX[3] = 130;
intmoneyTab.childY[3] = 92;
addHoveredButton(8004, "Interfaces/MoneyVault/deposit", 1, 32, 32, 8005);
intmoneyTab.children[4] = 8006;
intmoneyTab.childX[4] = 17;
intmoneyTab.childY[4] = 204;
addHoverButton(8006, "Interfaces/MoneyVault/taxBag", 0, 32, 32, "Purchase a Tax Bag", -1, 8007, 1); //TODO: Change the tooltip text
intmoneyTab.children[5] = 8007;
intmoneyTab.childX[5] = 17;
intmoneyTab.childY[5] = 204;
addHoveredButton(8007, "Interfaces/MoneyVault/taxBag", 1, 32, 32, 8008); //TODO: Change the tooltip text
intmoneyTab.children[6] = 8009;
intmoneyTab.childX[6] = 130;
intmoneyTab.childY[6] = 204;
addHoverButton(8009, "Interfaces/MoneyVault/yellBubble", 0, 32, 32, "Purchase Yell Tickets", -1, 8010, 1);
intmoneyTab.children[7] = 8010;
intmoneyTab.childX[7] = 130;
intmoneyTab.childY[7] = 204;
addHoveredButton(8010, "Interfaces/MoneyVault/yellBubble", 1, 32, 32, 8011);
intmoneyTab.children[8] = 8012;
intmoneyTab.childX[8] = 20;
intmoneyTab.childY[8] = 94;
addHoverButton(8012, "Interfaces/MoneyVault/withDraw", 0, 32, 32, "Withdraw from Vault", 1804, 8013, 1);
intmoneyTab.children[9] = 8013;
intmoneyTab.childX[9] = 20;
intmoneyTab.childY[9] = 94;
addHoveredButton(8013, "Interfaces/MoneyVault/withDraw", 1, 32, 32, 8014);
intmoneyTab.children[10] = 8016;
intmoneyTab.childX[10] = 87;
intmoneyTab.childY[10] = 135;
addText(8016, "Balance", TDA, 0, 16750623, true, true);
}
Also in RSInterface, add under "aClass44 = archive;"
Code:
moneyTab(textDrawingAreas);
Now open Client.java and Search for
Code:
if(friendsListAction == 2 && friendsCount > 0) {
under that If statement add these
Code:
if(interfaceButtonAction == 502 && promptInput.length() > 0) {
inputString = "::deposit "+promptInput;
System.out.println(inputString);
sendPacket(103);
}
if(interfaceButtonAction == 503 && promptInput.length() > 0) {
inputString = "::withdraw "+promptInput;
System.out.println(inputString);
sendPacket(103);
}
Now still in Client.java search for
Code:
private boolean promptUserForInput(
in that with the rest of these add these:
Code:
if(j == 1803) {
inputTaken = true;
messagePromptRaised = true;
amountOrNameInput = "";
inputDialogState = 0;
interfaceButtonAction = 502;
aString1121 = "Enter Amount to Deposit";
}
if(j == 1804) {
inputTaken = true;
messagePromptRaised = true;
amountOrNameInput = "";
inputDialogState = 0;
interfaceButtonAction = 503;
aString1121 = "Enter Amount to Withdraw";
}
IF NEEDED: Declare this Int and Method
Code:
static int interfaceButtonAction = 0;
void sendPacket(int packet) {
if (packet == 103) {
stream.createFrame(103);
stream.writeWordBigEndian(inputString.length() - 1);
stream.writeString(inputString.substring(2));
inputString = "";
promptInput = "";
interfaceButtonAction = 0;
}
}
Thanks for viewing my post, I will be posting the Server - Sided part of this as soon as possible.
Edit:
Server Sided:
http://www.rune-server.org/runescape...ml#post4174668