コード例 #1
0
 public override IEnumerable <FloatMenuOption> GetShuttleFloatMenuOptions(IEnumerable <IThingHolder> pods, Action <int, TransportPodsArrivalAction> launchAction)
 {
     if (!TransportPodsArrivalAction_LandInSpecificCell.CanLandInSpecificCell(pods, this))
     {
         yield break;
     }
     yield return(new FloatMenuOption("LandInExistingMap".Translate(Label), delegate
     {
         Map map = Map;
         Current.Game.CurrentMap = map;
         CameraJumper.TryHideWorld();
         Find.Targeter.BeginTargeting(TargetingParameters.ForDropPodsDestination(), delegate(LocalTargetInfo x)
         {
             launchAction(base.Tile, new TransportPodsArrivalAction_LandInSpecificCell(this, x.Cell, landInShuttle: true));
         }, delegate(LocalTargetInfo x)
         {
             RoyalTitlePermitWorker_CallShuttle.DrawShuttleGhost(x, Map);
         }, delegate(LocalTargetInfo x)
         {
             AcceptanceReport acceptanceReport = RoyalTitlePermitWorker_CallShuttle.ShuttleCanLandHere(x, Map);
             if (!acceptanceReport.Accepted)
             {
                 Messages.Message(acceptanceReport.Reason, new LookTargets(this), MessageTypeDefOf.RejectInput, historical: false);
             }
             return acceptanceReport.Accepted;
         }, null, null, CompLaunchable.TargeterMouseAttachment);
     }));
 }
コード例 #2
0
 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);
     }));
 }
コード例 #3
0
 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;
 }
コード例 #4
0
        public override FloatMenuAcceptanceReport StillValid(IEnumerable <IThingHolder> pods, int destinationTile)
        {
            FloatMenuAcceptanceReport floatMenuAcceptanceReport = base.StillValid(pods, destinationTile);

            if (!floatMenuAcceptanceReport)
            {
                return(floatMenuAcceptanceReport);
            }
            if (this.mapParent != null && this.mapParent.Tile != destinationTile)
            {
                return(false);
            }
            return(TransportPodsArrivalAction_LandInSpecificCell.CanLandInSpecificCell(pods, this.mapParent));
        }
コード例 #5
0
        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()*/;
        }