mirror of
https://github.com/ppy/osu.git
synced 2025-01-13 02:32:55 +08:00
Reorder methods around load()
This commit is contained in:
parent
1ba607b3ff
commit
a4dca6f839
@ -160,47 +160,6 @@ namespace osu.Game
|
|||||||
Name = @"osu!lazer";
|
Name = @"osu!lazer";
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void SetHost(GameHost host)
|
|
||||||
{
|
|
||||||
base.SetHost(host);
|
|
||||||
|
|
||||||
// may be non-null for certain tests
|
|
||||||
Storage ??= host.Storage;
|
|
||||||
|
|
||||||
LocalConfig ??= UseDevelopmentServer
|
|
||||||
? new DevelopmentOsuConfigManager(Storage)
|
|
||||||
: new OsuConfigManager(Storage);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Use to programatically exit the game as if the user was triggering via alt-f4.
|
|
||||||
/// Will keep persisting until an exit occurs (exit may be blocked multiple times).
|
|
||||||
/// </summary>
|
|
||||||
public void GracefullyExit()
|
|
||||||
{
|
|
||||||
if (!OnExiting())
|
|
||||||
Exit();
|
|
||||||
else
|
|
||||||
Scheduler.AddDelayed(GracefullyExit, 2000);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Migrate(string path)
|
|
||||||
{
|
|
||||||
contextFactory.FlushConnections();
|
|
||||||
(Storage as OsuStorage)?.Migrate(Host.GetStorage(path));
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override UserInputManager CreateUserInputManager() => new OsuUserInputManager();
|
|
||||||
|
|
||||||
protected virtual BatteryInfo CreateBatteryInfo() => null;
|
|
||||||
|
|
||||||
protected virtual Container CreateScalingContainer() => new DrawSizePreservingFillContainer();
|
|
||||||
|
|
||||||
protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnlyDependencyContainer parent) =>
|
|
||||||
dependencies = new DependencyContainer(base.CreateChildDependencies(parent));
|
|
||||||
|
|
||||||
protected override Storage CreateStorage(GameHost host, Storage defaultStorage) => new OsuStorage(host, defaultStorage);
|
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load()
|
private void load()
|
||||||
{
|
{
|
||||||
@ -390,6 +349,47 @@ namespace osu.Game
|
|||||||
FrameStatistics.ValueChanged += e => fpsDisplayVisible.Value = e.NewValue != FrameStatisticsMode.None;
|
FrameStatistics.ValueChanged += e => fpsDisplayVisible.Value = e.NewValue != FrameStatisticsMode.None;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnlyDependencyContainer parent) =>
|
||||||
|
dependencies = new DependencyContainer(base.CreateChildDependencies(parent));
|
||||||
|
|
||||||
|
public override void SetHost(GameHost host)
|
||||||
|
{
|
||||||
|
base.SetHost(host);
|
||||||
|
|
||||||
|
// may be non-null for certain tests
|
||||||
|
Storage ??= host.Storage;
|
||||||
|
|
||||||
|
LocalConfig ??= UseDevelopmentServer
|
||||||
|
? new DevelopmentOsuConfigManager(Storage)
|
||||||
|
: new OsuConfigManager(Storage);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Use to programatically exit the game as if the user was triggering via alt-f4.
|
||||||
|
/// Will keep persisting until an exit occurs (exit may be blocked multiple times).
|
||||||
|
/// </summary>
|
||||||
|
public void GracefullyExit()
|
||||||
|
{
|
||||||
|
if (!OnExiting())
|
||||||
|
Exit();
|
||||||
|
else
|
||||||
|
Scheduler.AddDelayed(GracefullyExit, 2000);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Migrate(string path)
|
||||||
|
{
|
||||||
|
contextFactory.FlushConnections();
|
||||||
|
(Storage as OsuStorage)?.Migrate(Host.GetStorage(path));
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override UserInputManager CreateUserInputManager() => new OsuUserInputManager();
|
||||||
|
|
||||||
|
protected virtual BatteryInfo CreateBatteryInfo() => null;
|
||||||
|
|
||||||
|
protected virtual Container CreateScalingContainer() => new DrawSizePreservingFillContainer();
|
||||||
|
|
||||||
|
protected override Storage CreateStorage(GameHost host, Storage defaultStorage) => new OsuStorage(host, defaultStorage);
|
||||||
|
|
||||||
private void onRulesetChanged(ValueChangedEvent<RulesetInfo> r)
|
private void onRulesetChanged(ValueChangedEvent<RulesetInfo> r)
|
||||||
{
|
{
|
||||||
var dict = new Dictionary<ModType, IReadOnlyList<Mod>>();
|
var dict = new Dictionary<ModType, IReadOnlyList<Mod>>();
|
||||||
|
Loading…
Reference in New Issue
Block a user