mirror of
https://github.com/ppy/osu.git
synced 2024-12-13 04:32:57 +08:00
Move menu tips to main menu
In preparation for removing the disclaimer screen.
This commit is contained in:
parent
3a3b4d445c
commit
a1867afbb4
@ -96,6 +96,7 @@ namespace osu.Game.Configuration
|
||||
|
||||
SetDefault(OsuSetting.MenuVoice, true);
|
||||
SetDefault(OsuSetting.MenuMusic, true);
|
||||
SetDefault(OsuSetting.MenuTips, true);
|
||||
|
||||
SetDefault(OsuSetting.AudioOffset, 0, -500.0, 500.0, 1);
|
||||
|
||||
@ -350,6 +351,7 @@ namespace osu.Game.Configuration
|
||||
VolumeInactive,
|
||||
MenuMusic,
|
||||
MenuVoice,
|
||||
MenuTips,
|
||||
CursorRotation,
|
||||
MenuParallax,
|
||||
Prefer24HourTime,
|
||||
|
@ -24,6 +24,11 @@ namespace osu.Game.Localisation
|
||||
/// </summary>
|
||||
public static LocalisableString MenuCursorSize => new TranslatableString(getKey(@"menu_cursor_size"), @"Menu cursor size");
|
||||
|
||||
/// <summary>
|
||||
/// "Menu tips"
|
||||
/// </summary>
|
||||
public static LocalisableString ShowMenuTips => new TranslatableString(getKey(@"show_menu_tips"), @"Menu tips");
|
||||
|
||||
/// <summary>
|
||||
/// "Parallax"
|
||||
/// </summary>
|
||||
@ -154,6 +159,6 @@ namespace osu.Game.Localisation
|
||||
/// </summary>
|
||||
public static LocalisableString TrueRandom => new TranslatableString(getKey(@"true_random"), @"True Random");
|
||||
|
||||
private static string getKey(string key) => $"{prefix}:{key}";
|
||||
private static string getKey(string key) => $@"{prefix}:{key}";
|
||||
}
|
||||
}
|
||||
|
@ -29,6 +29,11 @@ namespace osu.Game.Overlays.Settings.Sections.UserInterface
|
||||
|
||||
Children = new Drawable[]
|
||||
{
|
||||
new SettingsCheckbox
|
||||
{
|
||||
LabelText = UserInterfaceStrings.ShowMenuTips,
|
||||
Current = config.GetBindable<bool>(OsuSetting.MenuTips)
|
||||
},
|
||||
new SettingsCheckbox
|
||||
{
|
||||
LabelText = UserInterfaceStrings.InterfaceVoices,
|
||||
|
@ -12,7 +12,6 @@ using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Framework.Screens;
|
||||
using osu.Framework.Utils;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Graphics.Containers;
|
||||
using osu.Game.Online.API;
|
||||
@ -122,10 +121,6 @@ namespace osu.Game.Screens.Menu
|
||||
textFlow.NewParagraph();
|
||||
textFlow.NewParagraph();
|
||||
|
||||
textFlow.AddParagraph("today's tip:", formatSemiBold);
|
||||
textFlow.AddParagraph(getRandomTip(), formatRegular);
|
||||
textFlow.NewParagraph();
|
||||
|
||||
textFlow.NewParagraph();
|
||||
|
||||
iconColour = colours.Yellow;
|
||||
@ -228,30 +223,5 @@ namespace osu.Game.Screens.Menu
|
||||
this.Push(nextScreen);
|
||||
});
|
||||
}
|
||||
|
||||
private string getRandomTip()
|
||||
{
|
||||
string[] tips =
|
||||
{
|
||||
"You can press Ctrl-T anywhere in the game to toggle the toolbar!",
|
||||
"You can press Ctrl-O anywhere in the game to access options!",
|
||||
"All settings are dynamic and take effect in real-time. Try pausing and changing the skin while playing!",
|
||||
"New features are coming online every update. Make sure to stay up-to-date!",
|
||||
"If you find the UI too large or small, try adjusting UI scale in settings!",
|
||||
"Try adjusting the \"Screen Scaling\" mode to change your gameplay or UI area, even in fullscreen!",
|
||||
"What used to be \"osu!direct\" is available to all users just like on the website. You can access it anywhere using Ctrl-B!",
|
||||
"Seeking in replays is available by dragging on the difficulty bar at the bottom of the screen!",
|
||||
"Multithreading support means that even with low \"FPS\" your input and judgements will be accurate!",
|
||||
"Try scrolling down in the mod select panel to find a bunch of new fun mods!",
|
||||
"Most of the web content (profiles, rankings, etc.) are available natively in-game from the icons on the toolbar!",
|
||||
"Get more details, hide or delete a beatmap by right-clicking on its panel at song select!",
|
||||
"All delete operations are temporary until exiting. Restore accidentally deleted content from the maintenance settings!",
|
||||
"Check out the \"playlists\" system, which lets users create their own custom and permanent leaderboards!",
|
||||
"Toggle advanced frame / thread statistics with Ctrl-F11!",
|
||||
"Take a look under the hood at performance counters and enable verbose performance logging with Ctrl-F2!",
|
||||
};
|
||||
|
||||
return tips[RNG.Next(0, tips.Length)];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -95,6 +95,8 @@ namespace osu.Game.Screens.Menu
|
||||
private SongTicker songTicker;
|
||||
private Container logoTarget;
|
||||
private SystemTitle systemTitle;
|
||||
private MenuTip menuTip;
|
||||
private FillFlowContainer bottomElementsFlow;
|
||||
|
||||
private Sample reappearSampleSwoosh;
|
||||
|
||||
@ -157,7 +159,27 @@ namespace osu.Game.Screens.Menu
|
||||
Margin = new MarginPadding { Right = 15, Top = 5 }
|
||||
},
|
||||
new KiaiMenuFountains(),
|
||||
systemTitle = new SystemTitle(),
|
||||
bottomElementsFlow = new FillFlowContainer
|
||||
{
|
||||
AutoSizeAxes = Axes.Both,
|
||||
Direction = FillDirection.Vertical,
|
||||
Anchor = Anchor.BottomCentre,
|
||||
Origin = Anchor.BottomCentre,
|
||||
Spacing = new Vector2(15),
|
||||
Children = new Drawable[]
|
||||
{
|
||||
menuTip = new MenuTip
|
||||
{
|
||||
Anchor = Anchor.TopCentre,
|
||||
Origin = Anchor.TopCentre,
|
||||
},
|
||||
systemTitle = new SystemTitle
|
||||
{
|
||||
Anchor = Anchor.TopCentre,
|
||||
Origin = Anchor.TopCentre,
|
||||
}
|
||||
}
|
||||
},
|
||||
holdToExitGameOverlay?.CreateProxy() ?? Empty()
|
||||
});
|
||||
|
||||
@ -220,6 +242,8 @@ namespace osu.Game.Screens.Menu
|
||||
|
||||
if (storage is OsuStorage osuStorage && osuStorage.Error != OsuStorageError.None)
|
||||
dialogOverlay?.Push(new StorageErrorDialog(osuStorage, osuStorage.Error));
|
||||
|
||||
menuTip.ShowNextTip();
|
||||
}
|
||||
|
||||
[CanBeNull]
|
||||
@ -272,7 +296,7 @@ namespace osu.Game.Screens.Menu
|
||||
{
|
||||
base.Update();
|
||||
|
||||
systemTitle.Margin = new MarginPadding
|
||||
bottomElementsFlow.Margin = new MarginPadding
|
||||
{
|
||||
Bottom = (versionManager?.DrawHeight + 5) ?? 0
|
||||
};
|
||||
@ -314,6 +338,10 @@ namespace osu.Game.Screens.Menu
|
||||
buttonsContainer.MoveTo(new Vector2(-800, 0), FADE_OUT_DURATION, Easing.InSine);
|
||||
|
||||
sideFlashes.FadeOut(64, Easing.OutQuint);
|
||||
|
||||
bottomElementsFlow
|
||||
.ScaleTo(0.9f, 1000, Easing.OutQuint)
|
||||
.FadeOut(500, Easing.OutQuint);
|
||||
}
|
||||
|
||||
public override void OnResuming(ScreenTransitionEvent e)
|
||||
@ -330,6 +358,12 @@ namespace osu.Game.Screens.Menu
|
||||
preloadSongSelect();
|
||||
|
||||
musicController.EnsurePlayingSomething();
|
||||
|
||||
menuTip.ShowNextTip();
|
||||
|
||||
bottomElementsFlow
|
||||
.ScaleTo(1, 1000, Easing.OutQuint)
|
||||
.FadeIn(1000, Easing.OutQuint);
|
||||
}
|
||||
|
||||
public override bool OnExiting(ScreenExitEvent e)
|
||||
|
89
osu.Game/Screens/Menu/MenuTip.cs
Normal file
89
osu.Game/Screens/Menu/MenuTip.cs
Normal file
@ -0,0 +1,89 @@
|
||||
// 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 osu.Framework.Allocation;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Framework.Utils;
|
||||
using osu.Game.Configuration;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Graphics.Containers;
|
||||
using osuTK;
|
||||
|
||||
namespace osu.Game.Screens.Menu
|
||||
{
|
||||
public partial class MenuTip : CompositeDrawable
|
||||
{
|
||||
[Resolved]
|
||||
private OsuConfigManager config { get; set; } = null!;
|
||||
|
||||
private LinkFlowContainer textFlow = null!;
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load()
|
||||
{
|
||||
AutoSizeAxes = Axes.Both;
|
||||
|
||||
InternalChildren = new Drawable[]
|
||||
{
|
||||
textFlow = new LinkFlowContainer
|
||||
{
|
||||
Width = 700,
|
||||
AutoSizeAxes = Axes.Y,
|
||||
TextAnchor = Anchor.TopCentre,
|
||||
Anchor = Anchor.TopCentre,
|
||||
Origin = Anchor.TopCentre,
|
||||
Spacing = new Vector2(0, 2),
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
public void ShowNextTip()
|
||||
{
|
||||
if (!config.Get<bool>(OsuSetting.MenuTips)) return;
|
||||
|
||||
static void formatRegular(SpriteText t) => t.Font = OsuFont.GetFont(size: 20, weight: FontWeight.Regular);
|
||||
static void formatSemiBold(SpriteText t) => t.Font = OsuFont.GetFont(size: 20, weight: FontWeight.SemiBold);
|
||||
|
||||
string tip = getRandomTip();
|
||||
|
||||
AutoSizeAxes = Axes.Both;
|
||||
|
||||
textFlow.Clear();
|
||||
textFlow.AddParagraph("a tip for you:", formatSemiBold);
|
||||
textFlow.AddParagraph(tip, formatRegular);
|
||||
|
||||
this.FadeInFromZero(200, Easing.OutQuint)
|
||||
.Delay(1000 + 80 * tip.Length)
|
||||
.Then()
|
||||
.FadeOutFromOne(2000, Easing.OutQuint)
|
||||
.Finally(_ => AutoSizeAxes = Axes.X);
|
||||
}
|
||||
|
||||
private string getRandomTip()
|
||||
{
|
||||
string[] tips =
|
||||
{
|
||||
"You can press Ctrl-T anywhere in the game to toggle the toolbar!",
|
||||
"You can press Ctrl-O anywhere in the game to access options!",
|
||||
"All settings are dynamic and take effect in real-time. Try changing the skin while watching autoplay!",
|
||||
"New features are coming online every update. Make sure to stay up-to-date!",
|
||||
"If you find the UI too large or small, try adjusting UI scale in settings!",
|
||||
"Try adjusting the \"Screen Scaling\" mode to change your gameplay or UI area, even in fullscreen!",
|
||||
"What used to be \"osu!direct\" is available to all users just like on the website. You can access it anywhere using Ctrl-B!",
|
||||
"Seeking in replays is available by dragging on the difficulty bar at the bottom of the screen!",
|
||||
"Multithreading support means that even with low \"FPS\" your input and judgements will be accurate!",
|
||||
"Try scrolling down in the mod select panel to find a bunch of new fun mods!",
|
||||
"Most of the web content (profiles, rankings, etc.) are available natively in-game from the icons on the toolbar!",
|
||||
"Get more details, hide or delete a beatmap by right-clicking on its panel at song select!",
|
||||
"All delete operations are temporary until exiting. Restore accidentally deleted content from the maintenance settings!",
|
||||
"Check out the \"playlists\" system, which lets users create their own custom and permanent leaderboards!",
|
||||
"Toggle advanced frame / thread statistics with Ctrl-F11!",
|
||||
"Take a look under the hood at performance counters and enable verbose performance logging with Ctrl-F2!",
|
||||
};
|
||||
|
||||
return tips[RNG.Next(0, tips.Length)];
|
||||
}
|
||||
}
|
||||
}
|
@ -31,8 +31,6 @@ namespace osu.Game.Screens.Menu
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuGame? game)
|
||||
{
|
||||
Anchor = Anchor.BottomCentre;
|
||||
Origin = Anchor.BottomCentre;
|
||||
AutoSizeAxes = Axes.Both;
|
||||
|
||||
InternalChild = content = new OsuClickableContainer
|
||||
|
Loading…
Reference in New Issue
Block a user