コード例 #1
0
ファイル: WndClass.cs プロジェクト: zvinch/SharpDungeon
        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);
        }