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); } }
//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); } }
//[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 ----------- }
// 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); } }
protected override void FillTab() { NeedsCardUtility.DoNeedsMoodAndThoughts(new Rect(0f, 0f, size.x, size.y), PawnForNeeds, ref thoughtScrollPosition); }