public WndClass(HeroClass cl) { var tabPerks = new PerksTab(cl); Add(tabPerks); Tab tab = new RankingTab(this, Utils.Capitalize(cl.Title()), tabPerks); tab.SetSize(TabWidth, TabHeight()); Add(tab); if (Badge.IsUnlocked(cl.MasteryBadge())) { var tabMastery = new MasteryTab(cl); Add(tabMastery); tab = new RankingTab(this, TxtMastery, tabMastery); tab.SetSize(TabWidth, TabHeight()); Add(tab); Resize((int)Math.Max(tabPerks.Width, tabMastery.Width), (int)Math.Max(tabPerks.Height, tabMastery.Height)); } else { Resize((int)tabPerks.Width, (int)tabPerks.Height); } Select(0); }
private void CreateControls() { string[] labels = { TXT_STATS, TXT_ITEMS, TXT_BADGES }; Group[] pages = { new StatsTab(), new ItemsTab(), new BadgesTab(this) }; for (var i = 0; i < pages.Length; i++) { Add(pages[i]); Tab tab = new RankingTab(this, labels[i], pages[i]); tab.SetSize(TAB_WIDTH, TabHeight()); Add(tab); } Select(0); }