예제 #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 void PostSpawnSetup(bool respawningAfterLoad)
 {
     base.PostSpawnSetup(respawningAfterLoad);
     //ResourceBank.UILower = ContentFinder<Texture2D>.Get("UI/Commands/Lower", true);
     //ResourceBank.UIUpper = ContentFinder<Texture2D>.Get("UI/Commands/Upper", true);
     AirNetManager.NotifyCompSpawn(this);
 }
 public static void Initialize()
 {
     AirNetGrid.Reinit();
     AirNetManager.Reinit();
     Log.Message("LT-RH: Initialized RedistHeat.");
     doneInit = true;
 }
예제 #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);
        }
 public override void MapComponentTick()
 {
     if (!doneInit)
     {
         Initialize();
     }
     AirNetManager.AirNetsTick();
 }
 public override void MapComponentUpdate()
 {
     if (!doneInit)
     {
         Initialize();
     }
     AirNetManager.AirNetsUpdate();
     AirNetManager.UpdateMapDrawer();
 }
예제 #7
0
 public override void PostDestroy(DestroyMode mode, Map previousMap)
 {
     base.PostDestroy(mode, previousMap);
     AirNetManager.NotifyCompDespawn(this);
 }
예제 #8
0
 public override void PostDestroy(DestroyMode mode, bool wasSpawned)
 {
     base.PostDestroy(DestroyMode.Vanish, wasSpawned);
     AirNetManager.NotifyCompDespawn(this);
 }
예제 #9
0
 public override void PostDestroy(DestroyMode mode = DestroyMode.Vanish)
 {
     base.PostDestroy(mode);
     AirNetManager.NotifyCompDespawn(this);
 }
예제 #10
0
 public override void PostSpawnSetup()
 {
     base.PostSpawnSetup();
     AirNetManager.NotifyCompSpawn(this);
 }