Beispiel #1
0
 public override void ReceiveCompSignal(string signal)
 {
     base.ReceiveCompSignal(signal);
     if (signal == "PowerTurnedOff")
     {
         if (JukeBoxCore.orignalSongList.Count <= 0)
         {
             JukeBoxCore.orignalSongList.AddRange(DefDatabase <SongDef> .AllDefs);
         }
         JukeBoxCore.RemoveJukeBox(this);
     }
     if (signal == "PowerTurnedOn")
     {
         JukeBoxCore.AddJukeBox(this);
     }
 }
Beispiel #2
0
        public void PlaySong()
        {
            currentState = true;
            if (JukeBoxCore.orignalSongList.Count <= 0)
            {
                JukeBoxCore.orignalSongList.AddRange(DefDatabase <SongDef> .AllDefs);
            }
            if (JukeBoxCore.customSongList.Count <= 0)
            {
                JukeBoxCore.Scanning();
                if (JukeBoxCore.customSongList.Count <= 0)
                {
                    Log.Error("Songs Folder is Empty");
                    return;
                }
            }
            DefDatabase <SongDef> .Clear();

            DefDatabase <SongDef> .Add(JukeBoxCore.customSongList);

            Find.MusicManagerPlay.ForceStartSong(DefDatabase <SongDef> .GetRandom(), false);
        }
Beispiel #3
0
        public override void PostExposeData()
        {
            //이미 존재하는 개체
            base.PostExposeData();
            if (Scribe.mode == LoadSaveMode.ResolvingCrossRefs)
            {
                if (JukeBoxCore.orignalSongList.Count > 0)
                {
                    DefDatabase <SongDef> .Clear();

                    DefDatabase <SongDef> .Add(JukeBoxCore.orignalSongList);
                }
                JukeBoxCore.jukeBoxList.Clear();
            }
            if (Scribe.mode == LoadSaveMode.PostLoadInit)
            {
                compPowerTrader = parent.GetComp <CompPowerTrader>();
                if (compPowerTrader.PowerOn)
                {
                    JukeBoxCore.AddJukeBox(this);
                }
                currentState = false;
            }
        }
Beispiel #4
0
 public override void PostDeSpawn(Map map)
 {
     base.PostDeSpawn(map);
     JukeBoxCore.RemoveJukeBox(this);
     //마지막 한대면 복구
 }
Beispiel #5
0
 public override void PostSpawnSetup(bool respawningAfterLoad)
 {
     base.PostSpawnSetup(respawningAfterLoad);
     JukeBoxCore.AddJukeBox(this);
     compPowerTrader = parent.GetComp <CompPowerTrader>();
 }
Beispiel #6
0
 public void Synchronize()
 {
     JukeBoxCore.Scanning();
 }