options -> settings

This commit is contained in:
EVAST9919
2017-05-18 11:39:22 +03:00
parent d07d94d606
commit 83a89ce22d
12 changed files with 76 additions and 86 deletions

View File

@ -14,7 +14,7 @@ using osu.Game.Rulesets.Scoring;
using osu.Game.Rulesets.UI;
using osu.Game.Screens.Play.HUD;
using OpenTK.Input;
using osu.Game.Screens.Play.Options;
using osu.Game.Screens.Play.Settings;
namespace osu.Game.Screens.Play
{
@ -30,7 +30,7 @@ namespace osu.Game.Screens.Play
public readonly HealthDisplay HealthDisplay;
public readonly SongProgress Progress;
public readonly ModDisplay ModDisplay;
public readonly OptionsDisplay OptionsDisplay;
public readonly SettingsDisplay SettingsDisplay;
private Bindable<bool> showKeyCounter;
private Bindable<bool> showHud;
@ -44,7 +44,7 @@ namespace osu.Game.Screens.Play
protected abstract HealthDisplay CreateHealthDisplay();
protected abstract SongProgress CreateProgress();
protected abstract ModDisplay CreateModsContainer();
protected abstract OptionsDisplay CreateOptionsDisplay();
protected abstract SettingsDisplay CreateSettingsDisplay();
protected HUDOverlay()
{
@ -63,7 +63,7 @@ namespace osu.Game.Screens.Play
HealthDisplay = CreateHealthDisplay(),
Progress = CreateProgress(),
ModDisplay = CreateModsContainer(),
OptionsDisplay = CreateOptionsDisplay(),
SettingsDisplay = CreateSettingsDisplay(),
}
});
}

View File

@ -1,111 +0,0 @@
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using OpenTK;
using OpenTK.Graphics;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites;
using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
using osu.Game.Graphics.UserInterface;
namespace osu.Game.Screens.Play.Options
{
public abstract class OptionContainer : Container
{
/// <summary>
/// The title of this option.
/// </summary>
public abstract string Title { get; }
private readonly OptionDropdown content;
private readonly SimpleButton button;
private bool contentIsVisible;
protected OptionContainer()
{
AutoSizeAxes = Axes.Y;
Width = 250;
Masking = true;
CornerRadius = 5;
BorderColour = Color4.Black;
BorderThickness = 2;
Children = new Drawable[]
{
new Box
{
RelativeSizeAxes = Axes.Both,
Colour = Color4.Black,
Alpha = 0.5f,
},
new FillFlowContainer
{
Direction = FillDirection.Vertical,
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Children = new Drawable[]
{
new Container
{
RelativeSizeAxes = Axes.X,
Height = 30,
Origin = Anchor.TopCentre,
Anchor = Anchor.TopCentre,
Children = new Drawable[]
{
new OsuSpriteText
{
Origin = Anchor.CentreLeft,
Anchor = Anchor.CentreLeft,
Text = Title,
TextSize = 17,
Font = @"Exo2.0-Bold",
Margin = new MarginPadding { Left = 10 },
},
button = new SimpleButton
{
Origin = Anchor.Centre,
Anchor = Anchor.CentreRight,
Position = new Vector2(-15,0),
Icon = FontAwesome.fa_bars,
Scale = new Vector2(0.7f),
Action = () => triggerContentVisibility(),
},
}
},
content = new OptionDropdown
{
RelativeSizeAxes = Axes.X,
}
}
},
};
}
[BackgroundDependencyLoader]
private void load(OsuColour colours)
{
content.StateChanged += (c, s) => button.FadeColour(s == Visibility.Visible ? colours.Yellow : Color4.White, 200, EasingTypes.OutQuint);
}
public new void Add(Drawable drawable)
{
content.Add(drawable);
}
private void triggerContentVisibility()
{
contentIsVisible = !contentIsVisible;
if (contentIsVisible)
content.Show();
else
content.Hide();
}
}
}

View File

@ -1,50 +0,0 @@
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using OpenTK;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
namespace osu.Game.Screens.Play.Options
{
public class OptionDropdown : OverlayContainer
{
private const float transition_duration = 600;
private FillFlowContainer content;
public OptionDropdown()
{
Children = new Drawable[]
{
content = new FillFlowContainer
{
Direction = FillDirection.Vertical,
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Origin = Anchor.TopCentre,
Anchor = Anchor.TopCentre,
Padding = new MarginPadding(15),
Spacing = new Vector2(0, 10),
}
};
}
public new void Add(Drawable drawable)
{
content.Add(drawable);
}
protected override void PopIn()
{
ResizeTo(new Vector2(1, content.Height), transition_duration, EasingTypes.OutQuint);
FadeIn(transition_duration, EasingTypes.OutQuint);
}
protected override void PopOut()
{
ResizeTo(new Vector2(1, 0), transition_duration, EasingTypes.OutQuint);
FadeOut(transition_duration);
}
}
}

View File

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

View File

@ -6,10 +6,11 @@ using osu.Framework.Graphics;
using osu.Game.Graphics.Sprites;
using osu.Game.Overlays.Music;
using System.Collections.Generic;
using osu.Game.Graphics.UserInterface;
namespace osu.Game.Screens.Play.Options
namespace osu.Game.Screens.Play.Settings
{
public class CollectionOptions : OptionContainer
public class CollectionSettings : SettingsContainer
{
public override string Title => @"COLLECTIONS";

View File

@ -7,9 +7,9 @@ using osu.Game.Configuration;
using osu.Game.Graphics.UserInterface;
using osu.Game.Overlays.Settings;
namespace osu.Game.Screens.Play.Options
namespace osu.Game.Screens.Play.Settings
{
public class DiscussionOptions : OptionContainer
public class DiscussionSettings : SettingsContainer
{
public override string Title => @"DISCUSSIONS";

View File

@ -4,10 +4,11 @@
using osu.Framework.Allocation;
using osu.Game.Configuration;
using osu.Game.Overlays.Settings;
using osu.Game.Graphics.UserInterface;
namespace osu.Game.Screens.Play.Options
namespace osu.Game.Screens.Play.Settings
{
public class PlaybackOptions : OptionContainer
public class PlaybackSettings : SettingsContainer
{
public override string Title => @"PLAYBACK";

View File

@ -4,9 +4,9 @@
using OpenTK;
using osu.Framework.Graphics.Containers;
namespace osu.Game.Screens.Play.Options
namespace osu.Game.Screens.Play.Settings
{
public class OptionsDisplay : FillFlowContainer
public class SettingsDisplay : FillFlowContainer
{
private bool isVisible;
public bool IsVisible
@ -23,14 +23,14 @@ namespace osu.Game.Screens.Play.Options
get { return isVisible; }
}
public OptionsDisplay()
public SettingsDisplay()
{
Direction = FillDirection.Vertical;
Spacing = new Vector2(0, 20);
Add(new CollectionOptions());
Add(new DiscussionOptions());
Add(new PlaybackOptions());
Add(new CollectionSettings());
Add(new DiscussionSettings());
Add(new PlaybackSettings());
}
}
}

View File

@ -8,7 +8,7 @@ using osu.Game.Graphics.UserInterface;
using osu.Game.Rulesets.Scoring;
using osu.Game.Screens.Play.HUD;
using OpenTK;
using osu.Game.Screens.Play.Options;
using osu.Game.Screens.Play.Settings;
namespace osu.Game.Screens.Play
{
@ -72,7 +72,7 @@ namespace osu.Game.Screens.Play
Margin = new MarginPadding { Top = 20, Right = 10 },
};
protected override OptionsDisplay CreateOptionsDisplay() => new OptionsDisplay
protected override SettingsDisplay CreateSettingsDisplay() => new SettingsDisplay
{
Anchor = Anchor.TopRight,
Origin = Anchor.TopRight,