use of com.watabou.noosa.ui.Component in project pixel-dungeon-remix by NYRDS.
the class WndCatalogus method updateList.
private void updateList() {
txtTitle.text(Utils.format(TXT_TITLE, showPotions ? TXT_POTIONS : TXT_SCROLLS));
txtTitle.measure();
txtTitle.x = PixelScene.align(PixelScene.uiCamera, (width - txtTitle.width()) / 2);
items.clear();
Component content = list.content();
content.clear();
list.scrollTo(0, 0);
float pos = 0;
for (Class<? extends Item> itemClass : showPotions ? Potion.getKnown() : Scroll.getKnown()) {
CatalogusListItem item = new CatalogusListItem(itemClass);
item.setRect(0, pos, width, ITEM_HEIGHT);
content.add(item);
items.add(item);
pos += item.height();
}
for (Class<? extends Item> itemClass : showPotions ? Potion.getUnknown() : Scroll.getUnknown()) {
CatalogusListItem item = new CatalogusListItem(itemClass);
item.setRect(0, pos, width, ITEM_HEIGHT);
content.add(item);
items.add(item);
pos += item.height();
}
content.setSize(width, pos);
}
Aggregations