public bool OnPressed(ManiaAction action) { if (AllJudged) { return(false); } if (action != Action.Value) { return(false); } // The tail has a lenience applied to it which is factored into the miss window (i.e. the miss judgement will be delayed). // But the hold cannot ever be started within the late-lenience window, so we should skip trying to begin the hold during that time. // Note: Unlike below, we use the tail's start time to determine the time offset. if (Time.Current > Tail.HitObject.StartTime && !Tail.HitObject.HitWindows.CanBeHit(Time.Current - Tail.HitObject.StartTime)) { return(false); } beginHoldAt(Time.Current - Head.HitObject.StartTime); Head.UpdateResult(); return(true); }
public void OnReleased(ManiaAction action) { if (AllJudged) { return; } if (action != Action.Value) { return; } // Make sure a hold was started if (HoldStartTime == null) { return; } Tail.UpdateResult(); endHold(); // If the key has been released too early, the user should not receive full score for the release if (!Tail.IsHit) { HasBroken = true; } }
public override bool OnPressed(ManiaAction action) { if (!base.OnPressed(action)) { return(false); } // We only want to trigger a holding state from the head if the head has received a judgement if (!Judged) { return(false); } // If the key has been released too early, the user should not receive full score for the release if (Judgement.Result == HitResult.Miss) { holdNote.hasBroken = true; } // The head note also handles early hits before the body, but we want accurate early hits to count as the body being held // The body doesn't handle these early early hits, so we have to explicitly set the holding state here holdNote.holdStartTime = Time.Current; return(true); }
public DrawableTailNote(DrawableHoldNote holdNote, ManiaAction action) : base(holdNote.HitObject.Tail, action) { this.holdNote = holdNote; GlowPiece.Alpha = 0; }
public void OnReleased(ManiaAction action) { if (AllJudged) { return; } if (action != Action.Value) { return; } // do not run any of this logic when rewinding, as it inverts order of presses/releases. if (Time.Elapsed < 0) { return; } // Make sure a hold was started if (HoldStartTime == null) { return; } Tail.UpdateResult(); endHold(); // If the key has been released too early, the user should not receive full score for the release if (!Tail.IsHit) { HoldBrokenTime = Time.Current; } releaseTime = Time.Current; }
public bool OnPressed(ManiaAction action) { if (AllJudged) { return(false); } if (action != Action.Value) { return(false); } // do not run any of this logic when rewinding, as it inverts order of presses/releases. if (Time.Elapsed < 0) { return(false); } if (CheckHittable?.Invoke(this, Time.Current) == false) { return(false); } // The tail has a lenience applied to it which is factored into the miss window (i.e. the miss judgement will be delayed). // But the hold cannot ever be started within the late-lenience window, so we should skip trying to begin the hold during that time. // Note: Unlike below, we use the tail's start time to determine the time offset. if (Time.Current > Tail.HitObject.StartTime && !Tail.HitObject.HitWindows.CanBeHit(Time.Current - Tail.HitObject.StartTime)) { return(false); } beginHoldAt(Time.Current - Head.HitObject.StartTime); return(Head.UpdateResult()); }
public DrawableTailNote(DrawableHoldNote holdNote, ManiaAction action) : base(holdNote.HitObject.Tail, action) { this.holdNote = holdNote; RelativePositionAxes = Axes.None; Y = 0; }
public virtual bool OnPressed(ManiaAction action) { if (action != Action.Value) { return(false); } return(UpdateResult(true)); }
public virtual bool OnPressed(ManiaAction action) { if (action != Action) { return(false); } return(UpdateJudgement(true)); }
private bool onPressed(ManiaAction action) { if (action == Action) { background.FadeTo(0.6f, 50, Easing.OutQuint); keyIcon.ScaleTo(1.4f, 50, Easing.OutQuint); } return(false); }
private bool onReleased(ManiaAction action) { if (action == Action) { background.FadeTo(0.2f, 800, Easing.OutQuart); keyIcon.ScaleTo(1f, 400, Easing.OutQuart); } return(false); }
protected DrawableManiaHitObject(TObject hitObject, ManiaAction?action = null) : base(hitObject) { HitObject = hitObject; if (action != null) { Action = action.Value; } }
protected DrawableManiaHitObject(TObject hitObject, ManiaAction?action = null) : base(hitObject) { RelativePositionAxes = Axes.Y; HitObject = hitObject; if (action != null) { Action = action.Value; } }
public DrawableNote(Note hitObject, ManiaAction action) : base(hitObject, action) { RelativeSizeAxes = Axes.X; AutoSizeAxes = Axes.Y; CornerRadius = 5; Masking = true; InternalChild = headPiece = new NotePiece(); }
public DrawableHoldNote(HoldNote hitObject, ManiaAction action) : base(hitObject, action) { RelativeSizeAxes = Axes.Both; Height = (float)HitObject.Duration; AddRange(new Drawable[] { // The hit object itself cannot be used for various elements because the tail overshoots it // So a specialized container that is updated to contain the tail height is used fullHeightContainer = new Container { RelativeSizeAxes = Axes.X, Child = glowPiece = new GlowPiece() }, bodyPiece = new BodyPiece { Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, RelativeSizeAxes = Axes.X, }, tickContainer = new Container <DrawableHoldNoteTick> { RelativeSizeAxes = Axes.Both, RelativeChildOffset = new Vector2(0, (float)HitObject.StartTime), RelativeChildSize = new Vector2(1, (float)HitObject.Duration) }, head = new DrawableHeadNote(this, action) { Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre }, tail = new DrawableTailNote(this, action) { Anchor = Anchor.BottomCentre, Origin = Anchor.TopCentre } }); foreach (var tick in HitObject.NestedHitObjects.OfType <HoldNoteTick>()) { var drawableTick = new DrawableHoldNoteTick(tick) { HoldStartTime = () => holdStartTime }; tickContainer.Add(drawableTick); AddNested(drawableTick); } AddNested(head); AddNested(tail); }
public DrawableNote(Note hitObject, ManiaAction action) : base(hitObject, action) { RelativeSizeAxes = Axes.X; Height = 100; Add(headPiece = new NotePiece { Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre }); }
protected DrawableManiaHitObject(TObject hitObject, ManiaAction?action = null) : base(hitObject) { Anchor = Anchor.TopCentre; Origin = Anchor.TopCentre; HitObject = hitObject; if (action != null) { Action = action.Value; } }
public ColumnTestContainer(int column, ManiaAction action) { this.column = new Column(column) { Action = { Value = action }, AccentColour = Color4.Orange }; InternalChild = content = new ManiaInputManager(new ManiaRuleset().RulesetInfo, 4) { RelativeSizeAxes = Axes.Both }; }
public virtual bool OnPressed(ManiaAction action) { if (action != Action.Value) { return(false); } if (CheckHittable?.Invoke(this, Time.Current) == false) { return(false); } return(UpdateResult(true)); }
public DrawableHoldNote(HoldNote hitObject, ManiaAction action) : base(hitObject, action) { Container <DrawableHoldNoteTick> tickContainer; RelativeSizeAxes = Axes.X; InternalChildren = new Drawable[] { // The hit object itself cannot be used for various elements because the tail overshoots it // So a specialized container that is updated to contain the tail height is used fullHeightContainer = new Container { RelativeSizeAxes = Axes.X, Child = glowPiece = new GlowPiece() }, bodyPiece = new BodyPiece { Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, RelativeSizeAxes = Axes.X, }, tickContainer = new Container <DrawableHoldNoteTick> { RelativeSizeAxes = Axes.Both, ChildrenEnumerable = HitObject.NestedHitObjects.OfType <HoldNoteTick>().Select(tick => new DrawableHoldNoteTick(tick) { HoldStartTime = () => holdStartTime }) }, head = new DrawableHeadNote(this, action) { Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre }, tail = new DrawableTailNote(this, action) { Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre } }; foreach (var tick in tickContainer) { AddNested(tick); } AddNested(head); AddNested(tail); }
public DrawableTailNote(DrawableHoldNote holdNote, ManiaAction action) : base(holdNote.HitObject.Tail, action) { this.holdNote = holdNote; RelativePositionAxes = Axes.None; Y = 0; // Life time managed by the parent DrawableHoldNote LifetimeStart = double.MinValue; LifetimeEnd = double.MaxValue; GlowPiece.Alpha = 0; }
private void load() { SetContents(_ => { ManiaAction normalAction = ManiaAction.Key1; ManiaAction specialAction = ManiaAction.Special1; return(new ManiaInputManager(new ManiaRuleset().RulesetInfo, 4) { Child = new Stage(0, new StageDefinition { Columns = 4 }, ref normalAction, ref specialAction) }); }); }
public DrawableHoldNote(HoldNote hitObject, ManiaAction action) : base(hitObject, action) { RelativeSizeAxes = Axes.Both; Height = (float)HitObject.Duration; AddRange(new Drawable[] { // For now the body piece covers the entire height of the container // whereas possibly in the future we don't want to extend under the head/tail. // This will be fixed when new designs are given or the current design is finalized. bodyPiece = new BodyPiece { Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, }, tickContainer = new Container <DrawableHoldNoteTick> { RelativeSizeAxes = Axes.Both, RelativeChildOffset = new Vector2(0, (float)HitObject.StartTime), RelativeChildSize = new Vector2(1, (float)HitObject.Duration) }, head = new DrawableHeadNote(this, action) { Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre }, tail = new DrawableTailNote(this, action) { Anchor = Anchor.BottomCentre, Origin = Anchor.TopCentre } }); foreach (var tick in HitObject.Ticks) { var drawableTick = new DrawableHoldNoteTick(tick) { HoldStartTime = () => holdStartTime }; tickContainer.Add(drawableTick); AddNested(drawableTick); } AddNested(head); AddNested(tail); }
public bool OnPressed(ManiaAction action) { if (AllJudged) { return(false); } if (action != Action.Value) { return(false); } beginHoldAt(Time.Current - Head.HitObject.StartTime); Head.UpdateResult(); return(true); }
public override bool OnPressed(ManiaAction action) => false; // Tail doesn't handle key down public override bool OnReleased(ManiaAction action) { // Make sure that the user started holding the key during the hold note if (!holdNote.holdStartTime.HasValue) { return(false); } if (action != Action) { return(false); } UpdateJudgement(true); // Handled by the hold note, which will set holding = false return(false); }
public ColumnTestContainer(int column, ManiaAction action, bool showColumn = false) { InternalChildren = new[] { this.column = new Column(column) { Action = { Value = action }, AccentColour = Colour4.Orange, ColumnType = column % 2 == 0 ? ColumnType.Even : ColumnType.Odd, Alpha = showColumn ? 1 : 0 }, content = new ManiaInputManager(new ManiaRuleset().RulesetInfo, 4) { RelativeSizeAxes = Axes.Both }, this.column.TopLevelContainer.CreateProxy() }; }
public DrawableNote(Note hitObject, ManiaAction action) : base(hitObject, action) { RelativeSizeAxes = Axes.X; AutoSizeAxes = Axes.Y; CornerRadius = 5; Masking = true; InternalChildren = new Drawable[] { headPiece = new NotePiece { Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre } }; }
public override bool OnPressed(ManiaAction action) { if (!base.OnPressed(action)) { return(false); } // If the key has been released too early, the user should not receive full score for the release if (Result.Type == HitResult.Miss) { holdNote.hasBroken = true; } // The head note also handles early hits before the body, but we want accurate early hits to count as the body being held // The body doesn't handle these early early hits, so we have to explicitly set the holding state here holdNote.BeginHold(); return(true); }
public bool OnPressed(ManiaAction action) { // Make sure the action happened within the body of the hold note if (Time.Current < HitObject.StartTime || Time.Current > HitObject.EndTime) { return(false); } if (action != Action.Value) { return(false); } // The user has pressed during the body of the hold note, after the head note and its hit windows have passed // and within the limited range of the above if-statement. This state will be managed by the head note if the // user has pressed during the hit windows of the head note. BeginHold(); return(true); }
protected override DrawableHitObject <ManiaHitObject> GetVisualRepresentation(ManiaHitObject h) { ManiaAction action = Playfield.Columns.ElementAt(h.Column).Action; var holdNote = h as HoldNote; if (holdNote != null) { return(new DrawableHoldNote(holdNote, action)); } var note = h as Note; if (note != null) { return(new DrawableNote(note, action)); } return(null); }