コード例 #1
0
        public override IEnumerable <Gizmo> CompGetGizmosExtra()
        {
            foreach (var current in base.CompGetGizmosExtra())
            {
                yield return(current);
            }

            if (this.parent.Faction == Faction.OfPlayer)
            {
                Command_Action act = new Command_Action();

                act.defaultLabel  = ResourceBank.CycleLayerLabel;
                act.defaultDesc   = ResourceBank.CycleLayerDesc;
                act.icon          = currentLayer == NetLayer.Lower ? ResourceBank.UILower : ResourceBank.UIUpper;
                act.activateSound = SoundDef.Named("DesignateMine");
                act.hotKey        = KeyBindingDefOf.Command_ColonistDraft;
                act.action        = () =>
                {
                    var oldLayer = currentLayer;
                    currentLayer = currentLayer == NetLayer.Lower ? NetLayer.Upper : NetLayer.Lower;
                    MoteMaker.ThrowText(parent.Position.ToVector3Shifted(), parent.Map,
                                        ResourceBank.CycleLayerMote.Translate(currentLayer.ToStringTranslated())
                                        );
                    AirNetManager.NotifyCompLayerChange(this, oldLayer);
                };
                yield return(act);
            }
        }
コード例 #2
0
        public override IEnumerable <Command> CompGetGizmosExtra()
        {
            var com = new Command_Action
            {
                defaultLabel  = ResourceBank.CycleLayerLabel,
                defaultDesc   = ResourceBank.CycleLayerDesc,
                icon          = currentLayer == NetLayer.Lower ? ResourceBank.UILower : ResourceBank.UIUpper,
                activateSound = SoundDef.Named("DesignateMine"),
                hotKey        = KeyBindingDefOf.CommandColonistDraft,
                action        = () =>
                {
                    var oldLayer = currentLayer;
                    currentLayer = currentLayer == NetLayer.Lower ? NetLayer.Upper : NetLayer.Lower;
                    MoteThrower.ThrowText(parent.Position.ToVector3Shifted(),
                                          ResourceBank.CycleLayerMote.Translate(currentLayer.ToStringTranslated()));
                    AirNetManager.NotifyCompLayerChange(this, oldLayer);
                }
            };

            foreach (var current in base.CompGetGizmosExtra())
            {
                yield return(current);
            }

            yield return(com);
        }
コード例 #3
0
        public override string CompInspectStringExtra()
        {
            OverlayDrawHandler_AirNet.DrawAitNetOverlayThisFrame();
            var result = new StringBuilder();

            result.Append(ResourceBank.CurrentConnectionChannel.Translate(currentLayer.ToStringTranslated()));

            result.Append(ResourceBank.CurrentConnectedNetTemp);
            if (connectedNet != null)
            {
                result.Append(Mathf.Round(connectedNet.NetTemperature).ToStringTemperature("F0"));
#if DEBUG
                result.AppendLine().Append("Debug ID: ").Append(connectedNet.debugId);
#endif
            }

            return(result.ToString());
        }
コード例 #4
0
        public override IEnumerable<Command> CompGetGizmosExtra()
        {
            var com = new Command_Action
            {
                defaultLabel  = ResourceBank.CycleLayerLabel,
                defaultDesc   = ResourceBank.CycleLayerDesc,
                icon          = currentLayer == NetLayer.Lower ? ResourceBank.UILower : ResourceBank.UIUpper,
                activateSound = SoundDef.Named( "DesignateMine" ),
                hotKey        = KeyBindingDefOf.CommandColonistDraft,
                action        = () =>
                {
                    var oldLayer = currentLayer;
                    currentLayer = currentLayer == NetLayer.Lower ? NetLayer.Upper : NetLayer.Lower;
                    MoteThrower.ThrowText( parent.Position.ToVector3Shifted(),
                                           ResourceBank.CycleLayerMote.Translate( currentLayer.ToStringTranslated() ) );
                    AirNetManager.NotifyCompLayerChange( this, oldLayer );
                }
            };

            foreach (var current in base.CompGetGizmosExtra())
                yield return current;

            yield return com;
        }