示例#1
0
        public override void DoWindowContents(Rect inRect)
        {
            Rect rect = new Rect(inRect);

            rect        = rect.ContractedBy(18f);
            rect.height = 34f;
            Text.Font   = GameFont.Medium;
            Widgets.Label(rect, GetTitle());

            Rect rect2 = new Rect(inRect);

            rect2.yMin  = rect.yMax;
            rect2.yMax -= 38f;

            Rect rect3 = rect2;

            rect3.yMin += 45f;

            List <TabRecord> list = new List <TabRecord>();
            TabRecord        item = new TabRecord("TabStats".Translate(), delegate
            {
                tab = InfoCardTab.Stats;
            }, tab == InfoCardTab.Stats);

            list.Add(item);

            TabDrawer.DrawTabs(rect3, list);
            FillCard(rect3.ContractedBy(18f));
        }
示例#2
0
        private void Setup()
        {
            tab                     = InfoCardTab.Stats;
            forcePause              = true;
            doCloseButton           = true;
            doCloseX                = true;
            absorbInputAroundWindow = true;
            closeOnClickedOutside   = true;
            soundAppear             = SoundDefOf.InfoCard_Open;
            soundClose              = SoundDefOf.InfoCard_Close;

            PlayerKnowledgeDatabase.KnowledgeDemonstrated(ConceptDefOf.InfoCard, KnowledgeAmount.Total);
        }
示例#3
0
        public override void DoWindowContents(Rect inRect)
        {
            Rect rect = new Rect(inRect);

            rect        = rect.ContractedBy(18f);
            rect.height = 34f;
            Text.Font   = GameFont.Medium;
            Widgets.Label(rect, this.GetTitle());
            Rect rect2 = new Rect(inRect);

            rect2.yMin  = rect.yMax;
            rect2.yMax -= 38f;
            Rect rect3 = rect2;

            rect3.yMin += 45f;
            List <TabRecord> list = new List <TabRecord>();
            TabRecord        item = new TabRecord("TabStats".Translate(), delegate
            {
                this.tab = InfoCardTab.Stats;
            }, this.tab == InfoCardTab.Stats);

            list.Add(item);
            if (this.ThingPawn != null)
            {
                if (this.ThingPawn.RaceProps.Humanlike)
                {
                    TabRecord item2 = new TabRecord("TabCharacter".Translate(), delegate
                    {
                        this.tab = InfoCardTab.Character;
                    }, this.tab == InfoCardTab.Character);
                    list.Add(item2);
                }
                TabRecord item3 = new TabRecord("TabHealth".Translate(), delegate
                {
                    this.tab = InfoCardTab.Health;
                }, this.tab == InfoCardTab.Health);
                list.Add(item3);
                TabRecord item4 = new TabRecord("TabRecords".Translate(), delegate
                {
                    this.tab = InfoCardTab.Records;
                }, this.tab == InfoCardTab.Records);
                list.Add(item4);
            }
            TabDrawer.DrawTabs(rect3, list);
            this.FillCard(rect3.ContractedBy(18f));
        }
        public override void DoWindowContents(Rect inRect)
        {
            Rect rect = new Rect(inRect);

            rect        = rect.ContractedBy(18f);
            rect.height = 34f;
            rect.x     += 34f;
            Text.Font   = GameFont.Medium;
            Widgets.Label(rect, GetTitle());
            Rect rect2 = new Rect(inRect.x + 9f, rect.y, 34f, 34f);

            if (thing != null)
            {
                Widgets.ThingIcon(rect2, thing);
            }
            else
            {
                Widgets.DefIcon(rect2, def, stuff, 1f, drawPlaceholder: true);
            }
            Rect rect3 = new Rect(inRect);

            rect3.yMin  = rect.yMax;
            rect3.yMax -= 38f;
            Rect             rect4 = rect3;
            List <TabRecord> list  = new List <TabRecord>();
            TabRecord        item  = new TabRecord("TabStats".Translate(), delegate
            {
                tab = InfoCardTab.Stats;
            }, tab == InfoCardTab.Stats);

            list.Add(item);
            if (ThingPawn != null)
            {
                if (ThingPawn.RaceProps.Humanlike)
                {
                    TabRecord item2 = new TabRecord("TabCharacter".Translate(), delegate
                    {
                        tab = InfoCardTab.Character;
                    }, tab == InfoCardTab.Character);
                    list.Add(item2);
                }
                TabRecord item3 = new TabRecord("TabHealth".Translate(), delegate
                {
                    tab = InfoCardTab.Health;
                }, tab == InfoCardTab.Health);
                list.Add(item3);
                if (ModsConfig.RoyaltyActive && ThingPawn.RaceProps.Humanlike && ThingPawn.Faction == Faction.OfPlayer && !ThingPawn.IsQuestLodger() && ThingPawn.royalty != null && PermitsCardUtility.selectedFaction != null)
                {
                    TabRecord item4 = new TabRecord("TabPermits".Translate(), delegate
                    {
                        tab = InfoCardTab.Permits;
                    }, tab == InfoCardTab.Permits);
                    list.Add(item4);
                }
                TabRecord item5 = new TabRecord("TabRecords".Translate(), delegate
                {
                    tab = InfoCardTab.Records;
                }, tab == InfoCardTab.Records);
                list.Add(item5);
            }
            if (list.Count > 1)
            {
                rect4.yMin += 45f;
                TabDrawer.DrawTabs(rect4, list);
            }
            FillCard(rect4.ContractedBy(18f));
            if (def != null && def is BuildableDef)
            {
                IEnumerable <ThingDef> enumerable = GenStuff.AllowedStuffsFor((BuildableDef)def);
                if (enumerable.Count() > 0 && ShowMaterialsButton(inRect, history.Count > 0))
                {
                    List <FloatMenuOption> list2 = new List <FloatMenuOption>();
                    foreach (ThingDef item6 in enumerable)
                    {
                        ThingDef localStuff = item6;
                        list2.Add(new FloatMenuOption(item6.LabelCap, delegate
                        {
                            stuff = localStuff;
                            Setup();
                        }, item6));
                    }
                    Find.WindowStack.Add(new FloatMenu(list2));
                }
            }
            if (history.Count > 0 && Widgets.BackButtonFor(inRect))
            {
                Hyperlink hyperlink = history[history.Count - 1];
                history.RemoveAt(history.Count - 1);
                Find.WindowStack.TryRemove(typeof(Dialog_InfoCard), doCloseSound: false);
                hyperlink.OpenDialog();
            }
        }
 public void SetTab(InfoCardTab infoCardTab)
 {
     tab = infoCardTab;
 }
 public Dialog_InfoCard(Thing thing)
 {
     this.thing = thing;
     tab        = InfoCardTab.Stats;
     Setup();
 }
示例#7
0
 public Dialog_InfoCard_RimWind(List <Thing> products)
 {
     this.products = products;
     tab           = InfoCardTab.Stats;
     Setup();
 }
示例#8
0
 public Dialog_InfoCard_RimWind(EnchantmentTask enchantmentTask)
 {
     this.enchantmentTask = enchantmentTask;
     tab = InfoCardTab.Stats;
     Setup();
 }