Exemplo n.º 1
0
 //draws the harddrive's info tabs
 private void FillInfoTabs(Rect cardRect)
 {
     if (this.tab == Neurolink_Dialog_Mainframe.InfoCardTab.Character)
     {
         CharacterCardUtility.DrawCharacterCard(cardRect, this.selectedHarddrive.pawn, null, default(Rect));
     }
     else if (this.tab == Neurolink_Dialog_Mainframe.InfoCardTab.Stats)
     {
         if (this.selectedHarddrive != null)
         {
             Thing         innerPawn     = this.selectedHarddrive.pawn;
             MinifiedThing minifiedThing = (Thing)this.selectedHarddrive as MinifiedThing;
             if (minifiedThing != null)
             {
                 innerPawn = minifiedThing.InnerThing;
             }
             StatsReportUtility.DrawStatsReport(cardRect, innerPawn);
         }
         //	else if (this.titleDef != null) { //%TODO%
         //		StatsReportUtility.DrawStatsReport(cardRect, this.titleDef, this.faction);
         //	}
     }
     else if (this.tab == Neurolink_Dialog_Mainframe.InfoCardTab.Social)
     {
         SocialCardUtility.DrawSocialCard(cardRect, this.selectedHarddrive.pawn);
     }
     else if (this.tab == Neurolink_Dialog_Mainframe.InfoCardTab.Needs)
     {
         Vector2 scrollPos = default(Vector2);
         NeedsCardUtility.DoNeedsMoodAndThoughts(cardRect, this.selectedHarddrive.pawn, ref scrollPos);
     }
 }
        protected override void FillTab()
        {
            this.UpdateSize();
            Rect rect = new Rect(17f, 17f, CharacterCardUtility.PawnCardSize(this.PawnToShowInfoAbout).x, CharacterCardUtility.PawnCardSize(this.PawnToShowInfoAbout).y);

            //VoidKeyCardUtility.DrawCharacterCard(rect, this.PawnToShowInfoAbout, this.SelThing, null, default(Rect));
            CharacterCardUtility.DrawCharacterCard(rect, this.PawnToShowInfoAbout, null, default(Rect));
        }
 protected void FillCard(Rect cardRect)
 {
     if (tab == InfoCardTab.Stats)
     {
         if (thing != null)
         {
             Thing         innerThing    = thing;
             MinifiedThing minifiedThing = thing as MinifiedThing;
             if (minifiedThing != null)
             {
                 innerThing = minifiedThing.InnerThing;
             }
             StatsReportUtility.DrawStatsReport(cardRect, innerThing);
         }
         else if (titleDef != null)
         {
             StatsReportUtility.DrawStatsReport(cardRect, titleDef, faction);
         }
         else if (faction != null)
         {
             StatsReportUtility.DrawStatsReport(cardRect, faction);
         }
         else if (worldObject != null)
         {
             StatsReportUtility.DrawStatsReport(cardRect, worldObject);
         }
         else if (def is AbilityDef)
         {
             StatsReportUtility.DrawStatsReport(cardRect, (AbilityDef)def);
         }
         else
         {
             StatsReportUtility.DrawStatsReport(cardRect, def, stuff);
         }
     }
     else if (tab == InfoCardTab.Character)
     {
         CharacterCardUtility.DrawCharacterCard(cardRect, (Pawn)thing);
     }
     else if (tab == InfoCardTab.Health)
     {
         cardRect.yMin += 8f;
         HealthCardUtility.DrawPawnHealthCard(cardRect, (Pawn)thing, allowOperations: false, showBloodLoss: false, null);
     }
     else if (tab == InfoCardTab.Records)
     {
         RecordsCardUtility.DrawRecordsCard(cardRect, (Pawn)thing);
     }
     else if (tab == InfoCardTab.Permits)
     {
         PermitsCardUtility.DrawRecordsCard(cardRect, (Pawn)thing);
     }
     if (executeAfterFillCardOnce != null)
     {
         executeAfterFillCardOnce();
         executeAfterFillCardOnce = null;
     }
 }
        public override void DoWindowContents(Rect rect)
        {
            base.DrawPageTitle(rect);
            Rect mainRect = base.GetMainRect(rect, 30f, false);

            Widgets.DrawMenuSection(mainRect, true);
            TabDrawer.DrawTabs(mainRect, from c in Find.GameInitData.startingPawns
                               select new TabRecord(c.LabelCap, delegate {
                this.SelectPawn(c);
            }, c == this.curPawn));
            Rect rect2 = mainRect.ContractedBy(17f);
            Rect rect3 = rect2;

            rect3.width = 100f;
            GUI.DrawTexture(new Rect(rect3.xMin + (rect3.width - Page_ConfigureStartingPawns.PawnPortraitSize.x) / 2f - 10f, rect3.yMin + 20f, Page_ConfigureStartingPawns.PawnPortraitSize.x, Page_ConfigureStartingPawns.PawnPortraitSize.y), PortraitsCache.Get(this.curPawn, Page_ConfigureStartingPawns.PawnPortraitSize, default(Vector3), 1f));
            Rect rect4 = rect2;

            rect4.xMin = rect3.xMax;
            Rect rect5 = rect4;

            rect5.width = 475f;
            CharacterCardUtility.DrawCharacterCard(rect5, this.curPawn, new Action(this.RandomizeCurPawn));
            Rect rect6 = new Rect(rect5.xMax + 5f, rect4.y + 100f, rect4.width - rect5.width - 5f, 200f);

            Text.Font = GameFont.Medium;
            Widgets.Label(rect6, "Health".Translate());
            Text.Font   = GameFont.Small;
            rect6.yMin += 35f;
            HealthCardUtility.DrawHediffListing(rect6, this.curPawn, true);
            Rect rect7 = new Rect(rect6.x, rect6.yMax, rect6.width, 200f);

            Text.Font = GameFont.Medium;
            Widgets.Label(rect7, "Relations".Translate());
            Text.Font   = GameFont.Small;
            rect7.yMin += 35f;
            SocialCardUtility.DrawRelationsAndOpinions(rect7, this.curPawn);

            // EdB: Add a middle "Prepare Carefully" button.
            // base.DoBottomButtons(rect, "Start".Translate(), null, null, true);
            Action prepareCarefullyAction = () => {
                PrepareCarefully.Instance.Initialize();
                PrepareCarefully.Instance.OriginalPage = this;
                Find.WindowStack.Add(new Page_ConfigureStartingPawnsCarefully());
                if (!PrepareCarefully.Instance.FindScenPart())
                {
                    Find.WindowStack.Add(new Dialog_Confirm("EdB.PrepareCarefully.ModConfigProblem.Description".Translate(),
                                                            delegate { }, true, "EdB.PrepareCarefully.ModConfigProblem.Title".Translate(), false));
                }
            };

            base.DoBottomButtons(rect, "Start".Translate(), "EdB.PrepareCarefully".Translate(), prepareCarefullyAction, true);
        }
Exemplo n.º 5
0
            public static bool FillTabP(ITab_Pawn_Character __instance)
            {
                FieldInfo fi = typeof(ITab_Pawn_Character).GetField("size", Unprivater.flags);

                fi.SetValue(__instance, new Vector2(cardX + 34f, cardY + 34f));

                var p = Unprivater.GetProtectedProperty <Pawn>("PawnToShowInfoAbout", __instance);

                Rect rect = new Rect(17f, 17f, 570f, cardY);

                CharacterCardUtility.DrawCharacterCard(rect, p, null, default(Rect));

                return(false);
            }
Exemplo n.º 6
0
        // RimWorld.ITab_Pawn_Character
        public static bool Vamp_FillTab(ITab_Pawn_Character __instance)
        {
            Pawn p = (Pawn)AccessTools.Method(typeof(ITab_Pawn_Character), "get_PawnToShowInfoAbout")
                     .Invoke(__instance, null);

            if (p.IsVampire() || p.IsGhoul())
            {
                Rect rect = new Rect(17f, 17f, CharacterCardUtility.BasePawnCardSize.x,
                                     CharacterCardUtility.BasePawnCardSize.y);
                if (isSwitched)
                {
                    VampireCardUtility.DrawVampCard(rect, p);
                }
                else
                {
                    CharacterCardUtility.DrawCharacterCard(rect, p);
                }
                return(false);
            }

            return(true);
        }
Exemplo n.º 7
0
        public override void DoWindowContents(Rect rect)
        {
            base.DrawPageTitle(rect);
            Rect mainRect = base.GetMainRect(rect, 30f, false);

            Widgets.DrawMenuSection(mainRect, true);
            TabDrawer.DrawTabs(mainRect, from c in Find.GameInitData.startingPawns
                               select new TabRecord(c.LabelCap, delegate
            {
                this.SelectPawn(c);
            }, c == this.curPawn));
            Rect rect2 = mainRect.ContractedBy(17f);
            Rect rect3 = rect2;

            rect3.width = 100f;
            GUI.DrawTexture(new Rect(rect3.xMin + (rect3.width - Page_ConfigureStartingSlaves.PawnPortraitSize.x) / 2f - 10f, rect3.yMin + 20f, Page_ConfigureStartingSlaves.PawnPortraitSize.x, Page_ConfigureStartingSlaves.PawnPortraitSize.y), PortraitsCache.Get(this.curPawn, Page_ConfigureStartingSlaves.PawnPortraitSize, default(Vector3), 1f));
            Rect rect4 = rect2;

            rect4.xMin = rect3.xMax;
            Rect rect5 = rect4;

            rect5.width = 475f;
            CharacterCardUtility.DrawCharacterCard(rect5, this.curPawn, new Action(this.RandomizeCurPawn));
            Rect rect6 = new Rect(rect5.xMax + 5f, rect4.y + 100f, rect4.width - rect5.width - 5f, 200f);

            Text.Font = GameFont.Medium;
            Widgets.Label(rect6, "Health".Translate());
            Text.Font   = GameFont.Small;
            rect6.yMin += 35f;
            HealthCardUtility.DrawHediffListing(rect6, this.curPawn, true);
            Rect rect7 = new Rect(rect6.x, rect6.yMax, rect6.width, 200f);

            Text.Font = GameFont.Medium;
            Widgets.Label(rect7, "Relations".Translate());
            Text.Font   = GameFont.Small;
            rect7.yMin += 35f;
            SocialCardUtility.DrawRelationsAndOpinions(rect7, this.curPawn);
            base.DoBottomButtons(rect, "Next".Translate(), null, null, true);
        }
        public override void DoWindowContents(Rect rect)
        {
            DrawPageTitle(rect);
            var mainRect = GetMainRect(rect, 30f);

            Widgets.DrawMenuSection(mainRect);
            TabDrawer.DrawTabs(mainRect, (from c in Find.GameInitData.startingAndOptionalPawns
                                          select new TabRecord(c.LabelCap, delegate { SelectPawn(c); }, c == curPawn)).ToList());
            var rect2 = mainRect.ContractedBy(17f);
            var rect3 = rect2;

            rect3.width = 100f;
            GUI.DrawTexture(
                new Rect(rect3.xMin + ((rect3.width - PawnPortraitSize.x) / 2f) - 10f, rect3.yMin + 20f,
                         PawnPortraitSize.x, PawnPortraitSize.y), PortraitsCache.Get(curPawn, PawnPortraitSize, Rot4.South));
            var rect4 = rect2;

            rect4.xMin = rect3.xMax;
            var rect5 = rect4;

            rect5.width = 475f;
            CharacterCardUtility.DrawCharacterCard(rect5, curPawn, RandomizeCurPawn);
            var rect6 = new Rect(rect5.xMax + 5f, rect4.y + 100f, rect4.width - rect5.width - 5f, 200f);

            Text.Font = GameFont.Medium;
            Widgets.Label(rect6, "Health".Translate());
            Text.Font   = GameFont.Small;
            rect6.yMin += 35f;
            HealthCardUtility.DrawHediffListing(rect6, curPawn, true);
            var rect7 = new Rect(rect6.x, rect6.yMax, rect6.width, 200f);

            Text.Font = GameFont.Medium;
            Widgets.Label(rect7, "Relations".Translate());
            Text.Font   = GameFont.Small;
            rect7.yMin += 35f;
            SocialCardUtility.DrawRelationsAndOpinions(rect7, curPawn);
            DoBottomButtons(rect, "Next".Translate());
        }
Exemplo n.º 9
0
 protected void FillCard(Rect cardRect)
 {
     if (this.tab == Dialog_InfoCard.InfoCardTab.Stats)
     {
         if (this.thing != null)
         {
             Thing         innerThing    = this.thing;
             MinifiedThing minifiedThing = this.thing as MinifiedThing;
             if (minifiedThing != null)
             {
                 innerThing = minifiedThing.InnerThing;
             }
             StatsReportUtility.DrawStatsReport(cardRect, innerThing);
         }
         else if (this.worldObject != null)
         {
             StatsReportUtility.DrawStatsReport(cardRect, this.worldObject);
         }
         else
         {
             StatsReportUtility.DrawStatsReport(cardRect, this.def, this.stuff);
         }
     }
     else if (this.tab == Dialog_InfoCard.InfoCardTab.Character)
     {
         CharacterCardUtility.DrawCharacterCard(cardRect, (Pawn)this.thing, null, default(Rect));
     }
     else if (this.tab == Dialog_InfoCard.InfoCardTab.Health)
     {
         cardRect.yMin += 8f;
         HealthCardUtility.DrawPawnHealthCard(cardRect, (Pawn)this.thing, false, false, null);
     }
     else if (this.tab == Dialog_InfoCard.InfoCardTab.Records)
     {
         RecordsCardUtility.DrawRecordsCard(cardRect, (Pawn)this.thing);
     }
 }
Exemplo n.º 10
0
 protected void FillCard(Rect cardRect)
 {
     if (tab == InfoCardTab.Stats)
     {
         if (thing != null)
         {
             Thing         innerThing    = thing;
             MinifiedThing minifiedThing = thing as MinifiedThing;
             if (minifiedThing != null)
             {
                 innerThing = minifiedThing.InnerThing;
             }
             StatsReportUtility.DrawStatsReport(cardRect, innerThing);
         }
         else if (worldObject != null)
         {
             StatsReportUtility.DrawStatsReport(cardRect, worldObject);
         }
         else
         {
             StatsReportUtility.DrawStatsReport(cardRect, def, stuff);
         }
     }
     else if (tab == InfoCardTab.Character)
     {
         CharacterCardUtility.DrawCharacterCard(cardRect, (Pawn)thing);
     }
     else if (tab == InfoCardTab.Health)
     {
         cardRect.yMin += 8f;
         HealthCardUtility.DrawPawnHealthCard(cardRect, (Pawn)thing, allowOperations: false, showBloodLoss: false, null);
     }
     else if (tab == InfoCardTab.Records)
     {
         RecordsCardUtility.DrawRecordsCard(cardRect, (Pawn)thing);
     }
 }