1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-17 13:12:56 +08:00
osu-lazer/osu.Game.Tournament/TournamentGame.cs

55 lines
2.4 KiB
C#
Raw Normal View History

2019-03-04 12:24:19 +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.
2018-11-07 00:20:32 +08:00
using osu.Framework.Graphics;
2019-06-13 18:41:01 +08:00
using osu.Framework.Graphics.Sprites;
2019-02-17 17:20:03 +08:00
using osu.Framework.Screens;
2019-06-13 18:41:01 +08:00
using osu.Game.Graphics;
2018-11-07 00:20:32 +08:00
using osu.Game.Graphics.Cursor;
using osu.Game.Tournament.Screens;
namespace osu.Game.Tournament
{
2018-11-06 17:32:59 +08:00
public class TournamentGame : TournamentGameBase
{
protected override void LoadComplete()
{
base.LoadComplete();
2018-11-07 00:20:32 +08:00
Add(new OsuContextMenuContainer
{
RelativeSizeAxes = Axes.Both,
2019-02-17 17:20:03 +08:00
Child = new ScreenStack(new TournamentSceneManager()) { RelativeSizeAxes = Axes.Both }
2018-11-07 00:20:32 +08:00
});
MenuCursorContainer.Cursor.Alpha = 0;
}
}
2019-06-13 18:41:01 +08:00
public static class TournamentFontExtensions
{
/// <summary>
/// Creates a new <see cref="FontUsage"/> by applying adjustments to this <see cref="FontUsage"/>.
/// </summary>
/// <param name="usage">The base <see cref="FontUsage"/>.</param>
/// <param name="typeface">The font typeface. If null, the value is copied from this <see cref="FontUsage"/>.</param>
/// <param name="size">The text size. If null, the value is copied from this <see cref="FontUsage"/>.</param>
/// <param name="weight">The font weight. If null, the value is copied from this <see cref="FontUsage"/>.</param>
/// <param name="italics">Whether the font is italic. If null, the value is copied from this <see cref="FontUsage"/>.</param>
/// <param name="fixedWidth">Whether all characters should be spaced apart the same distance. If null, the value is copied from this <see cref="FontUsage"/>.</param>
/// <returns>The resulting <see cref="FontUsage"/>.</returns>
public static FontUsage With(this FontUsage usage, TournamentTypeface? typeface = null, float? size = null, FontWeight? weight = null, bool? italics = null, bool? fixedWidth = null)
{
string familyString = typeface != null ? TournamentFont.GetFamilyString(typeface.Value) : usage.Family;
string weightString = weight != null ? TournamentFont.GetWeightString(familyString, weight.Value) : usage.Weight;
return usage.With(familyString, size, weightString, italics, fixedWidth);
}
}
public enum TournamentTypeface
{
Aquatico
}
}