While creating (or at least trying to
) the trading system for Valikorlia, I realized that I wasn't accounting for duplicate items. So, I had the idea of having a text control at the bottom right-hand corner of the item's icon. However, I haven't had much luck.
I've tried creating a GuiTextCtrl inside the GuiTextListEntry, but it doesn't work. I've also tried creating it outside of the GuiTextListEntry, and it still doesn't work. Each time I try to create a GuiTextCtrl inside of this particular loop, it breaks and no rows are added at all.
Below is the chunk of code I'm dealing with. Note that
temp.i is declared at the start of the function.
PHP Code:
new GuiScrollCtrl("Trade_Inventory_Scroll") {
profile = GuiScrollProfile;
height = 225;
hscrollbar = "alwaysOff";
vscrollbar = "dynamic";
width = 165;
new GuiTextListCtrl("Trade_Inventory") {
profile = GuiTextListProfile;
height = 32;
horizsizing = "width";
seticonsize(32,32);
for(i = 0; i < thiso.archlist.size(); i++) {
if(thiso.archlist[i][0] == "gold") {
continue;
}
with(addrow(i, thiso.archlist[i][3])) {
this.archname = thiso.archlist[i][0];
this.iconimg = thiso.archlist[i][1];
this.value = thiso.archlist[i][2];
this.name_sl = thiso.archlist[i][3];
this.name_pl = thiso.archlist[i][4];
this.count = thiso.archlist[i][5];
this.icon.drawimage(0, 0, this.iconimg);
this.hint = "Value: " @ this.value;
}
/*
-- Trying to add it outside of the addrow()
does not work. Neither does adding it
inside of the addrow().
new GuiTextCtrl("Trade_" @ thiso.archlist[i][0] @ "_Count") {
profile = GuiInventoryItemTextProfile;
x = Trade_Inventory.rows[i].x + 15;
y = Trade_Inventory.rows[i].y + 15;
text = "x" @ thiso.archlist[i][5];
}*/
}
}
}