Skip to content

Commit

Permalink
Merge pull request #604 from peppy/taiko-fixes
Browse files Browse the repository at this point in the history
Minor taiko improvements
  • Loading branch information
Dan Balasescu committed Apr 7, 2017
2 parents f5f65fa + aa45515 commit 53c491d
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 3 deletions.
15 changes: 15 additions & 0 deletions osu.Game.Modes.Taiko/Objects/Drawables/DrawableHit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using osu.Framework.Graphics;
using osu.Game.Modes.Objects.Drawables;
using osu.Game.Modes.Taiko.Judgements;
using osu.Game.Modes.Taiko.Objects.Drawables.Pieces;
using OpenTK.Input;

namespace osu.Game.Modes.Taiko.Objects.Drawables
Expand Down Expand Up @@ -66,6 +67,10 @@ protected override void UpdateState(ArmedState state)
{
Delay(HitObject.StartTime - Time.Current + Judgement.TimeOffset, true);

var circlePiece = MainPiece as CirclePiece;

circlePiece?.FlashBox.Flush();

switch (State)
{
case ArmedState.Idle:
Expand All @@ -77,6 +82,16 @@ protected override void UpdateState(ArmedState state)
case ArmedState.Hit:
FadeOut(600);

var flash = circlePiece?.FlashBox;
if (flash != null)
{
flash.FadeTo(0.9f);
flash.FadeOut(300);
}


FadeOut(800);

const float gravity_time = 300;
const float gravity_travel_height = 200;

Expand Down
6 changes: 5 additions & 1 deletion osu.Game.Modes.Taiko/Objects/Drawables/Pieces/CirclePiece.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ public override bool KiaiMode

private readonly Container background;

public Box FlashBox;

public CirclePiece(bool isStrong = false)
{
AddInternal(new Drawable[]
Expand Down Expand Up @@ -104,11 +106,13 @@ public CirclePiece(bool isStrong = false)
Masking = true,
Children = new[]
{
new Box
FlashBox = new Box
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
RelativeSizeAxes = Axes.Both,
Colour = Color4.White,
BlendingMode = BlendingMode.Additive,
Alpha = 0,
AlwaysPresent = true
}
Expand Down
7 changes: 5 additions & 2 deletions osu.Game/Screens/Play/Player.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
using osu.Game.Screens.Ranking;
using System;
using System.Linq;
using osu.Framework.Threading;
using osu.Game.Modes.Scoring;

namespace osu.Game.Screens.Play
Expand Down Expand Up @@ -237,14 +238,16 @@ public void Restart()
});
}

private ScheduledDelegate onCompletionEvent;

private void onCompletion()
{
// Only show the completion screen if the player hasn't failed
if (scoreProcessor.HasFailed)
if (scoreProcessor.HasFailed || onCompletionEvent != null)
return;

Delay(1000);
Schedule(delegate
onCompletionEvent = Schedule(delegate
{
ValidForResume = false;
Push(new Results
Expand Down

0 comments on commit 53c491d

Please sign in to comment.