Move MenuItemType to correct namespace

This commit is contained in:
Dean Herbert 2017-06-13 15:20:21 +09:00
parent 9f8c66b8c6
commit 679786c76f
4 changed files with 14 additions and 15 deletions

View File

@ -10,7 +10,6 @@
using osu.Framework.Graphics.Transforms;
using osu.Framework.Graphics.UserInterface;
using osu.Framework.Testing;
using osu.Game.Graphics;
using osu.Game.Graphics.UserInterface;
namespace osu.Desktop.VisualTests.Tests
@ -101,12 +100,12 @@ private class MyContextMenuContainer : Container, IHasContextMenu
public ContextMenuItem[] ContextMenuItems => new ContextMenuItem[]
{
new OsuContextMenuItem(@"Some option"),
new OsuContextMenuItem(@"Highlighted option", ContextMenuType.Highlighted),
new OsuContextMenuItem(@"Highlighted option", MenuItemType.Highlighted),
new OsuContextMenuItem(@"Another option"),
new OsuContextMenuItem(@"Choose me please"),
new OsuContextMenuItem(@"And me too"),
new OsuContextMenuItem(@"Trying to fill"),
new OsuContextMenuItem(@"Destructive option", ContextMenuType.Destructive),
new OsuContextMenuItem(@"Destructive option", MenuItemType.Destructive),
};
}
@ -116,10 +115,10 @@ private class AnotherContextMenuContainer : Container, IHasContextMenu
{
new OsuContextMenuItem(@"Simple option"),
new OsuContextMenuItem(@"Simple very very long option"),
new OsuContextMenuItem(@"Change width", ContextMenuType.Highlighted) { Action = () => ResizeWidthTo(Width * 2, 100, EasingTypes.OutQuint) },
new OsuContextMenuItem(@"Change height", ContextMenuType.Highlighted) { Action = () => ResizeHeightTo(Height * 2, 100, EasingTypes.OutQuint) },
new OsuContextMenuItem(@"Change width back", ContextMenuType.Destructive) { Action = () => ResizeWidthTo(Width / 2, 100, EasingTypes.OutQuint) },
new OsuContextMenuItem(@"Change height back", ContextMenuType.Destructive) { Action = () => ResizeHeightTo(Height / 2, 100, EasingTypes.OutQuint) },
new OsuContextMenuItem(@"Change width", MenuItemType.Highlighted) { Action = () => ResizeWidthTo(Width * 2, 100, EasingTypes.OutQuint) },
new OsuContextMenuItem(@"Change height", MenuItemType.Highlighted) { Action = () => ResizeHeightTo(Height * 2, 100, EasingTypes.OutQuint) },
new OsuContextMenuItem(@"Change width back", MenuItemType.Destructive) { Action = () => ResizeWidthTo(Width / 2, 100, EasingTypes.OutQuint) },
new OsuContextMenuItem(@"Change height back", MenuItemType.Destructive) { Action = () => ResizeHeightTo(Height / 2, 100, EasingTypes.OutQuint) },
};
}
}

View File

@ -1,9 +1,9 @@
// 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.Graphics
namespace osu.Game.Graphics.UserInterface
{
public enum ContextMenuType
public enum MenuItemType
{
Standard,
Highlighted,

View File

@ -26,7 +26,7 @@ public class OsuContextMenuItem : ContextMenuItem
private SampleChannel sampleClick;
private SampleChannel sampleHover;
private readonly ContextMenuType type;
private readonly MenuItemType type;
protected override Container CreateTextContainer(string title) => new Container
{
@ -57,7 +57,7 @@ public class OsuContextMenuItem : ContextMenuItem
}
};
public OsuContextMenuItem(string title, ContextMenuType type = ContextMenuType.Standard) : base(title)
public OsuContextMenuItem(string title, MenuItemType type = MenuItemType.Standard) : base(title)
{
this.type = type;
}
@ -78,13 +78,13 @@ private void updateTextColour()
{
switch (type)
{
case ContextMenuType.Standard:
case MenuItemType.Standard:
textBold.Colour = text.Colour = Color4.White;
break;
case ContextMenuType.Destructive:
case MenuItemType.Destructive:
textBold.Colour = text.Colour = Color4.Red;
break;
case ContextMenuType.Highlighted:
case MenuItemType.Highlighted:
textBold.Colour = text.Colour = OsuColour.FromHex(@"ffcc22");
break;
}

View File

@ -76,9 +76,9 @@
<Compile Include="Beatmaps\Drawables\BeatmapBackgroundSprite.cs" />
<Compile Include="Beatmaps\DifficultyCalculator.cs" />
<Compile Include="Graphics\Cursor\OsuContextMenuContainer.cs" />
<Compile Include="Graphics\ContextMenuType.cs" />
<Compile Include="Graphics\UserInterface\IconButton.cs" />
<Compile Include="Configuration\SelectionRandomType.cs" />
<Compile Include="Graphics\UserInterface\MenuItemType.cs" />
<Compile Include="Graphics\UserInterface\OsuContextMenu.cs" />
<Compile Include="Graphics\UserInterface\OsuContextMenuItem.cs" />
<Compile Include="Online\API\Requests\GetUsersRequest.cs" />