Hi there, I just wanted to post a quick thread about some tricks I use when making interfaces. I'll be using some iteration of a mopar renamed client.
For this example, I'll use the quest tab. When you clear it, you can easily do it via the RSInterface class.
RSInterface scroll = interfaceCache[639];
scroll.totalChildren(0);
Then when you go and add all the stuff you want, just set the totalChildren to whatever you want and add the children yourself. No need for bandwidth waste when you can actually modify the interface to what it should be.
Then comes the problem of the scroll bar.
In drawFriendsListOrWelcomeScreen add something like:
Code:
if (class9.id == 639) {
int i1 = class9.children.length;
class9.scrollMax = i1 * 13 + 8; // this is a fixed height, so it's made specifically for one line of small text. you would have to modify it to make it work any other way.
if(class9.scrollMax <= class9.height)
class9.scrollMax = class9.height + 1; // if you don't add one then scrollbar becomes invisible aka scroll height = height = invisible
}
You may be able to just modify the "contentType" variable in the scroll interface (639) but I haven't tested this and am unaware of the implications, so I just do it this way...
In drawInterface there will be another call to drawFriendsListOrWelcomeScreen(child) add this below:
Code:
if (child.id == 639) { // whatever ids of interfaces with scrolls you want to modify.
drawFriendsListOrWelcomeScreen(child);
}
Anyway, not super high quality, but I demonstrated the general idea. There are other instances of fixing the scrollbar in the drawFriendsListOrWelcomeScreen method so I figure it belonged.
Go fix your interfaces that scroll into the abyss.