1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 15:33:05 +08:00

Merge branch 'master' into fix-carousel-test-loading-beatmaps

This commit is contained in:
Dan Balasescu 2020-03-12 18:14:27 +09:00 committed by GitHub
commit 1b5cb3893a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 33 additions and 22 deletions

View File

@ -7,7 +7,6 @@ using osu.Framework.Graphics.Colour;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Graphics.Video;
using osu.Framework.Platform;
using osu.Framework.Timing;
using osu.Game.Graphics;
@ -28,9 +27,9 @@ namespace osu.Game.Tournament.Components
}
[BackgroundDependencyLoader]
private void load(Storage storage)
private void load(TournamentStorage storage)
{
var stream = storage.GetStream($@"videos/{filename}.m4v");
var stream = storage.GetStream($@"videos/{filename}");
if (stream != null)
{

View File

@ -11,6 +11,7 @@ using osu.Game.Graphics;
using osu.Game.Graphics.UserInterface;
using osu.Game.Tournament.IPC;
using osu.Game.Tournament.Models;
using osuTK;
namespace osu.Game.Tournament.Screens.Gameplay.Components
{
@ -131,13 +132,15 @@ namespace osu.Game.Tournament.Screens.Gameplay.Components
Margin = new MarginPadding { Top = bar_height, Horizontal = 10 };
Winning = false;
DisplayedCountSpriteText.Spacing = new Vector2(-6);
}
public bool Winning
{
set => DisplayedCountSpriteText.Font = value
? OsuFont.Torus.With(weight: FontWeight.Bold, size: 50)
: OsuFont.Torus.With(weight: FontWeight.Regular, size: 40);
? OsuFont.Torus.With(weight: FontWeight.Bold, size: 50, fixedWidth: true)
: OsuFont.Torus.With(weight: FontWeight.Regular, size: 40, fixedWidth: true);
}
}
}

View File

@ -37,6 +37,8 @@ namespace osu.Game.Tournament
private Storage storage;
private TournamentStorage tournamentStorage;
private DependencyContainer dependencies;
private Bindable<Size> windowSize;
@ -54,7 +56,9 @@ namespace osu.Game.Tournament
{
Resources.AddStore(new DllResourceStore(typeof(TournamentGameBase).Assembly));
Textures.AddStore(new TextureLoaderStore(new ResourceStore<byte[]>(new StorageBackedResourceStore(storage))));
dependencies.CacheAs(tournamentStorage = new TournamentStorage(storage));
Textures.AddStore(new TextureLoaderStore(tournamentStorage));
this.storage = storage;

View File

@ -0,0 +1,19 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.IO.Stores;
using osu.Framework.Platform;
namespace osu.Game.Tournament
{
internal class TournamentStorage : NamespacedResourceStore<byte[]>
{
public TournamentStorage(Storage storage)
: base(new StorageBackedResourceStore(storage), "tournament")
{
AddExtension("m4v");
AddExtension("avi");
AddExtension("mp4");
}
}
}

View File

@ -14,22 +14,8 @@ namespace osu.Game.Overlays.Volume
public Func<GlobalAction, bool> ActionRequested;
public Func<GlobalAction, float, bool, bool> ScrollActionRequested;
public bool OnPressed(GlobalAction action)
{
// if nothing else handles selection actions in the game, it's safe to let volume be adjusted.
switch (action)
{
case GlobalAction.SelectPrevious:
action = GlobalAction.IncreaseVolume;
break;
case GlobalAction.SelectNext:
action = GlobalAction.DecreaseVolume;
break;
}
return ActionRequested?.Invoke(action) ?? false;
}
public bool OnPressed(GlobalAction action) =>
ActionRequested?.Invoke(action) ?? false;
public bool OnScroll(GlobalAction action, float amount, bool isPrecise) =>
ScrollActionRequested?.Invoke(action, amount, isPrecise) ?? false;