1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-13 22:22:55 +08:00

Applied suggested changes

This commit is contained in:
EVAST9919 2017-05-29 19:00:29 +03:00
parent 261f1f4e1f
commit 08219ccb42
9 changed files with 52 additions and 70 deletions

View File

@ -21,7 +21,6 @@ namespace osu.Desktop.VisualTests.Tests
Add(new ReplaySettingsOverlay()
{
IsAvaliable = true,
Anchor = Anchor.TopRight,
Origin = Anchor.TopRight,
});

View File

@ -40,7 +40,7 @@ namespace osu.Game.Graphics.UserInterface
BorderColour = Color4.Black;
BorderThickness = border_thickness;
Children = new Drawable[]
InternalChildren = new Drawable[]
{
new Box
{
@ -59,10 +59,10 @@ namespace osu.Game.Graphics.UserInterface
new Container
{
Name = @"Header",
RelativeSizeAxes = Axes.X,
Height = header_height,
Origin = Anchor.TopCentre,
Anchor = Anchor.TopCentre,
RelativeSizeAxes = Axes.X,
Height = header_height,
Children = new Drawable[]
{
@ -90,13 +90,13 @@ namespace osu.Game.Graphics.UserInterface
content = new FillFlowContainer
{
Name = @"Content",
Origin = Anchor.TopCentre,
Anchor = Anchor.TopCentre,
Direction = FillDirection.Vertical,
RelativeSizeAxes = Axes.X,
AutoSizeDuration = transition_duration,
AutoSizeEasing = EasingTypes.OutQuint,
AutoSizeAxes = Axes.Y,
Origin = Anchor.TopCentre,
Anchor = Anchor.TopCentre,
Padding = new MarginPadding(15),
Spacing = new Vector2(0, 15),
}
@ -105,10 +105,7 @@ namespace osu.Game.Graphics.UserInterface
};
}
public new void Add(Drawable drawable)
{
content.Add(drawable);
}
protected override Container<Drawable> Content => content;
private void triggerContentVisibility()
{

View File

@ -44,12 +44,12 @@ namespace osu.Game.Graphics.UserInterface
{
content = new Container
{
Size = new Vector2(button_size),
CornerRadius = 5,
Masking = true,
Origin = Anchor.Centre,
Anchor = Anchor.Centre,
Size = new Vector2 (button_size),
CornerRadius = 5,
Masking = true,
EdgeEffect = new EdgeEffect
{
Colour = Color4.Black.Opacity(0.04f),
@ -65,9 +65,9 @@ namespace osu.Game.Graphics.UserInterface
},
icon = new TextAwesome
{
TextSize = 18,
Origin = Anchor.Centre,
Anchor = Anchor.Centre
Anchor = Anchor.Centre,
TextSize = 18,
}
}
}

View File

@ -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.
if (!hitRenderer.HasReplayLoaded)
{
ReplaySettingsOverlay.Hide();
ReplaySettingsOverlay.AlwaysPresent = false;
using (ModDisplay.BeginDelayedSequence(2000))
ModDisplay.FadeOut(200);
}
}
protected override bool OnKeyDown(InputState state, KeyDownEventArgs args)

View File

@ -202,7 +202,6 @@ namespace osu.Game.Screens.Play
hudOverlay.Progress.Objects = HitRenderer.Objects;
hudOverlay.Progress.AudioClock = decoupledClock;
hudOverlay.Progress.AllowSeeking = HitRenderer.HasReplayLoaded;
hudOverlay.ReplaySettingsOverlay.IsAvaliable = HitRenderer.HasReplayLoaded;
hudOverlay.Progress.OnSeek = pos => decoupledClock.Seek(pos);
hudOverlay.ModDisplay.Current.BindTo(Beatmap.Mods);

View File

@ -17,15 +17,18 @@ namespace osu.Game.Screens.Play.ReplaySettings
[BackgroundDependencyLoader]
private void load()
{
Add(new OsuSpriteText
Children = new Drawable[]
{
Text = @"Add current song to",
});
Add(new CollectionsDropdown<PlaylistCollection>
{
RelativeSizeAxes = Axes.X,
Items = new[] { new KeyValuePair<string, PlaylistCollection>(@"All", PlaylistCollection.All) },
});
new OsuSpriteText
{
Text = @"Add current song to",
},
new CollectionsDropdown<PlaylistCollection>
{
RelativeSizeAxes = Axes.X,
Items = new[] { new KeyValuePair<string, PlaylistCollection>(@"All", PlaylistCollection.All) },
},
};
}
}
}

View File

@ -16,18 +16,21 @@ namespace osu.Game.Screens.Play.ReplaySettings
[BackgroundDependencyLoader]
private void load(OsuConfigManager config)
{
Add(new SettingsCheckbox
Children = new Drawable[]
{
LabelText = "Show floating coments",
Bindable = config.GetBindable<bool>(OsuSetting.FloatingComments)
});
Add(new FocusedTextBox
{
RelativeSizeAxes = Axes.X,
Height = 30,
PlaceholderText = "Add Comment",
HoldFocus = false,
});
new SettingsCheckbox
{
LabelText = "Show floating coments",
Bindable = config.GetBindable<bool>(OsuSetting.FloatingComments)
},
new FocusedTextBox
{
RelativeSizeAxes = Axes.X,
Height = 30,
PlaceholderText = "Add Comment",
HoldFocus = false,
},
};
}
}
}

View File

@ -5,6 +5,7 @@ using osu.Framework.Allocation;
using osu.Game.Configuration;
using osu.Game.Overlays.Settings;
using osu.Game.Graphics.UserInterface;
using osu.Framework.Graphics;
namespace osu.Game.Screens.Play.ReplaySettings
{
@ -15,11 +16,14 @@ namespace osu.Game.Screens.Play.ReplaySettings
[BackgroundDependencyLoader]
private void load(OsuConfigManager config)
{
Add(new SettingsSlider<double>
Children = new Drawable[]
{
LabelText = "Playback speed",
Bindable = config.GetBindable<double>(OsuSetting.PlaybackSpeed),
});
new SettingsSlider<double>
{
LabelText = "Playback speed",
Bindable = config.GetBindable<double>(OsuSetting.PlaybackSpeed),
}
};
}
}
}

View File

@ -15,26 +15,6 @@ namespace osu.Game.Screens.Play.ReplaySettings
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()
{
AlwaysPresent = true;
@ -54,20 +34,12 @@ namespace osu.Game.Screens.Play.ReplaySettings
switch (args.Key)
{
case Key.H:
toogleVisibility();
FadeTo(isVisible ? 1 : 0, fade_duration);
isVisible = !isVisible;
return true;
}
return base.OnKeyDown(state, args);
}
private void toogleVisibility()
{
if (isAvaliable)
{
FadeTo(isVisible ? 1 : 0, fade_duration);
isVisible = !isVisible;
}
}
}
}