mirror of
https://github.com/ppy/osu
synced 2024-12-14 02:46:27 +00:00
Merge pull request #20396 from peppy/files-folder-notice
Add warning message in `files` folder to avoid accidental deletion
This commit is contained in:
commit
729322c505
@ -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`.
|
||||
|
Loading…
Reference in New Issue
Block a user