mirror of
https://github.com/osukey/osukey.git
synced 2025-08-04 07:06:35 +09:00
Add dynamic panning fun to score panel sfx
This commit is contained in:
@ -96,9 +96,9 @@ namespace osu.Game.Screens.Ranking
|
||||
|
||||
public readonly ScoreInfo Score;
|
||||
|
||||
private bool displayWithFlair;
|
||||
public DrawableAudioMixer Mixer;
|
||||
|
||||
private Container content;
|
||||
private bool displayWithFlair;
|
||||
|
||||
private Container topLayerContainer;
|
||||
private Drawable topLayerBackground;
|
||||
@ -127,7 +127,7 @@ namespace osu.Game.Screens.Ranking
|
||||
// Adding a manual offset here allows the expanded version to take on an "acceptable" vertical centre when at 100% UI scale.
|
||||
const float vertical_fudge = 20;
|
||||
|
||||
InternalChild = content = new Container
|
||||
InternalChild = Mixer = new DrawableAudioMixer
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
@ -265,7 +265,7 @@ namespace osu.Game.Screens.Ranking
|
||||
break;
|
||||
}
|
||||
|
||||
content.ResizeTo(Size, RESIZE_DURATION, Easing.OutQuint);
|
||||
Mixer.ResizeTo(Size, RESIZE_DURATION, Easing.OutQuint);
|
||||
|
||||
bool topLayerExpanded = topLayerContainer.Y < 0;
|
||||
|
||||
|
@ -344,6 +344,23 @@ namespace osu.Game.Screens.Ranking
|
||||
private IEnumerable<ScorePanelTrackingContainer> applySorting(IEnumerable<Drawable> drawables) => drawables.OfType<ScorePanelTrackingContainer>()
|
||||
.OrderByDescending(GetLayoutPosition)
|
||||
.ThenBy(s => s.Panel.Score.OnlineID);
|
||||
|
||||
protected override void Update()
|
||||
{
|
||||
foreach (ScorePanelTrackingContainer trackingContainer in FlowingChildren.OfType<ScorePanelTrackingContainer>())
|
||||
{
|
||||
var panel = trackingContainer.Panel;
|
||||
|
||||
if (panel.State != PanelState.Expanded) continue;
|
||||
|
||||
var scrollContainer = Parent.Parent;
|
||||
float balance = scrollContainer.ToLocalSpace(panel.ToScreenSpace(panel.BoundingBox.Centre)).X / scrollContainer.RelativeToAbsoluteFactor.X;
|
||||
|
||||
panel.Mixer.Balance.Value = Math.Clamp(-1 + balance * 2, -1, 1);
|
||||
}
|
||||
|
||||
base.Update();
|
||||
}
|
||||
}
|
||||
|
||||
private class Scroll : OsuScrollContainer
|
||||
|
Reference in New Issue
Block a user