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);
     }
 }
Exemplo n.º 2
0
        protected override void ExtraOnGUI()
        {
            this.EnsureSpecificNeedsTabForPawnValid();
            base.ExtraOnGUI();
            Pawn localSpecificNeedsTabForPawn = this.specificNeedsTabForPawn;

            if (localSpecificNeedsTabForPawn != null)
            {
                Rect  tabRect = base.TabRect;
                float specificNeedsTabWidth = this.SpecificNeedsTabWidth;
                Rect  rect = new Rect(tabRect.xMax - 1f, tabRect.yMin, specificNeedsTabWidth, tabRect.height);
                Find.WindowStack.ImmediateWindow(1439870015, rect, WindowLayer.GameUI, delegate
                {
                    if (localSpecificNeedsTabForPawn.DestroyedOrNull())
                    {
                        return;
                    }
                    NeedsCardUtility.DoNeedsMoodAndThoughts(rect.AtZero(), localSpecificNeedsTabForPawn, ref this.thoughtScrollPosition);
                    if (Widgets.CloseButtonFor(rect.AtZero()))
                    {
                        this.specificNeedsTabForPawn = null;
                        SoundDefOf.TabClose.PlayOneShotOnCamera(null);
                    }
                }, true, false, 1f);
            }
        }
Exemplo n.º 3
0
        public static void _Postfix(ITab_Pawn_Needs __instance)
        {
            if (Find.CurrentMap == null)
            {
                return;
            }
            if (!TableDiner.settings.useExtraFeatures)
            {
                return;
            }
            Pawn SelPawn = Find.Selector.SingleSelectedThing as Pawn;

            if (SelPawn != null && SelPawn.IsColonist)
            {
                Vector2 size       = NeedsCardUtility.GetSize(SelPawn);
                Rect    tabRect    = new Rect(20, size.y - (ITab_Table.WinSize.y) + 10, ITab_Table.WinSize.x - 40, ITab_Table.WinSize.y - 20);
                Rect    tabRectBig = new Rect(10, size.y - (ITab_Table.WinSize.y) + 5, ITab_Table.WinSize.x - 20, ITab_Table.WinSize.y - 10);
                float   tr         = TableDinerGlobal.GetTableRadius(SelPawn.ThingID);
                GUI.color = Color.white;
                if (tr > TableDiner.settings.tableDistance)
                {
                    GUI.color = Color.yellow;
                }
                if (Mouse.IsOver(tabRect))
                {
                    Widgets.DrawHighlight(tabRectBig);
                    mOver = true;
                }
                TableDinerGlobal.tableRadii[SelPawn.ThingID] = Mathf.Pow(Widgets.HorizontalSlider(tabRect, Mathf.Sqrt(tr), 0, 23, true, tr < 1 ? "TDiner.Ignored".Translate() : Mathf.Round(tr).ToString(), "TDiner.TRSlideLabel".Translate()), 2);
                GUI.color = Color.white;
            }
        }
        //[DetourMethod(typeof(ITab_Pawn_Needs), "FillTab")]
        protected override void FillTab()
        {
            NeedsCardUtility.DoNeedsMoodAndThoughts(new Rect(0, 0, this.size.x, RimWorld.NeedsCardUtility.GetSize(SelPawn).y), base.SelPawn, ref this.thoughtScrollPosition);
            //base.FillTab();

            // ------ MOD -----------

            if (SelPawn.CanHaveFoodPolicy())
            {
                policyCardRect = new Rect(0, this.size.y - PawnPolicyCard.Size.y, PawnPolicyCard.Size.x, PawnPolicyCard.Size.y);
                //policyRect = new Rect(0, 0, PawnPolicyCard.RectSize.x, PawnPolicyCard.RectSize.y);
                PawnPolicyCard.Draw(policyCardRect, SelPawn);
            }

            // ------ MOD END -----------
        }
Exemplo n.º 5
0
        // RimWorld.Planet.WITab_Caravan_Needs
        //[DetourMethod(typeof(RimWorld.Planet.WITab_Caravan_Needs),"ExtraOnGUI")]
        protected override void ExtraOnGUI()
        {
            //base.ExtraOnGUI();
            Log.Message("ExtraOnGUI() 0 ");

            Pawn localSpecificNeedsTabForPawn = this.specificNeedsTabForPawn;

            if (localSpecificNeedsTabForPawn != null)
            {
                Rect tabRect = base.TabRect;

                tabRect.y      -= UI.PawnPolicyCard.Size.y;
                tabRect.height += UI.PawnPolicyCard.Size.y;

                float specificNeedsTabWidth = this.SpecificNeedsTabWidth;
                //Rect rect = new Rect(tabRect.xMax - 1f, tabRect.yMin, specificNeedsTabWidth, tabRect.height);

                Rect rect = new Rect(tabRect.xMax - 1f, tabRect.yMin, specificNeedsTabWidth, tabRect.height + UI.PawnPolicyCard.Size.y);

                Find.WindowStack.ImmediateWindow(1439870015, rect, WindowLayer.GameUI, delegate
                {
                    if (localSpecificNeedsTabForPawn.DestroyedOrNull())
                    {
                        return;
                    }
                    Log.Message("ExtraOnGUI() 1 " + rect);
                    NeedsCardUtility.DoNeedsMoodAndThoughts(rect, localSpecificNeedsTabForPawn, ref this.thoughtScrollPosition);

                    // --------- MOD ---------

                    Rect policyCardRect = new Rect(rect.x, rect.y + UI.PawnPolicyCard.Size.y, UI.PawnPolicyCard.Size.x, UI.PawnPolicyCard.Size.y);
                    Log.Message("ExtraOnGUI() 2 " + rect);

                    UI.PawnPolicyCard.Draw(rect, this.specificNeedsTabForPawn);

                    // --------- MOD END ---------

                    if (Widgets.CloseButtonFor(rect.AtZero()))
                    {
                        this.specificNeedsTabForPawn = null;
                        SoundDefOf.TabClose.PlayOneShotOnCamera();
                    }
                }, true, false, 1f);
            }
        }
Exemplo n.º 6
0
 protected override void UpdateSize()
 {
     size = NeedsCardUtility.GetSize(PawnForNeeds);
 }
Exemplo n.º 7
0
 protected override void FillTab()
 {
     NeedsCardUtility.DoNeedsMoodAndThoughts(new Rect(0f, 0f, size.x, size.y), PawnForNeeds, ref thoughtScrollPosition);
 }