2018-01-05 11:21:19 +00:00
|
|
|
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
2017-02-07 04:59:30 +00:00
|
|
|
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
2016-12-06 09:54:32 +00:00
|
|
|
|
|
2016-11-19 07:19:26 +00:00
|
|
|
|
using System.ComponentModel;
|
2017-04-18 07:05:58 +00:00
|
|
|
|
using osu.Game.Rulesets.Objects.Drawables;
|
2017-07-14 16:18:12 +00:00
|
|
|
|
using osu.Framework.Graphics;
|
2017-09-12 09:00:41 +00:00
|
|
|
|
using System.Linq;
|
2016-11-19 07:19:26 +00:00
|
|
|
|
|
2017-04-18 07:05:58 +00:00
|
|
|
|
namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
2016-11-19 07:19:26 +00:00
|
|
|
|
{
|
2017-09-06 09:05:51 +00:00
|
|
|
|
public class DrawableOsuHitObject : DrawableHitObject<OsuHitObject>
|
2016-11-19 07:19:26 +00:00
|
|
|
|
{
|
2017-12-31 16:15:14 +00:00
|
|
|
|
public override bool IsPresent => base.IsPresent || State.Value == ArmedState.Idle && Time.Current >= HitObject.StartTime - HitObject.TimePreempt;
|
2016-11-28 09:40:54 +00:00
|
|
|
|
|
2017-03-23 06:37:16 +00:00
|
|
|
|
protected DrawableOsuHitObject(OsuHitObject hitObject)
|
2016-11-26 07:51:51 +00:00
|
|
|
|
: base(hitObject)
|
|
|
|
|
{
|
2017-07-09 22:01:25 +00:00
|
|
|
|
Alpha = 0;
|
2016-11-26 07:51:51 +00:00
|
|
|
|
}
|
|
|
|
|
|
2017-04-28 04:27:20 +00:00
|
|
|
|
protected sealed override void UpdateState(ArmedState state)
|
2016-11-25 07:26:50 +00:00
|
|
|
|
{
|
2017-12-31 16:15:14 +00:00
|
|
|
|
double transformTime = HitObject.StartTime - HitObject.TimePreempt;
|
2016-11-28 09:40:54 +00:00
|
|
|
|
|
2017-11-09 08:04:04 +00:00
|
|
|
|
base.ApplyTransformsAt(transformTime, true);
|
|
|
|
|
base.ClearTransformsAfter(transformTime, true);
|
2017-07-09 22:01:25 +00:00
|
|
|
|
|
2017-11-09 05:04:59 +00:00
|
|
|
|
using (BeginAbsoluteSequence(transformTime, true))
|
|
|
|
|
{
|
2017-04-27 08:37:38 +00:00
|
|
|
|
UpdatePreemptState();
|
2016-11-28 09:40:54 +00:00
|
|
|
|
|
2017-12-31 16:15:14 +00:00
|
|
|
|
using (BeginDelayedSequence(HitObject.TimePreempt + (Judgements.FirstOrDefault()?.TimeOffset ?? 0), true))
|
2017-04-27 08:37:38 +00:00
|
|
|
|
UpdateCurrentState(state);
|
|
|
|
|
}
|
|
|
|
|
}
|
2016-11-28 09:40:54 +00:00
|
|
|
|
|
2017-12-31 16:30:58 +00:00
|
|
|
|
protected virtual void UpdatePreemptState() => this.FadeIn(HitObject.TimeFadein);
|
2016-11-28 09:40:54 +00:00
|
|
|
|
|
2017-07-09 22:01:25 +00:00
|
|
|
|
protected virtual void UpdateCurrentState(ArmedState state)
|
2016-11-28 09:40:54 +00:00
|
|
|
|
{
|
2016-11-25 07:26:50 +00:00
|
|
|
|
}
|
2017-08-18 07:04:01 +00:00
|
|
|
|
|
2017-11-09 08:04:04 +00:00
|
|
|
|
// Todo: At some point we need to move these to DrawableHitObject after ensuring that all other Rulesets apply
|
|
|
|
|
// transforms in the same way and don't rely on them not being cleared
|
|
|
|
|
public override void ClearTransformsAfter(double time, bool propagateChildren = false, string targetMember = null) { }
|
|
|
|
|
public override void ApplyTransformsAt(double time, bool propagateChildren = false) { }
|
|
|
|
|
|
2017-08-18 10:02:08 +00:00
|
|
|
|
private OsuInputManager osuActionInputManager;
|
|
|
|
|
internal OsuInputManager OsuActionInputManager => osuActionInputManager ?? (osuActionInputManager = GetContainingInputManager() as OsuInputManager);
|
2016-11-19 07:19:26 +00:00
|
|
|
|
}
|
|
|
|
|
|
2016-11-25 07:26:50 +00:00
|
|
|
|
public enum ComboResult
|
2016-11-19 07:19:26 +00:00
|
|
|
|
{
|
|
|
|
|
[Description(@"")]
|
|
|
|
|
None,
|
|
|
|
|
[Description(@"Good")]
|
|
|
|
|
Good,
|
|
|
|
|
[Description(@"Amazing")]
|
|
|
|
|
Perfect
|
|
|
|
|
}
|
|
|
|
|
}
|