public void Start() { ProbeControlRoomUtils.Logger.debug ("[ProbeControlRoom] Start()"); if (Instance != null) { ProbeControlRoomUtils.Logger.debug ("[ProbeControlRoom] Start() - InstanceKill"); Destroy (this); return; } Instance = this; GameEvents.onVesselChange.Add(OnVesselChange); GameEvents.onVesselWasModified.Add(OnVesselModified); refreshVesselRooms (); // TODO: check for cfg file with cached vars, if (after crash) load it and use those as defaults shipVolumeBackup = GameSettings.SHIP_VOLUME; ambianceVolumeBackup = GameSettings.AMBIENCE_VOLUME; //musicVolumeBackup = GameSettings.MUSIC_VOLUME; //uiVolumeBackup = GameSettings.UI_VOLUME; //voiceVolumeBackup = GameSettings.VOICE_VOLUME; cameraWobbleBackup = GameSettings.FLT_CAMERA_WOBBLE; cameraFXInternalBackup = GameSettings.CAMERA_FX_INTERNAL; cameraFXExternalBackup = GameSettings.CAMERA_FX_EXTERNAL; if (ProbeControlRoomSettings.Instance.ForcePCROnly) { ProbeControlRoomUtils.Logger.message ("[ProbeControlRoom] Start() - ForcePCROnly Enabled."); startIVA (); } }
public void OnDestroy() { //in case of revert to launch while in IVA, Update() won't detect it //and startIVA(p) will be called without prior stopIVA //which will cause settings to be lost forever //OnDestroy() will be called though //re-enable sound GameSettings.SHIP_VOLUME = shipVolumeBackup; GameSettings.AMBIENCE_VOLUME = ambianceVolumeBackup; //GameSettings.MUSIC_VOLUME = musicVolumeBackup; //GameSettings.UI_VOLUME = uiVolumeBackup; //GameSettings.VOICE_VOLUME = voiceVolumeBackup; //re-enable camera wobble GameSettings.FLT_CAMERA_WOBBLE = cameraWobbleBackup; GameSettings.CAMERA_FX_INTERNAL = cameraFXInternalBackup; GameSettings.CAMERA_FX_EXTERNAL = cameraFXExternalBackup; ProbeControlRoomUtils.Logger.debug("[ProbeControlRoom] OnDestroy()"); GameEvents.onVesselChange.Remove(OnVesselChange); GameEvents.onVesselWasModified.Remove(OnVesselModified); Instance = null; }
/// <summary> /// Startup and initialization /// </summary> public void Start() { ProbeControlRoomUtils.Logger.debug("Start()"); Instance = this; try{ GetFields(); } catch (Exception ex) { ProbeControlRoomUtils.Logger.debug("Exception finding fields: " + ex.ToString()); } refreshVesselRooms(); //Register game events GameEvents.onVesselWasModified.Fire(FlightGlobals.ActiveVessel); GameEvents.onVesselChange.Add(OnVesselChange); GameEvents.onVesselWasModified.Add(OnVesselModified); GameEvents.onGUIApplicationLauncherReady.Add(onGUIApplicationLauncherReady); GameEvents.onGUIApplicationLauncherDestroyed.Add(OnGUIAppLauncherDestroyed); GameEvents.OnMapExited.Add(onMapExited); GameEvents.OnCameraChange.Add(onCameraChange); GameEvents.onGameSceneSwitchRequested.Add(OnGameSceneSwitchRequested); //If Manely mode is set true, force straight into IVA if (ProbeControlRoomSettings.Instance.ForcePCROnly) { ProbeControlRoomUtils.Logger.message("Start() - ForcePCROnly Enabled."); startIVA(); } }
public void Start() { ProbeControlRoomUtils.Logger.debug("[ProbeControlRoom] Start()"); if (Instance != null) { ProbeControlRoomUtils.Logger.debug("[ProbeControlRoom] Start() - InstanceKill"); Destroy(this); return; } Instance = this; refreshVesselRooms(); GameEvents.onVesselWasModified.Fire(FlightGlobals.ActiveVessel); GameEvents.onVesselChange.Add(OnVesselChange); GameEvents.onVesselWasModified.Add(OnVesselModified); GameEvents.onGUIApplicationLauncherReady.Add(onGUIApplicationLauncherReady); // TODO: check for cfg file with cached vars, if (after crash) load it and use those as defaults shipVolumeBackup = GameSettings.SHIP_VOLUME; ambianceVolumeBackup = GameSettings.AMBIENCE_VOLUME; //musicVolumeBackup = GameSettings.MUSIC_VOLUME; //uiVolumeBackup = GameSettings.UI_VOLUME; //voiceVolumeBackup = GameSettings.VOICE_VOLUME; cameraWobbleBackup = GameSettings.FLT_CAMERA_WOBBLE; cameraFXInternalBackup = GameSettings.CAMERA_FX_INTERNAL; cameraFXExternalBackup = GameSettings.CAMERA_FX_EXTERNAL; if (ProbeControlRoomSettings.Instance.ForcePCROnly) { ProbeControlRoomUtils.Logger.message("[ProbeControlRoom] Start() - ForcePCROnly Enabled."); startIVA(); } }
public void OnDestroy() { GameSettings.CAMERA_FX_INTERNAL = OldCameraFx; ProbeControlRoomUtils.Logger.debug("[ProbeControlRoom] OnDestroy()"); GameEvents.onVesselChange.Remove(OnVesselChange); GameEvents.onVesselWasModified.Remove(OnVesselModified); Instance = null; }
public void Start() { ProbeControlRoomUtils.Logger.debug("[ProbeControlRoom] Start()"); if (Instance != null) { ProbeControlRoomUtils.Logger.debug("[ProbeControlRoom] Start() - InstanceKill"); Destroy(this); return; } Instance = this; GameEvents.onVesselChange.Add(OnVesselChange); GameEvents.onVesselWasModified.Add(OnVesselModified); refreshVesselRooms(); }
/// <summary> /// Startup and initialization /// </summary> public void Start() { ProbeControlRoomUtils.Logger.debug("Start()"); Instance = this; refreshVesselRooms(); //Register game events GameEvents.onVesselWasModified.Fire(FlightGlobals.ActiveVessel); GameEvents.onVesselChange.Add(OnVesselChange); GameEvents.onVesselWasModified.Add(OnVesselModified); GameEvents.onGUIApplicationLauncherReady.Add(onGUIApplicationLauncherReady); //If Manely mode is set true, force straight into IVA if (ProbeControlRoomSettings.Instance.ForcePCROnly) { ProbeControlRoomUtils.Logger.message("Start() - ForcePCROnly Enabled."); startIVA(); } }
public void OnDestroy() { //in case of revert to launch while in IVA, Update() won't detect it //and startIVA(p) will be called without prior stopIVA //which will cause settings to be lost forever //OnDestroy() will be called though if (ProbeControlRoomSettings.Instance.DisableSounds) { ProbeControlRoomUtils.Logger.message("[ProbeControlRoom] OnDestroy() - DisableSounds - RESTORE"); //re-enable sound GameSettings.SHIP_VOLUME = shipVolumeBackup; GameSettings.AMBIENCE_VOLUME = ambianceVolumeBackup; //GameSettings.MUSIC_VOLUME = musicVolumeBackup; //GameSettings.UI_VOLUME = uiVolumeBackup; //GameSettings.VOICE_VOLUME = voiceVolumeBackup; } if (ProbeControlRoomSettings.Instance.DisableWobble) { ProbeControlRoomUtils.Logger.message("[ProbeControlRoom] OnDestroy() - DisableWobble - RESTORE"); //re-enable camera wobble GameSettings.FLT_CAMERA_WOBBLE = cameraWobbleBackup; GameSettings.CAMERA_FX_INTERNAL = cameraFXInternalBackup; GameSettings.CAMERA_FX_EXTERNAL = cameraFXExternalBackup; } // TODO: remove cfg file with cached vars, no crash and reseted, no need to keep ProbeControlRoomUtils.Logger.debug("[ProbeControlRoom] OnDestroy()"); GameEvents.onVesselChange.Remove(OnVesselChange); GameEvents.onVesselWasModified.Remove(OnVesselModified); if (appLauncherButton != null) { ApplicationLauncher.Instance.RemoveModApplication(appLauncherButton); appLauncherButton = null; } Instance = null; }
public void OnDestroy() { //in case of revert to launch while in IVA, Update() won't detect it //and startIVA(p) will be called without prior stopIVA //which will cause settings to be lost forever //OnDestroy() will be called though if (ProbeControlRoomSettings.Instance.DisableSounds) { ProbeControlRoomUtils.Logger.message ("[ProbeControlRoom] OnDestroy() - DisableSounds - RESTORE"); //re-enable sound GameSettings.SHIP_VOLUME = shipVolumeBackup; GameSettings.AMBIENCE_VOLUME = ambianceVolumeBackup; //GameSettings.MUSIC_VOLUME = musicVolumeBackup; //GameSettings.UI_VOLUME = uiVolumeBackup; //GameSettings.VOICE_VOLUME = voiceVolumeBackup; } if (ProbeControlRoomSettings.Instance.DisableWobble) { ProbeControlRoomUtils.Logger.message ("[ProbeControlRoom] OnDestroy() - DisableWobble - RESTORE"); //re-enable camera wobble GameSettings.FLT_CAMERA_WOBBLE = cameraWobbleBackup; GameSettings.CAMERA_FX_INTERNAL = cameraFXInternalBackup; GameSettings.CAMERA_FX_EXTERNAL = cameraFXExternalBackup; } // TODO: remove cfg file with cached vars, no crash and reseted, no need to keep ProbeControlRoomUtils.Logger.debug ("[ProbeControlRoom] OnDestroy()"); GameEvents.onVesselChange.Remove(OnVesselChange); GameEvents.onVesselWasModified.Remove(OnVesselModified); Instance = null; }