Ejemplo n.º 1
0
        public static IEnumerable <Gizmo> BoardTransporterInProgress(IEnumerable <Gizmo> __result, CompTransporter __instance)
        {
            IEnumerator <Gizmo> enumerator = __result.GetEnumerator();

            while (enumerator.MoveNext())
            {
                var element = enumerator.Current;
                if (__instance.LoadingInProgressOrReadyToLaunch && (element as Command_Action)?.icon == CancelLoadCommandTex)
                {
                    yield return(element);

                    List <CompTransporter> transporterGroup = __instance.TransportersInGroup(__instance.parent.Map);
                    yield return(new Command_ReloadTransporters
                    {
                        defaultLabel = transporterGroup.Count > 1 ? "CommandReloadTransporter".Translate(transporterGroup.Count) : "CommandReloadTransporterSingle".Translate(),
                        defaultDesc = "CommandReloadTransporterDesc".Translate(),
                        icon = LoadCommandTex,
                        transComp = __instance,
                        transporters = transporterGroup
                    });

                    continue;
                }
                yield return(element);
            }
        }
Ejemplo n.º 2
0
        public static IEnumerable <Gizmo> BoardTransporterInProgress(IEnumerable <Gizmo> __result, CompTransporter __instance)
        {
            List <CompTransporter> transporterGroup = __instance.TransportersInGroup(__instance.parent.Map);

            if (__instance.LoadingInProgressOrReadyToLaunch && !transporterGroup.NullOrEmpty())
            {
                yield return(new Command_ReloadTransporters
                {
                    defaultLabel = transporterGroup.Count > 1 ? "CommandReloadTransporter".Translate(transporterGroup.Count) : "CommandReloadTransporterSingle".Translate(),
                    defaultDesc = "CommandReloadTransporterDesc".Translate(),
                    icon = LoadCommandTex,
                    transComp = __instance,
                    transporters = transporterGroup
                });
            }
            foreach (Gizmo gizmo in __result)
            {
                yield return(gizmo);
            }
        }