mirror of
https://github.com/osukey/osukey.git
synced 2025-08-05 07:33:55 +09:00
ingame options basic logic
This commit is contained in:
@ -14,6 +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;
|
||||
|
||||
namespace osu.Game.Screens.Play
|
||||
{
|
||||
@ -29,6 +30,7 @@ namespace osu.Game.Screens.Play
|
||||
public readonly HealthDisplay HealthDisplay;
|
||||
public readonly SongProgress Progress;
|
||||
public readonly ModDisplay ModDisplay;
|
||||
public readonly OptionsDisplay OptionsDisplay;
|
||||
|
||||
private Bindable<bool> showKeyCounter;
|
||||
private Bindable<bool> showHud;
|
||||
@ -42,6 +44,7 @@ namespace osu.Game.Screens.Play
|
||||
protected abstract HealthDisplay CreateHealthDisplay();
|
||||
protected abstract SongProgress CreateProgress();
|
||||
protected abstract ModDisplay CreateModsContainer();
|
||||
protected abstract OptionsDisplay CreateOptionsDisplay();
|
||||
|
||||
protected HUDOverlay()
|
||||
{
|
||||
@ -60,6 +63,7 @@ namespace osu.Game.Screens.Play
|
||||
HealthDisplay = CreateHealthDisplay(),
|
||||
Progress = CreateProgress(),
|
||||
ModDisplay = CreateModsContainer(),
|
||||
OptionsDisplay = CreateOptionsDisplay(),
|
||||
}
|
||||
});
|
||||
}
|
||||
|
59
osu.Game/Screens/Play/Options/OptionContainer.cs
Normal file
59
osu.Game/Screens/Play/Options/OptionContainer.cs
Normal file
@ -0,0 +1,59 @@
|
||||
// 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.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; }
|
||||
|
||||
public OptionContainer()
|
||||
{
|
||||
Masking = true;
|
||||
Size = new Vector2(200, 100);
|
||||
CornerRadius = 5;
|
||||
BorderColour = Color4.Black;
|
||||
BorderThickness = 2;
|
||||
Depth = 10;
|
||||
|
||||
Children = new Drawable[]
|
||||
{
|
||||
new Box
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Colour = Color4.Black,
|
||||
Alpha = 0.5f,
|
||||
},
|
||||
new OsuSpriteText
|
||||
{
|
||||
Origin = Anchor.TopLeft,
|
||||
Anchor = Anchor.TopLeft,
|
||||
Text = Title,
|
||||
TextSize = 17,
|
||||
Margin = new MarginPadding { Top = 5, Left = 10 },
|
||||
Font = @"Exo2.0-Bold",
|
||||
},
|
||||
new SimpleButton
|
||||
{
|
||||
Origin = Anchor.TopRight,
|
||||
Anchor = Anchor.TopRight,
|
||||
Margin = new MarginPadding { Top = 5, Right = 10 },
|
||||
Icon = FontAwesome.fa_bars,
|
||||
Scale = new Vector2(0.7f),
|
||||
},
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
21
osu.Game/Screens/Play/Options/OptionsDisplay.cs
Normal file
21
osu.Game/Screens/Play/Options/OptionsDisplay.cs
Normal file
@ -0,0 +1,21 @@
|
||||
// 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.Containers;
|
||||
|
||||
namespace osu.Game.Screens.Play.Options
|
||||
{
|
||||
public class OptionsDisplay : FillFlowContainer<OptionContainer>
|
||||
{
|
||||
public OptionsDisplay()
|
||||
{
|
||||
Direction = FillDirection.Vertical;
|
||||
Spacing = new Vector2(0, 20);
|
||||
|
||||
Add(new PlaybackOption());
|
||||
Add(new PlaybackOption());
|
||||
Add(new PlaybackOption());
|
||||
}
|
||||
}
|
||||
}
|
10
osu.Game/Screens/Play/Options/PlaybackOption.cs
Normal file
10
osu.Game/Screens/Play/Options/PlaybackOption.cs
Normal file
@ -0,0 +1,10 @@
|
||||
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
namespace osu.Game.Screens.Play.Options
|
||||
{
|
||||
public class PlaybackOption : OptionContainer
|
||||
{
|
||||
public override string Title => "PLAYBACK";
|
||||
}
|
||||
}
|
@ -8,6 +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;
|
||||
|
||||
namespace osu.Game.Screens.Play
|
||||
{
|
||||
@ -71,6 +72,14 @@ namespace osu.Game.Screens.Play
|
||||
Margin = new MarginPadding { Top = 20, Right = 10 },
|
||||
};
|
||||
|
||||
protected override OptionsDisplay CreateOptionsDisplay() => new OptionsDisplay
|
||||
{
|
||||
Anchor = Anchor.TopRight,
|
||||
Origin = Anchor.TopRight,
|
||||
AutoSizeAxes = Axes.Both,
|
||||
Margin = new MarginPadding { Top = 100, Right = 10 },
|
||||
};
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuColour colours)
|
||||
{
|
||||
|
Reference in New Issue
Block a user