internal void SaveFile() { Compose.RemovePlacementObject(); UpdateBreaks(true, false); hitObjectManager.Save(false, false, false); BeatmapManager.Add(hitObjectManager.Beatmap); //make sure this map is added to the beatmap listing (needed for BSS). NotificationManager.ShowMessageMassive(LocalisationManager.GetString(OsuString.Editor_FileOperations_SavedBeatmap), 1000); changeManager.Dirty = false; }
internal bool SaveIfDirty(bool prompt = false) { if (changeManager.Dirty) { Compose.RemovePlacementObject(); if (!hitObjectManager.Save(prompt, false, false)) { return(false); } changeManager.Dirty = false; } return(true); }
/// <summary> /// Initialises Test Mode. /// </summary> internal void TestMode() { lastMode = CurrentMode; if (hitObjectManager.hitObjects.Count == 0) { return; } if (AudioEngine.AudioState == AudioStates.Playing) { Pause(); } if (Compose != null) { Compose.FinishPlacement(); Compose.RemovePlacementObject(); } FinishBreakDrag(); changeManager.FinishAction(); if (AudioEngine.BeatLength <= 0) { MessageBox.Show(LocalisationManager.GetString(OsuString.EditorControl_OneSectionRequiredWarning), @"osu!", MessageBoxButtons.OK); return; } changeManager.IgnorePush = true; while (!AudioEngine.ControlPoints[0].TimingChange) { AudioEngine.ControlPoints.RemoveAt(0); AudioEngine.UpdateActiveTimingPoint(false); } changeManager.IgnorePush = false; AiModClose(); CloseImportDialog(); GameBase.TestMode = true; GameBase.TestTime = AudioEngine.Time; Beatmap b = hitObjectManager.Beatmap; Player.Mode = b.PlayMode; if (hitObjectManager.hitObjects.FindAll(h => h.EndTime > AudioEngine.Time).Count == 0) { GameBase.TestTime = 0; //There are no hitcircles after the current point. } if (!changeManager.Dirty || hitObjectManager.Save(true, false, false)) { if (b.DifficultyTomStars(b.PlayMode) < 0) { b.ComputeAndSetDifficultiesTomStars(b.PlayMode); } HideDifficultySwitch(); GameBase.ChangeModeInstant(OsuModes.Play); } else { GameBase.TestMode = false; } }
internal bool CheckForChanges() { Compose.RemovePlacementObject(); return(hitObjectManager.Save(false, false, true)); }