Exemple #1
0
        public override IEnumerable <Gizmo> GetWornGizmos()
        {
            if (Find.Selector.SingleSelectedThing == Wearer)
            {
                yield return(new Gizmo_VoidNetTerminalStatus
                {
                    terminal = this
                });
            }
            if (Prefs.DevMode)
            {
                yield return new Command_Action
                       {
                           defaultLabel = "Full",
                           defaultDesc  = "立刻满充能",
                           action       = delegate()
                           {
                               energyCur = energyCacheMax;
                           }
                       }
            }
            ;
            if (Wearer.equipment.Primary != null)
            {
                Comp.VoidNetWeaponShootMode comp = Wearer.equipment.Primary.TryGetComp <Comp.VoidNetWeaponShootMode>();

                if (comp != null)
                {
                    foreach (Gizmo item in comp.CompGetGizmosExtra())
                    {
                        yield return(item);
                    }
                }
            }

            yield break;
        }
Exemple #2
0
        // Token: 0x06004BC4 RID: 19396 RVA: 0x0019866B File Offset: 0x0019686B
        public override IEnumerable <Gizmo> GetGizmos()
        {
            foreach (Gizmo gizmo in base.GetGizmos())
            {
                yield return(gizmo);
            }

            Comp.VoidNetWeaponShootMode comp = gun.TryGetComp <Comp.VoidNetWeaponShootMode>();
            if (comp != null)
            {
                foreach (Gizmo item in comp.CompGetGizmosExtra())
                {
                    yield return(item);
                }
            }

            //IEnumerator<Gizmo> enumerator = null;
            if (this.CanExtractShell)
            {
                CompChangeableProjectile compChangeableProjectile = this.gun.TryGetComp <CompChangeableProjectile>();
                yield return(new Command_Action
                {
                    defaultLabel = "CommandExtractShell".Translate(),
                    defaultDesc = "CommandExtractShellDesc".Translate(),
                    icon = compChangeableProjectile.LoadedShell.uiIcon,
                    iconAngle = compChangeableProjectile.LoadedShell.uiIconAngle,
                    iconOffset = compChangeableProjectile.LoadedShell.uiIconOffset,
                    iconDrawScale = GenUI.IconDrawScale(compChangeableProjectile.LoadedShell),
                    action = delegate()
                    {
                        this.ExtractShell();
                    }
                });
            }
            CompChangeableProjectile compChangeableProjectile2 = this.gun.TryGetComp <CompChangeableProjectile>();

            if (compChangeableProjectile2 != null)
            {
                StorageSettings storeSettings = compChangeableProjectile2.GetStoreSettings();
                foreach (Gizmo gizmo2 in StorageSettingsClipboard.CopyPasteGizmosFor(storeSettings))
                {
                    yield return(gizmo2);
                }
                //enumerator = null;
            }
            if (this.CanSetForcedTarget)
            {
                Command_VerbTarget command_VerbTarget = new Command_VerbTarget
                {
                    defaultLabel = "CommandSetForceAttackTarget".Translate(),
                    defaultDesc  = "CommandSetForceAttackTargetDesc".Translate(),
                    icon         = ContentFinder <Texture2D> .Get("UI/Commands/Attack", true),
                    verb         = this.AttackVerb,
                    hotKey       = KeyBindingDefOf.Misc4,
                    drawRadius   = false
                };
                if (base.Spawned && this.IsMortarOrProjectileFliesOverhead && base.Position.Roofed(base.Map))
                {
                    command_VerbTarget.Disable("CannotFire".Translate() + ": " + "Roofed".Translate().CapitalizeFirst());
                }
                yield return(command_VerbTarget);
            }
            if (this.forcedTarget.IsValid)
            {
                Command_Action command_Action = new Command_Action
                {
                    defaultLabel = "CommandStopForceAttack".Translate(),
                    defaultDesc  = "CommandStopForceAttackDesc".Translate(),
                    icon         = ContentFinder <Texture2D> .Get("UI/Commands/Halt", true),
                    action       = delegate()
                    {
                        this.ResetForcedTarget();
                        SoundDefOf.Tick_Low.PlayOneShotOnCamera(null);
                    }
                };
                if (!this.forcedTarget.IsValid)
                {
                    command_Action.Disable("CommandStopAttackFailNotForceAttacking".Translate());
                }
                command_Action.hotKey = KeyBindingDefOf.Misc5;
                yield return(command_Action);
            }
            if (this.CanToggleHoldFire)
            {
                yield return(new Command_Toggle
                {
                    defaultLabel = "CommandHoldFire".Translate(),
                    defaultDesc = "CommandHoldFireDesc".Translate(),
                    icon = ContentFinder <Texture2D> .Get("UI/Commands/HoldFire", true),
                    hotKey = KeyBindingDefOf.Misc6,
                    toggleAction = delegate()
                    {
                        this.holdFire = !this.holdFire;
                        if (this.holdFire)
                        {
                            this.ResetForcedTarget();
                        }
                    },
                    isActive = (() => this.holdFire)
                });
            }
            yield break;
        }