1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-15 22:27:46 +08:00

Update framework and add rudimentary fading to song select screen.

This commit is contained in:
Thomas Müller 2016-11-20 12:16:54 +01:00
parent 0fdd505807
commit 57e7c7097d
7 changed files with 35 additions and 38 deletions

@ -1 +1 @@
Subproject commit a4f301076810571bebe9595af7aeaa3c77ac0c59
Subproject commit 8afa4fa7ae9bbd5f357f859b1cc944c78286751a

View File

@ -27,16 +27,12 @@ namespace osu.Desktop.VisualTests.Tests
public override string Description => @"Showing hitobjects and what not.";
FramedClock localClock;
protected override IFrameBasedClock Clock => localClock;
public override void Reset()
{
base.Reset();
//ensure we are at offset 0
localClock = new FramedClock();
Clock = new FramedClock();
List<HitObject> objects = new List<HitObject>();
@ -93,7 +89,7 @@ namespace osu.Desktop.VisualTests.Tests
protected override void Update()
{
base.Update();
localClock.ProcessFrame();
Clock.ProcessFrame();
}
}
}

View File

@ -19,21 +19,17 @@ namespace osu.Desktop.VisualTests.Tests
{
public override string Name => @"Hit Objects";
IFrameBasedClock ourClock;
protected override IFrameBasedClock Clock => ourClock;
public TestCaseHitObjects()
{
var swClock = new StopwatchClock(true) { Rate = 1 };
ourClock = new FramedClock(swClock);
Clock = new FramedClock(swClock);
}
public override void Reset()
{
base.Reset();
ourClock.ProcessFrame();
Clock.ProcessFrame();
Container approachContainer = new Container { Depth = float.MaxValue, };
@ -45,7 +41,7 @@ namespace osu.Desktop.VisualTests.Tests
{
var h = new HitCircle
{
StartTime = ourClock.CurrentTime + 1000 + i * 80,
StartTime = Clock.CurrentTime + 1000 + i * 80,
Position = new Vector2((i - count / 2) * 14),
};
@ -65,7 +61,7 @@ namespace osu.Desktop.VisualTests.Tests
protected override void Update()
{
base.Update();
ourClock.ProcessFrame();
Clock.ProcessFrame();
}
}
}

View File

@ -13,20 +13,17 @@ namespace osu.Desktop.VisualTests.Tests
public override string Name => @"Music Controller";
public override string Description => @"Tests music controller ui.";
IFrameBasedClock ourClock;
protected override IFrameBasedClock Clock => ourClock;
protected MusicController mc;
public TestCaseMusicController()
{
ourClock = new FramedClock();
Clock = new FramedClock();
}
public override void Reset()
{
base.Reset();
ourClock.ProcessFrame();
Clock.ProcessFrame();
mc = new MusicController
{
Origin = Anchor.Centre,
@ -39,7 +36,7 @@ namespace osu.Desktop.VisualTests.Tests
protected override void Update()
{
base.Update();
ourClock.ProcessFrame();
Clock.ProcessFrame();
}
}
}

View File

@ -8,8 +8,6 @@ using osu.Framework.Timing;
using osu.Game.Beatmaps;
using osu.Game.Beatmaps.Formats;
using OpenTK;
using osu.Framework;
using osu.Framework.Allocation;
using osu.Framework.Graphics.Sprites;
using osu.Game.Modes.Objects;
using osu.Game.Modes.Osu.Objects;
@ -24,16 +22,12 @@ namespace osu.Desktop.VisualTests.Tests
public override string Description => @"Showing everything to play the game.";
FramedClock localClock;
protected override IFrameBasedClock Clock => localClock;
public override void Reset()
{
base.Reset();
//ensure we are at offset 0
localClock = new FramedClock();
Clock = new FramedClock();
var objects = new List<HitObject>();
@ -75,7 +69,7 @@ namespace osu.Desktop.VisualTests.Tests
protected override void Update()
{
base.Update();
localClock.ProcessFrame();
Clock.ProcessFrame();
}
}
}

View File

@ -103,6 +103,7 @@ namespace osu.Game.Screens.Play
},
wedgedContainer = new Container
{
Alpha = 0,
Position = wedged_container_start_position,
Size = wedged_container_size,
Margin = new MarginPadding { Top = 20, Right = 20, },
@ -179,17 +180,31 @@ namespace osu.Game.Screens.Play
{
base.OnEntering(last);
ensurePlayingSelected();
backgroundWedgesContainer.FadeInFromZero(250);
changeBackground(Beatmap);
Content.FadeInFromZero(250);
}
protected override void OnResuming(GameMode last)
{
changeBackground(Beatmap);
ensurePlayingSelected();
base.OnResuming(last);
Content.FadeIn(250);
}
protected override void OnSuspending(GameMode next)
{
Content.FadeOut(250);
base.OnSuspending(next);
}
protected override bool OnExiting(GameMode next)
{
Content.FadeOut(100);
return base.OnExiting(next);
}
protected override void Dispose(bool isDisposing)
@ -232,6 +247,8 @@ namespace osu.Game.Screens.Play
oldWedgedBeatmapInfo.Expire();
}
wedgedContainer.FadeIn(250);
BeatmapSetInfo beatmapSetInfo = beatmap.BeatmapSetInfo;
BeatmapInfo beatmapInfo = beatmap.BeatmapInfo;
wedgedContainer.Add(wedgedBeatmapInfo = new BufferedContainer
@ -252,7 +269,7 @@ namespace osu.Game.Screens.Play
},
// We use a container, such that we can set the colour gradient to go across the
// vertices of the masked container instead of the vertices of the (larger) sprite.
new Container
beatmap.Background == null ? new Container() : new Container
{
RelativeSizeAxes = Axes.Both,
ColourInfo = ColourInfo.GradientVertical(Color4.White, new Color4(1f, 1f, 1f, 0.3f)),

View File

@ -33,9 +33,6 @@ namespace osu.Game.Screens.Play
public PlayMode PreferredPlayMode;
protected override IFrameBasedClock Clock => playerClock;
private InterpolatingFramedClock playerClock;
private IAdjustableClock sourceClock;
private Ruleset ruleset;
@ -64,7 +61,7 @@ namespace osu.Game.Screens.Play
}
sourceClock = (IAdjustableClock)track ?? new StopwatchClock();
playerClock = new InterpolatingFramedClock(sourceClock);
Clock = new InterpolatingFramedClock(sourceClock);
Schedule(() =>
{
@ -118,7 +115,7 @@ namespace osu.Game.Screens.Play
protected override void Update()
{
base.Update();
playerClock.ProcessFrame();
Clock.ProcessFrame();
}
class PlayerInputManager : UserInputManager