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:
commit
1b5cb3893a
@ -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)
|
||||
{
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
|
||||
|
19
osu.Game.Tournament/TournamentStorage.cs
Normal file
19
osu.Game.Tournament/TournamentStorage.cs
Normal 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");
|
||||
}
|
||||
}
|
||||
}
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user