public static bool CanDoNext(ref Page original) { bool result; if (!CheckColonistStats()) { Find.WindowStack.Add(new Page_VerifyStartConfiguration(original)); result = false; } else { foreach (Pawn current in Find.GameInitData.startingPawns) { if (!current.Name.IsValid) { Messages.Message(Translator.Translate("EveryoneNeedsValidName"), MessageSound.RejectInput); result = false; return(result); } } PortraitsCache.Clear(); result = true; } return(result); }
protected override bool CanDoNext() { bool flag; if (NewGameRules.floCurItemPoints < 0f || NewGameRules.floCurPawnPoints < 0f) { Messages.Message("You do not have enough points to continue.", MessageSound.RejectInput); flag = false; return(flag); } if (!base.CanDoNext()) { return(false); } List <Pawn> .Enumerator enumerator = Find.GameInitData.startingPawns.GetEnumerator(); try { while (enumerator.MoveNext()) { if (enumerator.Current.Name.IsValid) { continue; } Messages.Message("EveryoneNeedsValidName".Translate(), MessageSound.RejectInput); flag = false; return(flag); } PortraitsCache.Clear(); return(true); } finally { ((IDisposable)(object)enumerator).Dispose(); } }
private void UpdatePortrate() { this.Pawn.Drawer.renderer.graphics.ResolveAllGraphics(); PortraitsCache.Clear(); PortraitsCache.PortraitsCacheUpdate(); this.PortraitNeedUpdate = false; }
//fixes issue of portraits of pawns with gradient hairs having blank portraits on pawn selection screen public static void PreloadCacheBugfix() { for (int i = 0; i < Find.GameInitData.startingAndOptionalPawns.Count; i++) { Pawn pawn = Find.GameInitData.startingAndOptionalPawns[i]; PortraitsCache.Get(pawn, new Vector2(70f, 110f)); PortraitsCache.Clear(); } }
public static void UpdateApparelGraphicsFor(Pawn pawn) { if (pawn != null) { pawn.Drawer.renderer.graphics.ResolveApparelGraphics(); PortraitsCache.SetDirty(pawn); PortraitsCache.Clear(); PortraitsCache.PortraitsCacheUpdate(); } }
public void StartGame() { if (CanDoNext()) { PrepareCarefully.Instance.Active = true; PrepareCarefully.Instance.State.Page.Close(false); PrepareCarefully.Instance.State.Page = null; PrepareGame(); PrepareCarefully.Instance.DoNextInBasePage(); PrepareCarefully.RemoveInstance(); PortraitsCache.Clear(); } }
// // Methods // protected override bool CanDoNext() { if (!base.CanDoNext()) { return(false); } foreach (Pawn current in Find.GameInitData.startingPawns) { if (!current.Name.IsValid) { Messages.Message("EveryoneNeedsValidName".Translate(), MessageSound.RejectInput); return(false); } } PortraitsCache.Clear(); return(true); }
protected override bool CanDoNext() { if (!base.CanDoNext()) { return(false); } foreach (var current in Find.GameInitData.startingAndOptionalPawns) { if (current.Name.IsValid) { continue; } Messages.Message("EveryoneNeedsValidName".Translate(), MessageTypeDefOf.RejectInput); return(false); } PortraitsCache.Clear(); return(true); }