Create MusicController UI class and visual test.

This commit is contained in:
Huo Yaoyuan 2016-10-24 10:22:38 +08:00
parent e333f97364
commit e1f6ab1a42
4 changed files with 59 additions and 0 deletions

View File

@ -0,0 +1,32 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//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.Graphics;
using osu.Framework.GameModes.Testing;
using osu.Game.Overlays;
namespace osu.Desktop.Tests
{
class TestCaseMusicController : TestCase
{
public override string Name => @"Music Controller";
public override string Description => @"Tests music controller ui.";
public override void Reset()
{
base.Reset();
MusicController mc = new MusicController
{
Origin = Anchor.Centre,
Anchor = Anchor.Centre
};
Add(mc);
AddToggle(@"Show", mc.ToggleVisibility);
}
}
}

View File

@ -156,6 +156,7 @@
<ItemGroup>
<Compile Include="Program.cs" />
<Compile Include="Tests\TestCaseChatDisplay.cs" />
<Compile Include="Tests\TestCaseMusicController.cs" />
<Compile Include="Tests\TestCasePlayer.cs" />
<Compile Include="Tests\TestCaseGamefield.cs" />
<Compile Include="Tests\TestCaseHitObjects.cs" />

View File

@ -0,0 +1,25 @@
//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;
using osu.Framework.Graphics.Containers;
namespace osu.Game.Overlays
{
public class MusicController : OverlayContainer
{
public override void Load(BaseGame game)
{
base.Load(game);
Width = 400;
Height = 130;
CornerRadius = 5;
Masking = true;
}
//placeholder for toggling
protected override void PopIn() => FadeIn(500);
protected override void PopOut() => FadeOut(500);
}
}

View File

@ -63,6 +63,7 @@
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Overlays\MusicController.cs" />
<Compile Include="Beatmaps\Beatmap.cs" />
<Compile Include="Beatmaps\Drawable\BeatmapSetHeader.cs" />
<Compile Include="Beatmaps\Drawable\DifficultyIcon.cs" />