1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 12:57:36 +08:00

Make toggle more immediately hide/show tips

This commit is contained in:
Dean Herbert 2023-12-28 16:19:12 +09:00
parent 222459d921
commit 932d03a4f8
No known key found for this signature in database
2 changed files with 17 additions and 3 deletions

View File

@ -242,8 +242,6 @@ namespace osu.Game.Screens.Menu
if (storage is OsuStorage osuStorage && osuStorage.Error != OsuStorageError.None)
dialogOverlay?.Push(new StorageErrorDialog(osuStorage, osuStorage.Error));
menuTip.ShowNextTip();
}
[CanBeNull]
@ -359,6 +357,7 @@ namespace osu.Game.Screens.Menu
musicController.EnsurePlayingSomething();
// Cycle tip on resuming
menuTip.ShowNextTip();
bottomElementsFlow

View File

@ -2,6 +2,7 @@
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
@ -22,6 +23,8 @@ namespace osu.Game.Screens.Menu
private LinkFlowContainer textFlow = null!;
private Bindable<bool> showMenuTips = null!;
[BackgroundDependencyLoader]
private void load()
{
@ -56,9 +59,21 @@ namespace osu.Game.Screens.Menu
};
}
protected override void LoadComplete()
{
base.LoadComplete();
showMenuTips = config.GetBindable<bool>(OsuSetting.MenuTips);
showMenuTips.BindValueChanged(_ => ShowNextTip(), true);
}
public void ShowNextTip()
{
if (!config.Get<bool>(OsuSetting.MenuTips)) return;
if (!showMenuTips.Value)
{
this.FadeOut(100, Easing.OutQuint);
return;
}
static void formatRegular(SpriteText t) => t.Font = OsuFont.GetFont(size: 16, weight: FontWeight.Regular);
static void formatSemiBold(SpriteText t) => t.Font = OsuFont.GetFont(size: 16, weight: FontWeight.SemiBold);