Fix animations

This commit is contained in:
Dean Herbert 2023-09-13 17:55:25 +09:00
parent e241e41f2a
commit 21252c1c23

View File

@ -266,16 +266,16 @@ namespace osu.Game.Overlays.Mods
}, },
Children = new Drawable[] Children = new Drawable[]
{ {
beatmapAttributesDisplay = new BeatmapAttributesDisplay
{
Anchor = Anchor.TopRight,
Origin = Anchor.TopRight,
BeatmapInfo = { Value = beatmap?.BeatmapInfo }
},
multiplierDisplay = new DifficultyMultiplierDisplay multiplierDisplay = new DifficultyMultiplierDisplay
{ {
Anchor = Anchor.TopRight, Anchor = Anchor.BottomRight,
Origin = Anchor.TopRight Origin = Anchor.BottomRight
},
beatmapAttributesDisplay = new BeatmapAttributesDisplay
{
Anchor = Anchor.BottomRight,
Origin = Anchor.BottomRight,
BeatmapInfo = { Value = beatmap?.BeatmapInfo }
}, },
} }
}); });
@ -350,8 +350,7 @@ namespace osu.Game.Overlays.Mods
SearchTextBox.PlaceholderText = SearchTextBox.HasFocus ? Resources.Localisation.Web.CommonStrings.InputSearch : ModSelectOverlayStrings.TabToSearch; SearchTextBox.PlaceholderText = SearchTextBox.HasFocus ? Resources.Localisation.Web.CommonStrings.InputSearch : ModSelectOverlayStrings.TabToSearch;
// only update preview panel's collapsed state after we are fully visible, to ensure all the buttons are where we expect them to be. if (beatmapAttributesDisplay != null)
if (beatmapAttributesDisplay != null && Alpha == 1)
{ {
float rightEdgeOfLastButton = footerButtonFlow.Last().ScreenSpaceDrawQuad.TopRight.X; float rightEdgeOfLastButton = footerButtonFlow.Last().ScreenSpaceDrawQuad.TopRight.X;
@ -361,12 +360,13 @@ namespace osu.Game.Overlays.Mods
bool screenIsntWideEnough = rightEdgeOfLastButton > projectedLeftEdgeOfExpandedModEffectPreviewPanel; bool screenIsntWideEnough = rightEdgeOfLastButton > projectedLeftEdgeOfExpandedModEffectPreviewPanel;
beatmapAttributesDisplay.Collapsed.Value = screenIsntWideEnough; // only update preview panel's collapsed state after we are fully visible, to ensure all the buttons are where we expect them to be.
footerContentFlow.Direction = screenIsntWideEnough ? FillDirection.Vertical : FillDirection.Horizontal; if (Alpha == 1)
beatmapAttributesDisplay.Collapsed.Value = screenIsntWideEnough;
int layout = screenIsntWideEnough ? -1 : 1; footerContentFlow.LayoutDuration = 200;
if (footerContentFlow.GetLayoutPosition(beatmapAttributesDisplay) != layout) footerContentFlow.LayoutEasing = Easing.OutQuint;
footerContentFlow.SetLayoutPosition(beatmapAttributesDisplay, layout); footerContentFlow.Direction = screenIsntWideEnough ? FillDirection.Vertical : FillDirection.Horizontal;
} }
} }