mirror of
https://github.com/osukey/osukey.git
synced 2025-07-03 01:09:57 +09:00
Move text display layout to Toast.
This commit is contained in:
@ -4,6 +4,9 @@
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Graphics.Sprites;
|
||||
using osuTK;
|
||||
using osuTK.Graphics;
|
||||
|
||||
namespace osu.Game.Overlays.OSD
|
||||
@ -13,7 +16,7 @@ namespace osu.Game.Overlays.OSD
|
||||
private readonly Container content;
|
||||
protected override Container<Drawable> Content => content;
|
||||
|
||||
protected Toast()
|
||||
protected Toast(string description, string value, string keybinding)
|
||||
{
|
||||
Anchor = Anchor.Centre;
|
||||
Origin = Anchor.Centre;
|
||||
@ -35,7 +38,35 @@ namespace osu.Game.Overlays.OSD
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
}
|
||||
},
|
||||
new OsuSpriteText
|
||||
{
|
||||
Padding = new MarginPadding(10),
|
||||
Name = "Description",
|
||||
Font = OsuFont.GetFont(size: 14, weight: FontWeight.Black),
|
||||
Spacing = new Vector2(1, 0),
|
||||
Anchor = Anchor.TopCentre,
|
||||
Origin = Anchor.TopCentre,
|
||||
Text = description.ToUpperInvariant()
|
||||
},
|
||||
new OsuSpriteText
|
||||
{
|
||||
Font = OsuFont.GetFont(size: 24, weight: FontWeight.Light),
|
||||
Padding = new MarginPadding { Left = 10, Right = 10 },
|
||||
Name = "Value",
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.BottomCentre,
|
||||
Text = value
|
||||
},
|
||||
new OsuSpriteText
|
||||
{
|
||||
Anchor = Anchor.BottomCentre,
|
||||
Origin = Anchor.BottomCentre,
|
||||
Name = "Shortcut",
|
||||
Margin = new MarginPadding { Bottom = 15 },
|
||||
Font = OsuFont.GetFont(size: 12, weight: FontWeight.Bold),
|
||||
Text = string.IsNullOrEmpty(keybinding) ? "NO KEY BOUND" : keybinding.ToUpperInvariant()
|
||||
},
|
||||
};
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user