1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-13 08:32:57 +08:00

Rename variable and ensure timestamp is updated even when not saving

This commit is contained in:
Dean Herbert 2023-06-06 15:11:31 +09:00
parent 3a50e0fb2f
commit 22f7fe1d79
2 changed files with 17 additions and 5 deletions

View File

@ -171,7 +171,10 @@ namespace osu.Game.Beatmaps
public double TimelineZoom { get; set; } = 1.0;
public double? LastEditTime { get; set; }
/// <summary>
/// The time in milliseconds when last exiting the editor with this beatmap loaded.
/// </summary>
public double? EditorTimestamp { get; set; }
[Ignored]
public CountdownType Countdown { get; set; } = CountdownType.Normal;

View File

@ -28,6 +28,7 @@ using osu.Game.Audio;
using osu.Game.Beatmaps;
using osu.Game.Beatmaps.ControlPoints;
using osu.Game.Configuration;
using osu.Game.Database;
using osu.Game.Graphics.Cursor;
using osu.Game.Graphics.UserInterface;
using osu.Game.Input.Bindings;
@ -92,6 +93,9 @@ namespace osu.Game.Screens.Edit
[Resolved(canBeNull: true)]
private INotificationOverlay notifications { get; set; }
[Resolved]
private RealmAccess realm { get; set; }
public readonly Bindable<EditorScreenMode> Mode = new Bindable<EditorScreenMode>();
public IBindable<bool> SamplePlaybackDisabled => samplePlaybackDisabled;
@ -441,8 +445,6 @@ namespace osu.Game.Screens.Edit
try
{
editorBeatmap.BeatmapInfo.LastEditTime = clock.CurrentTime;
// save the loaded beatmap's data stream.
beatmapManager.Save(editorBeatmap.BeatmapInfo, editorBeatmap.PlayableBeatmap, editorBeatmap.BeatmapSkin);
}
@ -702,6 +704,13 @@ namespace osu.Game.Screens.Edit
}
}
realm.Write(r =>
{
var beatmap = r.Find<BeatmapInfo>(editorBeatmap.BeatmapInfo.ID);
if (beatmap != null)
beatmap.EditorTimestamp = clock.CurrentTime;
});
ApplyToBackground(b =>
{
b.DimWhenUserSettingsIgnored.Value = 0;
@ -835,9 +844,9 @@ namespace osu.Game.Screens.Edit
{
double targetTime = 0;
if (editorBeatmap.BeatmapInfo.LastEditTime != null)
if (editorBeatmap.BeatmapInfo.EditorTimestamp != null)
{
targetTime = editorBeatmap.BeatmapInfo.LastEditTime.Value;
targetTime = editorBeatmap.BeatmapInfo.EditorTimestamp.Value;
}
else if (Beatmap.Value.Beatmap.HitObjects.Count > 0)
{