mirror of
https://github.com/ppy/osu.git
synced 2025-01-28 02:02:53 +08:00
Reuse "select/deselect all" localisable string on column toggle
This commit is contained in:
parent
fa0a256f48
commit
f761d4d4d4
@ -5,6 +5,7 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
@ -22,6 +23,7 @@ using osu.Framework.Input.Events;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Graphics.Containers;
|
||||
using osu.Game.Graphics.UserInterface;
|
||||
using osu.Game.Localisation;
|
||||
using osu.Game.Rulesets.Mods;
|
||||
using osu.Game.Utils;
|
||||
using osuTK;
|
||||
@ -220,7 +222,6 @@ namespace osu.Game.Overlays.Mods
|
||||
Origin = Anchor.CentreLeft,
|
||||
Scale = new Vector2(0.8f),
|
||||
RelativeSizeAxes = Axes.X,
|
||||
LabelText = "Enable All",
|
||||
Shear = new Vector2(-ShearedOverlayContainer.SHEAR, 0)
|
||||
});
|
||||
panelFlow.Padding = new MarginPadding
|
||||
@ -265,6 +266,19 @@ namespace osu.Game.Overlays.Mods
|
||||
contentBackground.Colour = colourProvider.Background4;
|
||||
}
|
||||
|
||||
protected override void LoadComplete()
|
||||
{
|
||||
base.LoadComplete();
|
||||
|
||||
toggleAllCheckbox?.Current.BindValueChanged(_ => updateToggleAllText(), true);
|
||||
}
|
||||
|
||||
private void updateToggleAllText()
|
||||
{
|
||||
Debug.Assert(toggleAllCheckbox != null);
|
||||
toggleAllCheckbox.LabelText = toggleAllCheckbox.Current.Value ? CommonStrings.DeselectAll : CommonStrings.SelectAll;
|
||||
}
|
||||
|
||||
private void updateLocalAvailableMods()
|
||||
{
|
||||
var newMods = ModUtils.FlattenMods(availableMods.Value.GetValueOrDefault(ModType) ?? Array.Empty<Mod>())
|
||||
|
Loading…
Reference in New Issue
Block a user