mirror of
https://github.com/ppy/osu.git
synced 2026-05-19 21:01:01 +08:00
Implement config persistence through BasicStorage
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using osu.Framework.Configuration;
|
||||
using osu.Framework.Platform;
|
||||
using osu.Game.GameModes.Play;
|
||||
using osu.Game.Online.API;
|
||||
|
||||
@@ -25,6 +26,10 @@ namespace osu.Game.Configuration
|
||||
Set(OsuConfig.VolumeMusic, 1.0, 0, 1);
|
||||
Set(OsuConfig.VolumeEffect, 1.0, 0, 1);
|
||||
}
|
||||
|
||||
public OsuConfigManager(BasicStorage storage) : base(storage)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
enum OsuConfig
|
||||
|
||||
@@ -7,6 +7,7 @@ using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Cursor;
|
||||
using osu.Framework.Graphics.Textures;
|
||||
using osu.Framework.IO.Stores;
|
||||
using osu.Framework.Platform;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Beatmaps.IO;
|
||||
using osu.Game.Configuration;
|
||||
@@ -21,7 +22,7 @@ namespace osu.Game
|
||||
{
|
||||
public class OsuGameBase : BaseGame
|
||||
{
|
||||
internal OsuConfigManager Config = new OsuConfigManager();
|
||||
internal OsuConfigManager Config;
|
||||
public BeatmapDatabase Beatmaps { get; private set; }
|
||||
|
||||
protected override string MainResourceFile => @"osu.Game.Resources.dll";
|
||||
@@ -76,6 +77,13 @@ namespace osu.Game
|
||||
};
|
||||
}
|
||||
|
||||
public override void SetHost(BasicGameHost host)
|
||||
{
|
||||
if (Config == null)
|
||||
Config = new OsuConfigManager(host.Storage);
|
||||
base.SetHost(host);
|
||||
}
|
||||
|
||||
protected override void Update()
|
||||
{
|
||||
base.Update();
|
||||
|
||||
Reference in New Issue
Block a user