[Renamed]: Items Kept on Death interface.
Difficulty: 2
Base used: Royales, should work on any 317 renamed.
_____________________________________________
WARNING: You must do Meanz interface tutorial first!
Client Side:
Step One
Open RSInterface and add
Note: You might already have some of these methods from one of sigex's tutorials. But you do need my edited addGnarlyText() method.
Code:
public static void addGnarlyText(int i, String s, TextDrawingArea atextdrawingarea[], int j, int k, boolean center) {
RSInterface rsinterface = addTab2(i);
rsinterface.parentID = i;
rsinterface.id = i;
rsinterface.type = 4;
rsinterface.atActionType = 0;
rsinterface.width = 174;
rsinterface.height = 0;
rsinterface.anInt214 = 0;
rsinterface.aByte254 = 0;
rsinterface.anInt230 = -1;
rsinterface.aBoolean223 = center;
rsinterface.textShaded = true;
rsinterface.textDrawingAreas = atextdrawingarea[j];
rsinterface.message = s;
rsinterface.aString228 = "";
rsinterface.textColor = k;
rsinterface.anInt219 = 0;
rsinterface.anInt216 = 0;
rsinterface.anInt239 = 0;
}
public static void addCloseButton(int i) {
RSInterface rsinterface = interfaceCache[i] = new RSInterface();
rsinterface.id = i;
rsinterface.parentID = i;
rsinterface.type = 5;
rsinterface.atActionType = 1;
rsinterface.anInt214 = 0;
rsinterface.aByte254 = 0;
rsinterface.anInt230 = 52;
rsinterface.sprite1 = loadGnarlySprites(3, "sprite");
rsinterface.sprite2 = loadGnarlySprites(3, "sprite");
rsinterface.width = rsinterface.sprite1.myWidth;
rsinterface.height = rsinterface.sprite1.myHeight;
rsinterface.tooltip = "Close";
}
public static void addSprite(int i, int j, String s) {
RSInterface rsinterface = interfaceCache[i] = new RSInterface();
rsinterface.id = i;
rsinterface.parentID = i;
rsinterface.type = 5;
rsinterface.atActionType = 0;
rsinterface.anInt214 = 0;
rsinterface.aByte254 = 0;
rsinterface.anInt230 = 52;
rsinterface.sprite1 = loadGnarlySprites(j, s);
rsinterface.sprite2 = loadGnarlySprites(j, s);
rsinterface.width = 512;
rsinterface.height = 334;
}
public static RSInterface addFullScreen(int i) {
RSInterface rsinterface = interfaceCache[i] = new RSInterface();
rsinterface.id = i;
rsinterface.parentID = i;
rsinterface.type = 0;
rsinterface.atActionType = 0;
rsinterface.anInt214 = 0;
rsinterface.width = 512;
rsinterface.height = 334;
rsinterface.aByte254 = 0;
rsinterface.anInt230 = 0;
return rsinterface;
}
private static Sprite loadGnarlySprites(int i, String s) {
long l = (TextClass.method585(s) << 8) + (long)i;
Sprite sprite = (Sprite)aMRUNodes_238.insertFromCache(l);
if(sprite != null) {
return sprite;
}
try {
sprite = new Sprite((new StringBuilder()).append("./sprites/").append(s).append(" ").append(i).append(".PNG").toString(), 2);
System.out.println((new StringBuilder()).append("./sprites/").append(s).append(" ").append(i).append(".PNG").toString());
aMRUNodes_238.removeFromCache(sprite, l);
} catch(Exception exception) {
return null;
}
return sprite;
}
Step Two
Now it's time for the Interface it's self.
Note: I know at the end i started to just repeat the add 12, i was getting lazy, don't flame.
Code:
public static void itemsKeptOnDeath(TextDrawingArea aTextDrawingArea[]) {
RSInterface gnarlyInterface = addFullScreen(22030);
addSprite(22031, 5, "sprite");
addCloseButton(22032);
addText(22033, "", aTextDrawingArea, 0, 0xff981f, false);
addText(22034, "", aTextDrawingArea, 0, 0xff981f, false);
addText(22035, "", aTextDrawingArea, 0, 0xff981f, false);
addText(22036, "", aTextDrawingArea, 0, 0xff981f, false);
addText(22037, "", aTextDrawingArea, 0, 0xff981f, false);
addText(22038, "", aTextDrawingArea, 1, 0xffcc33, false);
gnarlyInterface.children = new int[8];
gnarlyInterface.childX = new int[8];
gnarlyInterface.childY = new int[8];
gnarlyInterface.children[0] = 22031;
gnarlyInterface.childX[0] = 7;
gnarlyInterface.childY[0] = 8;
gnarlyInterface.children[1] = 22032;
gnarlyInterface.childX[1] = 480;
gnarlyInterface.childY[1] = 17;
gnarlyInterface.children[2] = 22038;
gnarlyInterface.childX[2] = 398;
gnarlyInterface.childY[2] = 297;
gnarlyInterface.children[3] = 22033;
gnarlyInterface.childX[3] = 348;
gnarlyInterface.childY[3] = 98;
gnarlyInterface.children[4] = 22034;
gnarlyInterface.childX[4] = 348;
gnarlyInterface.childY[4] = 98+12;
gnarlyInterface.children[5] = 22035;
gnarlyInterface.childX[5] = 348;
gnarlyInterface.childY[5] = 98+12+12;
gnarlyInterface.children[6] = 22036;
gnarlyInterface.childX[6] = 348;
gnarlyInterface.childY[6] = 98+12+12+12;
gnarlyInterface.children[7] = 22037;
gnarlyInterface.childX[7] = 348;
gnarlyInterface.childY[7] = 98+12+12+12+12;
}
Server Side:
Step one
Open up the file with your ActionButton packet (case 185: in client.java usually) And add in this actionbutton,
Note: I had to rename these methods in here, because my server is a different framework then others, so if i messed up please inform me.
Code:
case ID_OF_BUTTON_THAT_OPENS_THE_INTERFACE: // Items Kept on Death interface made by Gnarly
showInterface(22030);
sendFrame126("Line One", 22033);
sendFrame126("Line Two", 22034);
sendFrame126("Line Three", 22035);
sendFrame126("Line Four", 22036);
sendFrame126("Line Five", 22037);
sendFrame126("~ # ~", 22038);
break;
Picture
[Only registered and activated users can see links. Click Here To Register...]
Sprites
Note: Add these in /sprites/ (not cache folder)
[Only registered and activated users can see links. Click Here To Register...]
[Only registered and activated users can see links. Click Here To Register...]
Credits
If you use this, please give me credit for it. ^_^