mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 00:40:09 +09:00
Add fade in/out animations to mod settings container
This commit is contained in:
@ -237,7 +237,7 @@ namespace osu.Game.Overlays.Mods
|
|||||||
{
|
{
|
||||||
Width = 180,
|
Width = 180,
|
||||||
Text = "Customisation",
|
Text = "Customisation",
|
||||||
Action = () => ModSettingsContainer.Alpha = ModSettingsContainer.Alpha == 1 ? 0 : 1,
|
Action = () => ModSettingsContainer.ToggleVisibility(),
|
||||||
Enabled = { Value = false },
|
Enabled = { Value = false },
|
||||||
Origin = Anchor.CentreLeft,
|
Origin = Anchor.CentreLeft,
|
||||||
Anchor = Anchor.CentreLeft,
|
Anchor = Anchor.CentreLeft,
|
||||||
@ -430,7 +430,7 @@ namespace osu.Game.Overlays.Mods
|
|||||||
|
|
||||||
DeselectTypes(selectedMod.IncompatibleMods, true);
|
DeselectTypes(selectedMod.IncompatibleMods, true);
|
||||||
|
|
||||||
if (selectedMod.RequiresConfiguration) ModSettingsContainer.Alpha = 1;
|
if (selectedMod.RequiresConfiguration) ModSettingsContainer.Show();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -17,7 +17,7 @@ using osuTK.Graphics;
|
|||||||
|
|
||||||
namespace osu.Game.Overlays.Mods
|
namespace osu.Game.Overlays.Mods
|
||||||
{
|
{
|
||||||
public class ModSettingsContainer : Container
|
public class ModSettingsContainer : VisibilityContainer
|
||||||
{
|
{
|
||||||
public readonly IBindable<IReadOnlyList<Mod>> SelectedMods = new Bindable<IReadOnlyList<Mod>>(Array.Empty<Mod>());
|
public readonly IBindable<IReadOnlyList<Mod>> SelectedMods = new Bindable<IReadOnlyList<Mod>>(Array.Empty<Mod>());
|
||||||
|
|
||||||
@ -27,6 +27,8 @@ namespace osu.Game.Overlays.Mods
|
|||||||
|
|
||||||
private readonly FillFlowContainer<ModControlSection> modSettingsContent;
|
private readonly FillFlowContainer<ModControlSection> modSettingsContent;
|
||||||
|
|
||||||
|
private const double transition_duration = 200;
|
||||||
|
|
||||||
public ModSettingsContainer()
|
public ModSettingsContainer()
|
||||||
{
|
{
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
@ -80,5 +82,15 @@ namespace osu.Game.Overlays.Mods
|
|||||||
|
|
||||||
protected override bool OnMouseDown(MouseDownEvent e) => true;
|
protected override bool OnMouseDown(MouseDownEvent e) => true;
|
||||||
protected override bool OnHover(HoverEvent e) => true;
|
protected override bool OnHover(HoverEvent e) => true;
|
||||||
|
|
||||||
|
protected override void PopIn()
|
||||||
|
{
|
||||||
|
this.FadeIn(transition_duration, Easing.OutQuint);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void PopOut()
|
||||||
|
{
|
||||||
|
this.FadeOut(transition_duration, Easing.OutQuint);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user