public static bool PublicTest(Sim actor, GameObject target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback) { if (TravelUtil.PlayerMadeTravelRequest) { greyedOutTooltipCallback = Common.DebugTooltip("PlayerMadeTravelRequest"); return(false); } if ((target.Repairable != null) && target.Repairable.Broken) { greyedOutTooltipCallback = Common.DebugTooltip("Broken"); return(false); } if (!TimePortal.sTimeTravelerHasBeenSummoned) { greyedOutTooltipCallback = Common.DebugTooltip("sTimeTravelerHasBeenSummoned"); return(false); } if (target.InUse && !target.IsActorUsingMe(actor)) { greyedOutTooltipCallback = Common.DebugTooltip("InUse"); return(false); } CauseEffectService instance = CauseEffectService.GetInstance(); if ((instance != null) && !instance.ShouldShowTimeAlmanacButton()) { greyedOutTooltipCallback = Common.DebugTooltip("ShouldShowTimeAlmanacButton"); return(false); } if (actor.BuffManager.HasElement(BuffNames.Ensorcelled)) { greyedOutTooltipCallback = Common.DebugTooltip("Ensorcelled"); return(false); } if (GameUtils.IsFutureWorld() && (actor.Household.Sims.Count != 0x1)) { greyedOutTooltipCallback = Common.DebugTooltip("Multiple"); return(false); } // Custom if (!TravelerSpace.Helpers.TravelUtilEx.CanSimTriggerTravelToFutureWorld(actor, true, ref greyedOutTooltipCallback)) { return(false); } return(true); }
public static bool PublicTest(Sim actor, GameObject target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback) { if ((target.Repairable != null) && target.Repairable.Broken) { greyedOutTooltipCallback = Common.DebugTooltip("Broken"); return(false); } if (TravelUtil.PlayerMadeTravelRequest) { greyedOutTooltipCallback = Common.DebugTooltip("PlayerMadeTravelRequest"); return(false); } if (target.InUse && !target.IsActorUsingMe(actor)) { greyedOutTooltipCallback = Common.DebugTooltip("InUse"); return(false); } CauseEffectService instance = CauseEffectService.GetInstance(); if ((instance != null) && !instance.ShouldShowTimeAlmanacButton()) { greyedOutTooltipCallback = Common.DebugTooltip("ShouldShowTimeAlmanacButton"); return(false); } if (actor.BuffManager.HasElement(BuffNames.Ensorcelled)) { greyedOutTooltipCallback = Common.DebugTooltip("Ensorcelled"); return(false); } if (actor.Household.Sims.Count <= 0x1) { greyedOutTooltipCallback = Common.DebugTooltip("Single"); return(false); } // Custom if (!TravelerSpace.Helpers.TravelUtilEx.CanSimTriggerTravelToFutureWorld(actor, true, ref greyedOutTooltipCallback)) { return(false); } if (GameUtils.IsFutureWorld()) { foreach (Sim sim in Households.AllSims(actor.Household)) { // Custom if ((sim != actor) && !TravelerSpace.Helpers.TravelUtilEx.CanSimTriggerTravelToFutureWorld(sim, true, ref greyedOutTooltipCallback)) { //greyedOutTooltipCallback = InteractionInstance.CreateTooltipCallback(Localization.LocalizeString(actor.IsFemale, TimePortal.sLocalizationKey + ":UnfitForTravel", new object[] { actor })); return(false); } } } else { Common.StringBuilder result = new Common.StringBuilder(); List <Sim> list = new List <Sim>(); foreach (Sim sim2 in Households.AllSims(actor.Household)) { // Custom if ((sim2 != actor) && TravelerSpace.Helpers.TravelUtilEx.CanSimTriggerTravelToFutureWorld(sim2, true, ref greyedOutTooltipCallback)) { if (greyedOutTooltipCallback != null) { result += Common.NewLine + greyedOutTooltipCallback(); } list.Add(sim2); } } if (list.Count == 0x0) { greyedOutTooltipCallback = InteractionInstance.CreateTooltipCallback(Localization.LocalizeString(actor.IsFemale, TimePortal.sLocalizationKey + ":UnfitForTravel", new object[] { actor }) + Common.NewLine + result); return(false); } } return(true); }