2017-10-03 00:33:58 +08:00
|
|
|
|
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
|
|
|
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
|
|
|
|
|
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
|
using osu.Framework.Graphics.Containers;
|
|
|
|
|
using osu.Game.Screens.Play.ReplaySettings;
|
|
|
|
|
using OpenTK;
|
|
|
|
|
using osu.Framework.Input;
|
|
|
|
|
using OpenTK.Input;
|
|
|
|
|
|
|
|
|
|
namespace osu.Game.Screens.Play.HUD
|
|
|
|
|
{
|
|
|
|
|
public class ReplaySettingsOverlay : VisibilityContainer
|
|
|
|
|
{
|
|
|
|
|
private const int fade_duration = 200;
|
|
|
|
|
|
2017-10-04 01:26:53 +08:00
|
|
|
|
public bool ReplayLoaded;
|
|
|
|
|
|
2017-10-03 00:33:58 +08:00
|
|
|
|
public readonly PlaybackSettings PlaybackSettings;
|
|
|
|
|
//public readonly CollectionSettings CollectionSettings;
|
|
|
|
|
//public readonly DiscussionSettings DiscussionSettings;
|
|
|
|
|
|
|
|
|
|
public ReplaySettingsOverlay()
|
|
|
|
|
{
|
|
|
|
|
AlwaysPresent = true;
|
|
|
|
|
RelativeSizeAxes = Axes.Both;
|
|
|
|
|
|
|
|
|
|
Child = new FillFlowContainer<ReplayGroup>
|
|
|
|
|
{
|
|
|
|
|
Anchor = Anchor.TopRight,
|
|
|
|
|
Origin = Anchor.TopRight,
|
|
|
|
|
AutoSizeAxes = Axes.Both,
|
|
|
|
|
Direction = FillDirection.Vertical,
|
|
|
|
|
Spacing = new Vector2(0, 20),
|
|
|
|
|
Margin = new MarginPadding { Top = 100, Right = 10 },
|
2017-12-10 03:21:17 +08:00
|
|
|
|
Children = new[]
|
2017-10-03 00:33:58 +08:00
|
|
|
|
{
|
|
|
|
|
//CollectionSettings = new CollectionSettings(),
|
|
|
|
|
//DiscussionSettings = new DiscussionSettings(),
|
|
|
|
|
PlaybackSettings = new PlaybackSettings(),
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
State = Visibility.Visible;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void PopIn() => this.FadeIn(fade_duration);
|
|
|
|
|
protected override void PopOut() => this.FadeOut(fade_duration);
|
|
|
|
|
|
|
|
|
|
protected override bool OnKeyDown(InputState state, KeyDownEventArgs args)
|
|
|
|
|
{
|
|
|
|
|
if (args.Repeat) return false;
|
|
|
|
|
|
|
|
|
|
if (state.Keyboard.ControlPressed)
|
|
|
|
|
{
|
2017-10-04 01:26:53 +08:00
|
|
|
|
if (args.Key == Key.H && ReplayLoaded)
|
2017-10-03 00:33:58 +08:00
|
|
|
|
{
|
|
|
|
|
ToggleVisibility();
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return base.OnKeyDown(state, args);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|