2023-12-28 15:05:20 +08:00
|
|
|
// 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;
|
2023-12-28 15:19:12 +08:00
|
|
|
using osu.Framework.Bindables;
|
2023-12-28 15:05:20 +08:00
|
|
|
using osu.Framework.Graphics;
|
|
|
|
using osu.Framework.Graphics.Containers;
|
2023-12-28 15:16:27 +08:00
|
|
|
using osu.Framework.Graphics.Shapes;
|
2023-12-28 15:05:20 +08:00
|
|
|
using osu.Framework.Graphics.Sprites;
|
|
|
|
using osu.Framework.Utils;
|
|
|
|
using osu.Game.Configuration;
|
|
|
|
using osu.Game.Graphics;
|
|
|
|
using osu.Game.Graphics.Containers;
|
|
|
|
using osuTK;
|
2023-12-28 15:16:27 +08:00
|
|
|
using osuTK.Graphics;
|
2023-12-28 15:05:20 +08:00
|
|
|
|
|
|
|
namespace osu.Game.Screens.Menu
|
|
|
|
{
|
|
|
|
public partial class MenuTip : CompositeDrawable
|
|
|
|
{
|
|
|
|
[Resolved]
|
|
|
|
private OsuConfigManager config { get; set; } = null!;
|
|
|
|
|
|
|
|
private LinkFlowContainer textFlow = null!;
|
|
|
|
|
2023-12-28 15:19:12 +08:00
|
|
|
private Bindable<bool> showMenuTips = null!;
|
|
|
|
|
2023-12-28 15:05:20 +08:00
|
|
|
[BackgroundDependencyLoader]
|
|
|
|
private void load()
|
|
|
|
{
|
|
|
|
AutoSizeAxes = Axes.Both;
|
|
|
|
|
|
|
|
InternalChildren = new Drawable[]
|
|
|
|
{
|
2023-12-28 15:16:27 +08:00
|
|
|
new Container
|
|
|
|
{
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
|
|
|
Masking = true,
|
|
|
|
CornerExponent = 2.5f,
|
|
|
|
CornerRadius = 15,
|
|
|
|
Children = new Drawable[]
|
|
|
|
{
|
|
|
|
new Box
|
|
|
|
{
|
|
|
|
Colour = Color4.Black,
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
|
|
|
Alpha = 0.4f,
|
|
|
|
},
|
|
|
|
}
|
|
|
|
},
|
2023-12-28 15:05:20 +08:00
|
|
|
textFlow = new LinkFlowContainer
|
|
|
|
{
|
2023-12-28 15:16:27 +08:00
|
|
|
Width = 600,
|
2023-12-28 15:05:20 +08:00
|
|
|
AutoSizeAxes = Axes.Y,
|
|
|
|
TextAnchor = Anchor.TopCentre,
|
|
|
|
Spacing = new Vector2(0, 2),
|
2023-12-28 15:16:27 +08:00
|
|
|
Margin = new MarginPadding(10)
|
2023-12-28 15:05:20 +08:00
|
|
|
},
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2023-12-28 15:19:12 +08:00
|
|
|
protected override void LoadComplete()
|
|
|
|
{
|
|
|
|
base.LoadComplete();
|
|
|
|
|
|
|
|
showMenuTips = config.GetBindable<bool>(OsuSetting.MenuTips);
|
|
|
|
showMenuTips.BindValueChanged(_ => ShowNextTip(), true);
|
|
|
|
}
|
|
|
|
|
2023-12-28 15:05:20 +08:00
|
|
|
public void ShowNextTip()
|
|
|
|
{
|
2023-12-28 15:19:12 +08:00
|
|
|
if (!showMenuTips.Value)
|
|
|
|
{
|
|
|
|
this.FadeOut(100, Easing.OutQuint);
|
|
|
|
return;
|
|
|
|
}
|
2023-12-28 15:05:20 +08:00
|
|
|
|
2023-12-28 15:16:27 +08:00
|
|
|
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);
|
2023-12-28 15:05:20 +08:00
|
|
|
|
|
|
|
string tip = getRandomTip();
|
|
|
|
|
|
|
|
textFlow.Clear();
|
|
|
|
textFlow.AddParagraph("a tip for you:", formatSemiBold);
|
|
|
|
textFlow.AddParagraph(tip, formatRegular);
|
|
|
|
|
|
|
|
this.FadeInFromZero(200, Easing.OutQuint)
|
|
|
|
.Delay(1000 + 80 * tip.Length)
|
|
|
|
.Then()
|
2023-12-28 15:16:27 +08:00
|
|
|
.FadeOutFromOne(2000, Easing.OutQuint);
|
2023-12-28 15:05:20 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
private string getRandomTip()
|
|
|
|
{
|
|
|
|
string[] tips =
|
|
|
|
{
|
2023-12-29 21:14:51 +08:00
|
|
|
"Press Ctrl-T anywhere in the game to toggle the toolbar!",
|
|
|
|
"Press Ctrl-O anywhere in the game to access options!",
|
2023-12-28 15:05:20 +08:00
|
|
|
"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!",
|
2023-12-29 21:24:16 +08:00
|
|
|
"Seeking in replays is available by dragging on the progress bar at the bottom of the screen or by using the left and right arrow keys!",
|
2023-12-28 15:05:20 +08:00
|
|
|
"Multithreading support means that even with low \"FPS\" your input and judgements will be accurate!",
|
2023-12-29 08:51:54 +08:00
|
|
|
"Try scrolling right in mod select to find a bunch of new fun mods!",
|
2023-12-28 15:05:20 +08:00
|
|
|
"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!",
|
2023-12-29 21:14:51 +08:00
|
|
|
"You can pause during a replay by pressing Space!",
|
|
|
|
"Most of the hotkeys in the game are configurable and can be changed to anything you want. Check the bindings panel under input settings!",
|
|
|
|
"When your gameplay HUD is hidden, you can press and hold Ctrl to view it temporarily!",
|
2023-12-29 21:20:29 +08:00
|
|
|
"Your gameplay HUD can be customized by using the skin layout editor. Open it at any time via Ctrl-Shift-S!",
|
2023-12-29 21:14:51 +08:00
|
|
|
"Drag and drop any image into the skin editor to load it in quickly!",
|
|
|
|
"You can create mod presets to make toggling your favorite mod combinations easier!",
|
|
|
|
"Many mods have customisation settings that drastically change how they function. Click the Mod Customisation button in mod select to view settings!",
|
|
|
|
"Press Ctrl-Shift-R to switch to a random skin!",
|
|
|
|
"Press Ctrl-Shift-F to toggle the FPS Counter. But make sure not to pay too much attention to it!",
|
2023-12-29 21:20:29 +08:00
|
|
|
"While watching a replay, press Ctrl-H to toggle replay settings!",
|
2023-12-29 21:14:51 +08:00
|
|
|
"You can easily copy the mods from scores on a leaderboard by right-clicking on them!",
|
|
|
|
"Ctrl-Enter at song select will start a beatmap in autoplay mode!"
|
2023-12-28 15:05:20 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
return tips[RNG.Next(0, tips.Length)];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|