public override void OnAwake() { instance = this; core = Notes_Core.Instance; }
private void startup() { instance = this; GameEvents.onNewVesselCreated.Add(vesselRefresh); GameEvents.onVesselWasModified.Add(vesselRefresh); GameEvents.onVesselChange.Add(vesselRefresh); GameEvents.OnScienceRecieved.Add(onScienceTransmit); GameEvents.onVesselRecovered.Add(onVesselRecovered); GameEvents.Contract.onAccepted.Add(onAddContract); GameEvents.Contract.onFinished.Add(onFinishContract); contractParser.onContractsParsed.Add(onLoadContracts); progressParser.onProgressParsed.Add(onLoadProgress); Notes_CheckListTypeHandler.registerEvents(); if (HighLogic.LoadedSceneIsFlight) activeVessel = FlightGlobals.ActiveVessel; for (int i = 0; i < FlightGlobals.Vessels.Count; i++) { Vessel v = FlightGlobals.Vessels[i]; if (v == null) continue; if (activeVessels.ContainsKey(v.id)) continue; activeVessels.Add(v.id, v); } }