public override IEnumerable <FloatMenuOption> GetTransportPodsFloatMenuOptions(IEnumerable <IThingHolder> pods, CompLaunchable representative) { foreach (FloatMenuOption transportPodsFloatMenuOption in base.GetTransportPodsFloatMenuOptions(pods, representative)) { yield return(transportPodsFloatMenuOption); } if (!TransportPodsArrivalAction_LandInSpecificCell.CanLandInSpecificCell(pods, this)) { yield break; } yield return(new FloatMenuOption("LandInExistingMap".Translate(Label), delegate { Map myMap = representative.parent.Map; Map map = Map; Current.Game.CurrentMap = map; CameraJumper.TryHideWorld(); Find.Targeter.BeginTargeting(TargetingParameters.ForDropPodsDestination(), delegate(LocalTargetInfo x) { representative.TryLaunch(base.Tile, new TransportPodsArrivalAction_LandInSpecificCell(this, x.Cell, representative.parent.TryGetComp <CompShuttle>() != null)); }, null, delegate { if (Find.Maps.Contains(myMap)) { Current.Game.CurrentMap = myMap; } }, CompLaunchable.TargeterMouseAttachment); })); }
public static IEnumerable <FloatMenuOption> GetFloatMenuOptions <T>(Func <FloatMenuAcceptanceReport> acceptanceReportGetter, Func <T> arrivalActionGetter, string label, CompLaunchable representative, int destinationTile) where T : TransportPodsArrivalAction { _003CGetFloatMenuOptions_003Ec__Iterator0 <T> _003CGetFloatMenuOptions_003Ec__Iterator = (_003CGetFloatMenuOptions_003Ec__Iterator0 <T>) /*Error near IL_0036: stateMachine*/; FloatMenuAcceptanceReport rep = acceptanceReportGetter(); if (rep.Accepted || !rep.FailReason.NullOrEmpty() || !rep.FailMessage.NullOrEmpty()) { if (rep.FailReason.NullOrEmpty()) { yield return(new FloatMenuOption(label, delegate { FloatMenuAcceptanceReport floatMenuAcceptanceReport = acceptanceReportGetter(); if (floatMenuAcceptanceReport.Accepted) { representative.TryLaunch(destinationTile, arrivalActionGetter()); } else if (!floatMenuAcceptanceReport.FailMessage.NullOrEmpty()) { Messages.Message(floatMenuAcceptanceReport.FailMessage, new GlobalTargetInfo(destinationTile), MessageTypeDefOf.RejectInput, historical: false); } })); /*Error: Unable to find new state assignment for yield return*/; } yield return(new FloatMenuOption(label + " (" + rep.FailReason + ")", null)); /*Error: Unable to find new state assignment for yield return*/; } }
public override IEnumerable <FloatMenuOption> GetTransportPodsFloatMenuOptions(IEnumerable <IThingHolder> pods, CompLaunchable representative) { foreach (FloatMenuOption o in base.GetTransportPodsFloatMenuOptions(pods, representative)) { yield return(o); } if (TransportPodsArrivalAction_LandInSpecificCell.CanLandInSpecificCell(pods, this)) { yield return(new FloatMenuOption("LandInExistingMap".Translate(new object[] { this.Label }), delegate() { Map myMap = representative.parent.Map; Map map = this.Map; Current.Game.CurrentMap = map; CameraJumper.TryHideWorld(); Find.Targeter.BeginTargeting(TargetingParameters.ForDropPodsDestination(), delegate(LocalTargetInfo x) { representative.TryLaunch(this.Tile, new TransportPodsArrivalAction_LandInSpecificCell(this.$this, x.Cell)); }, null, delegate() { if (Find.Maps.Contains(myMap)) { Current.Game.CurrentMap = myMap; } }, CompLaunchable.TargeterMouseAttachment); }, MenuOptionPriority.Default, null, null, 0f, null, null)); } yield break; }
public static IEnumerable <FloatMenuOption> GetFloatMenuOptions <T>(Func <FloatMenuAcceptanceReport> acceptanceReportGetter, Func <T> arrivalActionGetter, string label, CompLaunchable representative, int destinationTile) where T : TransportPodsArrivalAction { FloatMenuAcceptanceReport rep = acceptanceReportGetter(); if (rep.Accepted || !rep.FailReason.NullOrEmpty() || !rep.FailMessage.NullOrEmpty()) { if (!rep.FailReason.NullOrEmpty()) { yield return(new FloatMenuOption(label + " (" + rep.FailReason + ")", null, MenuOptionPriority.Default, null, null, 0f, null, null)); } else { yield return(new FloatMenuOption(label, delegate() { FloatMenuAcceptanceReport floatMenuAcceptanceReport = acceptanceReportGetter(); if (floatMenuAcceptanceReport.Accepted) { representative.TryLaunch(destinationTile, arrivalActionGetter()); } else if (!floatMenuAcceptanceReport.FailMessage.NullOrEmpty()) { Messages.Message(floatMenuAcceptanceReport.FailMessage, new GlobalTargetInfo(destinationTile), MessageTypeDefOf.RejectInput, false); } }, MenuOptionPriority.Default, null, null, 0f, null, null)); } } yield break; }
public bool MoveNext() { uint num = (uint)this.$PC; this.$PC = -1; switch (num) { case 0u: rep = acceptanceReportGetter(); if (rep.Accepted || !rep.FailReason.NullOrEmpty() || !rep.FailMessage.NullOrEmpty()) { if (!rep.FailReason.NullOrEmpty()) { this.$current = new FloatMenuOption(label + " (" + rep.FailReason + ")", null, MenuOptionPriority.Default, null, null, 0f, null, null); if (!this.$disposing) { this.$PC = 1; } } else { this.$current = new FloatMenuOption(label, delegate() { FloatMenuAcceptanceReport floatMenuAcceptanceReport = acceptanceReportGetter(); if (floatMenuAcceptanceReport.Accepted) { representative.TryLaunch(destinationTile, arrivalActionGetter()); } else if (!floatMenuAcceptanceReport.FailMessage.NullOrEmpty()) { Messages.Message(floatMenuAcceptanceReport.FailMessage, new GlobalTargetInfo(destinationTile), MessageTypeDefOf.RejectInput, false); } }, MenuOptionPriority.Default, null, null, 0f, null, null); if (!this.$disposing) { this.$PC = 2; } } return(true); } break; case 1u: break; case 2u: break; default: return(false); } this.$PC = -1; return(false); }
public static IEnumerable <FloatMenuOption> GetFloatMenuOptions <T>(Func <FloatMenuAcceptanceReport> acceptanceReportGetter, Func <T> arrivalActionGetter, string label, CompLaunchable representative, int destinationTile, Action <Action> uiConfirmationCallback = null) where T : TransportPodsArrivalAction { FloatMenuAcceptanceReport floatMenuAcceptanceReport = acceptanceReportGetter(); if (floatMenuAcceptanceReport.Accepted || !floatMenuAcceptanceReport.FailReason.NullOrEmpty() || !floatMenuAcceptanceReport.FailMessage.NullOrEmpty()) { if (!floatMenuAcceptanceReport.FailReason.NullOrEmpty()) { yield return(new FloatMenuOption(label + " (" + floatMenuAcceptanceReport.FailReason + ")", null)); } else { yield return(new FloatMenuOption(label, delegate { FloatMenuAcceptanceReport floatMenuAcceptanceReport2 = acceptanceReportGetter(); if (floatMenuAcceptanceReport2.Accepted) { if (uiConfirmationCallback == null) { representative.TryLaunch(destinationTile, arrivalActionGetter()); } else { uiConfirmationCallback(delegate { representative.TryLaunch(destinationTile, arrivalActionGetter()); }); } } else if (!floatMenuAcceptanceReport2.FailMessage.NullOrEmpty()) { Messages.Message(floatMenuAcceptanceReport2.FailMessage, new GlobalTargetInfo(destinationTile), MessageTypeDefOf.RejectInput, historical: false); } })); } } }
public override IEnumerable <FloatMenuOption> GetTransportPodsFloatMenuOptions(IEnumerable <IThingHolder> pods, CompLaunchable representative) { _003CGetTransportPodsFloatMenuOptions_003Ec__Iterator4 _003CGetTransportPodsFloatMenuOptions_003Ec__Iterator = (_003CGetTransportPodsFloatMenuOptions_003Ec__Iterator4) /*Error near IL_0038: stateMachine*/; using (IEnumerator <FloatMenuOption> enumerator = base.GetTransportPodsFloatMenuOptions(pods, representative).GetEnumerator()) { if (enumerator.MoveNext()) { FloatMenuOption o = enumerator.Current; yield return(o); /*Error: Unable to find new state assignment for yield return*/; } } if (TransportPodsArrivalAction_LandInSpecificCell.CanLandInSpecificCell(pods, this)) { yield return(new FloatMenuOption("LandInExistingMap".Translate(Label), delegate { _003CGetTransportPodsFloatMenuOptions_003Ec__Iterator4 _003CGetTransportPodsFloatMenuOptions_003Ec__Iterator2 = _003CGetTransportPodsFloatMenuOptions_003Ec__Iterator; Map myMap = representative.parent.Map; Map map = _003CGetTransportPodsFloatMenuOptions_003Ec__Iterator._0024this.Map; Current.Game.CurrentMap = map; CameraJumper.TryHideWorld(); Find.Targeter.BeginTargeting(TargetingParameters.ForDropPodsDestination(), delegate(LocalTargetInfo x) { representative.TryLaunch(_003CGetTransportPodsFloatMenuOptions_003Ec__Iterator2._0024this.Tile, new TransportPodsArrivalAction_LandInSpecificCell(_003CGetTransportPodsFloatMenuOptions_003Ec__Iterator2._0024this, x.Cell)); }, null, delegate { if (Find.Maps.Contains(myMap)) { Current.Game.CurrentMap = myMap; } }, CompLaunchable.TargeterMouseAttachment); })); /*Error: Unable to find new state assignment for yield return*/; } yield break; IL_0160: /*Error near IL_0161: Unexpected return in MoveNext()*/; }