scorll container and save mod after popover hidden

Requires manual handling of many visual effects
This commit is contained in:
cdwcgt
2023-03-11 12:31:33 +09:00
parent 1cd565193e
commit 15f11bb1e8
4 changed files with 95 additions and 18 deletions

View File

@ -1,6 +1,7 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System.Collections.Generic;
using System.Linq;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
@ -11,7 +12,7 @@ using osuTK;
namespace osu.Game.Overlays.Mods
{
public partial class ModPresetTooltip : VisibilityContainer, ITooltip<ModPreset>
public partial class ModPresetTooltip : VisibilityContainer, ITooltip<List<Mod>>
{
protected override Container<Drawable> Content { get; }
@ -42,15 +43,15 @@ namespace osu.Game.Overlays.Mods
};
}
private ModPreset? lastPreset;
private List<Mod>? lastPreset;
public void SetContent(ModPreset preset)
public void SetContent(List<Mod> mods)
{
if (ReferenceEquals(preset, lastPreset))
if (ReferenceEquals(mods, lastPreset))
return;
lastPreset = preset;
Content.ChildrenEnumerable = preset.Mods.Select(mod => new ModPresetRow(mod));
lastPreset = mods;
Content.ChildrenEnumerable = mods.Select(mod => new ModPresetRow(mod));
}
protected override void PopIn() => this.FadeIn(transition_duration, Easing.OutQuint);