Merge branch 'master' into realm-key-binding-store

This commit is contained in:
Dean Herbert
2021-04-22 12:13:23 +09:00
471 changed files with 19021 additions and 2945 deletions

View File

@ -40,6 +40,7 @@ using osu.Game.Rulesets;
using osu.Game.Rulesets.Mods;
using osu.Game.Scoring;
using osu.Game.Skinning;
using osu.Game.Utils;
using osuTK.Input;
using RuntimeInfo = osu.Framework.RuntimeInfo;
@ -60,6 +61,8 @@ namespace osu.Game
protected OsuConfigManager LocalConfig;
protected SessionStatics SessionStatics { get; private set; }
protected BeatmapManager BeatmapManager;
protected ScoreManager ScoreManager;
@ -158,6 +161,8 @@ namespace osu.Game
protected override UserInputManager CreateUserInputManager() => new OsuUserInputManager();
protected virtual BatteryInfo CreateBatteryInfo() => null;
/// <summary>
/// The maximum volume at which audio tracks should playback. This can be set lower than 1 to create some head-room for sound effects.
/// </summary>
@ -289,7 +294,12 @@ namespace osu.Game
dependencies.Cache(SettingsStore = new SettingsStore(contextFactory));
dependencies.Cache(RulesetConfigCache = new RulesetConfigCache(SettingsStore));
dependencies.Cache(new SessionStatics());
var powerStatus = CreateBatteryInfo();
if (powerStatus != null)
dependencies.CacheAs(powerStatus);
dependencies.Cache(SessionStatics = new SessionStatics());
dependencies.Cache(new OsuColour());
RegisterImportHandler(BeatmapManager);
@ -316,17 +326,18 @@ namespace osu.Game
AddInternal(RulesetConfigCache);
MenuCursorContainer = new MenuCursorContainer { RelativeSizeAxes = Axes.Both };
GlobalActionContainer globalBindings;
MenuCursorContainer.Child = globalBindings = new GlobalActionContainer(this)
var mainContent = new Drawable[]
{
RelativeSizeAxes = Axes.Both,
Child = content = new OsuTooltipContainer(MenuCursorContainer.Cursor) { RelativeSizeAxes = Axes.Both }
MenuCursorContainer = new MenuCursorContainer { RelativeSizeAxes = Axes.Both },
// to avoid positional input being blocked by children, ensure the GlobalActionContainer is above everything.
globalBindings = new GlobalActionContainer(this)
};
base.Content.Add(CreateScalingContainer().WithChild(MenuCursorContainer));
MenuCursorContainer.Child = content = new OsuTooltipContainer(MenuCursorContainer.Cursor) { RelativeSizeAxes = Axes.Both };
base.Content.Add(CreateScalingContainer().WithChildren(mainContent));
KeyBindingStore.Register(globalBindings);
@ -470,12 +481,18 @@ namespace osu.Game
public async Task Import(params string[] paths)
{
var extension = Path.GetExtension(paths.First())?.ToLowerInvariant();
if (paths.Length == 0)
return;
foreach (var importer in fileImporters)
var filesPerExtension = paths.GroupBy(p => Path.GetExtension(p).ToLowerInvariant());
foreach (var groups in filesPerExtension)
{
if (importer.HandledExtensions.Contains(extension))
await importer.Import(paths).ConfigureAwait(false);
foreach (var importer in fileImporters)
{
if (importer.HandledExtensions.Contains(groups.Key))
await importer.Import(groups.ToArray()).ConfigureAwait(false);
}
}
}