mirror of
https://github.com/ppy/osu.git
synced 2025-02-16 15:43:18 +08:00
Merge branch 'master' into beatmap-difficulty-cache-nullable
This commit is contained in:
commit
46ea0f44eb
@ -194,4 +194,7 @@ dotnet_diagnostic.IDE0068.severity = none
|
|||||||
dotnet_diagnostic.IDE0069.severity = none
|
dotnet_diagnostic.IDE0069.severity = none
|
||||||
|
|
||||||
#Disable operator overloads requiring alternate named methods
|
#Disable operator overloads requiring alternate named methods
|
||||||
dotnet_diagnostic.CA2225.severity = none
|
dotnet_diagnostic.CA2225.severity = none
|
||||||
|
|
||||||
|
# Banned APIs
|
||||||
|
dotnet_diagnostic.RS0030.severity = error
|
@ -7,3 +7,4 @@ M:osu.Framework.Graphics.Sprites.SpriteText.#ctor;Use OsuSpriteText.
|
|||||||
M:osu.Framework.Bindables.IBindableList`1.GetBoundCopy();Fails on iOS. Use manual ctor + BindTo instead. (see https://github.com/mono/mono/issues/19900)
|
M:osu.Framework.Bindables.IBindableList`1.GetBoundCopy();Fails on iOS. Use manual ctor + BindTo instead. (see https://github.com/mono/mono/issues/19900)
|
||||||
T:Microsoft.EntityFrameworkCore.Internal.EnumerableExtensions;Don't use internal extension methods.
|
T:Microsoft.EntityFrameworkCore.Internal.EnumerableExtensions;Don't use internal extension methods.
|
||||||
T:Microsoft.EntityFrameworkCore.Internal.TypeExtensions;Don't use internal extension methods.
|
T:Microsoft.EntityFrameworkCore.Internal.TypeExtensions;Don't use internal extension methods.
|
||||||
|
M:System.Enum.HasFlag(System.Enum);Use osu.Framework.Extensions.EnumExtensions.HasFlagFast<T>() instead.
|
@ -18,7 +18,7 @@
|
|||||||
<ItemGroup Label="Code Analysis">
|
<ItemGroup Label="Code Analysis">
|
||||||
<PackageReference Include="Microsoft.CodeAnalysis.BannedApiAnalyzers" Version="3.3.2" PrivateAssets="All" />
|
<PackageReference Include="Microsoft.CodeAnalysis.BannedApiAnalyzers" Version="3.3.2" PrivateAssets="All" />
|
||||||
<AdditionalFiles Include="$(MSBuildThisFileDirectory)CodeAnalysis\BannedSymbols.txt" />
|
<AdditionalFiles Include="$(MSBuildThisFileDirectory)CodeAnalysis\BannedSymbols.txt" />
|
||||||
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="3.3.2" PrivateAssets="All" />
|
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="5.0.3" PrivateAssets="All" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<PropertyGroup Label="Code Analysis">
|
<PropertyGroup Label="Code Analysis">
|
||||||
<CodeAnalysisRuleSet>$(MSBuildThisFileDirectory)CodeAnalysis\osu.ruleset</CodeAnalysisRuleSet>
|
<CodeAnalysisRuleSet>$(MSBuildThisFileDirectory)CodeAnalysis\osu.ruleset</CodeAnalysisRuleSet>
|
||||||
|
@ -52,6 +52,6 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="ppy.osu.Game.Resources" Version="2021.211.1" />
|
<PackageReference Include="ppy.osu.Game.Resources" Version="2021.211.1" />
|
||||||
<PackageReference Include="ppy.osu.Framework.Android" Version="2021.222.0" />
|
<PackageReference Include="ppy.osu.Framework.Android" Version="2021.225.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
@ -21,6 +21,7 @@ using osu.Game.Rulesets.Difficulty;
|
|||||||
using osu.Game.Rulesets.Scoring;
|
using osu.Game.Rulesets.Scoring;
|
||||||
using osu.Game.Scoring;
|
using osu.Game.Scoring;
|
||||||
using System;
|
using System;
|
||||||
|
using osu.Framework.Extensions.EnumExtensions;
|
||||||
using osu.Game.Rulesets.Catch.Skinning.Legacy;
|
using osu.Game.Rulesets.Catch.Skinning.Legacy;
|
||||||
using osu.Game.Skinning;
|
using osu.Game.Skinning;
|
||||||
|
|
||||||
@ -50,40 +51,40 @@ namespace osu.Game.Rulesets.Catch
|
|||||||
|
|
||||||
public override IEnumerable<Mod> ConvertFromLegacyMods(LegacyMods mods)
|
public override IEnumerable<Mod> ConvertFromLegacyMods(LegacyMods mods)
|
||||||
{
|
{
|
||||||
if (mods.HasFlag(LegacyMods.Nightcore))
|
if (mods.HasFlagFast(LegacyMods.Nightcore))
|
||||||
yield return new CatchModNightcore();
|
yield return new CatchModNightcore();
|
||||||
else if (mods.HasFlag(LegacyMods.DoubleTime))
|
else if (mods.HasFlagFast(LegacyMods.DoubleTime))
|
||||||
yield return new CatchModDoubleTime();
|
yield return new CatchModDoubleTime();
|
||||||
|
|
||||||
if (mods.HasFlag(LegacyMods.Perfect))
|
if (mods.HasFlagFast(LegacyMods.Perfect))
|
||||||
yield return new CatchModPerfect();
|
yield return new CatchModPerfect();
|
||||||
else if (mods.HasFlag(LegacyMods.SuddenDeath))
|
else if (mods.HasFlagFast(LegacyMods.SuddenDeath))
|
||||||
yield return new CatchModSuddenDeath();
|
yield return new CatchModSuddenDeath();
|
||||||
|
|
||||||
if (mods.HasFlag(LegacyMods.Cinema))
|
if (mods.HasFlagFast(LegacyMods.Cinema))
|
||||||
yield return new CatchModCinema();
|
yield return new CatchModCinema();
|
||||||
else if (mods.HasFlag(LegacyMods.Autoplay))
|
else if (mods.HasFlagFast(LegacyMods.Autoplay))
|
||||||
yield return new CatchModAutoplay();
|
yield return new CatchModAutoplay();
|
||||||
|
|
||||||
if (mods.HasFlag(LegacyMods.Easy))
|
if (mods.HasFlagFast(LegacyMods.Easy))
|
||||||
yield return new CatchModEasy();
|
yield return new CatchModEasy();
|
||||||
|
|
||||||
if (mods.HasFlag(LegacyMods.Flashlight))
|
if (mods.HasFlagFast(LegacyMods.Flashlight))
|
||||||
yield return new CatchModFlashlight();
|
yield return new CatchModFlashlight();
|
||||||
|
|
||||||
if (mods.HasFlag(LegacyMods.HalfTime))
|
if (mods.HasFlagFast(LegacyMods.HalfTime))
|
||||||
yield return new CatchModHalfTime();
|
yield return new CatchModHalfTime();
|
||||||
|
|
||||||
if (mods.HasFlag(LegacyMods.HardRock))
|
if (mods.HasFlagFast(LegacyMods.HardRock))
|
||||||
yield return new CatchModHardRock();
|
yield return new CatchModHardRock();
|
||||||
|
|
||||||
if (mods.HasFlag(LegacyMods.Hidden))
|
if (mods.HasFlagFast(LegacyMods.Hidden))
|
||||||
yield return new CatchModHidden();
|
yield return new CatchModHidden();
|
||||||
|
|
||||||
if (mods.HasFlag(LegacyMods.NoFail))
|
if (mods.HasFlagFast(LegacyMods.NoFail))
|
||||||
yield return new CatchModNoFail();
|
yield return new CatchModNoFail();
|
||||||
|
|
||||||
if (mods.HasFlag(LegacyMods.Relax))
|
if (mods.HasFlagFast(LegacyMods.Relax))
|
||||||
yield return new CatchModRelax();
|
yield return new CatchModRelax();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,6 +6,7 @@ using NUnit.Framework;
|
|||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
using osu.Framework.Extensions.Color4Extensions;
|
using osu.Framework.Extensions.Color4Extensions;
|
||||||
|
using osu.Framework.Extensions.EnumExtensions;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
@ -97,7 +98,7 @@ namespace osu.Game.Rulesets.Mania.Tests
|
|||||||
}
|
}
|
||||||
|
|
||||||
private bool verifyAnchors(DrawableHitObject hitObject, Anchor expectedAnchor)
|
private bool verifyAnchors(DrawableHitObject hitObject, Anchor expectedAnchor)
|
||||||
=> hitObject.Anchor.HasFlag(expectedAnchor) && hitObject.Origin.HasFlag(expectedAnchor);
|
=> hitObject.Anchor.HasFlagFast(expectedAnchor) && hitObject.Origin.HasFlagFast(expectedAnchor);
|
||||||
|
|
||||||
private bool verifyAnchors(DrawableHoldNote holdNote, Anchor expectedAnchor)
|
private bool verifyAnchors(DrawableHoldNote holdNote, Anchor expectedAnchor)
|
||||||
=> verifyAnchors((DrawableHitObject)holdNote, expectedAnchor) && holdNote.NestedHitObjects.All(n => verifyAnchors(n, expectedAnchor));
|
=> verifyAnchors((DrawableHitObject)holdNote, expectedAnchor) && holdNote.NestedHitObjects.All(n => verifyAnchors(n, expectedAnchor));
|
||||||
|
@ -5,6 +5,7 @@ using System;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using osu.Framework.Extensions.EnumExtensions;
|
||||||
using osu.Game.Audio;
|
using osu.Game.Audio;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Rulesets.Mania.MathUtils;
|
using osu.Game.Rulesets.Mania.MathUtils;
|
||||||
@ -141,7 +142,7 @@ namespace osu.Game.Rulesets.Mania.Beatmaps.Patterns.Legacy
|
|||||||
|
|
||||||
if (ConversionDifficulty > 6.5)
|
if (ConversionDifficulty > 6.5)
|
||||||
{
|
{
|
||||||
if (convertType.HasFlag(PatternType.LowProbability))
|
if (convertType.HasFlagFast(PatternType.LowProbability))
|
||||||
return generateNRandomNotes(StartTime, 0.78, 0.3, 0);
|
return generateNRandomNotes(StartTime, 0.78, 0.3, 0);
|
||||||
|
|
||||||
return generateNRandomNotes(StartTime, 0.85, 0.36, 0.03);
|
return generateNRandomNotes(StartTime, 0.85, 0.36, 0.03);
|
||||||
@ -149,7 +150,7 @@ namespace osu.Game.Rulesets.Mania.Beatmaps.Patterns.Legacy
|
|||||||
|
|
||||||
if (ConversionDifficulty > 4)
|
if (ConversionDifficulty > 4)
|
||||||
{
|
{
|
||||||
if (convertType.HasFlag(PatternType.LowProbability))
|
if (convertType.HasFlagFast(PatternType.LowProbability))
|
||||||
return generateNRandomNotes(StartTime, 0.43, 0.08, 0);
|
return generateNRandomNotes(StartTime, 0.43, 0.08, 0);
|
||||||
|
|
||||||
return generateNRandomNotes(StartTime, 0.56, 0.18, 0);
|
return generateNRandomNotes(StartTime, 0.56, 0.18, 0);
|
||||||
@ -157,13 +158,13 @@ namespace osu.Game.Rulesets.Mania.Beatmaps.Patterns.Legacy
|
|||||||
|
|
||||||
if (ConversionDifficulty > 2.5)
|
if (ConversionDifficulty > 2.5)
|
||||||
{
|
{
|
||||||
if (convertType.HasFlag(PatternType.LowProbability))
|
if (convertType.HasFlagFast(PatternType.LowProbability))
|
||||||
return generateNRandomNotes(StartTime, 0.3, 0, 0);
|
return generateNRandomNotes(StartTime, 0.3, 0, 0);
|
||||||
|
|
||||||
return generateNRandomNotes(StartTime, 0.37, 0.08, 0);
|
return generateNRandomNotes(StartTime, 0.37, 0.08, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (convertType.HasFlag(PatternType.LowProbability))
|
if (convertType.HasFlagFast(PatternType.LowProbability))
|
||||||
return generateNRandomNotes(StartTime, 0.17, 0, 0);
|
return generateNRandomNotes(StartTime, 0.17, 0, 0);
|
||||||
|
|
||||||
return generateNRandomNotes(StartTime, 0.27, 0, 0);
|
return generateNRandomNotes(StartTime, 0.27, 0, 0);
|
||||||
@ -221,7 +222,7 @@ namespace osu.Game.Rulesets.Mania.Beatmaps.Patterns.Legacy
|
|||||||
var pattern = new Pattern();
|
var pattern = new Pattern();
|
||||||
|
|
||||||
int nextColumn = GetColumn((HitObject as IHasXPosition)?.X ?? 0, true);
|
int nextColumn = GetColumn((HitObject as IHasXPosition)?.X ?? 0, true);
|
||||||
if (convertType.HasFlag(PatternType.ForceNotStack) && PreviousPattern.ColumnWithObjects < TotalColumns)
|
if (convertType.HasFlagFast(PatternType.ForceNotStack) && PreviousPattern.ColumnWithObjects < TotalColumns)
|
||||||
nextColumn = FindAvailableColumn(nextColumn, PreviousPattern);
|
nextColumn = FindAvailableColumn(nextColumn, PreviousPattern);
|
||||||
|
|
||||||
int lastColumn = nextColumn;
|
int lastColumn = nextColumn;
|
||||||
@ -373,7 +374,7 @@ namespace osu.Game.Rulesets.Mania.Beatmaps.Patterns.Legacy
|
|||||||
|
|
||||||
static bool isDoubleSample(HitSampleInfo sample) => sample.Name == HitSampleInfo.HIT_CLAP || sample.Name == HitSampleInfo.HIT_FINISH;
|
static bool isDoubleSample(HitSampleInfo sample) => sample.Name == HitSampleInfo.HIT_CLAP || sample.Name == HitSampleInfo.HIT_FINISH;
|
||||||
|
|
||||||
bool canGenerateTwoNotes = !convertType.HasFlag(PatternType.LowProbability);
|
bool canGenerateTwoNotes = !convertType.HasFlagFast(PatternType.LowProbability);
|
||||||
canGenerateTwoNotes &= HitObject.Samples.Any(isDoubleSample) || sampleInfoListAt(StartTime).Any(isDoubleSample);
|
canGenerateTwoNotes &= HitObject.Samples.Any(isDoubleSample) || sampleInfoListAt(StartTime).Any(isDoubleSample);
|
||||||
|
|
||||||
if (canGenerateTwoNotes)
|
if (canGenerateTwoNotes)
|
||||||
@ -406,7 +407,7 @@ namespace osu.Game.Rulesets.Mania.Beatmaps.Patterns.Legacy
|
|||||||
int endTime = startTime + SegmentDuration * SpanCount;
|
int endTime = startTime + SegmentDuration * SpanCount;
|
||||||
|
|
||||||
int nextColumn = GetColumn((HitObject as IHasXPosition)?.X ?? 0, true);
|
int nextColumn = GetColumn((HitObject as IHasXPosition)?.X ?? 0, true);
|
||||||
if (convertType.HasFlag(PatternType.ForceNotStack) && PreviousPattern.ColumnWithObjects < TotalColumns)
|
if (convertType.HasFlagFast(PatternType.ForceNotStack) && PreviousPattern.ColumnWithObjects < TotalColumns)
|
||||||
nextColumn = FindAvailableColumn(nextColumn, PreviousPattern);
|
nextColumn = FindAvailableColumn(nextColumn, PreviousPattern);
|
||||||
|
|
||||||
for (int i = 0; i < columnRepeat; i++)
|
for (int i = 0; i < columnRepeat; i++)
|
||||||
@ -435,7 +436,7 @@ namespace osu.Game.Rulesets.Mania.Beatmaps.Patterns.Legacy
|
|||||||
var pattern = new Pattern();
|
var pattern = new Pattern();
|
||||||
|
|
||||||
int holdColumn = GetColumn((HitObject as IHasXPosition)?.X ?? 0, true);
|
int holdColumn = GetColumn((HitObject as IHasXPosition)?.X ?? 0, true);
|
||||||
if (convertType.HasFlag(PatternType.ForceNotStack) && PreviousPattern.ColumnWithObjects < TotalColumns)
|
if (convertType.HasFlagFast(PatternType.ForceNotStack) && PreviousPattern.ColumnWithObjects < TotalColumns)
|
||||||
holdColumn = FindAvailableColumn(holdColumn, PreviousPattern);
|
holdColumn = FindAvailableColumn(holdColumn, PreviousPattern);
|
||||||
|
|
||||||
// Create the hold note
|
// Create the hold note
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using osu.Framework.Extensions.EnumExtensions;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
using osu.Game.Audio;
|
using osu.Game.Audio;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
@ -78,7 +79,7 @@ namespace osu.Game.Rulesets.Mania.Beatmaps.Patterns.Legacy
|
|||||||
else
|
else
|
||||||
convertType |= PatternType.LowProbability;
|
convertType |= PatternType.LowProbability;
|
||||||
|
|
||||||
if (!convertType.HasFlag(PatternType.KeepSingle))
|
if (!convertType.HasFlagFast(PatternType.KeepSingle))
|
||||||
{
|
{
|
||||||
if (HitObject.Samples.Any(s => s.Name == HitSampleInfo.HIT_FINISH) && TotalColumns != 8)
|
if (HitObject.Samples.Any(s => s.Name == HitSampleInfo.HIT_FINISH) && TotalColumns != 8)
|
||||||
convertType |= PatternType.Mirror;
|
convertType |= PatternType.Mirror;
|
||||||
@ -101,7 +102,7 @@ namespace osu.Game.Rulesets.Mania.Beatmaps.Patterns.Legacy
|
|||||||
|
|
||||||
int lastColumn = PreviousPattern.HitObjects.FirstOrDefault()?.Column ?? 0;
|
int lastColumn = PreviousPattern.HitObjects.FirstOrDefault()?.Column ?? 0;
|
||||||
|
|
||||||
if (convertType.HasFlag(PatternType.Reverse) && PreviousPattern.HitObjects.Any())
|
if (convertType.HasFlagFast(PatternType.Reverse) && PreviousPattern.HitObjects.Any())
|
||||||
{
|
{
|
||||||
// Generate a new pattern by copying the last hit objects in reverse-column order
|
// Generate a new pattern by copying the last hit objects in reverse-column order
|
||||||
for (int i = RandomStart; i < TotalColumns; i++)
|
for (int i = RandomStart; i < TotalColumns; i++)
|
||||||
@ -113,11 +114,11 @@ namespace osu.Game.Rulesets.Mania.Beatmaps.Patterns.Legacy
|
|||||||
return pattern;
|
return pattern;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (convertType.HasFlag(PatternType.Cycle) && PreviousPattern.HitObjects.Count() == 1
|
if (convertType.HasFlagFast(PatternType.Cycle) && PreviousPattern.HitObjects.Count() == 1
|
||||||
// If we convert to 7K + 1, let's not overload the special key
|
// If we convert to 7K + 1, let's not overload the special key
|
||||||
&& (TotalColumns != 8 || lastColumn != 0)
|
&& (TotalColumns != 8 || lastColumn != 0)
|
||||||
// Make sure the last column was not the centre column
|
// Make sure the last column was not the centre column
|
||||||
&& (TotalColumns % 2 == 0 || lastColumn != TotalColumns / 2))
|
&& (TotalColumns % 2 == 0 || lastColumn != TotalColumns / 2))
|
||||||
{
|
{
|
||||||
// Generate a new pattern by cycling backwards (similar to Reverse but for only one hit object)
|
// Generate a new pattern by cycling backwards (similar to Reverse but for only one hit object)
|
||||||
int column = RandomStart + TotalColumns - lastColumn - 1;
|
int column = RandomStart + TotalColumns - lastColumn - 1;
|
||||||
@ -126,7 +127,7 @@ namespace osu.Game.Rulesets.Mania.Beatmaps.Patterns.Legacy
|
|||||||
return pattern;
|
return pattern;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (convertType.HasFlag(PatternType.ForceStack) && PreviousPattern.HitObjects.Any())
|
if (convertType.HasFlagFast(PatternType.ForceStack) && PreviousPattern.HitObjects.Any())
|
||||||
{
|
{
|
||||||
// Generate a new pattern by placing on the already filled columns
|
// Generate a new pattern by placing on the already filled columns
|
||||||
for (int i = RandomStart; i < TotalColumns; i++)
|
for (int i = RandomStart; i < TotalColumns; i++)
|
||||||
@ -140,7 +141,7 @@ namespace osu.Game.Rulesets.Mania.Beatmaps.Patterns.Legacy
|
|||||||
|
|
||||||
if (PreviousPattern.HitObjects.Count() == 1)
|
if (PreviousPattern.HitObjects.Count() == 1)
|
||||||
{
|
{
|
||||||
if (convertType.HasFlag(PatternType.Stair))
|
if (convertType.HasFlagFast(PatternType.Stair))
|
||||||
{
|
{
|
||||||
// Generate a new pattern by placing on the next column, cycling back to the start if there is no "next"
|
// Generate a new pattern by placing on the next column, cycling back to the start if there is no "next"
|
||||||
int targetColumn = lastColumn + 1;
|
int targetColumn = lastColumn + 1;
|
||||||
@ -151,7 +152,7 @@ namespace osu.Game.Rulesets.Mania.Beatmaps.Patterns.Legacy
|
|||||||
return pattern;
|
return pattern;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (convertType.HasFlag(PatternType.ReverseStair))
|
if (convertType.HasFlagFast(PatternType.ReverseStair))
|
||||||
{
|
{
|
||||||
// Generate a new pattern by placing on the previous column, cycling back to the end if there is no "previous"
|
// Generate a new pattern by placing on the previous column, cycling back to the end if there is no "previous"
|
||||||
int targetColumn = lastColumn - 1;
|
int targetColumn = lastColumn - 1;
|
||||||
@ -163,10 +164,10 @@ namespace osu.Game.Rulesets.Mania.Beatmaps.Patterns.Legacy
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (convertType.HasFlag(PatternType.KeepSingle))
|
if (convertType.HasFlagFast(PatternType.KeepSingle))
|
||||||
return generateRandomNotes(1);
|
return generateRandomNotes(1);
|
||||||
|
|
||||||
if (convertType.HasFlag(PatternType.Mirror))
|
if (convertType.HasFlagFast(PatternType.Mirror))
|
||||||
{
|
{
|
||||||
if (ConversionDifficulty > 6.5)
|
if (ConversionDifficulty > 6.5)
|
||||||
return generateRandomPatternWithMirrored(0.12, 0.38, 0.12);
|
return generateRandomPatternWithMirrored(0.12, 0.38, 0.12);
|
||||||
@ -178,7 +179,7 @@ namespace osu.Game.Rulesets.Mania.Beatmaps.Patterns.Legacy
|
|||||||
|
|
||||||
if (ConversionDifficulty > 6.5)
|
if (ConversionDifficulty > 6.5)
|
||||||
{
|
{
|
||||||
if (convertType.HasFlag(PatternType.LowProbability))
|
if (convertType.HasFlagFast(PatternType.LowProbability))
|
||||||
return generateRandomPattern(0.78, 0.42, 0, 0);
|
return generateRandomPattern(0.78, 0.42, 0, 0);
|
||||||
|
|
||||||
return generateRandomPattern(1, 0.62, 0, 0);
|
return generateRandomPattern(1, 0.62, 0, 0);
|
||||||
@ -186,7 +187,7 @@ namespace osu.Game.Rulesets.Mania.Beatmaps.Patterns.Legacy
|
|||||||
|
|
||||||
if (ConversionDifficulty > 4)
|
if (ConversionDifficulty > 4)
|
||||||
{
|
{
|
||||||
if (convertType.HasFlag(PatternType.LowProbability))
|
if (convertType.HasFlagFast(PatternType.LowProbability))
|
||||||
return generateRandomPattern(0.35, 0.08, 0, 0);
|
return generateRandomPattern(0.35, 0.08, 0, 0);
|
||||||
|
|
||||||
return generateRandomPattern(0.52, 0.15, 0, 0);
|
return generateRandomPattern(0.52, 0.15, 0, 0);
|
||||||
@ -194,7 +195,7 @@ namespace osu.Game.Rulesets.Mania.Beatmaps.Patterns.Legacy
|
|||||||
|
|
||||||
if (ConversionDifficulty > 2)
|
if (ConversionDifficulty > 2)
|
||||||
{
|
{
|
||||||
if (convertType.HasFlag(PatternType.LowProbability))
|
if (convertType.HasFlagFast(PatternType.LowProbability))
|
||||||
return generateRandomPattern(0.18, 0, 0, 0);
|
return generateRandomPattern(0.18, 0, 0, 0);
|
||||||
|
|
||||||
return generateRandomPattern(0.45, 0, 0, 0);
|
return generateRandomPattern(0.45, 0, 0, 0);
|
||||||
@ -207,9 +208,9 @@ namespace osu.Game.Rulesets.Mania.Beatmaps.Patterns.Legacy
|
|||||||
|
|
||||||
foreach (var obj in p.HitObjects)
|
foreach (var obj in p.HitObjects)
|
||||||
{
|
{
|
||||||
if (convertType.HasFlag(PatternType.Stair) && obj.Column == TotalColumns - 1)
|
if (convertType.HasFlagFast(PatternType.Stair) && obj.Column == TotalColumns - 1)
|
||||||
StairType = PatternType.ReverseStair;
|
StairType = PatternType.ReverseStair;
|
||||||
if (convertType.HasFlag(PatternType.ReverseStair) && obj.Column == RandomStart)
|
if (convertType.HasFlagFast(PatternType.ReverseStair) && obj.Column == RandomStart)
|
||||||
StairType = PatternType.Stair;
|
StairType = PatternType.Stair;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -229,7 +230,7 @@ namespace osu.Game.Rulesets.Mania.Beatmaps.Patterns.Legacy
|
|||||||
{
|
{
|
||||||
var pattern = new Pattern();
|
var pattern = new Pattern();
|
||||||
|
|
||||||
bool allowStacking = !convertType.HasFlag(PatternType.ForceNotStack);
|
bool allowStacking = !convertType.HasFlagFast(PatternType.ForceNotStack);
|
||||||
|
|
||||||
if (!allowStacking)
|
if (!allowStacking)
|
||||||
noteCount = Math.Min(noteCount, TotalColumns - RandomStart - PreviousPattern.ColumnWithObjects);
|
noteCount = Math.Min(noteCount, TotalColumns - RandomStart - PreviousPattern.ColumnWithObjects);
|
||||||
@ -249,7 +250,7 @@ namespace osu.Game.Rulesets.Mania.Beatmaps.Patterns.Legacy
|
|||||||
|
|
||||||
int getNextColumn(int last)
|
int getNextColumn(int last)
|
||||||
{
|
{
|
||||||
if (convertType.HasFlag(PatternType.Gathered))
|
if (convertType.HasFlagFast(PatternType.Gathered))
|
||||||
{
|
{
|
||||||
last++;
|
last++;
|
||||||
if (last == TotalColumns)
|
if (last == TotalColumns)
|
||||||
@ -296,7 +297,7 @@ namespace osu.Game.Rulesets.Mania.Beatmaps.Patterns.Legacy
|
|||||||
/// <returns>The <see cref="Pattern"/> containing the hit objects.</returns>
|
/// <returns>The <see cref="Pattern"/> containing the hit objects.</returns>
|
||||||
private Pattern generateRandomPatternWithMirrored(double centreProbability, double p2, double p3)
|
private Pattern generateRandomPatternWithMirrored(double centreProbability, double p2, double p3)
|
||||||
{
|
{
|
||||||
if (convertType.HasFlag(PatternType.ForceNotStack))
|
if (convertType.HasFlagFast(PatternType.ForceNotStack))
|
||||||
return generateRandomPattern(1 / 2f + p2 / 2, p2, (p2 + p3) / 2, p3);
|
return generateRandomPattern(1 / 2f + p2 / 2, p2, (p2 + p3) / 2, p3);
|
||||||
|
|
||||||
var pattern = new Pattern();
|
var pattern = new Pattern();
|
||||||
|
@ -9,6 +9,7 @@ using osu.Game.Rulesets.Mods;
|
|||||||
using osu.Game.Rulesets.UI;
|
using osu.Game.Rulesets.UI;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using osu.Framework.Extensions.EnumExtensions;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
using osu.Framework.Input.Bindings;
|
using osu.Framework.Input.Bindings;
|
||||||
@ -59,76 +60,76 @@ namespace osu.Game.Rulesets.Mania
|
|||||||
|
|
||||||
public override IEnumerable<Mod> ConvertFromLegacyMods(LegacyMods mods)
|
public override IEnumerable<Mod> ConvertFromLegacyMods(LegacyMods mods)
|
||||||
{
|
{
|
||||||
if (mods.HasFlag(LegacyMods.Nightcore))
|
if (mods.HasFlagFast(LegacyMods.Nightcore))
|
||||||
yield return new ManiaModNightcore();
|
yield return new ManiaModNightcore();
|
||||||
else if (mods.HasFlag(LegacyMods.DoubleTime))
|
else if (mods.HasFlagFast(LegacyMods.DoubleTime))
|
||||||
yield return new ManiaModDoubleTime();
|
yield return new ManiaModDoubleTime();
|
||||||
|
|
||||||
if (mods.HasFlag(LegacyMods.Perfect))
|
if (mods.HasFlagFast(LegacyMods.Perfect))
|
||||||
yield return new ManiaModPerfect();
|
yield return new ManiaModPerfect();
|
||||||
else if (mods.HasFlag(LegacyMods.SuddenDeath))
|
else if (mods.HasFlagFast(LegacyMods.SuddenDeath))
|
||||||
yield return new ManiaModSuddenDeath();
|
yield return new ManiaModSuddenDeath();
|
||||||
|
|
||||||
if (mods.HasFlag(LegacyMods.Cinema))
|
if (mods.HasFlagFast(LegacyMods.Cinema))
|
||||||
yield return new ManiaModCinema();
|
yield return new ManiaModCinema();
|
||||||
else if (mods.HasFlag(LegacyMods.Autoplay))
|
else if (mods.HasFlagFast(LegacyMods.Autoplay))
|
||||||
yield return new ManiaModAutoplay();
|
yield return new ManiaModAutoplay();
|
||||||
|
|
||||||
if (mods.HasFlag(LegacyMods.Easy))
|
if (mods.HasFlagFast(LegacyMods.Easy))
|
||||||
yield return new ManiaModEasy();
|
yield return new ManiaModEasy();
|
||||||
|
|
||||||
if (mods.HasFlag(LegacyMods.FadeIn))
|
if (mods.HasFlagFast(LegacyMods.FadeIn))
|
||||||
yield return new ManiaModFadeIn();
|
yield return new ManiaModFadeIn();
|
||||||
|
|
||||||
if (mods.HasFlag(LegacyMods.Flashlight))
|
if (mods.HasFlagFast(LegacyMods.Flashlight))
|
||||||
yield return new ManiaModFlashlight();
|
yield return new ManiaModFlashlight();
|
||||||
|
|
||||||
if (mods.HasFlag(LegacyMods.HalfTime))
|
if (mods.HasFlagFast(LegacyMods.HalfTime))
|
||||||
yield return new ManiaModHalfTime();
|
yield return new ManiaModHalfTime();
|
||||||
|
|
||||||
if (mods.HasFlag(LegacyMods.HardRock))
|
if (mods.HasFlagFast(LegacyMods.HardRock))
|
||||||
yield return new ManiaModHardRock();
|
yield return new ManiaModHardRock();
|
||||||
|
|
||||||
if (mods.HasFlag(LegacyMods.Hidden))
|
if (mods.HasFlagFast(LegacyMods.Hidden))
|
||||||
yield return new ManiaModHidden();
|
yield return new ManiaModHidden();
|
||||||
|
|
||||||
if (mods.HasFlag(LegacyMods.Key1))
|
if (mods.HasFlagFast(LegacyMods.Key1))
|
||||||
yield return new ManiaModKey1();
|
yield return new ManiaModKey1();
|
||||||
|
|
||||||
if (mods.HasFlag(LegacyMods.Key2))
|
if (mods.HasFlagFast(LegacyMods.Key2))
|
||||||
yield return new ManiaModKey2();
|
yield return new ManiaModKey2();
|
||||||
|
|
||||||
if (mods.HasFlag(LegacyMods.Key3))
|
if (mods.HasFlagFast(LegacyMods.Key3))
|
||||||
yield return new ManiaModKey3();
|
yield return new ManiaModKey3();
|
||||||
|
|
||||||
if (mods.HasFlag(LegacyMods.Key4))
|
if (mods.HasFlagFast(LegacyMods.Key4))
|
||||||
yield return new ManiaModKey4();
|
yield return new ManiaModKey4();
|
||||||
|
|
||||||
if (mods.HasFlag(LegacyMods.Key5))
|
if (mods.HasFlagFast(LegacyMods.Key5))
|
||||||
yield return new ManiaModKey5();
|
yield return new ManiaModKey5();
|
||||||
|
|
||||||
if (mods.HasFlag(LegacyMods.Key6))
|
if (mods.HasFlagFast(LegacyMods.Key6))
|
||||||
yield return new ManiaModKey6();
|
yield return new ManiaModKey6();
|
||||||
|
|
||||||
if (mods.HasFlag(LegacyMods.Key7))
|
if (mods.HasFlagFast(LegacyMods.Key7))
|
||||||
yield return new ManiaModKey7();
|
yield return new ManiaModKey7();
|
||||||
|
|
||||||
if (mods.HasFlag(LegacyMods.Key8))
|
if (mods.HasFlagFast(LegacyMods.Key8))
|
||||||
yield return new ManiaModKey8();
|
yield return new ManiaModKey8();
|
||||||
|
|
||||||
if (mods.HasFlag(LegacyMods.Key9))
|
if (mods.HasFlagFast(LegacyMods.Key9))
|
||||||
yield return new ManiaModKey9();
|
yield return new ManiaModKey9();
|
||||||
|
|
||||||
if (mods.HasFlag(LegacyMods.KeyCoop))
|
if (mods.HasFlagFast(LegacyMods.KeyCoop))
|
||||||
yield return new ManiaModDualStages();
|
yield return new ManiaModDualStages();
|
||||||
|
|
||||||
if (mods.HasFlag(LegacyMods.NoFail))
|
if (mods.HasFlagFast(LegacyMods.NoFail))
|
||||||
yield return new ManiaModNoFail();
|
yield return new ManiaModNoFail();
|
||||||
|
|
||||||
if (mods.HasFlag(LegacyMods.Random))
|
if (mods.HasFlagFast(LegacyMods.Random))
|
||||||
yield return new ManiaModRandom();
|
yield return new ManiaModRandom();
|
||||||
|
|
||||||
if (mods.HasFlag(LegacyMods.Mirror))
|
if (mods.HasFlagFast(LegacyMods.Mirror))
|
||||||
yield return new ManiaModMirror();
|
yield return new ManiaModMirror();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -29,6 +29,7 @@ using osu.Game.Scoring;
|
|||||||
using osu.Game.Skinning;
|
using osu.Game.Skinning;
|
||||||
using System;
|
using System;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using osu.Framework.Extensions.EnumExtensions;
|
||||||
using osu.Game.Rulesets.Osu.Objects;
|
using osu.Game.Rulesets.Osu.Objects;
|
||||||
using osu.Game.Rulesets.Osu.Skinning.Legacy;
|
using osu.Game.Rulesets.Osu.Skinning.Legacy;
|
||||||
using osu.Game.Rulesets.Osu.Statistics;
|
using osu.Game.Rulesets.Osu.Statistics;
|
||||||
@ -58,52 +59,52 @@ namespace osu.Game.Rulesets.Osu
|
|||||||
|
|
||||||
public override IEnumerable<Mod> ConvertFromLegacyMods(LegacyMods mods)
|
public override IEnumerable<Mod> ConvertFromLegacyMods(LegacyMods mods)
|
||||||
{
|
{
|
||||||
if (mods.HasFlag(LegacyMods.Nightcore))
|
if (mods.HasFlagFast(LegacyMods.Nightcore))
|
||||||
yield return new OsuModNightcore();
|
yield return new OsuModNightcore();
|
||||||
else if (mods.HasFlag(LegacyMods.DoubleTime))
|
else if (mods.HasFlagFast(LegacyMods.DoubleTime))
|
||||||
yield return new OsuModDoubleTime();
|
yield return new OsuModDoubleTime();
|
||||||
|
|
||||||
if (mods.HasFlag(LegacyMods.Perfect))
|
if (mods.HasFlagFast(LegacyMods.Perfect))
|
||||||
yield return new OsuModPerfect();
|
yield return new OsuModPerfect();
|
||||||
else if (mods.HasFlag(LegacyMods.SuddenDeath))
|
else if (mods.HasFlagFast(LegacyMods.SuddenDeath))
|
||||||
yield return new OsuModSuddenDeath();
|
yield return new OsuModSuddenDeath();
|
||||||
|
|
||||||
if (mods.HasFlag(LegacyMods.Autopilot))
|
if (mods.HasFlagFast(LegacyMods.Autopilot))
|
||||||
yield return new OsuModAutopilot();
|
yield return new OsuModAutopilot();
|
||||||
|
|
||||||
if (mods.HasFlag(LegacyMods.Cinema))
|
if (mods.HasFlagFast(LegacyMods.Cinema))
|
||||||
yield return new OsuModCinema();
|
yield return new OsuModCinema();
|
||||||
else if (mods.HasFlag(LegacyMods.Autoplay))
|
else if (mods.HasFlagFast(LegacyMods.Autoplay))
|
||||||
yield return new OsuModAutoplay();
|
yield return new OsuModAutoplay();
|
||||||
|
|
||||||
if (mods.HasFlag(LegacyMods.Easy))
|
if (mods.HasFlagFast(LegacyMods.Easy))
|
||||||
yield return new OsuModEasy();
|
yield return new OsuModEasy();
|
||||||
|
|
||||||
if (mods.HasFlag(LegacyMods.Flashlight))
|
if (mods.HasFlagFast(LegacyMods.Flashlight))
|
||||||
yield return new OsuModFlashlight();
|
yield return new OsuModFlashlight();
|
||||||
|
|
||||||
if (mods.HasFlag(LegacyMods.HalfTime))
|
if (mods.HasFlagFast(LegacyMods.HalfTime))
|
||||||
yield return new OsuModHalfTime();
|
yield return new OsuModHalfTime();
|
||||||
|
|
||||||
if (mods.HasFlag(LegacyMods.HardRock))
|
if (mods.HasFlagFast(LegacyMods.HardRock))
|
||||||
yield return new OsuModHardRock();
|
yield return new OsuModHardRock();
|
||||||
|
|
||||||
if (mods.HasFlag(LegacyMods.Hidden))
|
if (mods.HasFlagFast(LegacyMods.Hidden))
|
||||||
yield return new OsuModHidden();
|
yield return new OsuModHidden();
|
||||||
|
|
||||||
if (mods.HasFlag(LegacyMods.NoFail))
|
if (mods.HasFlagFast(LegacyMods.NoFail))
|
||||||
yield return new OsuModNoFail();
|
yield return new OsuModNoFail();
|
||||||
|
|
||||||
if (mods.HasFlag(LegacyMods.Relax))
|
if (mods.HasFlagFast(LegacyMods.Relax))
|
||||||
yield return new OsuModRelax();
|
yield return new OsuModRelax();
|
||||||
|
|
||||||
if (mods.HasFlag(LegacyMods.SpunOut))
|
if (mods.HasFlagFast(LegacyMods.SpunOut))
|
||||||
yield return new OsuModSpunOut();
|
yield return new OsuModSpunOut();
|
||||||
|
|
||||||
if (mods.HasFlag(LegacyMods.Target))
|
if (mods.HasFlagFast(LegacyMods.Target))
|
||||||
yield return new OsuModTarget();
|
yield return new OsuModTarget();
|
||||||
|
|
||||||
if (mods.HasFlag(LegacyMods.TouchDevice))
|
if (mods.HasFlagFast(LegacyMods.TouchDevice))
|
||||||
yield return new OsuModTouchDevice();
|
yield return new OsuModTouchDevice();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ namespace osu.Game.Rulesets.Osu.Skinning.Default
|
|||||||
|
|
||||||
public string Text
|
public string Text
|
||||||
{
|
{
|
||||||
get => number.Text;
|
get => number.Text.ToString();
|
||||||
set => number.Text = value;
|
set => number.Text = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -22,6 +22,7 @@ using osu.Game.Rulesets.Taiko.Scoring;
|
|||||||
using osu.Game.Scoring;
|
using osu.Game.Scoring;
|
||||||
using System;
|
using System;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using osu.Framework.Extensions.EnumExtensions;
|
||||||
using osu.Game.Rulesets.Edit;
|
using osu.Game.Rulesets.Edit;
|
||||||
using osu.Game.Rulesets.Taiko.Edit;
|
using osu.Game.Rulesets.Taiko.Edit;
|
||||||
using osu.Game.Rulesets.Taiko.Objects;
|
using osu.Game.Rulesets.Taiko.Objects;
|
||||||
@ -57,43 +58,43 @@ namespace osu.Game.Rulesets.Taiko
|
|||||||
|
|
||||||
public override IEnumerable<Mod> ConvertFromLegacyMods(LegacyMods mods)
|
public override IEnumerable<Mod> ConvertFromLegacyMods(LegacyMods mods)
|
||||||
{
|
{
|
||||||
if (mods.HasFlag(LegacyMods.Nightcore))
|
if (mods.HasFlagFast(LegacyMods.Nightcore))
|
||||||
yield return new TaikoModNightcore();
|
yield return new TaikoModNightcore();
|
||||||
else if (mods.HasFlag(LegacyMods.DoubleTime))
|
else if (mods.HasFlagFast(LegacyMods.DoubleTime))
|
||||||
yield return new TaikoModDoubleTime();
|
yield return new TaikoModDoubleTime();
|
||||||
|
|
||||||
if (mods.HasFlag(LegacyMods.Perfect))
|
if (mods.HasFlagFast(LegacyMods.Perfect))
|
||||||
yield return new TaikoModPerfect();
|
yield return new TaikoModPerfect();
|
||||||
else if (mods.HasFlag(LegacyMods.SuddenDeath))
|
else if (mods.HasFlagFast(LegacyMods.SuddenDeath))
|
||||||
yield return new TaikoModSuddenDeath();
|
yield return new TaikoModSuddenDeath();
|
||||||
|
|
||||||
if (mods.HasFlag(LegacyMods.Cinema))
|
if (mods.HasFlagFast(LegacyMods.Cinema))
|
||||||
yield return new TaikoModCinema();
|
yield return new TaikoModCinema();
|
||||||
else if (mods.HasFlag(LegacyMods.Autoplay))
|
else if (mods.HasFlagFast(LegacyMods.Autoplay))
|
||||||
yield return new TaikoModAutoplay();
|
yield return new TaikoModAutoplay();
|
||||||
|
|
||||||
if (mods.HasFlag(LegacyMods.Easy))
|
if (mods.HasFlagFast(LegacyMods.Easy))
|
||||||
yield return new TaikoModEasy();
|
yield return new TaikoModEasy();
|
||||||
|
|
||||||
if (mods.HasFlag(LegacyMods.Flashlight))
|
if (mods.HasFlagFast(LegacyMods.Flashlight))
|
||||||
yield return new TaikoModFlashlight();
|
yield return new TaikoModFlashlight();
|
||||||
|
|
||||||
if (mods.HasFlag(LegacyMods.HalfTime))
|
if (mods.HasFlagFast(LegacyMods.HalfTime))
|
||||||
yield return new TaikoModHalfTime();
|
yield return new TaikoModHalfTime();
|
||||||
|
|
||||||
if (mods.HasFlag(LegacyMods.HardRock))
|
if (mods.HasFlagFast(LegacyMods.HardRock))
|
||||||
yield return new TaikoModHardRock();
|
yield return new TaikoModHardRock();
|
||||||
|
|
||||||
if (mods.HasFlag(LegacyMods.Hidden))
|
if (mods.HasFlagFast(LegacyMods.Hidden))
|
||||||
yield return new TaikoModHidden();
|
yield return new TaikoModHidden();
|
||||||
|
|
||||||
if (mods.HasFlag(LegacyMods.NoFail))
|
if (mods.HasFlagFast(LegacyMods.NoFail))
|
||||||
yield return new TaikoModNoFail();
|
yield return new TaikoModNoFail();
|
||||||
|
|
||||||
if (mods.HasFlag(LegacyMods.Relax))
|
if (mods.HasFlagFast(LegacyMods.Relax))
|
||||||
yield return new TaikoModRelax();
|
yield return new TaikoModRelax();
|
||||||
|
|
||||||
if (mods.HasFlag(LegacyMods.Random))
|
if (mods.HasFlagFast(LegacyMods.Random))
|
||||||
yield return new TaikoModRandom();
|
yield return new TaikoModRandom();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@ namespace osu.Game.Tests.Visual.Ranking
|
|||||||
Beatmap = createTestBeatmap(author)
|
Beatmap = createTestBeatmap(author)
|
||||||
}));
|
}));
|
||||||
|
|
||||||
AddAssert("mapper name present", () => this.ChildrenOfType<OsuSpriteText>().Any(spriteText => spriteText.Text == "mapper_name"));
|
AddAssert("mapper name present", () => this.ChildrenOfType<OsuSpriteText>().Any(spriteText => spriteText.Current.Value == "mapper_name"));
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
@ -49,7 +49,7 @@ namespace osu.Game.Tests.Visual.Ranking
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
AddAssert("mapped by text not present", () =>
|
AddAssert("mapped by text not present", () =>
|
||||||
this.ChildrenOfType<OsuSpriteText>().All(spriteText => !containsAny(spriteText.Text, "mapped", "by")));
|
this.ChildrenOfType<OsuSpriteText>().All(spriteText => !containsAny(spriteText.Current.Value, "mapped", "by")));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void showPanel(ScoreInfo score) => Child = new ExpandedPanelMiddleContentContainer(score);
|
private void showPanel(ScoreInfo score) => Child = new ExpandedPanelMiddleContentContainer(score);
|
||||||
|
@ -78,7 +78,7 @@ namespace osu.Game.Tests.Visual.Settings
|
|||||||
|
|
||||||
clickClearButton();
|
clickClearButton();
|
||||||
|
|
||||||
AddAssert("first binding cleared", () => string.IsNullOrEmpty(multiBindingRow.ChildrenOfType<KeyBindingRow.KeyButton>().First().Text.Text));
|
AddAssert("first binding cleared", () => string.IsNullOrEmpty(multiBindingRow.ChildrenOfType<KeyBindingRow.KeyButton>().First().Text.Text.ToString()));
|
||||||
|
|
||||||
AddStep("click second binding", () =>
|
AddStep("click second binding", () =>
|
||||||
{
|
{
|
||||||
@ -90,7 +90,7 @@ namespace osu.Game.Tests.Visual.Settings
|
|||||||
|
|
||||||
clickClearButton();
|
clickClearButton();
|
||||||
|
|
||||||
AddAssert("second binding cleared", () => string.IsNullOrEmpty(multiBindingRow.ChildrenOfType<KeyBindingRow.KeyButton>().ElementAt(1).Text.Text));
|
AddAssert("second binding cleared", () => string.IsNullOrEmpty(multiBindingRow.ChildrenOfType<KeyBindingRow.KeyButton>().ElementAt(1).Text.Text.ToString()));
|
||||||
|
|
||||||
void clickClearButton()
|
void clickClearButton()
|
||||||
{
|
{
|
||||||
|
@ -103,10 +103,10 @@ namespace osu.Game.Tests.Visual.SongSelect
|
|||||||
|
|
||||||
private void testBeatmapLabels(Ruleset ruleset)
|
private void testBeatmapLabels(Ruleset ruleset)
|
||||||
{
|
{
|
||||||
AddAssert("check version", () => infoWedge.Info.VersionLabel.Text == $"{ruleset.ShortName}Version");
|
AddAssert("check version", () => infoWedge.Info.VersionLabel.Current.Value == $"{ruleset.ShortName}Version");
|
||||||
AddAssert("check title", () => infoWedge.Info.TitleLabel.Text == $"{ruleset.ShortName}Source — {ruleset.ShortName}Title");
|
AddAssert("check title", () => infoWedge.Info.TitleLabel.Current.Value == $"{ruleset.ShortName}Source — {ruleset.ShortName}Title");
|
||||||
AddAssert("check artist", () => infoWedge.Info.ArtistLabel.Text == $"{ruleset.ShortName}Artist");
|
AddAssert("check artist", () => infoWedge.Info.ArtistLabel.Current.Value == $"{ruleset.ShortName}Artist");
|
||||||
AddAssert("check author", () => infoWedge.Info.MapperContainer.Children.OfType<OsuSpriteText>().Any(s => s.Text == $"{ruleset.ShortName}Author"));
|
AddAssert("check author", () => infoWedge.Info.MapperContainer.Children.OfType<OsuSpriteText>().Any(s => s.Current.Value == $"{ruleset.ShortName}Author"));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void testInfoLabels(int expectedCount)
|
private void testInfoLabels(int expectedCount)
|
||||||
@ -119,9 +119,9 @@ namespace osu.Game.Tests.Visual.SongSelect
|
|||||||
public void TestNullBeatmap()
|
public void TestNullBeatmap()
|
||||||
{
|
{
|
||||||
selectBeatmap(null);
|
selectBeatmap(null);
|
||||||
AddAssert("check empty version", () => string.IsNullOrEmpty(infoWedge.Info.VersionLabel.Text));
|
AddAssert("check empty version", () => string.IsNullOrEmpty(infoWedge.Info.VersionLabel.Current.Value));
|
||||||
AddAssert("check default title", () => infoWedge.Info.TitleLabel.Text == Beatmap.Default.BeatmapInfo.Metadata.Title);
|
AddAssert("check default title", () => infoWedge.Info.TitleLabel.Current.Value == Beatmap.Default.BeatmapInfo.Metadata.Title);
|
||||||
AddAssert("check default artist", () => infoWedge.Info.ArtistLabel.Text == Beatmap.Default.BeatmapInfo.Metadata.Artist);
|
AddAssert("check default artist", () => infoWedge.Info.ArtistLabel.Current.Value == Beatmap.Default.BeatmapInfo.Metadata.Artist);
|
||||||
AddAssert("check empty author", () => !infoWedge.Info.MapperContainer.Children.Any());
|
AddAssert("check empty author", () => !infoWedge.Info.MapperContainer.Children.Any());
|
||||||
AddAssert("check no info labels", () => !infoWedge.Info.InfoLabelContainer.Children.Any());
|
AddAssert("check no info labels", () => !infoWedge.Info.InfoLabelContainer.Children.Any());
|
||||||
}
|
}
|
||||||
|
@ -145,7 +145,7 @@ namespace osu.Game.Tests.Visual.UserInterface
|
|||||||
|
|
||||||
AddStep("click delete option", () =>
|
AddStep("click delete option", () =>
|
||||||
{
|
{
|
||||||
InputManager.MoveMouseTo(contextMenuContainer.ChildrenOfType<DrawableOsuMenuItem>().First(i => i.Item.Text.Value.ToLowerInvariant() == "delete"));
|
InputManager.MoveMouseTo(contextMenuContainer.ChildrenOfType<DrawableOsuMenuItem>().First(i => i.Item.Text.Value.ToString().ToLowerInvariant() == "delete"));
|
||||||
InputManager.Click(MouseButton.Left);
|
InputManager.Click(MouseButton.Left);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -76,7 +76,7 @@ namespace osu.Game.Tests.Visual.UserInterface
|
|||||||
var multiplier = mods.Aggregate(1.0, (current, mod) => current * mod.ScoreMultiplier);
|
var multiplier = mods.Aggregate(1.0, (current, mod) => current * mod.ScoreMultiplier);
|
||||||
var expectedValue = multiplier.Equals(1.0) ? string.Empty : $"{multiplier:N2}x";
|
var expectedValue = multiplier.Equals(1.0) ? string.Empty : $"{multiplier:N2}x";
|
||||||
|
|
||||||
return expectedValue == footerButtonMods.MultiplierText.Text;
|
return expectedValue == footerButtonMods.MultiplierText.Current.Value;
|
||||||
}
|
}
|
||||||
|
|
||||||
private class TestFooterButtonMods : FooterButtonMods
|
private class TestFooterButtonMods : FooterButtonMods
|
||||||
|
@ -74,9 +74,9 @@ namespace osu.Game.Tournament.Components
|
|||||||
{
|
{
|
||||||
new TournamentSpriteText
|
new TournamentSpriteText
|
||||||
{
|
{
|
||||||
Text = new LocalisedString((
|
Text = new RomanisableString(
|
||||||
$"{Beatmap.Metadata.ArtistUnicode ?? Beatmap.Metadata.Artist} - {Beatmap.Metadata.TitleUnicode ?? Beatmap.Metadata.Title}",
|
$"{Beatmap.Metadata.ArtistUnicode ?? Beatmap.Metadata.Artist} - {Beatmap.Metadata.TitleUnicode ?? Beatmap.Metadata.Title}",
|
||||||
$"{Beatmap.Metadata.Artist} - {Beatmap.Metadata.Title}")),
|
$"{Beatmap.Metadata.Artist} - {Beatmap.Metadata.Title}"),
|
||||||
Font = OsuFont.Torus.With(weight: FontWeight.Bold),
|
Font = OsuFont.Torus.With(weight: FontWeight.Bold),
|
||||||
},
|
},
|
||||||
new FillFlowContainer
|
new FillFlowContainer
|
||||||
|
@ -6,6 +6,7 @@ using System.Collections.Generic;
|
|||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using osu.Framework.Extensions;
|
using osu.Framework.Extensions;
|
||||||
|
using osu.Framework.Extensions.EnumExtensions;
|
||||||
using osu.Game.Beatmaps.ControlPoints;
|
using osu.Game.Beatmaps.ControlPoints;
|
||||||
using osu.Game.Beatmaps.Legacy;
|
using osu.Game.Beatmaps.Legacy;
|
||||||
using osu.Game.Beatmaps.Timing;
|
using osu.Game.Beatmaps.Timing;
|
||||||
@ -348,8 +349,8 @@ namespace osu.Game.Beatmaps.Formats
|
|||||||
if (split.Length >= 8)
|
if (split.Length >= 8)
|
||||||
{
|
{
|
||||||
LegacyEffectFlags effectFlags = (LegacyEffectFlags)Parsing.ParseInt(split[7]);
|
LegacyEffectFlags effectFlags = (LegacyEffectFlags)Parsing.ParseInt(split[7]);
|
||||||
kiaiMode = effectFlags.HasFlag(LegacyEffectFlags.Kiai);
|
kiaiMode = effectFlags.HasFlagFast(LegacyEffectFlags.Kiai);
|
||||||
omitFirstBarSignature = effectFlags.HasFlag(LegacyEffectFlags.OmitFirstBarLine);
|
omitFirstBarSignature = effectFlags.HasFlagFast(LegacyEffectFlags.OmitFirstBarLine);
|
||||||
}
|
}
|
||||||
|
|
||||||
string stringSampleSet = sampleSet.ToString().ToLowerInvariant();
|
string stringSampleSet = sampleSet.ToString().ToLowerInvariant();
|
||||||
|
@ -11,6 +11,7 @@ using osu.Framework.Graphics;
|
|||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
using osu.Framework.Graphics.UserInterface;
|
using osu.Framework.Graphics.UserInterface;
|
||||||
using osu.Framework.Input.Events;
|
using osu.Framework.Input.Events;
|
||||||
|
using osu.Framework.Localisation;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
using osu.Game.Graphics.Containers;
|
using osu.Game.Graphics.Containers;
|
||||||
@ -121,7 +122,7 @@ namespace osu.Game.Collections
|
|||||||
Current.TriggerChange();
|
Current.TriggerChange();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override string GenerateItemText(CollectionFilterMenuItem item) => item.CollectionName.Value;
|
protected override LocalisableString GenerateItemText(CollectionFilterMenuItem item) => item.CollectionName.Value;
|
||||||
|
|
||||||
protected sealed override DropdownHeader CreateHeader() => CreateCollectionHeader().With(d =>
|
protected sealed override DropdownHeader CreateHeader() => CreateCollectionHeader().With(d =>
|
||||||
{
|
{
|
||||||
@ -139,7 +140,7 @@ namespace osu.Game.Collections
|
|||||||
public readonly Bindable<CollectionFilterMenuItem> SelectedItem = new Bindable<CollectionFilterMenuItem>();
|
public readonly Bindable<CollectionFilterMenuItem> SelectedItem = new Bindable<CollectionFilterMenuItem>();
|
||||||
private readonly Bindable<string> collectionName = new Bindable<string>();
|
private readonly Bindable<string> collectionName = new Bindable<string>();
|
||||||
|
|
||||||
protected override string Label
|
protected override LocalisableString Label
|
||||||
{
|
{
|
||||||
get => base.Label;
|
get => base.Label;
|
||||||
set { } // See updateText().
|
set { } // See updateText().
|
||||||
|
@ -8,6 +8,7 @@ using System.Reflection;
|
|||||||
using JetBrains.Annotations;
|
using JetBrains.Annotations;
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
|
using osu.Framework.Localisation;
|
||||||
using osu.Game.Overlays.Settings;
|
using osu.Game.Overlays.Settings;
|
||||||
|
|
||||||
namespace osu.Game.Configuration
|
namespace osu.Game.Configuration
|
||||||
@ -24,7 +25,7 @@ namespace osu.Game.Configuration
|
|||||||
[AttributeUsage(AttributeTargets.Property)]
|
[AttributeUsage(AttributeTargets.Property)]
|
||||||
public class SettingSourceAttribute : Attribute
|
public class SettingSourceAttribute : Attribute
|
||||||
{
|
{
|
||||||
public string Label { get; }
|
public LocalisableString Label { get; }
|
||||||
|
|
||||||
public string Description { get; }
|
public string Description { get; }
|
||||||
|
|
||||||
|
@ -6,6 +6,7 @@ using osu.Framework.Graphics;
|
|||||||
using osu.Framework.Graphics.Colour;
|
using osu.Framework.Graphics.Colour;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
|
using osu.Framework.Localisation;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
|
|
||||||
namespace osu.Game.Graphics.Sprites
|
namespace osu.Game.Graphics.Sprites
|
||||||
@ -14,7 +15,7 @@ namespace osu.Game.Graphics.Sprites
|
|||||||
{
|
{
|
||||||
private readonly OsuSpriteText spriteText, blurredText;
|
private readonly OsuSpriteText spriteText, blurredText;
|
||||||
|
|
||||||
public string Text
|
public LocalisableString Text
|
||||||
{
|
{
|
||||||
get => spriteText.Text;
|
get => spriteText.Text;
|
||||||
set => blurredText.Text = spriteText.Text = value;
|
set => blurredText.Text = spriteText.Text = value;
|
||||||
|
@ -6,6 +6,7 @@ using osu.Framework.Graphics;
|
|||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using osu.Framework.Extensions.EnumExtensions;
|
||||||
|
|
||||||
namespace osu.Game.Graphics.UserInterface
|
namespace osu.Game.Graphics.UserInterface
|
||||||
{
|
{
|
||||||
@ -24,11 +25,11 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
set
|
set
|
||||||
{
|
{
|
||||||
direction = value;
|
direction = value;
|
||||||
base.Direction = direction.HasFlag(BarDirection.Horizontal) ? FillDirection.Vertical : FillDirection.Horizontal;
|
base.Direction = direction.HasFlagFast(BarDirection.Horizontal) ? FillDirection.Vertical : FillDirection.Horizontal;
|
||||||
|
|
||||||
foreach (var bar in Children)
|
foreach (var bar in Children)
|
||||||
{
|
{
|
||||||
bar.Size = direction.HasFlag(BarDirection.Horizontal) ? new Vector2(1, 1.0f / Children.Count) : new Vector2(1.0f / Children.Count, 1);
|
bar.Size = direction.HasFlagFast(BarDirection.Horizontal) ? new Vector2(1, 1.0f / Children.Count) : new Vector2(1.0f / Children.Count, 1);
|
||||||
bar.Direction = direction;
|
bar.Direction = direction;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -56,14 +57,14 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
if (bar.Bar != null)
|
if (bar.Bar != null)
|
||||||
{
|
{
|
||||||
bar.Bar.Length = length;
|
bar.Bar.Length = length;
|
||||||
bar.Bar.Size = direction.HasFlag(BarDirection.Horizontal) ? new Vector2(1, size) : new Vector2(size, 1);
|
bar.Bar.Size = direction.HasFlagFast(BarDirection.Horizontal) ? new Vector2(1, size) : new Vector2(size, 1);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Add(new Bar
|
Add(new Bar
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Size = direction.HasFlag(BarDirection.Horizontal) ? new Vector2(1, size) : new Vector2(size, 1),
|
Size = direction.HasFlagFast(BarDirection.Horizontal) ? new Vector2(1, size) : new Vector2(size, 1),
|
||||||
Length = length,
|
Length = length,
|
||||||
Direction = Direction,
|
Direction = Direction,
|
||||||
});
|
});
|
||||||
|
@ -10,6 +10,7 @@ using osu.Framework.Graphics.Containers;
|
|||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
using osu.Framework.Graphics.UserInterface;
|
using osu.Framework.Graphics.UserInterface;
|
||||||
using osu.Framework.Input.Events;
|
using osu.Framework.Input.Events;
|
||||||
|
using osu.Framework.Localisation;
|
||||||
using osu.Game.Graphics.Sprites;
|
using osu.Game.Graphics.Sprites;
|
||||||
using osuTK.Graphics;
|
using osuTK.Graphics;
|
||||||
|
|
||||||
@ -105,7 +106,7 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
|
|
||||||
protected class TextContainer : Container, IHasText
|
protected class TextContainer : Container, IHasText
|
||||||
{
|
{
|
||||||
public string Text
|
public LocalisableString Text
|
||||||
{
|
{
|
||||||
get => NormalText.Text;
|
get => NormalText.Text;
|
||||||
set
|
set
|
||||||
|
@ -11,6 +11,7 @@ using osu.Framework.Graphics.Shapes;
|
|||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
using osu.Framework.Graphics.UserInterface;
|
using osu.Framework.Graphics.UserInterface;
|
||||||
using osu.Framework.Input.Events;
|
using osu.Framework.Input.Events;
|
||||||
|
using osu.Framework.Localisation;
|
||||||
using osu.Game.Graphics.Sprites;
|
using osu.Game.Graphics.Sprites;
|
||||||
using osuTK.Graphics;
|
using osuTK.Graphics;
|
||||||
|
|
||||||
@ -21,9 +22,9 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public class OsuButton : Button
|
public class OsuButton : Button
|
||||||
{
|
{
|
||||||
public string Text
|
public LocalisableString Text
|
||||||
{
|
{
|
||||||
get => SpriteText?.Text;
|
get => SpriteText?.Text ?? default;
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
if (SpriteText != null)
|
if (SpriteText != null)
|
||||||
|
@ -9,6 +9,7 @@ using osu.Framework.Graphics;
|
|||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
using osu.Framework.Graphics.UserInterface;
|
using osu.Framework.Graphics.UserInterface;
|
||||||
|
using osu.Framework.Localisation;
|
||||||
using osu.Game.Graphics.Containers;
|
using osu.Game.Graphics.Containers;
|
||||||
using osu.Game.Graphics.Sprites;
|
using osu.Game.Graphics.Sprites;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
@ -168,7 +169,7 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
|
|
||||||
protected new class Content : FillFlowContainer, IHasText
|
protected new class Content : FillFlowContainer, IHasText
|
||||||
{
|
{
|
||||||
public string Text
|
public LocalisableString Text
|
||||||
{
|
{
|
||||||
get => Label.Text;
|
get => Label.Text;
|
||||||
set => Label.Text = value;
|
set => Label.Text = value;
|
||||||
@ -215,7 +216,7 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
{
|
{
|
||||||
protected readonly SpriteText Text;
|
protected readonly SpriteText Text;
|
||||||
|
|
||||||
protected override string Label
|
protected override LocalisableString Label
|
||||||
{
|
{
|
||||||
get => Text.Text;
|
get => Text.Text;
|
||||||
set => Text.Text = value;
|
set => Text.Text = value;
|
||||||
|
@ -11,6 +11,7 @@ using osu.Game.Graphics.Sprites;
|
|||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
using osu.Framework.Graphics.UserInterface;
|
using osu.Framework.Graphics.UserInterface;
|
||||||
using osu.Framework.Input.Events;
|
using osu.Framework.Input.Events;
|
||||||
|
using osu.Framework.Localisation;
|
||||||
|
|
||||||
namespace osu.Game.Graphics.UserInterface
|
namespace osu.Game.Graphics.UserInterface
|
||||||
{
|
{
|
||||||
@ -35,7 +36,7 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public string Text
|
public LocalisableString Text
|
||||||
{
|
{
|
||||||
get => text.Text;
|
get => text.Text;
|
||||||
set => text.Text = value;
|
set => text.Text = value;
|
||||||
|
@ -11,6 +11,7 @@ using osu.Game.Graphics.Sprites;
|
|||||||
using osu.Game.Overlays;
|
using osu.Game.Overlays;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using osu.Framework.Localisation;
|
||||||
|
|
||||||
namespace osu.Game.Graphics.UserInterface
|
namespace osu.Game.Graphics.UserInterface
|
||||||
{
|
{
|
||||||
@ -18,7 +19,7 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
{
|
{
|
||||||
private const int duration = 200;
|
private const int duration = 200;
|
||||||
|
|
||||||
public string Text
|
public LocalisableString Text
|
||||||
{
|
{
|
||||||
get => text.Text;
|
get => text.Text;
|
||||||
set => text.Text = value;
|
set => text.Text = value;
|
||||||
|
@ -27,7 +27,7 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual IEnumerable<string> FilterTerms => new[] { Text };
|
public virtual IEnumerable<string> FilterTerms => new[] { Text.ToString() };
|
||||||
|
|
||||||
public bool MatchingFilter
|
public bool MatchingFilter
|
||||||
{
|
{
|
||||||
|
@ -12,6 +12,7 @@ using osu.Game.Graphics.Containers;
|
|||||||
using osu.Game.Beatmaps.ControlPoints;
|
using osu.Game.Beatmaps.ControlPoints;
|
||||||
using osu.Framework.Audio.Track;
|
using osu.Framework.Audio.Track;
|
||||||
using System;
|
using System;
|
||||||
|
using osu.Framework.Extensions.EnumExtensions;
|
||||||
using osu.Framework.Graphics.Effects;
|
using osu.Framework.Graphics.Effects;
|
||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
using osu.Framework.Input.Events;
|
using osu.Framework.Input.Events;
|
||||||
@ -56,15 +57,15 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
set
|
set
|
||||||
{
|
{
|
||||||
base.Origin = value;
|
base.Origin = value;
|
||||||
c1.Origin = c1.Anchor = value.HasFlag(Anchor.x2) ? Anchor.TopLeft : Anchor.TopRight;
|
c1.Origin = c1.Anchor = value.HasFlagFast(Anchor.x2) ? Anchor.TopLeft : Anchor.TopRight;
|
||||||
c2.Origin = c2.Anchor = value.HasFlag(Anchor.x2) ? Anchor.TopRight : Anchor.TopLeft;
|
c2.Origin = c2.Anchor = value.HasFlagFast(Anchor.x2) ? Anchor.TopRight : Anchor.TopLeft;
|
||||||
|
|
||||||
X = value.HasFlag(Anchor.x2) ? SIZE_RETRACTED.X * shear.X * 0.5f : 0;
|
X = value.HasFlagFast(Anchor.x2) ? SIZE_RETRACTED.X * shear.X * 0.5f : 0;
|
||||||
|
|
||||||
Remove(c1);
|
Remove(c1);
|
||||||
Remove(c2);
|
Remove(c2);
|
||||||
c1.Depth = value.HasFlag(Anchor.x2) ? 0 : 1;
|
c1.Depth = value.HasFlagFast(Anchor.x2) ? 0 : 1;
|
||||||
c2.Depth = value.HasFlag(Anchor.x2) ? 1 : 0;
|
c2.Depth = value.HasFlagFast(Anchor.x2) ? 1 : 0;
|
||||||
Add(c1);
|
Add(c1);
|
||||||
Add(c2);
|
Add(c2);
|
||||||
}
|
}
|
||||||
|
@ -84,14 +84,14 @@ namespace osu.Game.Overlays.BeatmapListing.Panels
|
|||||||
{
|
{
|
||||||
new OsuSpriteText
|
new OsuSpriteText
|
||||||
{
|
{
|
||||||
Text = new LocalisedString((SetInfo.Metadata.TitleUnicode, SetInfo.Metadata.Title)),
|
Text = new RomanisableString(SetInfo.Metadata.TitleUnicode, SetInfo.Metadata.Title),
|
||||||
Font = OsuFont.GetFont(size: 18, weight: FontWeight.Bold, italics: true)
|
Font = OsuFont.GetFont(size: 18, weight: FontWeight.Bold, italics: true)
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
new OsuSpriteText
|
new OsuSpriteText
|
||||||
{
|
{
|
||||||
Text = new LocalisedString((SetInfo.Metadata.ArtistUnicode, SetInfo.Metadata.Artist)),
|
Text = new RomanisableString(SetInfo.Metadata.ArtistUnicode, SetInfo.Metadata.Artist),
|
||||||
Font = OsuFont.GetFont(weight: FontWeight.Bold, italics: true)
|
Font = OsuFont.GetFont(weight: FontWeight.Bold, italics: true)
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -107,14 +107,14 @@ namespace osu.Game.Overlays.BeatmapListing.Panels
|
|||||||
{
|
{
|
||||||
new OsuSpriteText
|
new OsuSpriteText
|
||||||
{
|
{
|
||||||
Text = new LocalisedString((SetInfo.Metadata.TitleUnicode, SetInfo.Metadata.Title)),
|
Text = new RomanisableString(SetInfo.Metadata.TitleUnicode, SetInfo.Metadata.Title),
|
||||||
Font = OsuFont.GetFont(size: 18, weight: FontWeight.Bold, italics: true)
|
Font = OsuFont.GetFont(size: 18, weight: FontWeight.Bold, italics: true)
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
new OsuSpriteText
|
new OsuSpriteText
|
||||||
{
|
{
|
||||||
Text = new LocalisedString((SetInfo.Metadata.ArtistUnicode, SetInfo.Metadata.Artist)),
|
Text = new RomanisableString(SetInfo.Metadata.ArtistUnicode, SetInfo.Metadata.Artist),
|
||||||
Font = OsuFont.GetFont(weight: FontWeight.Bold, italics: true)
|
Font = OsuFont.GetFont(weight: FontWeight.Bold, italics: true)
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -8,6 +8,7 @@ using osu.Framework.Graphics;
|
|||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.Cursor;
|
using osu.Framework.Graphics.Cursor;
|
||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
|
using osu.Framework.Localisation;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
using osu.Game.Graphics.Sprites;
|
using osu.Game.Graphics.Sprites;
|
||||||
@ -96,7 +97,7 @@ namespace osu.Game.Overlays.BeatmapSet
|
|||||||
|
|
||||||
public string TooltipText { get; }
|
public string TooltipText { get; }
|
||||||
|
|
||||||
public string Value
|
public LocalisableString Value
|
||||||
{
|
{
|
||||||
get => value.Text;
|
get => value.Text;
|
||||||
set => this.value.Text = value;
|
set => this.value.Text = value;
|
||||||
|
@ -9,7 +9,6 @@ using osu.Framework.Graphics;
|
|||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
using osu.Framework.Localisation;
|
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
using osu.Game.Graphics.Sprites;
|
using osu.Game.Graphics.Sprites;
|
||||||
@ -204,7 +203,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
|
|||||||
this.text = text;
|
this.text = text;
|
||||||
}
|
}
|
||||||
|
|
||||||
public LocalisedString Text
|
public string Text
|
||||||
{
|
{
|
||||||
set => text.Text = value;
|
set => text.Text = value;
|
||||||
}
|
}
|
||||||
|
@ -4,19 +4,17 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using osuTK;
|
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
using osu.Game.Graphics.Sprites;
|
using osu.Game.Graphics.Sprites;
|
||||||
using osu.Game.Online.Chat;
|
using osu.Game.Online.Chat;
|
||||||
|
using osuTK;
|
||||||
|
|
||||||
namespace osu.Game.Overlays.Chat.Selection
|
namespace osu.Game.Overlays.Chat.Selection
|
||||||
{
|
{
|
||||||
public class ChannelSection : Container, IHasFilterableChildren
|
public class ChannelSection : Container, IHasFilterableChildren
|
||||||
{
|
{
|
||||||
private readonly OsuSpriteText header;
|
|
||||||
|
|
||||||
public readonly FillFlowContainer<ChannelListItem> ChannelFlow;
|
public readonly FillFlowContainer<ChannelListItem> ChannelFlow;
|
||||||
|
|
||||||
public IEnumerable<IFilterable> FilterableChildren => ChannelFlow.Children;
|
public IEnumerable<IFilterable> FilterableChildren => ChannelFlow.Children;
|
||||||
@ -29,12 +27,6 @@ namespace osu.Game.Overlays.Chat.Selection
|
|||||||
|
|
||||||
public bool FilteringActive { get; set; }
|
public bool FilteringActive { get; set; }
|
||||||
|
|
||||||
public string Header
|
|
||||||
{
|
|
||||||
get => header.Text;
|
|
||||||
set => header.Text = value.ToUpperInvariant();
|
|
||||||
}
|
|
||||||
|
|
||||||
public IEnumerable<Channel> Channels
|
public IEnumerable<Channel> Channels
|
||||||
{
|
{
|
||||||
set => ChannelFlow.ChildrenEnumerable = value.Select(c => new ChannelListItem(c));
|
set => ChannelFlow.ChildrenEnumerable = value.Select(c => new ChannelListItem(c));
|
||||||
@ -47,9 +39,10 @@ namespace osu.Game.Overlays.Chat.Selection
|
|||||||
|
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
header = new OsuSpriteText
|
new OsuSpriteText
|
||||||
{
|
{
|
||||||
Font = OsuFont.GetFont(size: 15, weight: FontWeight.Bold),
|
Font = OsuFont.GetFont(size: 15, weight: FontWeight.Bold),
|
||||||
|
Text = "All Channels".ToUpperInvariant()
|
||||||
},
|
},
|
||||||
ChannelFlow = new FillFlowContainer<ChannelListItem>
|
ChannelFlow = new FillFlowContainer<ChannelListItem>
|
||||||
{
|
{
|
||||||
|
@ -131,11 +131,7 @@ namespace osu.Game.Overlays.Chat.Selection
|
|||||||
{
|
{
|
||||||
sectionsFlow.ChildrenEnumerable = new[]
|
sectionsFlow.ChildrenEnumerable = new[]
|
||||||
{
|
{
|
||||||
new ChannelSection
|
new ChannelSection { Channels = channels, },
|
||||||
{
|
|
||||||
Header = "All Channels",
|
|
||||||
Channels = channels,
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
|
|
||||||
foreach (ChannelSection s in sectionsFlow.Children)
|
foreach (ChannelSection s in sectionsFlow.Children)
|
||||||
|
@ -6,6 +6,7 @@ using osu.Framework.Graphics;
|
|||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
using osu.Framework.Input.Events;
|
using osu.Framework.Input.Events;
|
||||||
|
using osu.Framework.Localisation;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
using osu.Game.Graphics.Sprites;
|
using osu.Game.Graphics.Sprites;
|
||||||
using osu.Game.Graphics.UserInterface;
|
using osu.Game.Graphics.UserInterface;
|
||||||
@ -16,7 +17,7 @@ namespace osu.Game.Overlays.Comments.Buttons
|
|||||||
{
|
{
|
||||||
public abstract class CommentRepliesButton : CompositeDrawable
|
public abstract class CommentRepliesButton : CompositeDrawable
|
||||||
{
|
{
|
||||||
protected string Text
|
protected LocalisableString Text
|
||||||
{
|
{
|
||||||
get => text.Text;
|
get => text.Text;
|
||||||
set => text.Text = value;
|
set => text.Text = value;
|
||||||
|
@ -51,7 +51,7 @@ namespace osu.Game.Overlays.KeyBinding
|
|||||||
private FillFlowContainer cancelAndClearButtons;
|
private FillFlowContainer cancelAndClearButtons;
|
||||||
private FillFlowContainer<KeyButton> buttons;
|
private FillFlowContainer<KeyButton> buttons;
|
||||||
|
|
||||||
public IEnumerable<string> FilterTerms => bindings.Select(b => b.KeyCombination.ReadableString()).Prepend((string)text.Text);
|
public IEnumerable<string> FilterTerms => bindings.Select(b => b.KeyCombination.ReadableString()).Prepend(text.Text.ToString());
|
||||||
|
|
||||||
public KeyBindingRow(object action, IEnumerable<Framework.Input.Bindings.KeyBinding> bindings)
|
public KeyBindingRow(object action, IEnumerable<Framework.Input.Bindings.KeyBinding> bindings)
|
||||||
{
|
{
|
||||||
|
@ -48,8 +48,8 @@ namespace osu.Game.Overlays.Music
|
|||||||
artistColour = colours.Gray9;
|
artistColour = colours.Gray9;
|
||||||
HandleColour = colours.Gray5;
|
HandleColour = colours.Gray5;
|
||||||
|
|
||||||
title = localisation.GetLocalisedString(new LocalisedString((Model.Metadata.TitleUnicode, Model.Metadata.Title)));
|
title = localisation.GetLocalisedString(new RomanisableString(Model.Metadata.TitleUnicode, Model.Metadata.Title));
|
||||||
artist = localisation.GetLocalisedString(new LocalisedString((Model.Metadata.ArtistUnicode, Model.Metadata.Artist)));
|
artist = localisation.GetLocalisedString(new RomanisableString(Model.Metadata.ArtistUnicode, Model.Metadata.Artist));
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void LoadComplete()
|
protected override void LoadComplete()
|
||||||
|
@ -8,6 +8,7 @@ using osu.Framework.Allocation;
|
|||||||
using osu.Framework.Extensions.IEnumerableExtensions;
|
using osu.Framework.Extensions.IEnumerableExtensions;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
|
using osu.Framework.Localisation;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
using osu.Game.Graphics.Sprites;
|
using osu.Game.Graphics.Sprites;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
@ -37,7 +38,7 @@ namespace osu.Game.Overlays.Notifications
|
|||||||
|
|
||||||
public NotificationSection(string title, string clearButtonText)
|
public NotificationSection(string title, string clearButtonText)
|
||||||
{
|
{
|
||||||
this.clearButtonText = clearButtonText;
|
this.clearButtonText = clearButtonText.ToUpperInvariant();
|
||||||
titleText = title;
|
titleText = title;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -138,10 +139,10 @@ namespace osu.Game.Overlays.Notifications
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public string Text
|
public LocalisableString Text
|
||||||
{
|
{
|
||||||
get => text.Text;
|
get => text.Text;
|
||||||
set => text.Text = value.ToUpperInvariant();
|
set => text.Text = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -293,8 +293,8 @@ namespace osu.Game.Overlays
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
BeatmapMetadata metadata = beatmap.Metadata;
|
BeatmapMetadata metadata = beatmap.Metadata;
|
||||||
title.Text = new LocalisedString((metadata.TitleUnicode, metadata.Title));
|
title.Text = new RomanisableString(metadata.TitleUnicode, metadata.Title);
|
||||||
artist.Text = new LocalisedString((metadata.ArtistUnicode, metadata.Artist));
|
artist.Text = new RomanisableString(metadata.ArtistUnicode, metadata.Artist);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -17,6 +17,7 @@ using osu.Game.Overlays.Comments;
|
|||||||
using JetBrains.Annotations;
|
using JetBrains.Annotations;
|
||||||
using System;
|
using System;
|
||||||
using osu.Framework.Extensions;
|
using osu.Framework.Extensions;
|
||||||
|
using osu.Framework.Localisation;
|
||||||
|
|
||||||
namespace osu.Game.Overlays
|
namespace osu.Game.Overlays
|
||||||
{
|
{
|
||||||
@ -30,7 +31,7 @@ namespace osu.Game.Overlays
|
|||||||
set => current.Current = value;
|
set => current.Current = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public string Title
|
public LocalisableString Title
|
||||||
{
|
{
|
||||||
get => text.Text;
|
get => text.Text;
|
||||||
set => text.Text = value;
|
set => text.Text = value;
|
||||||
|
@ -5,7 +5,6 @@ using osu.Framework.Allocation;
|
|||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
using osu.Framework.Localisation;
|
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Beatmaps.Drawables;
|
using osu.Game.Beatmaps.Drawables;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
@ -13,6 +12,7 @@ using osu.Game.Graphics.Containers;
|
|||||||
using osu.Game.Graphics.Sprites;
|
using osu.Game.Graphics.Sprites;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
using osu.Framework.Graphics.Cursor;
|
using osu.Framework.Graphics.Cursor;
|
||||||
|
using osu.Framework.Localisation;
|
||||||
|
|
||||||
namespace osu.Game.Overlays.Profile.Sections.Historical
|
namespace osu.Game.Overlays.Profile.Sections.Historical
|
||||||
{
|
{
|
||||||
@ -129,14 +129,14 @@ namespace osu.Game.Overlays.Profile.Sections.Historical
|
|||||||
{
|
{
|
||||||
new OsuSpriteText
|
new OsuSpriteText
|
||||||
{
|
{
|
||||||
Text = new LocalisedString((
|
Text = new RomanisableString(
|
||||||
$"{beatmap.Metadata.TitleUnicode ?? beatmap.Metadata.Title} [{beatmap.Version}] ",
|
$"{beatmap.Metadata.TitleUnicode ?? beatmap.Metadata.Title} [{beatmap.Version}] ",
|
||||||
$"{beatmap.Metadata.Title ?? beatmap.Metadata.TitleUnicode} [{beatmap.Version}] ")),
|
$"{beatmap.Metadata.Title ?? beatmap.Metadata.TitleUnicode} [{beatmap.Version}] "),
|
||||||
Font = OsuFont.GetFont(weight: FontWeight.Bold)
|
Font = OsuFont.GetFont(weight: FontWeight.Bold)
|
||||||
},
|
},
|
||||||
new OsuSpriteText
|
new OsuSpriteText
|
||||||
{
|
{
|
||||||
Text = "by " + new LocalisedString((beatmap.Metadata.ArtistUnicode, beatmap.Metadata.Artist)),
|
Text = "by " + new RomanisableString(beatmap.Metadata.ArtistUnicode, beatmap.Metadata.Artist),
|
||||||
Font = OsuFont.GetFont(weight: FontWeight.Regular)
|
Font = OsuFont.GetFont(weight: FontWeight.Regular)
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
@ -256,16 +256,16 @@ namespace osu.Game.Overlays.Profile.Sections.Ranks
|
|||||||
{
|
{
|
||||||
Anchor = Anchor.BottomLeft,
|
Anchor = Anchor.BottomLeft,
|
||||||
Origin = Anchor.BottomLeft,
|
Origin = Anchor.BottomLeft,
|
||||||
Text = new LocalisedString((
|
Text = new RomanisableString(
|
||||||
$"{beatmap.Metadata.TitleUnicode ?? beatmap.Metadata.Title} ",
|
$"{beatmap.Metadata.TitleUnicode ?? beatmap.Metadata.Title} ",
|
||||||
$"{beatmap.Metadata.Title ?? beatmap.Metadata.TitleUnicode} ")),
|
$"{beatmap.Metadata.Title ?? beatmap.Metadata.TitleUnicode} "),
|
||||||
Font = OsuFont.GetFont(size: 14, weight: FontWeight.SemiBold, italics: true)
|
Font = OsuFont.GetFont(size: 14, weight: FontWeight.SemiBold, italics: true)
|
||||||
},
|
},
|
||||||
new OsuSpriteText
|
new OsuSpriteText
|
||||||
{
|
{
|
||||||
Anchor = Anchor.BottomLeft,
|
Anchor = Anchor.BottomLeft,
|
||||||
Origin = Anchor.BottomLeft,
|
Origin = Anchor.BottomLeft,
|
||||||
Text = "by " + new LocalisedString((beatmap.Metadata.ArtistUnicode, beatmap.Metadata.Artist)),
|
Text = "by " + new RomanisableString(beatmap.Metadata.ArtistUnicode, beatmap.Metadata.Artist),
|
||||||
Font = OsuFont.GetFont(size: 12, italics: true)
|
Font = OsuFont.GetFont(size: 12, italics: true)
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
@ -6,6 +6,7 @@ using osu.Framework.Audio;
|
|||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using osu.Framework.Localisation;
|
||||||
using osu.Game.Graphics.UserInterface;
|
using osu.Game.Graphics.UserInterface;
|
||||||
|
|
||||||
namespace osu.Game.Overlays.Settings.Sections.Audio
|
namespace osu.Game.Overlays.Settings.Sections.Audio
|
||||||
@ -76,7 +77,7 @@ namespace osu.Game.Overlays.Settings.Sections.Audio
|
|||||||
|
|
||||||
private class AudioDeviceDropdownControl : DropdownControl
|
private class AudioDeviceDropdownControl : DropdownControl
|
||||||
{
|
{
|
||||||
protected override string GenerateItemText(string item)
|
protected override LocalisableString GenerateItemText(string item)
|
||||||
=> string.IsNullOrEmpty(item) ? "Default" : base.GenerateItemText(item);
|
=> string.IsNullOrEmpty(item) ? "Default" : base.GenerateItemText(item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,6 +11,7 @@ using osu.Framework.Extensions.IEnumerableExtensions;
|
|||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
|
using osu.Framework.Localisation;
|
||||||
using osu.Framework.Platform;
|
using osu.Framework.Platform;
|
||||||
using osu.Game.Configuration;
|
using osu.Game.Configuration;
|
||||||
using osu.Game.Graphics.Containers;
|
using osu.Game.Graphics.Containers;
|
||||||
@ -234,7 +235,7 @@ namespace osu.Game.Overlays.Settings.Sections.Graphics
|
|||||||
|
|
||||||
private class ResolutionDropdownControl : DropdownControl
|
private class ResolutionDropdownControl : DropdownControl
|
||||||
{
|
{
|
||||||
protected override string GenerateItemText(Size item)
|
protected override LocalisableString GenerateItemText(Size item)
|
||||||
{
|
{
|
||||||
if (item == new Size(9999, 9999))
|
if (item == new Size(9999, 9999))
|
||||||
return "Default";
|
return "Default";
|
||||||
|
@ -8,6 +8,7 @@ using osu.Framework.Allocation;
|
|||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
|
using osu.Framework.Localisation;
|
||||||
using osu.Framework.Logging;
|
using osu.Framework.Logging;
|
||||||
using osu.Game.Configuration;
|
using osu.Game.Configuration;
|
||||||
using osu.Game.Graphics.UserInterface;
|
using osu.Game.Graphics.UserInterface;
|
||||||
@ -178,7 +179,7 @@ namespace osu.Game.Overlays.Settings.Sections
|
|||||||
|
|
||||||
private class SkinDropdownControl : DropdownControl
|
private class SkinDropdownControl : DropdownControl
|
||||||
{
|
{
|
||||||
protected override string GenerateItemText(SkinInfo item) => item.ToString();
|
protected override LocalisableString GenerateItemText(SkinInfo item) => item.ToString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,20 +2,22 @@
|
|||||||
// 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.Localisation;
|
||||||
using osu.Game.Graphics.UserInterface;
|
using osu.Game.Graphics.UserInterface;
|
||||||
|
|
||||||
namespace osu.Game.Overlays.Settings
|
namespace osu.Game.Overlays.Settings
|
||||||
{
|
{
|
||||||
public class SettingsCheckbox : SettingsItem<bool>
|
public class SettingsCheckbox : SettingsItem<bool>
|
||||||
{
|
{
|
||||||
private string labelText;
|
private LocalisableString labelText;
|
||||||
|
|
||||||
protected override Drawable CreateControl() => new OsuCheckbox();
|
protected override Drawable CreateControl() => new OsuCheckbox();
|
||||||
|
|
||||||
public override string LabelText
|
public override LocalisableString LabelText
|
||||||
{
|
{
|
||||||
get => labelText;
|
get => labelText;
|
||||||
set => ((OsuCheckbox)Control).LabelText = labelText = value;
|
// checkbox doesn't properly support localisation yet.
|
||||||
|
set => ((OsuCheckbox)Control).LabelText = (labelText = value).ToString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -15,6 +15,7 @@ using osu.Framework.Graphics.Shapes;
|
|||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
using osu.Framework.Graphics.UserInterface;
|
using osu.Framework.Graphics.UserInterface;
|
||||||
using osu.Framework.Input.Events;
|
using osu.Framework.Input.Events;
|
||||||
|
using osu.Framework.Localisation;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
using osu.Game.Graphics.Sprites;
|
using osu.Game.Graphics.Sprites;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
@ -39,7 +40,7 @@ namespace osu.Game.Overlays.Settings
|
|||||||
|
|
||||||
public string TooltipText { get; set; }
|
public string TooltipText { get; set; }
|
||||||
|
|
||||||
public virtual string LabelText
|
public virtual LocalisableString LabelText
|
||||||
{
|
{
|
||||||
get => labelText?.Text ?? string.Empty;
|
get => labelText?.Text ?? string.Empty;
|
||||||
set
|
set
|
||||||
@ -69,7 +70,7 @@ namespace osu.Game.Overlays.Settings
|
|||||||
set => controlWithCurrent.Current = value;
|
set => controlWithCurrent.Current = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual IEnumerable<string> FilterTerms => Keywords == null ? new[] { LabelText } : new List<string>(Keywords) { LabelText }.ToArray();
|
public virtual IEnumerable<string> FilterTerms => Keywords == null ? new[] { LabelText.ToString() } : new List<string>(Keywords) { LabelText.ToString() }.ToArray();
|
||||||
|
|
||||||
public IEnumerable<string> Keywords { get; set; }
|
public IEnumerable<string> Keywords { get; set; }
|
||||||
|
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Caching;
|
using osu.Framework.Caching;
|
||||||
using osu.Framework.Extensions.Color4Extensions;
|
using osu.Framework.Extensions.Color4Extensions;
|
||||||
|
using osu.Framework.Extensions.EnumExtensions;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.Effects;
|
using osu.Framework.Graphics.Effects;
|
||||||
@ -12,6 +13,7 @@ using osu.Framework.Graphics.Sprites;
|
|||||||
using osu.Framework.Graphics.Textures;
|
using osu.Framework.Graphics.Textures;
|
||||||
using osu.Framework.Input.Bindings;
|
using osu.Framework.Input.Bindings;
|
||||||
using osu.Framework.Input.Events;
|
using osu.Framework.Input.Events;
|
||||||
|
using osu.Framework.Localisation;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
using osu.Game.Graphics.Backgrounds;
|
using osu.Game.Graphics.Backgrounds;
|
||||||
using osu.Game.Graphics.Containers;
|
using osu.Game.Graphics.Containers;
|
||||||
@ -43,19 +45,19 @@ namespace osu.Game.Overlays.Toolbar
|
|||||||
Texture = textures.Get(texture),
|
Texture = textures.Get(texture),
|
||||||
});
|
});
|
||||||
|
|
||||||
public string Text
|
public LocalisableString Text
|
||||||
{
|
{
|
||||||
get => DrawableText.Text;
|
get => DrawableText.Text;
|
||||||
set => DrawableText.Text = value;
|
set => DrawableText.Text = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public string TooltipMain
|
public LocalisableString TooltipMain
|
||||||
{
|
{
|
||||||
get => tooltip1.Text;
|
get => tooltip1.Text;
|
||||||
set => tooltip1.Text = value;
|
set => tooltip1.Text = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public string TooltipSub
|
public LocalisableString TooltipSub
|
||||||
{
|
{
|
||||||
get => tooltip2.Text;
|
get => tooltip2.Text;
|
||||||
set => tooltip2.Text = value;
|
set => tooltip2.Text = value;
|
||||||
@ -127,9 +129,9 @@ namespace osu.Game.Overlays.Toolbar
|
|||||||
{
|
{
|
||||||
Direction = FillDirection.Vertical,
|
Direction = FillDirection.Vertical,
|
||||||
RelativeSizeAxes = Axes.Both, // stops us being considered in parent's autosize
|
RelativeSizeAxes = Axes.Both, // stops us being considered in parent's autosize
|
||||||
Anchor = TooltipAnchor.HasFlag(Anchor.x0) ? Anchor.BottomLeft : Anchor.BottomRight,
|
Anchor = TooltipAnchor.HasFlagFast(Anchor.x0) ? Anchor.BottomLeft : Anchor.BottomRight,
|
||||||
Origin = TooltipAnchor,
|
Origin = TooltipAnchor,
|
||||||
Position = new Vector2(TooltipAnchor.HasFlag(Anchor.x0) ? 5 : -5, 5),
|
Position = new Vector2(TooltipAnchor.HasFlagFast(Anchor.x0) ? 5 : -5, 5),
|
||||||
Alpha = 0,
|
Alpha = 0,
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
using MessagePack;
|
using MessagePack;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
using osu.Framework.Extensions.EnumExtensions;
|
||||||
using osu.Game.Rulesets.Replays;
|
using osu.Game.Rulesets.Replays;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
|
|
||||||
@ -31,19 +32,19 @@ namespace osu.Game.Replays.Legacy
|
|||||||
|
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
[IgnoreMember]
|
[IgnoreMember]
|
||||||
public bool MouseLeft1 => ButtonState.HasFlag(ReplayButtonState.Left1);
|
public bool MouseLeft1 => ButtonState.HasFlagFast(ReplayButtonState.Left1);
|
||||||
|
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
[IgnoreMember]
|
[IgnoreMember]
|
||||||
public bool MouseRight1 => ButtonState.HasFlag(ReplayButtonState.Right1);
|
public bool MouseRight1 => ButtonState.HasFlagFast(ReplayButtonState.Right1);
|
||||||
|
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
[IgnoreMember]
|
[IgnoreMember]
|
||||||
public bool MouseLeft2 => ButtonState.HasFlag(ReplayButtonState.Left2);
|
public bool MouseLeft2 => ButtonState.HasFlagFast(ReplayButtonState.Left2);
|
||||||
|
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
[IgnoreMember]
|
[IgnoreMember]
|
||||||
public bool MouseRight2 => ButtonState.HasFlag(ReplayButtonState.Right2);
|
public bool MouseRight2 => ButtonState.HasFlagFast(ReplayButtonState.Right2);
|
||||||
|
|
||||||
[Key(3)]
|
[Key(3)]
|
||||||
public ReplayButtonState ButtonState;
|
public ReplayButtonState ButtonState;
|
||||||
|
@ -10,6 +10,7 @@ using osu.Game.Beatmaps.Formats;
|
|||||||
using osu.Game.Audio;
|
using osu.Game.Audio;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using JetBrains.Annotations;
|
using JetBrains.Annotations;
|
||||||
|
using osu.Framework.Extensions.EnumExtensions;
|
||||||
using osu.Framework.Utils;
|
using osu.Framework.Utils;
|
||||||
using osu.Game.Beatmaps.Legacy;
|
using osu.Game.Beatmaps.Legacy;
|
||||||
using osu.Game.Skinning;
|
using osu.Game.Skinning;
|
||||||
@ -54,7 +55,7 @@ namespace osu.Game.Rulesets.Objects.Legacy
|
|||||||
int comboOffset = (int)(type & LegacyHitObjectType.ComboOffset) >> 4;
|
int comboOffset = (int)(type & LegacyHitObjectType.ComboOffset) >> 4;
|
||||||
type &= ~LegacyHitObjectType.ComboOffset;
|
type &= ~LegacyHitObjectType.ComboOffset;
|
||||||
|
|
||||||
bool combo = type.HasFlag(LegacyHitObjectType.NewCombo);
|
bool combo = type.HasFlagFast(LegacyHitObjectType.NewCombo);
|
||||||
type &= ~LegacyHitObjectType.NewCombo;
|
type &= ~LegacyHitObjectType.NewCombo;
|
||||||
|
|
||||||
var soundType = (LegacyHitSoundType)Parsing.ParseInt(split[4]);
|
var soundType = (LegacyHitSoundType)Parsing.ParseInt(split[4]);
|
||||||
@ -62,14 +63,14 @@ namespace osu.Game.Rulesets.Objects.Legacy
|
|||||||
|
|
||||||
HitObject result = null;
|
HitObject result = null;
|
||||||
|
|
||||||
if (type.HasFlag(LegacyHitObjectType.Circle))
|
if (type.HasFlagFast(LegacyHitObjectType.Circle))
|
||||||
{
|
{
|
||||||
result = CreateHit(pos, combo, comboOffset);
|
result = CreateHit(pos, combo, comboOffset);
|
||||||
|
|
||||||
if (split.Length > 5)
|
if (split.Length > 5)
|
||||||
readCustomSampleBanks(split[5], bankInfo);
|
readCustomSampleBanks(split[5], bankInfo);
|
||||||
}
|
}
|
||||||
else if (type.HasFlag(LegacyHitObjectType.Slider))
|
else if (type.HasFlagFast(LegacyHitObjectType.Slider))
|
||||||
{
|
{
|
||||||
double? length = null;
|
double? length = null;
|
||||||
|
|
||||||
@ -141,7 +142,7 @@ namespace osu.Game.Rulesets.Objects.Legacy
|
|||||||
|
|
||||||
result = CreateSlider(pos, combo, comboOffset, convertPathString(split[5], pos), length, repeatCount, nodeSamples);
|
result = CreateSlider(pos, combo, comboOffset, convertPathString(split[5], pos), length, repeatCount, nodeSamples);
|
||||||
}
|
}
|
||||||
else if (type.HasFlag(LegacyHitObjectType.Spinner))
|
else if (type.HasFlagFast(LegacyHitObjectType.Spinner))
|
||||||
{
|
{
|
||||||
double duration = Math.Max(0, Parsing.ParseDouble(split[5]) + Offset - startTime);
|
double duration = Math.Max(0, Parsing.ParseDouble(split[5]) + Offset - startTime);
|
||||||
|
|
||||||
@ -150,7 +151,7 @@ namespace osu.Game.Rulesets.Objects.Legacy
|
|||||||
if (split.Length > 6)
|
if (split.Length > 6)
|
||||||
readCustomSampleBanks(split[6], bankInfo);
|
readCustomSampleBanks(split[6], bankInfo);
|
||||||
}
|
}
|
||||||
else if (type.HasFlag(LegacyHitObjectType.Hold))
|
else if (type.HasFlagFast(LegacyHitObjectType.Hold))
|
||||||
{
|
{
|
||||||
// Note: Hold is generated by BMS converts
|
// Note: Hold is generated by BMS converts
|
||||||
|
|
||||||
@ -436,16 +437,16 @@ namespace osu.Game.Rulesets.Objects.Legacy
|
|||||||
new LegacyHitSampleInfo(HitSampleInfo.HIT_NORMAL, bankInfo.Normal, bankInfo.Volume, bankInfo.CustomSampleBank,
|
new LegacyHitSampleInfo(HitSampleInfo.HIT_NORMAL, bankInfo.Normal, bankInfo.Volume, bankInfo.CustomSampleBank,
|
||||||
// if the sound type doesn't have the Normal flag set, attach it anyway as a layered sample.
|
// if the sound type doesn't have the Normal flag set, attach it anyway as a layered sample.
|
||||||
// None also counts as a normal non-layered sample: https://osu.ppy.sh/help/wiki/osu!_File_Formats/Osu_(file_format)#hitsounds
|
// None also counts as a normal non-layered sample: https://osu.ppy.sh/help/wiki/osu!_File_Formats/Osu_(file_format)#hitsounds
|
||||||
type != LegacyHitSoundType.None && !type.HasFlag(LegacyHitSoundType.Normal))
|
type != LegacyHitSoundType.None && !type.HasFlagFast(LegacyHitSoundType.Normal))
|
||||||
};
|
};
|
||||||
|
|
||||||
if (type.HasFlag(LegacyHitSoundType.Finish))
|
if (type.HasFlagFast(LegacyHitSoundType.Finish))
|
||||||
soundTypes.Add(new LegacyHitSampleInfo(HitSampleInfo.HIT_FINISH, bankInfo.Add, bankInfo.Volume, bankInfo.CustomSampleBank));
|
soundTypes.Add(new LegacyHitSampleInfo(HitSampleInfo.HIT_FINISH, bankInfo.Add, bankInfo.Volume, bankInfo.CustomSampleBank));
|
||||||
|
|
||||||
if (type.HasFlag(LegacyHitSoundType.Whistle))
|
if (type.HasFlagFast(LegacyHitSoundType.Whistle))
|
||||||
soundTypes.Add(new LegacyHitSampleInfo(HitSampleInfo.HIT_WHISTLE, bankInfo.Add, bankInfo.Volume, bankInfo.CustomSampleBank));
|
soundTypes.Add(new LegacyHitSampleInfo(HitSampleInfo.HIT_WHISTLE, bankInfo.Add, bankInfo.Volume, bankInfo.CustomSampleBank));
|
||||||
|
|
||||||
if (type.HasFlag(LegacyHitSoundType.Clap))
|
if (type.HasFlagFast(LegacyHitSoundType.Clap))
|
||||||
soundTypes.Add(new LegacyHitSampleInfo(HitSampleInfo.HIT_CLAP, bankInfo.Add, bankInfo.Volume, bankInfo.CustomSampleBank));
|
soundTypes.Add(new LegacyHitSampleInfo(HitSampleInfo.HIT_CLAP, bankInfo.Add, bankInfo.Volume, bankInfo.CustomSampleBank));
|
||||||
|
|
||||||
return soundTypes;
|
return soundTypes;
|
||||||
|
@ -8,8 +8,8 @@ using osu.Game.Graphics.Sprites;
|
|||||||
using osuTK;
|
using osuTK;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
using osu.Game.Beatmaps;
|
|
||||||
using osu.Framework.Localisation;
|
using osu.Framework.Localisation;
|
||||||
|
using osu.Game.Beatmaps;
|
||||||
|
|
||||||
namespace osu.Game.Screens.Menu
|
namespace osu.Game.Screens.Menu
|
||||||
{
|
{
|
||||||
@ -61,8 +61,8 @@ namespace osu.Game.Screens.Menu
|
|||||||
{
|
{
|
||||||
var metadata = beatmap.Value.Metadata;
|
var metadata = beatmap.Value.Metadata;
|
||||||
|
|
||||||
title.Text = new LocalisedString((metadata.TitleUnicode, metadata.Title));
|
title.Text = new RomanisableString(metadata.TitleUnicode, metadata.Title);
|
||||||
artist.Text = new LocalisedString((metadata.ArtistUnicode, metadata.Artist));
|
artist.Text = new RomanisableString(metadata.ArtistUnicode, metadata.Artist);
|
||||||
|
|
||||||
this.FadeInFromZero(fade_duration / 2f)
|
this.FadeInFromZero(fade_duration / 2f)
|
||||||
.Delay(4000)
|
.Delay(4000)
|
||||||
|
@ -73,7 +73,7 @@ namespace osu.Game.Screens.OnlinePlay.Components
|
|||||||
{
|
{
|
||||||
new OsuSpriteText
|
new OsuSpriteText
|
||||||
{
|
{
|
||||||
Text = new LocalisedString((beatmap.Value.Metadata.ArtistUnicode, beatmap.Value.Metadata.Artist)),
|
Text = new RomanisableString(beatmap.Value.Metadata.ArtistUnicode, beatmap.Value.Metadata.Artist),
|
||||||
Font = OsuFont.GetFont(size: TextSize),
|
Font = OsuFont.GetFont(size: TextSize),
|
||||||
},
|
},
|
||||||
new OsuSpriteText
|
new OsuSpriteText
|
||||||
@ -83,7 +83,7 @@ namespace osu.Game.Screens.OnlinePlay.Components
|
|||||||
},
|
},
|
||||||
new OsuSpriteText
|
new OsuSpriteText
|
||||||
{
|
{
|
||||||
Text = new LocalisedString((beatmap.Value.Metadata.TitleUnicode, beatmap.Value.Metadata.Title)),
|
Text = new RomanisableString(beatmap.Value.Metadata.TitleUnicode, beatmap.Value.Metadata.Title),
|
||||||
Font = OsuFont.GetFont(size: TextSize),
|
Font = OsuFont.GetFont(size: TextSize),
|
||||||
}
|
}
|
||||||
}, LinkAction.OpenBeatmap, beatmap.Value.OnlineBeatmapID.ToString(), "Open beatmap");
|
}, LinkAction.OpenBeatmap, beatmap.Value.OnlineBeatmapID.ToString(), "Open beatmap");
|
||||||
|
@ -10,6 +10,7 @@ using osu.Framework.Extensions.Color4Extensions;
|
|||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
|
using osu.Framework.Localisation;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
using osu.Game.Graphics.Containers;
|
using osu.Game.Graphics.Containers;
|
||||||
using osu.Game.Graphics.Sprites;
|
using osu.Game.Graphics.Sprites;
|
||||||
@ -362,7 +363,7 @@ namespace osu.Game.Screens.OnlinePlay.Playlists
|
|||||||
Menu.MaxHeight = 100;
|
Menu.MaxHeight = 100;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override string GenerateItemText(TimeSpan item) => item.Humanize();
|
protected override LocalisableString GenerateItemText(TimeSpan item) => item.Humanize();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -73,7 +73,7 @@ namespace osu.Game.Screens.Play
|
|||||||
}),
|
}),
|
||||||
new OsuSpriteText
|
new OsuSpriteText
|
||||||
{
|
{
|
||||||
Text = new LocalisedString((metadata.TitleUnicode, metadata.Title)),
|
Text = new RomanisableString(metadata.TitleUnicode, metadata.Title),
|
||||||
Font = OsuFont.GetFont(size: 36, italics: true),
|
Font = OsuFont.GetFont(size: 36, italics: true),
|
||||||
Origin = Anchor.TopCentre,
|
Origin = Anchor.TopCentre,
|
||||||
Anchor = Anchor.TopCentre,
|
Anchor = Anchor.TopCentre,
|
||||||
@ -81,7 +81,7 @@ namespace osu.Game.Screens.Play
|
|||||||
},
|
},
|
||||||
new OsuSpriteText
|
new OsuSpriteText
|
||||||
{
|
{
|
||||||
Text = new LocalisedString((metadata.ArtistUnicode, metadata.Artist)),
|
Text = new RomanisableString(metadata.ArtistUnicode, metadata.Artist),
|
||||||
Font = OsuFont.GetFont(size: 26, italics: true),
|
Font = OsuFont.GetFont(size: 26, italics: true),
|
||||||
Origin = Anchor.TopCentre,
|
Origin = Anchor.TopCentre,
|
||||||
Anchor = Anchor.TopCentre,
|
Anchor = Anchor.TopCentre,
|
||||||
|
@ -101,7 +101,7 @@ namespace osu.Game.Screens.Ranking.Expanded
|
|||||||
{
|
{
|
||||||
Anchor = Anchor.TopCentre,
|
Anchor = Anchor.TopCentre,
|
||||||
Origin = Anchor.TopCentre,
|
Origin = Anchor.TopCentre,
|
||||||
Text = new LocalisedString((metadata.TitleUnicode, metadata.Title)),
|
Text = new RomanisableString(metadata.TitleUnicode, metadata.Title),
|
||||||
Font = OsuFont.Torus.With(size: 20, weight: FontWeight.SemiBold),
|
Font = OsuFont.Torus.With(size: 20, weight: FontWeight.SemiBold),
|
||||||
MaxWidth = ScorePanel.EXPANDED_WIDTH - padding * 2,
|
MaxWidth = ScorePanel.EXPANDED_WIDTH - padding * 2,
|
||||||
Truncate = true,
|
Truncate = true,
|
||||||
@ -110,7 +110,7 @@ namespace osu.Game.Screens.Ranking.Expanded
|
|||||||
{
|
{
|
||||||
Anchor = Anchor.TopCentre,
|
Anchor = Anchor.TopCentre,
|
||||||
Origin = Anchor.TopCentre,
|
Origin = Anchor.TopCentre,
|
||||||
Text = new LocalisedString((metadata.ArtistUnicode, metadata.Artist)),
|
Text = new RomanisableString(metadata.ArtistUnicode, metadata.Artist),
|
||||||
Font = OsuFont.Torus.With(size: 14, weight: FontWeight.SemiBold),
|
Font = OsuFont.Torus.With(size: 14, weight: FontWeight.SemiBold),
|
||||||
MaxWidth = ScorePanel.EXPANDED_WIDTH - padding * 2,
|
MaxWidth = ScorePanel.EXPANDED_WIDTH - padding * 2,
|
||||||
Truncate = true,
|
Truncate = true,
|
||||||
|
@ -187,8 +187,8 @@ namespace osu.Game.Screens.Select
|
|||||||
|
|
||||||
RelativeSizeAxes = Axes.Both;
|
RelativeSizeAxes = Axes.Both;
|
||||||
|
|
||||||
titleBinding = localisation.GetLocalisedString(new LocalisedString((metadata.TitleUnicode, metadata.Title)));
|
titleBinding = localisation.GetLocalisedString(new RomanisableString(metadata.TitleUnicode, metadata.Title));
|
||||||
artistBinding = localisation.GetLocalisedString(new LocalisedString((metadata.ArtistUnicode, metadata.Artist)));
|
artistBinding = localisation.GetLocalisedString(new RomanisableString(metadata.ArtistUnicode, metadata.Artist));
|
||||||
|
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
|
@ -41,13 +41,13 @@ namespace osu.Game.Screens.Select.Carousel
|
|||||||
{
|
{
|
||||||
new OsuSpriteText
|
new OsuSpriteText
|
||||||
{
|
{
|
||||||
Text = new LocalisedString((beatmapSet.Metadata.TitleUnicode, beatmapSet.Metadata.Title)),
|
Text = new RomanisableString(beatmapSet.Metadata.TitleUnicode, beatmapSet.Metadata.Title),
|
||||||
Font = OsuFont.GetFont(weight: FontWeight.Bold, size: 22, italics: true),
|
Font = OsuFont.GetFont(weight: FontWeight.Bold, size: 22, italics: true),
|
||||||
Shadow = true,
|
Shadow = true,
|
||||||
},
|
},
|
||||||
new OsuSpriteText
|
new OsuSpriteText
|
||||||
{
|
{
|
||||||
Text = new LocalisedString((beatmapSet.Metadata.ArtistUnicode, beatmapSet.Metadata.Artist)),
|
Text = new RomanisableString(beatmapSet.Metadata.ArtistUnicode, beatmapSet.Metadata.Artist),
|
||||||
Font = OsuFont.GetFont(weight: FontWeight.SemiBold, size: 17, italics: true),
|
Font = OsuFont.GetFont(weight: FontWeight.SemiBold, size: 17, italics: true),
|
||||||
Shadow = true,
|
Shadow = true,
|
||||||
},
|
},
|
||||||
|
@ -16,6 +16,7 @@ using osu.Game.Rulesets.Mods;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using osu.Framework.Localisation;
|
||||||
using osu.Framework.Threading;
|
using osu.Framework.Threading;
|
||||||
using osu.Framework.Utils;
|
using osu.Framework.Utils;
|
||||||
using osu.Game.Configuration;
|
using osu.Game.Configuration;
|
||||||
@ -179,7 +180,7 @@ namespace osu.Game.Screens.Select.Details
|
|||||||
[Resolved]
|
[Resolved]
|
||||||
private OsuColour colours { get; set; }
|
private OsuColour colours { get; set; }
|
||||||
|
|
||||||
public string Title
|
public LocalisableString Title
|
||||||
{
|
{
|
||||||
get => name.Text;
|
get => name.Text;
|
||||||
set => name.Text = value;
|
set => name.Text = value;
|
||||||
|
@ -10,6 +10,7 @@ using osu.Framework.Graphics.Containers;
|
|||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
using osu.Framework.Input.Events;
|
using osu.Framework.Input.Events;
|
||||||
|
using osu.Framework.Localisation;
|
||||||
using osu.Game.Graphics.Sprites;
|
using osu.Game.Graphics.Sprites;
|
||||||
using osu.Game.Graphics.Containers;
|
using osu.Game.Graphics.Containers;
|
||||||
|
|
||||||
@ -21,9 +22,9 @@ namespace osu.Game.Screens.Select
|
|||||||
|
|
||||||
protected static readonly Vector2 SHEAR = new Vector2(SHEAR_WIDTH / Footer.HEIGHT, 0);
|
protected static readonly Vector2 SHEAR = new Vector2(SHEAR_WIDTH / Footer.HEIGHT, 0);
|
||||||
|
|
||||||
public string Text
|
public LocalisableString Text
|
||||||
{
|
{
|
||||||
get => SpriteText?.Text;
|
get => SpriteText?.Text ?? default;
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
if (SpriteText != null)
|
if (SpriteText != null)
|
||||||
|
@ -8,6 +8,7 @@ using osu.Framework.Graphics.Effects;
|
|||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
using osu.Framework.Input.Events;
|
using osu.Framework.Input.Events;
|
||||||
|
using osu.Framework.Localisation;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
using osu.Game.Graphics.Sprites;
|
using osu.Game.Graphics.Sprites;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
@ -39,13 +40,13 @@ namespace osu.Game.Screens.Select.Options
|
|||||||
set => iconText.Icon = value;
|
set => iconText.Icon = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public string FirstLineText
|
public LocalisableString FirstLineText
|
||||||
{
|
{
|
||||||
get => firstLine.Text;
|
get => firstLine.Text;
|
||||||
set => firstLine.Text = value;
|
set => firstLine.Text = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public string SecondLineText
|
public LocalisableString SecondLineText
|
||||||
{
|
{
|
||||||
get => secondLine.Text;
|
get => secondLine.Text;
|
||||||
set => secondLine.Text = value;
|
set => secondLine.Text = value;
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
using System;
|
using System;
|
||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
|
using osu.Framework.Localisation;
|
||||||
|
|
||||||
namespace osu.Game.Skinning
|
namespace osu.Game.Skinning
|
||||||
{
|
{
|
||||||
@ -21,9 +22,9 @@ namespace osu.Game.Skinning
|
|||||||
textDrawable.Text = Text;
|
textDrawable.Text = Text;
|
||||||
}
|
}
|
||||||
|
|
||||||
private string text;
|
private LocalisableString text;
|
||||||
|
|
||||||
public string Text
|
public LocalisableString Text
|
||||||
{
|
{
|
||||||
get => text;
|
get => text;
|
||||||
set
|
set
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
using System;
|
using System;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
|
using osu.Framework.Extensions.EnumExtensions;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Animations;
|
using osu.Framework.Graphics.Animations;
|
||||||
using osu.Framework.Graphics.Textures;
|
using osu.Framework.Graphics.Textures;
|
||||||
@ -80,17 +81,17 @@ namespace osu.Game.Storyboards.Drawables
|
|||||||
|
|
||||||
if (FlipH)
|
if (FlipH)
|
||||||
{
|
{
|
||||||
if (origin.HasFlag(Anchor.x0))
|
if (origin.HasFlagFast(Anchor.x0))
|
||||||
origin = Anchor.x2 | (origin & (Anchor.y0 | Anchor.y1 | Anchor.y2));
|
origin = Anchor.x2 | (origin & (Anchor.y0 | Anchor.y1 | Anchor.y2));
|
||||||
else if (origin.HasFlag(Anchor.x2))
|
else if (origin.HasFlagFast(Anchor.x2))
|
||||||
origin = Anchor.x0 | (origin & (Anchor.y0 | Anchor.y1 | Anchor.y2));
|
origin = Anchor.x0 | (origin & (Anchor.y0 | Anchor.y1 | Anchor.y2));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (FlipV)
|
if (FlipV)
|
||||||
{
|
{
|
||||||
if (origin.HasFlag(Anchor.y0))
|
if (origin.HasFlagFast(Anchor.y0))
|
||||||
origin = Anchor.y2 | (origin & (Anchor.x0 | Anchor.x1 | Anchor.x2));
|
origin = Anchor.y2 | (origin & (Anchor.x0 | Anchor.x1 | Anchor.x2));
|
||||||
else if (origin.HasFlag(Anchor.y2))
|
else if (origin.HasFlagFast(Anchor.y2))
|
||||||
origin = Anchor.y0 | (origin & (Anchor.x0 | Anchor.x1 | Anchor.x2));
|
origin = Anchor.y0 | (origin & (Anchor.x0 | Anchor.x1 | Anchor.x2));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
using System;
|
using System;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
|
using osu.Framework.Extensions.EnumExtensions;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.Textures;
|
using osu.Framework.Graphics.Textures;
|
||||||
@ -80,17 +81,17 @@ namespace osu.Game.Storyboards.Drawables
|
|||||||
|
|
||||||
if (FlipH)
|
if (FlipH)
|
||||||
{
|
{
|
||||||
if (origin.HasFlag(Anchor.x0))
|
if (origin.HasFlagFast(Anchor.x0))
|
||||||
origin = Anchor.x2 | (origin & (Anchor.y0 | Anchor.y1 | Anchor.y2));
|
origin = Anchor.x2 | (origin & (Anchor.y0 | Anchor.y1 | Anchor.y2));
|
||||||
else if (origin.HasFlag(Anchor.x2))
|
else if (origin.HasFlagFast(Anchor.x2))
|
||||||
origin = Anchor.x0 | (origin & (Anchor.y0 | Anchor.y1 | Anchor.y2));
|
origin = Anchor.x0 | (origin & (Anchor.y0 | Anchor.y1 | Anchor.y2));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (FlipV)
|
if (FlipV)
|
||||||
{
|
{
|
||||||
if (origin.HasFlag(Anchor.y0))
|
if (origin.HasFlagFast(Anchor.y0))
|
||||||
origin = Anchor.y2 | (origin & (Anchor.x0 | Anchor.x1 | Anchor.x2));
|
origin = Anchor.y2 | (origin & (Anchor.x0 | Anchor.x1 | Anchor.x2));
|
||||||
else if (origin.HasFlag(Anchor.y2))
|
else if (origin.HasFlagFast(Anchor.y2))
|
||||||
origin = Anchor.y0 | (origin & (Anchor.x0 | Anchor.x1 | Anchor.x2));
|
origin = Anchor.y0 | (origin & (Anchor.x0 | Anchor.x1 | Anchor.x2));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@
|
|||||||
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="2.2.0" />
|
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="2.2.0" />
|
||||||
<PackageReference Include="Microsoft.NETCore.Targets" Version="3.1.0" />
|
<PackageReference Include="Microsoft.NETCore.Targets" Version="3.1.0" />
|
||||||
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
|
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
|
||||||
<PackageReference Include="ppy.osu.Framework" Version="2021.222.0" />
|
<PackageReference Include="ppy.osu.Framework" Version="2021.225.0" />
|
||||||
<PackageReference Include="ppy.osu.Game.Resources" Version="2021.211.1" />
|
<PackageReference Include="ppy.osu.Game.Resources" Version="2021.211.1" />
|
||||||
<PackageReference Include="Sentry" Version="3.0.1" />
|
<PackageReference Include="Sentry" Version="3.0.1" />
|
||||||
<PackageReference Include="SharpCompress" Version="0.27.1" />
|
<PackageReference Include="SharpCompress" Version="0.27.1" />
|
||||||
|
@ -70,7 +70,7 @@
|
|||||||
<Reference Include="System.Net.Http" />
|
<Reference Include="System.Net.Http" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup Label="Package References">
|
<ItemGroup Label="Package References">
|
||||||
<PackageReference Include="ppy.osu.Framework.iOS" Version="2021.222.0" />
|
<PackageReference Include="ppy.osu.Framework.iOS" Version="2021.225.0" />
|
||||||
<PackageReference Include="ppy.osu.Game.Resources" Version="2021.211.1" />
|
<PackageReference Include="ppy.osu.Game.Resources" Version="2021.211.1" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<!-- See https://github.com/dotnet/runtime/issues/35988 (can be removed after Xamarin uses net5.0 / net6.0) -->
|
<!-- See https://github.com/dotnet/runtime/issues/35988 (can be removed after Xamarin uses net5.0 / net6.0) -->
|
||||||
@ -91,7 +91,7 @@
|
|||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.2.6" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.2.6" />
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.2.6" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.2.6" />
|
||||||
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
|
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
|
||||||
<PackageReference Include="ppy.osu.Framework" Version="2021.222.0" />
|
<PackageReference Include="ppy.osu.Framework" Version="2021.225.0" />
|
||||||
<PackageReference Include="SharpCompress" Version="0.27.1" />
|
<PackageReference Include="SharpCompress" Version="0.27.1" />
|
||||||
<PackageReference Include="NUnit" Version="3.12.0" />
|
<PackageReference Include="NUnit" Version="3.12.0" />
|
||||||
<PackageReference Include="SharpRaven" Version="2.4.0" />
|
<PackageReference Include="SharpRaven" Version="2.4.0" />
|
||||||
|
Loading…
Reference in New Issue
Block a user