mirror of
https://github.com/ppy/osu.git
synced 2025-01-14 04:02:59 +08:00
Applied suggested changes
This commit is contained in:
parent
261f1f4e1f
commit
08219ccb42
@ -21,7 +21,6 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
|
|
||||||
Add(new ReplaySettingsOverlay()
|
Add(new ReplaySettingsOverlay()
|
||||||
{
|
{
|
||||||
IsAvaliable = true,
|
|
||||||
Anchor = Anchor.TopRight,
|
Anchor = Anchor.TopRight,
|
||||||
Origin = Anchor.TopRight,
|
Origin = Anchor.TopRight,
|
||||||
});
|
});
|
||||||
|
@ -40,7 +40,7 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
BorderColour = Color4.Black;
|
BorderColour = Color4.Black;
|
||||||
BorderThickness = border_thickness;
|
BorderThickness = border_thickness;
|
||||||
|
|
||||||
Children = new Drawable[]
|
InternalChildren = new Drawable[]
|
||||||
{
|
{
|
||||||
new Box
|
new Box
|
||||||
{
|
{
|
||||||
@ -59,10 +59,10 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
new Container
|
new Container
|
||||||
{
|
{
|
||||||
Name = @"Header",
|
Name = @"Header",
|
||||||
RelativeSizeAxes = Axes.X,
|
|
||||||
Height = header_height,
|
|
||||||
Origin = Anchor.TopCentre,
|
Origin = Anchor.TopCentre,
|
||||||
Anchor = Anchor.TopCentre,
|
Anchor = Anchor.TopCentre,
|
||||||
|
RelativeSizeAxes = Axes.X,
|
||||||
|
Height = header_height,
|
||||||
|
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
@ -90,13 +90,13 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
content = new FillFlowContainer
|
content = new FillFlowContainer
|
||||||
{
|
{
|
||||||
Name = @"Content",
|
Name = @"Content",
|
||||||
|
Origin = Anchor.TopCentre,
|
||||||
|
Anchor = Anchor.TopCentre,
|
||||||
Direction = FillDirection.Vertical,
|
Direction = FillDirection.Vertical,
|
||||||
RelativeSizeAxes = Axes.X,
|
RelativeSizeAxes = Axes.X,
|
||||||
AutoSizeDuration = transition_duration,
|
AutoSizeDuration = transition_duration,
|
||||||
AutoSizeEasing = EasingTypes.OutQuint,
|
AutoSizeEasing = EasingTypes.OutQuint,
|
||||||
AutoSizeAxes = Axes.Y,
|
AutoSizeAxes = Axes.Y,
|
||||||
Origin = Anchor.TopCentre,
|
|
||||||
Anchor = Anchor.TopCentre,
|
|
||||||
Padding = new MarginPadding(15),
|
Padding = new MarginPadding(15),
|
||||||
Spacing = new Vector2(0, 15),
|
Spacing = new Vector2(0, 15),
|
||||||
}
|
}
|
||||||
@ -105,10 +105,7 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public new void Add(Drawable drawable)
|
protected override Container<Drawable> Content => content;
|
||||||
{
|
|
||||||
content.Add(drawable);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void triggerContentVisibility()
|
private void triggerContentVisibility()
|
||||||
{
|
{
|
||||||
|
@ -44,12 +44,12 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
{
|
{
|
||||||
content = new Container
|
content = new Container
|
||||||
{
|
{
|
||||||
Size = new Vector2(button_size),
|
|
||||||
CornerRadius = 5,
|
|
||||||
Masking = true,
|
|
||||||
|
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
|
Size = new Vector2 (button_size),
|
||||||
|
|
||||||
|
CornerRadius = 5,
|
||||||
|
Masking = true,
|
||||||
EdgeEffect = new EdgeEffect
|
EdgeEffect = new EdgeEffect
|
||||||
{
|
{
|
||||||
Colour = Color4.Black.Opacity(0.04f),
|
Colour = Color4.Black.Opacity(0.04f),
|
||||||
@ -65,9 +65,9 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
},
|
},
|
||||||
icon = new TextAwesome
|
icon = new TextAwesome
|
||||||
{
|
{
|
||||||
TextSize = 18,
|
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
Anchor = Anchor.Centre
|
Anchor = Anchor.Centre,
|
||||||
|
TextSize = 18,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -99,8 +99,13 @@ namespace osu.Game.Screens.Play
|
|||||||
|
|
||||||
// in the case a replay isn't loaded, we want some elements to only appear briefly.
|
// in the case a replay isn't loaded, we want some elements to only appear briefly.
|
||||||
if (!hitRenderer.HasReplayLoaded)
|
if (!hitRenderer.HasReplayLoaded)
|
||||||
|
{
|
||||||
|
ReplaySettingsOverlay.Hide();
|
||||||
|
ReplaySettingsOverlay.AlwaysPresent = false;
|
||||||
|
|
||||||
using (ModDisplay.BeginDelayedSequence(2000))
|
using (ModDisplay.BeginDelayedSequence(2000))
|
||||||
ModDisplay.FadeOut(200);
|
ModDisplay.FadeOut(200);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override bool OnKeyDown(InputState state, KeyDownEventArgs args)
|
protected override bool OnKeyDown(InputState state, KeyDownEventArgs args)
|
||||||
|
@ -202,7 +202,6 @@ namespace osu.Game.Screens.Play
|
|||||||
hudOverlay.Progress.Objects = HitRenderer.Objects;
|
hudOverlay.Progress.Objects = HitRenderer.Objects;
|
||||||
hudOverlay.Progress.AudioClock = decoupledClock;
|
hudOverlay.Progress.AudioClock = decoupledClock;
|
||||||
hudOverlay.Progress.AllowSeeking = HitRenderer.HasReplayLoaded;
|
hudOverlay.Progress.AllowSeeking = HitRenderer.HasReplayLoaded;
|
||||||
hudOverlay.ReplaySettingsOverlay.IsAvaliable = HitRenderer.HasReplayLoaded;
|
|
||||||
hudOverlay.Progress.OnSeek = pos => decoupledClock.Seek(pos);
|
hudOverlay.Progress.OnSeek = pos => decoupledClock.Seek(pos);
|
||||||
|
|
||||||
hudOverlay.ModDisplay.Current.BindTo(Beatmap.Mods);
|
hudOverlay.ModDisplay.Current.BindTo(Beatmap.Mods);
|
||||||
|
@ -17,15 +17,18 @@ namespace osu.Game.Screens.Play.ReplaySettings
|
|||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load()
|
private void load()
|
||||||
{
|
{
|
||||||
Add(new OsuSpriteText
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
Text = @"Add current song to",
|
new OsuSpriteText
|
||||||
});
|
{
|
||||||
Add(new CollectionsDropdown<PlaylistCollection>
|
Text = @"Add current song to",
|
||||||
{
|
},
|
||||||
RelativeSizeAxes = Axes.X,
|
new CollectionsDropdown<PlaylistCollection>
|
||||||
Items = new[] { new KeyValuePair<string, PlaylistCollection>(@"All", PlaylistCollection.All) },
|
{
|
||||||
});
|
RelativeSizeAxes = Axes.X,
|
||||||
|
Items = new[] { new KeyValuePair<string, PlaylistCollection>(@"All", PlaylistCollection.All) },
|
||||||
|
},
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -16,18 +16,21 @@ namespace osu.Game.Screens.Play.ReplaySettings
|
|||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(OsuConfigManager config)
|
private void load(OsuConfigManager config)
|
||||||
{
|
{
|
||||||
Add(new SettingsCheckbox
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
LabelText = "Show floating coments",
|
new SettingsCheckbox
|
||||||
Bindable = config.GetBindable<bool>(OsuSetting.FloatingComments)
|
{
|
||||||
});
|
LabelText = "Show floating coments",
|
||||||
Add(new FocusedTextBox
|
Bindable = config.GetBindable<bool>(OsuSetting.FloatingComments)
|
||||||
{
|
},
|
||||||
RelativeSizeAxes = Axes.X,
|
new FocusedTextBox
|
||||||
Height = 30,
|
{
|
||||||
PlaceholderText = "Add Comment",
|
RelativeSizeAxes = Axes.X,
|
||||||
HoldFocus = false,
|
Height = 30,
|
||||||
});
|
PlaceholderText = "Add Comment",
|
||||||
|
HoldFocus = false,
|
||||||
|
},
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,6 +5,7 @@ using osu.Framework.Allocation;
|
|||||||
using osu.Game.Configuration;
|
using osu.Game.Configuration;
|
||||||
using osu.Game.Overlays.Settings;
|
using osu.Game.Overlays.Settings;
|
||||||
using osu.Game.Graphics.UserInterface;
|
using osu.Game.Graphics.UserInterface;
|
||||||
|
using osu.Framework.Graphics;
|
||||||
|
|
||||||
namespace osu.Game.Screens.Play.ReplaySettings
|
namespace osu.Game.Screens.Play.ReplaySettings
|
||||||
{
|
{
|
||||||
@ -15,11 +16,14 @@ namespace osu.Game.Screens.Play.ReplaySettings
|
|||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(OsuConfigManager config)
|
private void load(OsuConfigManager config)
|
||||||
{
|
{
|
||||||
Add(new SettingsSlider<double>
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
LabelText = "Playback speed",
|
new SettingsSlider<double>
|
||||||
Bindable = config.GetBindable<double>(OsuSetting.PlaybackSpeed),
|
{
|
||||||
});
|
LabelText = "Playback speed",
|
||||||
|
Bindable = config.GetBindable<double>(OsuSetting.PlaybackSpeed),
|
||||||
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -15,26 +15,6 @@ namespace osu.Game.Screens.Play.ReplaySettings
|
|||||||
|
|
||||||
private bool isVisible;
|
private bool isVisible;
|
||||||
|
|
||||||
private bool isAvaliable;
|
|
||||||
/// <summary>
|
|
||||||
/// Allow user to interact with this overlay.
|
|
||||||
/// </summary>
|
|
||||||
public bool IsAvaliable
|
|
||||||
{
|
|
||||||
set
|
|
||||||
{
|
|
||||||
isAvaliable = value;
|
|
||||||
if (isAvaliable)
|
|
||||||
Show();
|
|
||||||
else
|
|
||||||
Hide();
|
|
||||||
}
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return isAvaliable;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public ReplaySettingsOverlay()
|
public ReplaySettingsOverlay()
|
||||||
{
|
{
|
||||||
AlwaysPresent = true;
|
AlwaysPresent = true;
|
||||||
@ -54,20 +34,12 @@ namespace osu.Game.Screens.Play.ReplaySettings
|
|||||||
switch (args.Key)
|
switch (args.Key)
|
||||||
{
|
{
|
||||||
case Key.H:
|
case Key.H:
|
||||||
toogleVisibility();
|
FadeTo(isVisible ? 1 : 0, fade_duration);
|
||||||
|
isVisible = !isVisible;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return base.OnKeyDown(state, args);
|
return base.OnKeyDown(state, args);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void toogleVisibility()
|
|
||||||
{
|
|
||||||
if (isAvaliable)
|
|
||||||
{
|
|
||||||
FadeTo(isVisible ? 1 : 0, fade_duration);
|
|
||||||
isVisible = !isVisible;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user