public BeatmapEditor(MainForm f) { mainform = f; // Load previously saved settings NoSpinners = Properties.Settings.Default.NoSpinners; ChangePitch = Properties.Settings.Default.ChangePitch; SetState(EditorState.NOT_READY); NotReadyReason = BadBeatmapReason.NO_BEATMAP_LOADED; }
public BeatmapEditor(MainForm f) { mainform = f; // Load previously saved settings HpIsLocked = Properties.Settings.Default.HPLockedState; CsIsLocked = Properties.Settings.Default.CSLockedState; ArIsLocked = Properties.Settings.Default.ARLockedState; OdIsLocked = Properties.Settings.Default.ODLockedState; ScaleAR = ArIsLocked ? false : true; ScaleOD = OdIsLocked ? false : true; lockedHP = Properties.Settings.Default.LockedHPSetting; lockedCS = Properties.Settings.Default.LockedCSSetting; lockedAR = Properties.Settings.Default.LockedARSetting; lockedOD = Properties.Settings.Default.LockedODSetting; BpmIsLocked = Properties.Settings.Default.BpmLockedState; if (BpmIsLocked) { lockedBpm = Properties.Settings.Default.LockedBpmSetting; } else { BpmRate = Properties.Settings.Default.BpmRate; } ChangePitch = Properties.Settings.Default.ChangePitch; NoSpinners = Properties.Settings.Default.NoSpinners; HighQualityMp3s = Properties.Settings.Default.HighQualityMp3s; LoadProfilesFromDisk(); SetState(EditorState.NOT_READY); NotReadyReason = BadBeatmapReason.NO_BEATMAP_LOADED; }
private async void ServiceBeatmapChangeRequest() { // acquire mutually exclusive entry into this method serviceBeatmapRequestLocked = true; Beatmap candidateOriginalBeatmap = null, candidateNewBeatmap = null; while (completedBeatmapRequest == null || completedBeatmapRequest.RequestNumber != mapChangeRequests.Last().RequestNumber) { completedBeatmapRequest = mapChangeRequests.Last(); candidateOriginalBeatmap = await Task.Run(() => LoadBeatmap(mapChangeRequests.Last().Name)); if (candidateOriginalBeatmap != null) { candidateNewBeatmap = new Beatmap(candidateOriginalBeatmap); } // if a new request came in, invalidate candidate beatmap and service the new request } // no new requests, we can commit to using this beatmap OriginalBeatmap = candidateOriginalBeatmap; NewBeatmap = candidateNewBeatmap; if (OriginalBeatmap == null) { SetState(EditorState.NOT_READY); NotReadyReason = BadBeatmapReason.ERROR_LOADING_BEATMAP; BeatmapSwitched?.Invoke(this, EventArgs.Empty); } else { if (OriginalBeatmap.HitObjectCount == 0) { SetState(EditorState.NOT_READY); NotReadyReason = BadBeatmapReason.EMPTY_MAP; BeatmapSwitched?.Invoke(this, EventArgs.Empty); } else { // Apply multiplier if (BpmIsLocked) { SetBpm(lockedBpm); } NewBeatmap.SetRate(BpmRate); // Apply bpm scaled settings if (ScaleAR) { NewBeatmap.ApproachRate = DifficultyCalculator.CalculateMultipliedAR(candidateOriginalBeatmap, BpmRate); } if (ScaleOD) { NewBeatmap.OverallDifficulty = DifficultyCalculator.CalculateMultipliedOD(candidateOriginalBeatmap, BpmRate); } // Apply locked settings to new map if (HpIsLocked) { NewBeatmap.HPDrainRate = lockedHP; } if (CsIsLocked) { NewBeatmap.CircleSize = lockedCS; } if (ArIsLocked) { NewBeatmap.ApproachRate = lockedAR; } if (OdIsLocked) { NewBeatmap.OverallDifficulty = lockedOD; } // Apply Hardrock if (ForceHardrockCirclesize) { NewBeatmap.CircleSize = OriginalBeatmap.CircleSize * 1.3M; } SetState(EditorState.READY); RequestDiffCalc(); BeatmapSwitched?.Invoke(this, EventArgs.Empty); BeatmapModified?.Invoke(this, EventArgs.Empty); } } ControlsModified?.Invoke(this, EventArgs.Empty); serviceBeatmapRequestLocked = false; }
public BeatmapEditor(MainForm f) { form = f; SetState(EditorState.NOT_READY); NotReadyReason = BadBeatmapReason.NO_BEATMAP_LOADED; }