Calculate and store widget parent id and position when the interfaces are rendered

This removes the need to calculate widget bounds and parent on demand by
traversing up the widget tree.
This commit is contained in:
Adam
2018-06-26 15:14:53 -04:00
parent 8ad6f466da
commit 799f8b1266
6 changed files with 137 additions and 110 deletions

View File

@@ -156,6 +156,15 @@ public interface RSClient extends RSGameEngine, Client
@Import("widgets")
RSWidget[][] getWidgets();
/**
* Gets an array of widgets that correspond to the passed group ID.
*
* @param groupId the group ID
* @return the widget group
* @see net.runelite.api.widgets.WidgetID
*/
RSWidget[] getGroup(int groupId);
@Import("region")
@Override
RSRegion getRegion();

View File

@@ -40,6 +40,12 @@ public interface RSWidget extends Widget
@Override
int getId();
void setRenderParentId(int parentId);
void setRenderX(int x);
void setRenderY(int y);
@Import("parentId")
int getRSParentId();