mirror of
https://github.com/ppy/osu.git
synced 2025-02-19 12:23:13 +08:00
Move font-related code out of TournamentGame
This commit is contained in:
parent
7652339dc0
commit
7c163ad911
@ -67,4 +67,9 @@ namespace osu.Game.Tournament
|
|||||||
return weightString;
|
return weightString;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public enum TournamentTypeface
|
||||||
|
{
|
||||||
|
Aquatico
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,8 +2,6 @@
|
|||||||
// See the LICENCE file in the repository root for full licence text.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Sprites;
|
|
||||||
using osu.Game.Graphics;
|
|
||||||
using osu.Game.Graphics.Cursor;
|
using osu.Game.Graphics.Cursor;
|
||||||
|
|
||||||
namespace osu.Game.Tournament
|
namespace osu.Game.Tournament
|
||||||
@ -20,33 +18,8 @@ namespace osu.Game.Tournament
|
|||||||
Child = new TournamentSceneManager()
|
Child = new TournamentSceneManager()
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// we don't want to show the menu cursor as it would appear on stream output.
|
||||||
MenuCursorContainer.Cursor.Alpha = 0;
|
MenuCursorContainer.Cursor.Alpha = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
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
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user