1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-15 04:13:00 +08:00

Tidy namespaces.

This commit is contained in:
Dean Herbert 2016-10-27 11:55:55 +09:00
parent 9c27c33e18
commit f846505a92
6 changed files with 140 additions and 118 deletions

View File

@ -2,24 +2,18 @@
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System;
using System.Linq;
using osu.Framework;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites;
using osu.Game.Graphics;
using osu.Game.Beatmaps;
using osu.Game.Database;
using osu.Framework.Graphics.Primitives;
using OpenTK;
using System.Linq;
using osu.Framework.Graphics.Transformations;
using osu.Framework.Input;
using osu.Game.Database;
using osu.Game.Graphics;
using OpenTK;
using OpenTK.Graphics;
using osu.Game.Beatmaps.IO;
using osu.Framework.Graphics.Textures;
using System.Threading.Tasks;
using osu.Framework;
namespace osu.Game.GameModes.Play
namespace osu.Game.Beatmaps.Drawable
{
class BeatmapGroup : Container, IStateful<BeatmapGroup.GroupState>
{
@ -44,7 +38,7 @@ namespace osu.Game.GameModes.Play
public Action<BeatmapGroup, BeatmapInfo> BeatmapSelected;
public BeatmapSetInfo BeatmapSet;
private BeatmapSetHeader setBox;
private BeatmapSetHeader header;
private FlowContainer difficulties;
private bool collapsed;
public GroupState State
@ -63,14 +57,14 @@ namespace osu.Game.GameModes.Play
difficulties.Hide();
else
difficulties.Show();
setBox.ClearTransformations();
setBox.Width = collapsed ? collapsedWidth : 1; // TODO: Transform
setBox.BorderColour = new Color4(
setBox.BorderColour.R,
setBox.BorderColour.G,
setBox.BorderColour.B,
header.ClearTransformations();
header.Width = collapsed ? collapsedWidth : 1; // TODO: Transform
header.BorderColour = new Color4(
header.BorderColour.R,
header.BorderColour.G,
header.BorderColour.B,
collapsed ? 0 : 255);
setBox.GlowRadius = collapsed ? 0 : 5;
header.GlowRadius = collapsed ? 0 : 5;
}
}
@ -89,9 +83,9 @@ namespace osu.Game.GameModes.Play
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Direction = FlowDirection.VerticalOnly,
Children = new Drawable[]
Children = new Framework.Graphics.Drawable[]
{
setBox = new BeatmapSetHeader(beatmapSet)
header = new BeatmapSetHeader(beatmapSet)
{
RelativeSizeAxes = Axes.X,
Width = collapsedWidth,
@ -142,89 +136,4 @@ namespace osu.Game.GameModes.Play
return true;
}
}
class BeatmapSetHeader : Container
{
public BeatmapSetHeader(BeatmapSetInfo beatmapSet)
{
AutoSizeAxes = Axes.Y;
Masking = true;
CornerRadius = 5;
BorderThickness = 2;
BorderColour = new Color4(221, 255, 255, 0);
GlowColour = new Color4(166, 221, 251, 0.5f); // TODO: Get actual color for this
Children = new Drawable[]
{
new Box
{
Colour = new Color4(85, 85, 85, 255),
RelativeSizeAxes = Axes.Both,
Size = Vector2.One,
},
new Container
{
RelativeSizeAxes = Axes.Both,
Size = Vector2.One,
Children = new Drawable[]
{
new Box // TODO: Gradient
{
Colour = new Color4(0, 0, 0, 100),
RelativeSizeAxes = Axes.Both,
Size = Vector2.One,
}
}
},
new FlowContainer
{
Direction = FlowDirection.VerticalOnly,
Spacing = new Vector2(0, 2),
Padding = new MarginPadding { Top = 3, Left = 20, Right = 20, Bottom = 3 },
AutoSizeAxes = Axes.Both,
Children = new[]
{
// TODO: Make these italic
new SpriteText
{
Text = beatmapSet.Metadata.Title ?? beatmapSet.Metadata.TitleUnicode,
TextSize = 20
},
new SpriteText
{
Text = beatmapSet.Metadata.Artist ?? beatmapSet.Metadata.ArtistUnicode,
TextSize = 16
},
new FlowContainer
{
AutoSizeAxes = Axes.Both,
Children = new[]
{
new DifficultyIcon(FontAwesome.dot_circle_o, new Color4(159, 198, 0, 255)),
new DifficultyIcon(FontAwesome.dot_circle_o, new Color4(246, 101, 166, 255)),
}
}
}
}
};
}
}
class DifficultyIcon : Container
{
public DifficultyIcon(FontAwesome icon, Color4 color)
{
const float size = 20;
Size = new Vector2(size);
Children = new[]
{
new TextAwesome
{
Anchor = Anchor.Centre,
TextSize = size,
Colour = color,
Icon = icon
}
};
}
}
}

View File

@ -4,16 +4,16 @@
using System;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Primitives;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Input;
using osu.Game.Database;
using osu.Framework.Graphics.Primitives;
using OpenTK.Graphics;
using OpenTK;
using osu.Game.Graphics;
using osu.Game.Graphics.UserInterface;
using OpenTK;
using OpenTK.Graphics;
namespace osu.Game.GameModes.Play
namespace osu.Game.Beatmaps.Drawable
{
class BeatmapPanel : Container
{
@ -49,7 +49,7 @@ namespace osu.Game.GameModes.Play
BorderThickness = 2;
BorderColour = new Color4(221, 255, 255, 0);
GlowColour = new Color4(166, 221, 251, 0.75f); // TODO: Get actual color for this
Children = new Drawable[]
Children = new Framework.Graphics.Drawable[]
{
new Box
{
@ -62,7 +62,7 @@ namespace osu.Game.GameModes.Play
Padding = new MarginPadding(5),
Direction = FlowDirection.HorizontalOnly,
AutoSizeAxes = Axes.Both,
Children = new Drawable[]
Children = new Framework.Graphics.Drawable[]
{
new DifficultyIcon(FontAwesome.dot_circle_o, new Color4(159, 198, 0, 255)),
new FlowContainer
@ -70,7 +70,7 @@ namespace osu.Game.GameModes.Play
Padding = new MarginPadding { Left = 10 },
Direction = FlowDirection.VerticalOnly,
AutoSizeAxes = Axes.Both,
Children = new Drawable[]
Children = new Framework.Graphics.Drawable[]
{
new FlowContainer
{

View File

@ -0,0 +1,80 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Primitives;
using osu.Framework.Graphics.Sprites;
using osu.Game.Database;
using osu.Game.Graphics;
using OpenTK;
using OpenTK.Graphics;
namespace osu.Game.Beatmaps.Drawable
{
class BeatmapSetHeader : Container
{
public BeatmapSetHeader(BeatmapSetInfo beatmapSet)
{
AutoSizeAxes = Axes.Y;
Masking = true;
CornerRadius = 5;
BorderThickness = 2;
BorderColour = new Color4(221, 255, 255, 0);
GlowColour = new Color4(166, 221, 251, 0.5f); // TODO: Get actual color for this
Children = new Framework.Graphics.Drawable[]
{
new Box
{
Colour = new Color4(85, 85, 85, 255),
RelativeSizeAxes = Axes.Both,
Size = Vector2.One,
},
new Container
{
RelativeSizeAxes = Axes.Both,
Size = Vector2.One,
Children = new Framework.Graphics.Drawable[]
{
new Box // TODO: Gradient
{
Colour = new Color4(0, 0, 0, 100),
RelativeSizeAxes = Axes.Both,
Size = Vector2.One,
}
}
},
new FlowContainer
{
Direction = FlowDirection.VerticalOnly,
Spacing = new Vector2(0, 2),
Padding = new MarginPadding { Top = 3, Left = 20, Right = 20, Bottom = 3 },
AutoSizeAxes = Axes.Both,
Children = new[]
{
// TODO: Make these italic
new SpriteText
{
Text = beatmapSet.Metadata.Title ?? beatmapSet.Metadata.TitleUnicode,
TextSize = 20
},
new SpriteText
{
Text = beatmapSet.Metadata.Artist ?? beatmapSet.Metadata.ArtistUnicode,
TextSize = 16
},
new FlowContainer
{
AutoSizeAxes = Axes.Both,
Children = new[]
{
new DifficultyIcon(FontAwesome.dot_circle_o, new Color4(159, 198, 0, 255)),
new DifficultyIcon(FontAwesome.dot_circle_o, new Color4(246, 101, 166, 255)),
}
}
}
}
};
}
}
}

View File

@ -0,0 +1,30 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Game.Graphics;
using OpenTK;
using OpenTK.Graphics;
namespace osu.Game.Beatmaps.Drawable
{
class DifficultyIcon : Container
{
public DifficultyIcon(FontAwesome icon, Color4 color)
{
const float size = 20;
Size = new Vector2(size);
Children = new[]
{
new TextAwesome
{
Anchor = Anchor.Centre,
TextSize = size,
Colour = color,
Icon = icon
}
};
}
}
}

View File

@ -15,6 +15,7 @@ using OpenTK;
using OpenTK.Graphics;
using osu.Framework.Graphics.UserInterface;
using System.Threading.Tasks;
using osu.Game.Beatmaps.Drawable;
namespace osu.Game.GameModes.Play
{

View File

@ -64,6 +64,8 @@
</ItemGroup>
<ItemGroup>
<Compile Include="Beatmaps\Beatmap.cs" />
<Compile Include="Beatmaps\Drawable\BeatmapSetHeader.cs" />
<Compile Include="Beatmaps\Drawable\DifficultyIcon.cs" />
<Compile Include="Beatmaps\Objects\Catch\CatchConverter.cs" />
<Compile Include="Beatmaps\Objects\Catch\Drawable\DrawableFruit.cs" />
<Compile Include="Beatmaps\Objects\DrawableHitObject.cs" />
@ -116,8 +118,8 @@
<Compile Include="GameModes\OsuGameMode.cs" />
<Compile Include="GameModes\Play\ModSelect.cs" />
<Compile Include="GameModes\Play\Osu\ScoreOverlayOsu.cs" />
<Compile Include="GameModes\Play\BeatmapGroup.cs" />
<Compile Include="GameModes\Play\BeatmapPanel.cs" />
<Compile Include="Beatmaps\Drawable\BeatmapGroup.cs" />
<Compile Include="Beatmaps\Drawable\BeatmapPanel.cs" />
<Compile Include="GameModes\Play\Player.cs" />
<Compile Include="GameModes\Charts\ChartListing.cs" />
<Compile Include="GameModes\Play\PlayMode.cs" />
@ -218,4 +220,4 @@
<Target Name="AfterBuild">
</Target>
-->
</Project>
</Project>