-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #28650 from peppy/mod-preset-tooltip-improvements
Show mod preset description text in tooltip popup
- Loading branch information
Showing
4 changed files
with
32 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,6 @@ | ||
// Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the MIT Licence. | ||
// See the LICENCE file in the repository root for full licence text. | ||
|
||
#nullable disable | ||
|
||
using osu.Framework.Allocation; | ||
using osu.Framework.Graphics; | ||
using osu.Framework.Graphics.Containers; | ||
using osu.Framework.Graphics.Cursor; | ||
|
@@ -18,21 +15,21 @@ namespace osu.Game.Overlays.Mods | |
public partial class ModButtonTooltip : VisibilityContainer, ITooltip<Mod> | ||
{ | ||
private readonly OsuSpriteText descriptionText; | ||
private readonly Box background; | ||
|
||
protected override Container<Drawable> Content { get; } | ||
|
||
public ModButtonTooltip() | ||
public ModButtonTooltip(OverlayColourProvider colourProvider) | ||
{ | ||
AutoSizeAxes = Axes.Both; | ||
Masking = true; | ||
CornerRadius = 5; | ||
|
||
InternalChildren = new Drawable[] | ||
{ | ||
background = new Box | ||
new Box | ||
{ | ||
RelativeSizeAxes = Axes.Both | ||
RelativeSizeAxes = Axes.Both, | ||
Colour = colourProvider.Background6, | ||
}, | ||
Content = new FillFlowContainer | ||
{ | ||
|
@@ -43,24 +40,18 @@ public ModButtonTooltip() | |
{ | ||
descriptionText = new OsuSpriteText | ||
{ | ||
Colour = colourProvider.Content1, | ||
Font = OsuFont.GetFont(weight: FontWeight.Regular), | ||
}, | ||
} | ||
}, | ||
}; | ||
} | ||
|
||
[BackgroundDependencyLoader] | ||
private void load(OsuColour colours) | ||
{ | ||
background.Colour = colours.Gray3; | ||
descriptionText.Colour = colours.BlueLighter; | ||
} | ||
|
||
protected override void PopIn() => this.FadeIn(200, Easing.OutQuint); | ||
protected override void PopOut() => this.FadeOut(200, Easing.OutQuint); | ||
|
||
private Mod lastMod; | ||
private Mod? lastMod; | ||
|
||
public void SetContent(Mod mod) | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters