-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into fix-key-binding-corruption
- Loading branch information
Showing
8 changed files
with
121 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,11 @@ | ||
// Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the MIT Licence. | ||
// See the LICENCE file in the repository root for full licence text. | ||
|
||
using osu.Framework.Allocation; | ||
using osu.Framework.Bindables; | ||
using osu.Framework.Graphics; | ||
using osu.Framework.Graphics.Primitives; | ||
using osu.Game.Configuration; | ||
using osu.Game.Rulesets.Osu.Edit.Blueprints.HitCircles.Components; | ||
using osu.Game.Rulesets.Osu.Objects; | ||
using osu.Game.Rulesets.Osu.Objects.Drawables; | ||
|
@@ -16,6 +19,7 @@ public partial class HitCircleSelectionBlueprint : OsuSelectionBlueprint<HitCirc | |
|
||
protected readonly HitCirclePiece CirclePiece; | ||
private readonly HitCircleOverlapMarker marker; | ||
private readonly Bindable<bool> showHitMarkers = new Bindable<bool>(); | ||
|
||
public HitCircleSelectionBlueprint(HitCircle circle) | ||
: base(circle) | ||
|
@@ -27,12 +31,32 @@ public HitCircleSelectionBlueprint(HitCircle circle) | |
}; | ||
} | ||
|
||
[BackgroundDependencyLoader] | ||
private void load(OsuConfigManager config) | ||
{ | ||
config.BindWith(OsuSetting.EditorShowHitMarkers, showHitMarkers); | ||
} | ||
|
||
protected override void LoadComplete() | ||
{ | ||
base.LoadComplete(); | ||
|
||
showHitMarkers.BindValueChanged(_ => | ||
{ | ||
if (!showHitMarkers.Value) | ||
DrawableObject.RestoreHitAnimations(); | ||
}); | ||
} | ||
|
||
protected override void Update() | ||
{ | ||
base.Update(); | ||
|
||
CirclePiece.UpdateFrom(HitObject); | ||
marker.UpdateFrom(HitObject); | ||
|
||
if (showHitMarkers.Value) | ||
DrawableObject.SuppressHitAnimations(); | ||
} | ||
|
||
public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => DrawableObject.HitArea.ReceivePositionalInputAt(screenSpacePos); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
// Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the MIT Licence. | ||
// See the LICENCE file in the repository root for full licence text. | ||
|
||
using osu.Framework.Graphics; | ||
using osu.Framework.Graphics.Containers; | ||
using osu.Game.Rulesets.Osu.Edit.Blueprints.HitCircles.Components; | ||
using osu.Game.Rulesets.Osu.Objects; | ||
|
@@ -14,18 +13,17 @@ public partial class SliderCircleOverlay : CompositeDrawable | |
|
||
private readonly Slider slider; | ||
private readonly SliderPosition position; | ||
private readonly HitCircleOverlapMarker marker; | ||
private readonly HitCircleOverlapMarker? marker; | ||
|
||
public SliderCircleOverlay(Slider slider, SliderPosition position) | ||
{ | ||
this.slider = slider; | ||
this.position = position; | ||
|
||
InternalChildren = new Drawable[] | ||
{ | ||
marker = new HitCircleOverlapMarker(), | ||
CirclePiece = new HitCirclePiece(), | ||
}; | ||
if (position == SliderPosition.Start) | ||
AddInternal(marker = new HitCircleOverlapMarker()); | ||
|
||
AddInternal(CirclePiece = new HitCirclePiece()); | ||
} | ||
|
||
protected override void Update() | ||
|
@@ -35,7 +33,7 @@ protected override void Update() | |
var circle = position == SliderPosition.Start ? (HitCircle)slider.HeadCircle : slider.TailCircle; | ||
|
||
CirclePiece.UpdateFrom(circle); | ||
marker.UpdateFrom(circle); | ||
marker?.UpdateFrom(circle); | ||
} | ||
|
||
public override void Hide() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters