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); } }
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); }
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; } }
public override void PostDeSpawn(Map map) { base.PostDeSpawn(map); JukeBoxCore.RemoveJukeBox(this); //마지막 한대면 복구 }
public override void PostSpawnSetup(bool respawningAfterLoad) { base.PostSpawnSetup(respawningAfterLoad); JukeBoxCore.AddJukeBox(this); compPowerTrader = parent.GetComp <CompPowerTrader>(); }
public void Synchronize() { JukeBoxCore.Scanning(); }