1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-21 20:07:25 +08:00

Implement config persistence through BasicStorage

This commit is contained in:
Drew DeVault 2016-10-31 12:44:20 -06:00
parent 6f16a6a6d4
commit 2aaff01675
2 changed files with 14 additions and 1 deletions

View File

@ -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

View File

@ -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();