1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 11:37:28 +08:00

Clean up a bit.

This commit is contained in:
Dean Herbert 2016-10-04 19:57:32 +09:00
parent cc52580568
commit 836083667f
2 changed files with 8 additions and 17 deletions

View File

@ -7,21 +7,15 @@ using osu.Framework.Graphics.Drawables;
using OpenTK;
using OpenTK.Graphics;
using osu.Game.Graphics;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Input;
using osu.Game.Configuration;
using System;
using System.Linq;
using osu.Game.GameModes.Play;
using osu.Framework.Extensions;
namespace osu.Game.Overlays
{
public partial class Toolbar : Container
public class Toolbar : Container
{
const float height = 50;
private FlowContainer leftFlow;
private FlowContainer rightFlow;
public Action OnSettings;
public Action OnHome;
@ -43,7 +37,7 @@ namespace osu.Game.Overlays
RelativeSizeAxes = Axes.Both,
Colour = new Color4(0.1f, 0.1f, 0.1f, 0.4f)
},
leftFlow = new FlowContainer
new FlowContainer
{
Direction = FlowDirection.HorizontalOnly,
RelativeSizeAxes = Axes.Y,
@ -53,27 +47,28 @@ namespace osu.Game.Overlays
{
Icon = FontAwesome.gear,
Action = OnSettings,
TooltipMain = "Settings"
TooltipMain = "Settings",
TooltipSub = "Change your settings",
},
new ToolbarButton
{
Icon = FontAwesome.home,
TooltipMain = "Home",
TooltipSub = "Return to the main menu",
Action = OnHome
},
modeSelector = new ToolbarModeSelector
{
OnPlayModeChange = this.OnPlayModeChange
OnPlayModeChange = OnPlayModeChange
}
}
},
rightFlow = new FlowContainer
new FlowContainer
{
Anchor = Anchor.TopRight,
Origin = Anchor.TopRight,
Direction = FlowDirection.HorizontalOnly,
RelativeSizeAxes = Axes.Y,
Size = new Vector2(0, 1),
Children = new []
{
new ToolbarButton

View File

@ -2,10 +2,7 @@
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using osu.Framework.Cached;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
@ -27,7 +24,6 @@ namespace osu.Game.Overlays
public Action<PlayMode> OnPlayModeChange;
public ToolbarModeSelector()
{
RelativeSizeAxes = Axes.Y;
@ -92,7 +88,7 @@ namespace osu.Game.Overlays
activeMode.Invalidate();
}
Cached<Drawable> activeMode = new Cached<Drawable>();
private Cached<Drawable> activeMode = new Cached<Drawable>();
protected override void UpdateLayout()
{