public static IEnumerable <FloatMenuOption> GetFloatMenuOptions(CompLaunchable representative, IEnumerable <IThingHolder> pods, Site site) { foreach (FloatMenuOption floatMenuOption in TransportPodsArrivalActionUtility.GetFloatMenuOptions(() => CanVisit(pods, site), () => new TransportPodsArrivalAction_VisitSite(site, PawnsArrivalModeDefOf.EdgeDrop), "DropAtEdge".Translate(), representative, site.Tile)) { yield return(floatMenuOption); } foreach (FloatMenuOption floatMenuOption2 in TransportPodsArrivalActionUtility.GetFloatMenuOptions(() => CanVisit(pods, site), () => new TransportPodsArrivalAction_VisitSite(site, PawnsArrivalModeDefOf.CenterDrop), "DropInCenter".Translate(), representative, site.Tile)) { yield return(floatMenuOption2); } }
public TransportPodsArrivalAction_VisitSite(Site site, PawnsArrivalModeDef arrivalMode) { this.site = site; this.arrivalMode = arrivalMode; }
public static FloatMenuAcceptanceReport CanVisit(IEnumerable <IThingHolder> pods, Site site) { if (site == null || !site.Spawned) { return(false); } if (!TransportPodsArrivalActionUtility.AnyNonDownedColonist(pods)) { return(false); } if (site.EnterCooldownBlocksEntering()) { return(FloatMenuAcceptanceReport.WithFailMessage("MessageEnterCooldownBlocksEntering".Translate(site.EnterCooldownDaysLeft().ToString("0.#")))); } return(true); }
public static FloatMenuAcceptanceReport CanVisit(IEnumerable <IThingHolder> pods, Site site) { FloatMenuAcceptanceReport result; if (site == null || !site.Spawned || !site.core.def.transportPodsCanLandAndGenerateMap) { result = false; } else if (!TransportPodsArrivalActionUtility.AnyNonDownedColonist(pods)) { result = false; } else if (site.EnterCooldownBlocksEntering()) { result = FloatMenuAcceptanceReport.WithFailMessage("MessageEnterCooldownBlocksEntering".Translate(new object[] { site.EnterCooldownDaysLeft().ToString("0.#") })); } else { result = true; } return(result); }