/*private void onActiveJointNeedUpdate(Vessel v) { Utils.Log("#onActiveJointNeedUpdate"); }*/ private void OnCameraChange(CameraManager.CameraMode cameraMode) { Enums.CameraModes currentCameraMode = Enums.ConvertCameraMode(cameraMode); bool cameraChanged = SoundtrackEditor.CurrentSituation.cameraMode != currentCameraMode; SoundtrackEditor.CurrentSituation.cameraMode = currentCameraMode; if (cameraChanged && MonitorCameraMode) { SoundtrackEditor.Instance.OnSituationChanged(); } }
public Prerequisites(Prerequisites p) { bodyName = p.bodyName; paused = p.paused; scene = p.scene; situation = p.situation; cameraMode = p.cameraMode; inAtmosphere = p.inAtmosphere; timeOfDay = p.timeOfDay; maxVelocitySurface = p.maxVelocitySurface; minVelocitySurface = p.minVelocitySurface; maxVelocityOrbital = p.maxVelocityOrbital; minVelocityOrbital = p.minVelocityOrbital; maxAltitude = p.maxAltitude; minAltitude = p.minAltitude; }
/// <summary> /// Draws a playlist viewer and editor GUI. /// </summary> /// <param name="windowID"></param> public void PlaylistGui(int windowID) { _playlistScrollPosition = GUILayout.BeginScrollView(_playlistScrollPosition, GUILayout.MinHeight(Screen.height / 1.25f)); SoundtrackEditor sted = SoundtrackEditor.Instance; List<Playlist> playlists = sted.Playlists; for (int i = 0; i < playlists.Count; i++) { string playlistName = playlists[i].name; GUILayout.BeginHorizontal(); if (!_expandedPlaylists.ContainsKey(playlistName)) _expandedPlaylists.Add(playlistName, false); bool isExpanded = _expandedPlaylists[playlistName]; if (GUILayout.Button(isExpanded ? " - " : " + ")) _expandedPlaylists[playlistName] = !isExpanded; GUILayout.Label("<b>" + playlistName + (sted.CurrentPlaylist == playlists[i] ? " ►" : "") + " </b>"); GUILayout.FlexibleSpace(); if (GUILayout.Button("Edit")) { _editorGuiVisible = true; _editingPlaylistOriginal = playlists[i]; _editingPlaylist = new Playlist(playlists[i]); _previousSituation = playlists[i].playWhen.situation; _previousCameraMode = playlists[i].playWhen.cameraMode; _previousScene = playlists[i].playWhen.scene; } GUILayout.EndHorizontal(); if (_expandedPlaylists[playlistName]) { for (int j = 0; j < playlists[i].tracks.Count; j++) { string prefix = sted.CurrentPlaylist != null && sted.CurrentPlaylist.name == playlists[i].name && sted.CurrentClip != null && sted.CurrentClip.name == playlists[i].tracks[j] ? " ► " : " "; // Indent. The '►' is very wide in KSP's font. GUILayout.Label(prefix + playlists[i].tracks[j]); } } } GUILayout.EndScrollView(); GUILayout.BeginHorizontal(); if (GUILayout.Button(" New ")) { _editingPlaylist = new Playlist(); _editorGuiVisible = true; } GUILayout.EndHorizontal(); // Close button GUILayout.BeginHorizontal(); GUILayout.FlexibleSpace(); if (GUILayout.Button(" Close ")) _playlistGuiVisible = false; GUILayout.EndHorizontal(); GUI.DragWindow(); }
public Prerequisites(Prerequisites p) { bodyName = p.bodyName; paused = p.paused; scene = p.scene; situation = p.situation; cameraMode = p.cameraMode; inAtmosphere = p.inAtmosphere; timeOfDay = p.timeOfDay; maxVelocitySurface = p.maxVelocitySurface; minVelocitySurface = p.minVelocitySurface; maxVelocityOrbital = p.maxVelocityOrbital; minVelocityOrbital = p.minVelocityOrbital; maxAltitude = p.maxAltitude; minAltitude = p.minAltitude; }