public WndJournal() { Resize(WIDTH, HEIGHT); txtTitle = PixelScene.CreateText(TxtTitle, 9); txtTitle.Hardlight(TitleColor); txtTitle.Measure(); txtTitle.X = PixelScene.Align(PixelScene.uiCamera, (WIDTH - txtTitle.Width) / 2); Add(txtTitle); var content = new Component(); Collections.Sort(Journal.Records); float pos = 0; foreach (var rec in Journal.Records) { var item = new ListItem(rec.feature, rec.depth); item.SetRect(0, pos, WIDTH, ItemHeight); content.Add(item); pos += item.Height; } content.SetSize(WIDTH, pos); list = new ScrollPane(content); Add(list); list.SetRect(0, txtTitle.Height, WIDTH, HEIGHT - txtTitle.Height); }
public WndCatalogus() { Resize(WIDTH, HEIGHT); _txtTitle = PixelScene.CreateText(TxtTitle, 9); _txtTitle.Hardlight(TitleColor); _txtTitle.Measure(); Add(_txtTitle); _list = new ScrollPane(new Component()); _list.ClickAction = ListClick; Add(_list); _list.SetRect(0, _txtTitle.Height, WIDTH, HEIGHT - _txtTitle.Height); var potionTab = new LabeledTab(this, TxtPotions); potionTab.SelectAction = PotionTabSelect; Tabs.Add(potionTab); var scrollTab = new LabeledTab(this, TxtPotions); scrollTab.SelectAction = ScrollTabSelect; Tabs.Add(potionTab); foreach (var tab in Tabs) { tab.SetSize(TabWidth, TabHeight()); Add(tab); } Select(ShowPotions ? 0 : 1); }