Here's the script
PHP Code:
public function updateInventory(){
for (temp.i = 0; temp.i < 42; temp.i++)
{
(@ "InventoryGuiBitmapCtrl_item_" @ temp.i).destroy();
}
temp.itemlist = clientr.item.getdynamicvarnames();
temp.w = -1;
for (temp.i = 0; temp.i < temp.itemlist.size(); temp.i++)
{
if (clientr.item.(@temp.itemlist[temp.i])[13] == this.selectedtab)
{
if (temp.w > 4)
{
temp.w = null;
temp.h++;
}
else
temp.w++;
with (InventoryGuiScrollCtrl_Contents){
new GuiShowImgCtrl("InventoryGuiShowImgCtrl_item_" @ temp.i){
this.itemvars = {temp.itemlist[temp.i], clientr.item.(@temp.itemlist[temp.i])[9]};
x = (temp.w*33);
y = (temp.h*33);
image = clientr.item.(@temp.itemlist[temp.i])[12];
width = height = 32;
thiso.catchevent(name, "onMouseEnter", "onUpdateItemNameText");
thiso.catchevent(name, "onMouseLeave", "onClearItemNameText");
thiso.catchevent(name, "onMouseDown", "onTest");
new GuiTextCtrl("InventoryGuiTextCtrl_item_" @ temp.i){
this.itemvars = {temp.itemlist[temp.i], clientr.item.(@temp.itemlist[temp.i])[9]};
x = 0;
y = 10;
width = height = 32;
useownprofile = true;
profile.align = "right";
profile.textshadow = true;
text = clientr.item.(@temp.itemlist[temp.i])[0];
thiso.catchevent(name, "onMouseEnter", "onUpdateItemNameText");
thiso.catchevent(name, "onMouseLeave", "onClearItemNameText");
thiso.catchevent(name, "onMouseDown", "onTest");
}
}
}
}
}
GraalControl.makefirstresponder(true);
}