mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 16:27:26 +08:00
Dim other buttons if customisation panel is open
This commit is contained in:
parent
18e4c3ed0f
commit
4ff96f82be
@ -54,7 +54,7 @@ namespace osu.Game.Overlays.Mods
|
||||
|
||||
protected virtual ModColumn CreateModColumn(ModType modType, Key[]? toggleKeys = null) => new ModColumn(modType, false, toggleKeys);
|
||||
|
||||
protected virtual Drawable[] CreateFooterButtons() => new Drawable[]
|
||||
protected virtual IEnumerable<ShearedButton> CreateFooterButtons() => new[]
|
||||
{
|
||||
customisationButton = new ShearedToggleButton(200)
|
||||
{
|
||||
@ -75,6 +75,7 @@ namespace osu.Game.Overlays.Mods
|
||||
private ColumnScrollContainer columnScroll = null!;
|
||||
private ColumnFlowContainer columnFlow = null!;
|
||||
private ShearedToggleButton? customisationButton;
|
||||
private FillFlowContainer<ShearedButton> footerButtonFlow = null!;
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load()
|
||||
@ -156,7 +157,7 @@ namespace osu.Game.Overlays.Mods
|
||||
});
|
||||
}
|
||||
|
||||
FooterContent.Child = new FillFlowContainer
|
||||
FooterContent.Child = footerButtonFlow = new FillFlowContainer<ShearedButton>
|
||||
{
|
||||
RelativeSizeAxes = Axes.X,
|
||||
AutoSizeAxes = Axes.Y,
|
||||
@ -169,7 +170,7 @@ namespace osu.Game.Overlays.Mods
|
||||
Horizontal = 70
|
||||
},
|
||||
Spacing = new Vector2(10),
|
||||
Children = CreateFooterButtons()
|
||||
ChildrenEnumerable = CreateFooterButtons()
|
||||
};
|
||||
}
|
||||
|
||||
@ -259,6 +260,12 @@ namespace osu.Game.Overlays.Mods
|
||||
|
||||
MainAreaContent.FadeColour(customisationVisible.Value ? Colour4.Gray : Colour4.White, transition_duration, Easing.InOutCubic);
|
||||
|
||||
foreach (var button in footerButtonFlow)
|
||||
{
|
||||
if (button != customisationButton)
|
||||
button.Enabled.Value = !customisationVisible.Value;
|
||||
}
|
||||
|
||||
float modAreaHeight = customisationVisible.Value ? ModSettingsArea.HEIGHT : 0;
|
||||
|
||||
modSettingsArea.ResizeHeightTo(modAreaHeight, transition_duration, Easing.InOutCubic);
|
||||
|
@ -2,6 +2,7 @@
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Game.Graphics.UserInterface;
|
||||
using osu.Game.Overlays.Mods;
|
||||
@ -27,7 +28,7 @@ namespace osu.Game.Screens.OnlinePlay
|
||||
|
||||
protected override ModColumn CreateModColumn(ModType modType, Key[] toggleKeys = null) => new ModColumn(modType, true, toggleKeys);
|
||||
|
||||
protected override Drawable[] CreateFooterButtons() => new Drawable[]
|
||||
protected override IEnumerable<ShearedButton> CreateFooterButtons() => new[]
|
||||
{
|
||||
new ShearedButton(200)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user