1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-14 19:12:59 +08:00

Merge branch 'master' into Colour_hit_meter_improved

This commit is contained in:
Dean Herbert 2022-09-22 15:52:06 +09:00 committed by GitHub
commit 2bc6b4e84f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5,6 +5,7 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Threading;
@ -255,6 +256,8 @@ namespace osu.Game
InitialiseFonts();
addFilesWarning();
Audio.Samples.PlaybackConcurrency = SAMPLE_CONCURRENCY;
dependencies.Cache(SkinManager = new SkinManager(Storage, realm, Host, Resources, Audio, Scheduler));
@ -373,6 +376,29 @@ namespace osu.Game
Beatmap.BindValueChanged(onBeatmapChanged);
}
private void addFilesWarning()
{
var realmStore = new RealmFileStore(realm, Storage);
const string filename = "IMPORTANT READ ME.txt";
if (!realmStore.Storage.Exists(filename))
{
using (var stream = realmStore.Storage.CreateFileSafely(filename))
using (var textWriter = new StreamWriter(stream))
{
textWriter.WriteLine(@"This folder contains all your user files (beatmaps, skins, replays etc.)");
textWriter.WriteLine(@"Please do not touch or delete this folder!!");
textWriter.WriteLine();
textWriter.WriteLine(@"If you are really looking to completely delete user data, please delete");
textWriter.WriteLine(@"the parent folder including all other files and directories");
textWriter.WriteLine();
textWriter.WriteLine(@"For more information on how these files are organised,");
textWriter.WriteLine(@"see https://github.com/ppy/osu/wiki/User-file-storage");
}
}
}
private void onTrackChanged(WorkingBeatmap beatmap, TrackChangeDirection direction)
{
// FramedBeatmapClock uses a decoupled clock internally which will mutate the source if it is an `IAdjustableClock`.