Add empty RoomSettingsOverlay.

This commit is contained in:
DrabWeb 2018-06-06 00:29:52 -03:00
parent b8e403f38a
commit 8c97999de9
2 changed files with 77 additions and 0 deletions

View File

@ -0,0 +1,26 @@
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using NUnit.Framework;
using osu.Framework.Graphics;
using osu.Game.Screens.Multi.Screens.Match;
namespace osu.Game.Tests.Visual
{
[TestFixture]
public class TestCaseRoomSettings : OsuTestCase
{
public TestCaseRoomSettings()
{
RoomSettingsOverlay overlay;
Add(overlay = new RoomSettingsOverlay
{
RelativeSizeAxes = Axes.Both,
Height = 0.75f,
});
AddStep(@"toggle", overlay.ToggleVisibility);
}
}
}

View File

@ -0,0 +1,51 @@
// Copyright (c) 2007-2018 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.Shapes;
using osu.Game.Graphics;
using osu.Game.Graphics.Containers;
namespace osu.Game.Screens.Multi.Screens.Match
{
public class RoomSettingsOverlay : OsuFocusedOverlayContainer
{
private const float transition_duration = 500;
private readonly Container content;
protected override Container<Drawable> Content => content;
public RoomSettingsOverlay()
{
InternalChild = content = new Container
{
RelativeSizeAxes = Axes.Both,
RelativePositionAxes = Axes.Y,
Children = new Drawable[]
{
new Box
{
RelativeSizeAxes = Axes.Both,
Colour = OsuColour.FromHex(@"28242d"),
},
},
};
}
protected override void PopIn()
{
base.PopIn();
Content.MoveToY(0, transition_duration, Easing.OutSine);
}
protected override void PopOut()
{
base.PopOut();
Content.MoveToY(-1, transition_duration, Easing.InSine);
}
}
}