internal override void Start() { LogFormatted("Start"); ARPWrapper.InitKSPARPWrapper(); ARPWrapper.KSPARP.onMonitorStateChanged += KSPARP_onMonitorStateChanged; ARPWrapper.KSPARP.onAlarmStateChanged += KSPARP_onAlarmStateChanged; }
public void Start() { ARPWrapper.InitKSPARPWrapper(); if (ARPWrapper.APIReady) { ARPPresent = true; KSPit.AddToDeviceHandler(LFProvider); LFChannel = GameEvents.FindEvent <EventData <byte, object> >("toSerial10"); KSPit.AddToDeviceHandler(LFStageProvider); LFStageChannel = GameEvents.FindEvent <EventData <byte, object> >("toSerial11"); KSPit.AddToDeviceHandler(OxProvider); OxChannel = GameEvents.FindEvent <EventData <byte, object> >("toSerial12"); KSPit.AddToDeviceHandler(OxStageProvider); OxStageChannel = GameEvents.FindEvent <EventData <byte, object> >("toSerial13"); KSPit.AddToDeviceHandler(SFProvider); SFChannel = GameEvents.FindEvent <EventData <byte, object> >("toSerial14"); KSPit.AddToDeviceHandler(SFStageProvider); SFStageChannel = GameEvents.FindEvent <EventData <byte, object> >("toSerial15"); KSPit.AddToDeviceHandler(MonoProvider); MonoChannel = GameEvents.FindEvent <EventData <byte, object> >("toSerial16"); KSPit.AddToDeviceHandler(ElectricProvider); ElectricChannel = GameEvents.FindEvent <EventData <byte, object> >("toSerial17"); KSPit.AddToDeviceHandler(EvaProvider); EvaChannel = GameEvents.FindEvent <EventData <byte, object> >("toSerial18"); KSPit.AddToDeviceHandler(OreProvider); OreChannel = GameEvents.FindEvent <EventData <byte, object> >("toSerial19"); KSPit.AddToDeviceHandler(AbProvider); AbChannel = GameEvents.FindEvent <EventData <byte, object> >("toSerial20"); KSPit.AddToDeviceHandler(AbStageProvider); AbStageChannel = GameEvents.FindEvent <EventData <byte, object> >("toSerial21"); ScanForResources(); } else { ARPPresent = false; Debug.Log("KerbalSimpit: AlternateResourcePanel not found. Resource providers WILL NOT WORK."); } }
// Add to the Start Method the initialisation of the ARPWrapper public new void Start() { base.Start(); if (!ARPWrapper.APIReady) { ARPWrapper.InitKSPARPWrapper(); } if (!ARPWrapper.APIReady) { Debug.Log("KerbalSimpit: AlternateResourcePanel not found. Resource providers WILL NOT WORK."); _isARPInstalled = false; } else { Debug.Log("KerbalSimpit: AlternateResourcePanel found. Resource providers will work."); _isARPInstalled = true; } }