1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-18 05:42:56 +08:00

Fix remaining issues

This commit is contained in:
Dean Herbert 2019-02-28 13:31:40 +09:00
parent 3e1f283281
commit 26d53d06a9
241 changed files with 673 additions and 330 deletions

View File

@ -34,13 +34,16 @@ namespace osu.Game.Rulesets.Catch.Tests
case JuiceStream stream: case JuiceStream stream:
foreach (var nested in stream.NestedHitObjects) foreach (var nested in stream.NestedHitObjects)
yield return new ConvertValue((CatchHitObject)nested); yield return new ConvertValue((CatchHitObject)nested);
break; break;
case BananaShower shower: case BananaShower shower:
foreach (var nested in shower.NestedHitObjects) foreach (var nested in shower.NestedHitObjects)
yield return new ConvertValue((CatchHitObject)nested); yield return new ConvertValue((CatchHitObject)nested);
break; break;
default: default:
yield return new ConvertValue((CatchHitObject)hitObject); yield return new ConvertValue((CatchHitObject)hitObject);
break; break;
} }
} }

View File

@ -8,7 +8,8 @@ namespace osu.Game.Rulesets.Catch.Tests
[TestFixture] [TestFixture]
public class TestCaseCatchPlayer : Game.Tests.Visual.TestCasePlayer public class TestCaseCatchPlayer : Game.Tests.Visual.TestCasePlayer
{ {
public TestCaseCatchPlayer() : base(new CatchRuleset()) public TestCaseCatchPlayer()
: base(new CatchRuleset())
{ {
} }
} }

View File

@ -56,6 +56,7 @@ namespace osu.Game.Rulesets.Catch.Beatmaps
rng.Next(); // osu!stable retrieved a random banana rotation rng.Next(); // osu!stable retrieved a random banana rotation
rng.Next(); // osu!stable retrieved a random banana colour rng.Next(); // osu!stable retrieved a random banana colour
} }
break; break;
case JuiceStream juiceStream: case JuiceStream juiceStream:
foreach (var nested in juiceStream.NestedHitObjects) foreach (var nested in juiceStream.NestedHitObjects)
@ -67,6 +68,7 @@ namespace osu.Game.Rulesets.Catch.Beatmaps
rng.Next(); // osu!stable retrieved a random droplet rotation rng.Next(); // osu!stable retrieved a random droplet rotation
hitObject.X = MathHelper.Clamp(hitObject.X, 0, 1); hitObject.X = MathHelper.Clamp(hitObject.X, 0, 1);
} }
break; break;
} }
} }

View File

@ -19,8 +19,10 @@ namespace osu.Game.Rulesets.Catch
{ {
[Description("Move left")] [Description("Move left")]
MoveLeft, MoveLeft,
[Description("Move right")] [Description("Move right")]
MoveRight, MoveRight,
[Description("Engage dash")] [Description("Engage dash")]
Dash, Dash,
} }

View File

@ -68,14 +68,17 @@ namespace osu.Game.Rulesets.Catch.Difficulty
// We want to only consider fruits that contribute to the combo. Droplets are addressed as accuracy and spinners are not relevant for "skill" calculations. // We want to only consider fruits that contribute to the combo. Droplets are addressed as accuracy and spinners are not relevant for "skill" calculations.
case Fruit fruit: case Fruit fruit:
yield return new CatchDifficultyHitObject(fruit, lastObject, clockRate, halfCatchWidth); yield return new CatchDifficultyHitObject(fruit, lastObject, clockRate, halfCatchWidth);
lastObject = hitObject; lastObject = hitObject;
break; break;
case JuiceStream _: case JuiceStream _:
foreach (var nested in hitObject.NestedHitObjects.OfType<CatchHitObject>().Where(o => !(o is TinyDroplet))) foreach (var nested in hitObject.NestedHitObjects.OfType<CatchHitObject>().Where(o => !(o is TinyDroplet)))
{ {
yield return new CatchDifficultyHitObject(nested, lastObject, clockRate, halfCatchWidth); yield return new CatchDifficultyHitObject(nested, lastObject, clockRate, halfCatchWidth);
lastObject = nested; lastObject = nested;
} }
break; break;
} }
} }

View File

@ -33,11 +33,11 @@ namespace osu.Game.Rulesets.Catch.MathUtils
/// <returns>The random value.</returns> /// <returns>The random value.</returns>
public uint NextUInt() public uint NextUInt()
{ {
uint t = _x ^ _x << 11; uint t = _x ^ (_x << 11);
_x = _y; _x = _y;
_y = _z; _y = _z;
_z = _w; _z = _w;
return _w = _w ^ _w >> 19 ^ t ^ t >> 8; return _w = _w ^ (_w >> 19) ^ t ^ (t >> 8);
} }
/// <summary> /// <summary>

View File

@ -23,6 +23,7 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable.Pieces
} }
private Color4 accentColour; private Color4 accentColour;
public Color4 AccentColour public Color4 AccentColour
{ {
get { return accentColour; } get { return accentColour; }

View File

@ -78,6 +78,7 @@ namespace osu.Game.Rulesets.Mania.Beatmaps
if (maniaOriginal != null) if (maniaOriginal != null)
{ {
yield return maniaOriginal; yield return maniaOriginal;
yield break; yield break;
} }
@ -92,6 +93,7 @@ namespace osu.Game.Rulesets.Mania.Beatmaps
private readonly List<double> prevNoteTimes = new List<double>(max_notes_for_density); private readonly List<double> prevNoteTimes = new List<double>(max_notes_for_density);
private double density = int.MaxValue; private double density = int.MaxValue;
private void computeDensity(double newNoteTime) private void computeDensity(double newNoteTime)
{ {
if (prevNoteTimes.Count == max_notes_for_density) if (prevNoteTimes.Count == max_notes_for_density)
@ -104,6 +106,7 @@ namespace osu.Game.Rulesets.Mania.Beatmaps
private double lastTime; private double lastTime;
private Vector2 lastPosition; private Vector2 lastPosition;
private PatternType lastStair = PatternType.Stair; private PatternType lastStair = PatternType.Stair;
private void recordNote(double time, Vector2 position) private void recordNote(double time, Vector2 position)
{ {
lastTime = time; lastTime = time;

View File

@ -65,6 +65,7 @@ namespace osu.Game.Rulesets.Mania.Beatmaps.Patterns.Legacy
if (originalPattern.HitObjects.Count() == 1) if (originalPattern.HitObjects.Count() == 1)
{ {
yield return originalPattern; yield return originalPattern;
yield break; yield break;
} }
@ -135,6 +136,7 @@ namespace osu.Game.Rulesets.Mania.Beatmaps.Patterns.Legacy
{ {
if (convertType.HasFlag(PatternType.LowProbability)) if (convertType.HasFlag(PatternType.LowProbability))
return generateNRandomNotes(HitObject.StartTime, 0.78, 0.3, 0); return generateNRandomNotes(HitObject.StartTime, 0.78, 0.3, 0);
return generateNRandomNotes(HitObject.StartTime, 0.85, 0.36, 0.03); return generateNRandomNotes(HitObject.StartTime, 0.85, 0.36, 0.03);
} }
@ -142,6 +144,7 @@ namespace osu.Game.Rulesets.Mania.Beatmaps.Patterns.Legacy
{ {
if (convertType.HasFlag(PatternType.LowProbability)) if (convertType.HasFlag(PatternType.LowProbability))
return generateNRandomNotes(HitObject.StartTime, 0.43, 0.08, 0); return generateNRandomNotes(HitObject.StartTime, 0.43, 0.08, 0);
return generateNRandomNotes(HitObject.StartTime, 0.56, 0.18, 0); return generateNRandomNotes(HitObject.StartTime, 0.56, 0.18, 0);
} }
@ -149,11 +152,13 @@ namespace osu.Game.Rulesets.Mania.Beatmaps.Patterns.Legacy
{ {
if (convertType.HasFlag(PatternType.LowProbability)) if (convertType.HasFlag(PatternType.LowProbability))
return generateNRandomNotes(HitObject.StartTime, 0.3, 0, 0); return generateNRandomNotes(HitObject.StartTime, 0.3, 0, 0);
return generateNRandomNotes(HitObject.StartTime, 0.37, 0.08, 0); return generateNRandomNotes(HitObject.StartTime, 0.37, 0.08, 0);
} }
if (convertType.HasFlag(PatternType.LowProbability)) if (convertType.HasFlag(PatternType.LowProbability))
return generateNRandomNotes(HitObject.StartTime, 0.17, 0, 0); return generateNRandomNotes(HitObject.StartTime, 0.17, 0, 0);
return generateNRandomNotes(HitObject.StartTime, 0.27, 0, 0); return generateNRandomNotes(HitObject.StartTime, 0.27, 0, 0);
} }

View File

@ -172,6 +172,7 @@ namespace osu.Game.Rulesets.Mania.Beatmaps.Patterns.Legacy
return pattern = generateRandomPatternWithMirrored(0.12, 0.38, 0.12); return pattern = generateRandomPatternWithMirrored(0.12, 0.38, 0.12);
if (ConversionDifficulty > 4) if (ConversionDifficulty > 4)
return pattern = generateRandomPatternWithMirrored(0.12, 0.17, 0); return pattern = generateRandomPatternWithMirrored(0.12, 0.17, 0);
return pattern = generateRandomPatternWithMirrored(0.12, 0, 0); return pattern = generateRandomPatternWithMirrored(0.12, 0, 0);
} }
@ -179,6 +180,7 @@ namespace osu.Game.Rulesets.Mania.Beatmaps.Patterns.Legacy
{ {
if (convertType.HasFlag(PatternType.LowProbability)) if (convertType.HasFlag(PatternType.LowProbability))
return pattern = generateRandomPattern(0.78, 0.42, 0, 0); return pattern = generateRandomPattern(0.78, 0.42, 0, 0);
return pattern = generateRandomPattern(1, 0.62, 0, 0); return pattern = generateRandomPattern(1, 0.62, 0, 0);
} }
@ -186,6 +188,7 @@ namespace osu.Game.Rulesets.Mania.Beatmaps.Patterns.Legacy
{ {
if (convertType.HasFlag(PatternType.LowProbability)) if (convertType.HasFlag(PatternType.LowProbability))
return pattern = generateRandomPattern(0.35, 0.08, 0, 0); return pattern = generateRandomPattern(0.35, 0.08, 0, 0);
return pattern = generateRandomPattern(0.52, 0.15, 0, 0); return pattern = generateRandomPattern(0.52, 0.15, 0, 0);
} }
@ -193,6 +196,7 @@ namespace osu.Game.Rulesets.Mania.Beatmaps.Patterns.Legacy
{ {
if (convertType.HasFlag(PatternType.LowProbability)) if (convertType.HasFlag(PatternType.LowProbability))
return pattern = generateRandomPattern(0.18, 0, 0, 0); return pattern = generateRandomPattern(0.18, 0, 0, 0);
return pattern = generateRandomPattern(0.45, 0, 0, 0); return pattern = generateRandomPattern(0.45, 0, 0, 0);
} }
@ -250,6 +254,7 @@ namespace osu.Game.Rulesets.Mania.Beatmaps.Patterns.Legacy
} }
else else
last = GetRandomColumn(); last = GetRandomColumn();
return last; return last;
} }
} }

View File

@ -87,6 +87,7 @@ namespace osu.Game.Rulesets.Mania.Beatmaps.Patterns.Legacy
return 4; return 4;
if (val >= 1 - p3) if (val >= 1 - p3)
return 3; return 3;
return val >= 1 - p2 ? 2 : 1; return val >= 1 - p2 ? 2 : 1;
} }

View File

@ -12,51 +12,63 @@ namespace osu.Game.Rulesets.Mania.Beatmaps.Patterns.Legacy
internal enum PatternType internal enum PatternType
{ {
None = 0, None = 0,
/// <summary> /// <summary>
/// Keep the same as last row. /// Keep the same as last row.
/// </summary> /// </summary>
ForceStack = 1 << 0, ForceStack = 1 << 0,
/// <summary> /// <summary>
/// Keep different from last row. /// Keep different from last row.
/// </summary> /// </summary>
ForceNotStack = 1 << 1, ForceNotStack = 1 << 1,
/// <summary> /// <summary>
/// Keep as single note at its original position. /// Keep as single note at its original position.
/// </summary> /// </summary>
KeepSingle = 1 << 2, KeepSingle = 1 << 2,
/// <summary> /// <summary>
/// Use a lower random value. /// Use a lower random value.
/// </summary> /// </summary>
LowProbability = 1 << 3, LowProbability = 1 << 3,
/// <summary> /// <summary>
/// Reserved. /// Reserved.
/// </summary> /// </summary>
Alternate = 1 << 4, Alternate = 1 << 4,
/// <summary> /// <summary>
/// Ignore the repeat count. /// Ignore the repeat count.
/// </summary> /// </summary>
ForceSigSlider = 1 << 5, ForceSigSlider = 1 << 5,
/// <summary> /// <summary>
/// Convert slider to circle. /// Convert slider to circle.
/// </summary> /// </summary>
ForceNotSlider = 1 << 6, ForceNotSlider = 1 << 6,
/// <summary> /// <summary>
/// Notes gathered together. /// Notes gathered together.
/// </summary> /// </summary>
Gathered = 1 << 7, Gathered = 1 << 7,
Mirror = 1 << 8, Mirror = 1 << 8,
/// <summary> /// <summary>
/// Change 0 -> 6. /// Change 0 -> 6.
/// </summary> /// </summary>
Reverse = 1 << 9, Reverse = 1 << 9,
/// <summary> /// <summary>
/// 1 -> 5 -> 1 -> 5 like reverse. /// 1 -> 5 -> 1 -> 5 like reverse.
/// </summary> /// </summary>
Cycle = 1 << 10, Cycle = 1 << 10,
/// <summary> /// <summary>
/// Next note will be at column + 1. /// Next note will be at column + 1.
/// </summary> /// </summary>
Stair = 1 << 11, Stair = 1 << 11,
/// <summary> /// <summary>
/// Next note will be at column - 1. /// Next note will be at column - 1.
/// </summary> /// </summary>

View File

@ -19,6 +19,7 @@ namespace osu.Game.Rulesets.Mania
{ {
[Description("Special 1")] [Description("Special 1")]
Special1 = 1, Special1 = 1,
[Description("Special 2")] [Description("Special 2")]
Special2, Special2,
@ -26,38 +27,55 @@ namespace osu.Game.Rulesets.Mania
// above at a later time, without breaking replays/configs. // above at a later time, without breaking replays/configs.
[Description("Key 1")] [Description("Key 1")]
Key1 = 10, Key1 = 10,
[Description("Key 2")] [Description("Key 2")]
Key2, Key2,
[Description("Key 3")] [Description("Key 3")]
Key3, Key3,
[Description("Key 4")] [Description("Key 4")]
Key4, Key4,
[Description("Key 5")] [Description("Key 5")]
Key5, Key5,
[Description("Key 6")] [Description("Key 6")]
Key6, Key6,
[Description("Key 7")] [Description("Key 7")]
Key7, Key7,
[Description("Key 8")] [Description("Key 8")]
Key8, Key8,
[Description("Key 9")] [Description("Key 9")]
Key9, Key9,
[Description("Key 10")] [Description("Key 10")]
Key10, Key10,
[Description("Key 11")] [Description("Key 11")]
Key11, Key11,
[Description("Key 12")] [Description("Key 12")]
Key12, Key12,
[Description("Key 13")] [Description("Key 13")]
Key13, Key13,
[Description("Key 14")] [Description("Key 14")]
Key14, Key14,
[Description("Key 15")] [Description("Key 15")]
Key15, Key15,
[Description("Key 16")] [Description("Key 16")]
Key16, Key16,
[Description("Key 17")] [Description("Key 17")]
Key17, Key17,
[Description("Key 18")] [Description("Key 18")]
Key18, Key18,
} }

View File

@ -37,11 +37,11 @@ namespace osu.Game.Rulesets.Mania.MathUtils
/// <returns>The random value.</returns> /// <returns>The random value.</returns>
public uint NextUInt() public uint NextUInt()
{ {
uint t = X ^ X << 11; uint t = X ^ (X << 11);
X = Y; X = Y;
Y = Z; Y = Z;
Z = W; Z = W;
return W = W ^ W >> 19 ^ t ^ t >> 8; return W = W ^ (W >> 19) ^ t ^ (t >> 8);
} }
/// <summary> /// <summary>

View File

@ -82,6 +82,7 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables.Pieces
{ {
if (accentColour == value) if (accentColour == value)
return; return;
accentColour = value; accentColour = value;
updateAccentColour(); updateAccentColour();

View File

@ -35,6 +35,7 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables.Pieces
} }
private Color4 accentColour; private Color4 accentColour;
public Color4 AccentColour public Color4 AccentColour
{ {
get { return accentColour; } get { return accentColour; }
@ -42,6 +43,7 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables.Pieces
{ {
if (accentColour == value) if (accentColour == value)
return; return;
accentColour = value; accentColour = value;
updateGlow(); updateGlow();

View File

@ -56,6 +56,7 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables.Pieces
} }
private Color4 accentColour; private Color4 accentColour;
public Color4 AccentColour public Color4 AccentColour
{ {
get { return accentColour; } get { return accentColour; }
@ -63,6 +64,7 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables.Pieces
{ {
if (accentColour == value) if (accentColour == value)
return; return;
accentColour = value; accentColour = value;
colouredBox.Colour = AccentColour.Lighten(0.9f); colouredBox.Colour = AccentColour.Lighten(0.9f);

View File

@ -17,6 +17,7 @@ namespace osu.Game.Rulesets.Mania.Objects
public double EndTime => StartTime + Duration; public double EndTime => StartTime + Duration;
private double duration; private double duration;
public double Duration public double Duration
{ {
get { return duration; } get { return duration; }

View File

@ -97,6 +97,7 @@ namespace osu.Game.Rulesets.Mania.UI
public override Axes RelativeSizeAxes => Axes.Y; public override Axes RelativeSizeAxes => Axes.Y;
private bool isSpecial; private bool isSpecial;
public bool IsSpecial public bool IsSpecial
{ {
get { return isSpecial; } get { return isSpecial; }
@ -104,6 +105,7 @@ namespace osu.Game.Rulesets.Mania.UI
{ {
if (isSpecial == value) if (isSpecial == value)
return; return;
isSpecial = value; isSpecial = value;
Width = isSpecial ? special_column_width : column_width; Width = isSpecial ? special_column_width : column_width;
@ -111,6 +113,7 @@ namespace osu.Game.Rulesets.Mania.UI
} }
private Color4 accentColour; private Color4 accentColour;
public Color4 AccentColour public Color4 AccentColour
{ {
get { return accentColour; } get { return accentColour; }
@ -118,6 +121,7 @@ namespace osu.Game.Rulesets.Mania.UI
{ {
if (accentColour == value) if (accentColour == value)
return; return;
accentColour = value; accentColour = value;
background.AccentColour = value; background.AccentColour = value;

View File

@ -70,6 +70,7 @@ namespace osu.Game.Rulesets.Mania.UI.Components
{ {
if (accentColour == value) if (accentColour == value)
return; return;
accentColour = value; accentColour = value;
updateColours(); updateColours();

View File

@ -73,6 +73,7 @@ namespace osu.Game.Rulesets.Mania.UI.Components
{ {
if (accentColour == value) if (accentColour == value)
return; return;
accentColour = value; accentColour = value;
updateColours(); updateColours();

View File

@ -87,6 +87,7 @@ namespace osu.Game.Rulesets.Mania.UI.Components
{ {
if (accentColour == value) if (accentColour == value)
return; return;
accentColour = value; accentColour = value;
updateColours(); updateColours();

View File

@ -33,9 +33,11 @@ namespace osu.Game.Rulesets.Osu.Tests
case Slider slider: case Slider slider:
foreach (var nested in slider.NestedHitObjects) foreach (var nested in slider.NestedHitObjects)
yield return createConvertValue(nested); yield return createConvertValue(nested);
break; break;
default: default:
yield return createConvertValue(hitObject); yield return createConvertValue(hitObject);
break; break;
} }

View File

@ -89,7 +89,8 @@ namespace osu.Game.Rulesets.Osu.Tests
{ {
private readonly bool auto; private readonly bool auto;
public TestDrawableHitCircle(HitCircle h, bool auto) : base(h) public TestDrawableHitCircle(HitCircle h, bool auto)
: base(h)
{ {
this.auto = auto; this.auto = auto;
} }

View File

@ -301,6 +301,7 @@ namespace osu.Game.Rulesets.Osu.Tests
} }
private float judgementOffsetDirection = 1; private float judgementOffsetDirection = 1;
private void onNewResult(DrawableHitObject judgedObject, JudgementResult result) private void onNewResult(DrawableHitObject judgedObject, JudgementResult result)
{ {
var osuObject = judgedObject as DrawableOsuHitObject; var osuObject = judgedObject as DrawableOsuHitObject;

View File

@ -67,7 +67,8 @@ namespace osu.Game.Rulesets.Osu.Tests
{ {
private bool auto; private bool auto;
public TestDrawableSpinner(Spinner s, bool auto) : base(s) public TestDrawableSpinner(Spinner s, bool auto)
: base(s)
{ {
this.auto = auto; this.auto = auto;
} }

View File

@ -126,8 +126,10 @@ namespace osu.Game.Rulesets.Osu.Difficulty
{ {
// Apply object-based bonus for flashlight. // Apply object-based bonus for flashlight.
aimValue *= 1.0f + 0.35f * Math.Min(1.0f, totalHits / 200.0f) + aimValue *= 1.0f + 0.35f * Math.Min(1.0f, totalHits / 200.0f) +
(totalHits > 200 ? 0.3f * Math.Min(1.0f, (totalHits - 200) / 300.0f) + (totalHits > 200
(totalHits > 500 ? (totalHits - 500) / 1200.0f : 0.0f) : 0.0f); ? 0.3f * Math.Min(1.0f, (totalHits - 200) / 300.0f) +
(totalHits > 500 ? (totalHits - 500) / 1200.0f : 0.0f)
: 0.0f);
} }
// Scale the aim value with accuracy _slightly_ // Scale the aim value with accuracy _slightly_

View File

@ -92,6 +92,7 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Preprocessing
{ {
if (slider.LazyEndPosition != null) if (slider.LazyEndPosition != null)
return; return;
slider.LazyEndPosition = slider.StackedPosition; slider.LazyEndPosition = slider.StackedPosition;
float approxFollowCircleRadius = (float)(slider.Radius * 3); float approxFollowCircleRadius = (float)(slider.Radius * 3);

View File

@ -9,8 +9,10 @@ namespace osu.Game.Rulesets.Osu.Judgements
{ {
[Description(@"")] [Description(@"")]
None, None,
[Description(@"Good")] [Description(@"Good")]
Good, Good,
[Description(@"Amazing")] [Description(@"Amazing")]
Perfect Perfect
} }

View File

@ -20,7 +20,8 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
public override bool DisplayResult => false; public override bool DisplayResult => false;
public DrawableSliderTick(SliderTick sliderTick) : base(sliderTick) public DrawableSliderTick(SliderTick sliderTick)
: base(sliderTick)
{ {
Size = new Vector2(16) * sliderTick.Scale; Size = new Vector2(16) * sliderTick.Scale;
Origin = Anchor.Centre; Origin = Anchor.Centre;

View File

@ -42,7 +42,8 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
private Color4 normalColour; private Color4 normalColour;
private Color4 completeColour; private Color4 completeColour;
public DrawableSpinner(Spinner s) : base(s) public DrawableSpinner(Spinner s)
: base(s)
{ {
Origin = Anchor.Centre; Origin = Anchor.Centre;
Position = s.Position; Position = s.Position;

View File

@ -40,6 +40,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
{ {
if (path.AccentColour == value) if (path.AccentColour == value)
return; return;
path.AccentColour = value; path.AccentColour = value;
container.ForceRedraw(); container.ForceRedraw();
@ -56,6 +57,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
{ {
if (path.BorderColour == value) if (path.BorderColour == value)
return; return;
path.BorderColour = value; path.BorderColour = value;
container.ForceRedraw(); container.ForceRedraw();
@ -105,6 +107,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
{ {
if (borderColour == value) if (borderColour == value)
return; return;
borderColour = value; borderColour = value;
InvalidateTexture(); InvalidateTexture();
@ -120,6 +123,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
{ {
if (accentColour == value) if (accentColour == value)
return; return;
accentColour = value; accentColour = value;
InvalidateTexture(); InvalidateTexture();

View File

@ -43,12 +43,14 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => true; public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => true;
private bool tracking; private bool tracking;
public bool Tracking public bool Tracking
{ {
get { return tracking; } get { return tracking; }
set set
{ {
if (value == tracking) return; if (value == tracking) return;
tracking = value; tracking = value;
background.FadeTo(tracking ? tracking_alpha : idle_alpha, 100); background.FadeTo(tracking ? tracking_alpha : idle_alpha, 100);
@ -56,12 +58,14 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
} }
private bool complete; private bool complete;
public bool Complete public bool Complete
{ {
get { return complete; } get { return complete; }
set set
{ {
if (value == complete) return; if (value == complete) return;
complete = value; complete = value;
updateCompleteTick(); updateCompleteTick();

View File

@ -45,6 +45,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
private set private set
{ {
if (value == spm) return; if (value == spm) return;
spm = value; spm = value;
spmText.Text = Math.Truncate(value).ToString(@"#0"); spmText.Text = Math.Truncate(value).ToString(@"#0");
} }

View File

@ -262,6 +262,7 @@ namespace osu.Game.Rulesets.Osu.Objects
{ {
if (nodeIndex < NodeSamples.Count) if (nodeIndex < NodeSamples.Count)
return NodeSamples[nodeIndex]; return NodeSamples[nodeIndex];
return Samples; return Samples;
} }

View File

@ -38,6 +38,7 @@ namespace osu.Game.Rulesets.Osu
protected override bool Handle(UIEvent e) protected override bool Handle(UIEvent e)
{ {
if (!AllowUserPresses) return false; if (!AllowUserPresses) return false;
return base.Handle(e); return base.Handle(e);
} }
} }

View File

@ -121,7 +121,8 @@ namespace osu.Game.Rulesets.Osu
new OsuModAutopilot(), new OsuModAutopilot(),
}; };
case ModType.Fun: case ModType.Fun:
return new Mod[] { return new Mod[]
{
new OsuModTransform(), new OsuModTransform(),
new OsuModWiggle(), new OsuModWiggle(),
new OsuModGrow() new OsuModGrow()

View File

@ -20,6 +20,7 @@ namespace osu.Game.Rulesets.Osu.Replays
/// Constants (for spinners). /// Constants (for spinners).
/// </summary> /// </summary>
protected static readonly Vector2 SPINNER_CENTRE = OsuPlayfield.BASE_SIZE / 2; protected static readonly Vector2 SPINNER_CENTRE = OsuPlayfield.BASE_SIZE / 2;
protected const float SPIN_RADIUS = 50; protected const float SPIN_RADIUS = 50;
/// <summary> /// <summary>
@ -46,6 +47,7 @@ namespace osu.Game.Rulesets.Osu.Replays
#endregion #endregion
#region Utilities #region Utilities
protected double ApplyModsToTime(double v) => v; protected double ApplyModsToTime(double v) => v;
protected double ApplyModsToRate(double v) => v; protected double ApplyModsToRate(double v) => v;

View File

@ -255,10 +255,13 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor
{ {
[VertexMember(2, VertexAttribPointerType.Float)] [VertexMember(2, VertexAttribPointerType.Float)]
public Vector2 Position; public Vector2 Position;
[VertexMember(4, VertexAttribPointerType.Float)] [VertexMember(4, VertexAttribPointerType.Float)]
public Color4 Colour; public Color4 Colour;
[VertexMember(2, VertexAttribPointerType.Float)] [VertexMember(2, VertexAttribPointerType.Float)]
public Vector2 TexturePosition; public Vector2 TexturePosition;
[VertexMember(1, VertexAttribPointerType.Float)] [VertexMember(1, VertexAttribPointerType.Float)]
public float Time; public float Time;

View File

@ -213,6 +213,7 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor
public void Expand() public void Expand()
{ {
if (!cursorExpand) return; if (!cursorExpand) return;
expandTarget.ScaleTo(released_scale).ScaleTo(pressed_scale, 100, Easing.OutQuad); expandTarget.ScaleTo(released_scale).ScaleTo(pressed_scale, 100, Easing.OutQuad);
} }

View File

@ -229,6 +229,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
// Ensure alternating centre and rim hits // Ensure alternating centre and rim hits
if (lastWasCentre == isCentre) if (lastWasCentre == isCentre)
return false; return false;
lastWasCentre = isCentre; lastWasCentre = isCentre;
UpdateResult(true); UpdateResult(true);

View File

@ -49,6 +49,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
protected void ProxyContent() protected void ProxyContent()
{ {
if (isProxied) return; if (isProxied) return;
isProxied = true; isProxied = true;
nonProxiedContent.Remove(Content); nonProxiedContent.Remove(Content);
@ -62,6 +63,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
protected void UnproxyContent() protected void UnproxyContent()
{ {
if (!isProxied) return; if (!isProxied) return;
isProxied = false; isProxied = false;
proxiedContent.Remove(Content); proxiedContent.Remove(Content);

View File

@ -11,6 +11,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables.Pieces
public class TaikoPiece : BeatSyncedContainer, IHasAccentColour public class TaikoPiece : BeatSyncedContainer, IHasAccentColour
{ {
private Color4 accentColour; private Color4 accentColour;
/// <summary> /// <summary>
/// The colour of the inner circle and outer glows. /// The colour of the inner circle and outer glows.
/// </summary> /// </summary>
@ -21,16 +22,14 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables.Pieces
} }
private bool kiaiMode; private bool kiaiMode;
/// <summary> /// <summary>
/// Whether Kiai mode effects are enabled for this circle piece. /// Whether Kiai mode effects are enabled for this circle piece.
/// </summary> /// </summary>
public virtual bool KiaiMode public virtual bool KiaiMode
{ {
get { return kiaiMode; } get { return kiaiMode; }
set set { kiaiMode = value; }
{
kiaiMode = value;
}
} }
public TaikoPiece() public TaikoPiece()

View File

@ -23,6 +23,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables.Pieces
private const float tick_size = 0.35f; private const float tick_size = 0.35f;
private bool filled; private bool filled;
public bool Filled public bool Filled
{ {
get { return filled; } get { return filled; }

View File

@ -19,7 +19,10 @@ namespace osu.Game.Rulesets.Taiko.Objects
/// </summary> /// </summary>
public int RequiredHits = 10; public int RequiredHits = 10;
public override bool IsStrong { set => throw new NotSupportedException($"{nameof(Swell)} cannot be a strong hitobject."); } public override bool IsStrong
{
set => throw new NotSupportedException($"{nameof(Swell)} cannot be a strong hitobject.");
}
protected override void CreateNestedHitObjects() protected override void CreateNestedHitObjects()
{ {

View File

@ -19,10 +19,13 @@ namespace osu.Game.Rulesets.Taiko
{ {
[Description("Left (rim)")] [Description("Left (rim)")]
LeftRim, LeftRim,
[Description("Left (centre)")] [Description("Left (centre)")]
LeftCentre, LeftCentre,
[Description("Right (centre)")] [Description("Right (centre)")]
RightCentre, RightCentre,
[Description("Right (rim)")] [Description("Right (rim)")]
RightRim RightRim
} }

View File

@ -141,6 +141,7 @@ namespace osu.Game.Tests.Visual
} }
private SortedList<TimingControlPoint> timingPoints => Beatmap.Value.Beatmap.ControlPointInfo.TimingPoints; private SortedList<TimingControlPoint> timingPoints => Beatmap.Value.Beatmap.ControlPointInfo.TimingPoints;
private TimingControlPoint getNextTimingPoint(TimingControlPoint current) private TimingControlPoint getNextTimingPoint(TimingControlPoint current)
{ {
if (timingPoints[timingPoints.Count - 1] == current) if (timingPoints[timingPoints.Count - 1] == current)

View File

@ -150,6 +150,7 @@ namespace osu.Game.Tests.Visual
var currentlySelected = carousel.Items.Find(s => s.Item is CarouselBeatmap && s.Item.State.Value == CarouselItemState.Selected); var currentlySelected = carousel.Items.Find(s => s.Item is CarouselBeatmap && s.Item.State.Value == CarouselItemState.Selected);
if (currentlySelected == null) if (currentlySelected == null)
return true; return true;
return currentlySelected.Item.Visible; return currentlySelected.Item.Visible;
} }
@ -522,6 +523,7 @@ namespace osu.Game.Tests.Visual
} }
}); });
} }
return toReturn; return toReturn;
} }

View File

@ -265,6 +265,7 @@ namespace osu.Game.Tests.Visual
pauseOverlay.OnRetry = lastAction; pauseOverlay.OnRetry = lastAction;
lastAction = null; lastAction = null;
} }
return triggered; return triggered;
}); });
AddAssert("Overlay is closed", () => pauseOverlay.State == Visibility.Hidden); AddAssert("Overlay is closed", () => pauseOverlay.State == Visibility.Hidden);

View File

@ -20,7 +20,8 @@ namespace osu.Game.Tests.Visual
[Description("PlaySongSelect leaderboard")] [Description("PlaySongSelect leaderboard")]
public class TestCaseLeaderboard : OsuTestCase public class TestCaseLeaderboard : OsuTestCase
{ {
public override IReadOnlyList<Type> RequiredTypes => new[] { public override IReadOnlyList<Type> RequiredTypes => new[]
{
typeof(Placeholder), typeof(Placeholder),
typeof(MessagePlaceholder), typeof(MessagePlaceholder),
typeof(RetrievalFailurePlaceholder), typeof(RetrievalFailurePlaceholder),

View File

@ -50,7 +50,10 @@ namespace osu.Game.Tests.Visual
}); });
AddStep("Restart", restart); AddStep("Restart", restart);
AddToggleStep("Passing", passing => { if (storyboard != null) storyboard.Passing = passing; }); AddToggleStep("Passing", passing =>
{
if (storyboard != null) storyboard.Passing = passing;
});
} }
[BackgroundDependencyLoader] [BackgroundDependencyLoader]

View File

@ -50,12 +50,14 @@ namespace osu.Game.Audio
{ {
if (!string.IsNullOrEmpty(Suffix)) if (!string.IsNullOrEmpty(Suffix))
yield return $"{Namespace}/{Bank}-{Name}{Suffix}"; yield return $"{Namespace}/{Bank}-{Name}{Suffix}";
yield return $"{Namespace}/{Bank}-{Name}"; yield return $"{Namespace}/{Bank}-{Name}";
} }
// check non-namespace as a fallback even when we have a namespace // check non-namespace as a fallback even when we have a namespace
if (!string.IsNullOrEmpty(Suffix)) if (!string.IsNullOrEmpty(Suffix))
yield return $"{Bank}-{Name}{Suffix}"; yield return $"{Bank}-{Name}{Suffix}";
yield return $"{Bank}-{Name}"; yield return $"{Bank}-{Name}";
} }
} }

View File

@ -16,6 +16,7 @@ namespace osu.Game.Beatmaps
where T : HitObject where T : HitObject
{ {
private event Action<HitObject, IEnumerable<HitObject>> ObjectConverted; private event Action<HitObject, IEnumerable<HitObject>> ObjectConverted;
event Action<HitObject, IEnumerable<HitObject>> IBeatmapConverter.ObjectConverted event Action<HitObject, IEnumerable<HitObject>> IBeatmapConverter.ObjectConverted
{ {
add => ObjectConverted += value; add => ObjectConverted += value;

View File

@ -48,6 +48,7 @@ namespace osu.Game.Beatmaps
return mid + (max - mid) * (difficulty - 5) / 5; return mid + (max - mid) * (difficulty - 5) / 5;
if (difficulty < 5) if (difficulty < 5)
return mid - (mid - min) * (5 - difficulty) / 5; return mid - (mid - min) * (5 - difficulty) / 5;
return mid; return mid;
} }

View File

@ -48,6 +48,7 @@ namespace osu.Game.Beatmaps
[JsonProperty(@"tags")] [JsonProperty(@"tags")]
public string Tags { get; set; } public string Tags { get; set; }
public int PreviewTime { get; set; } public int PreviewTime { get; set; }
public string AudioFile { get; set; } public string AudioFile { get; set; }
public string BackgroundFile { get; set; } public string BackgroundFile { get; set; }

View File

@ -34,6 +34,7 @@ namespace osu.Game.Beatmaps
Refresh(ref beatmap, Beatmaps); Refresh(ref beatmap, Beatmaps);
if (beatmap.Hidden) return false; if (beatmap.Hidden) return false;
beatmap.Hidden = true; beatmap.Hidden = true;
} }
@ -53,6 +54,7 @@ namespace osu.Game.Beatmaps
Refresh(ref beatmap, Beatmaps); Refresh(ref beatmap, Beatmaps);
if (!beatmap.Hidden) return false; if (!beatmap.Hidden) return false;
beatmap.Hidden = false; beatmap.Hidden = false;
} }

View File

@ -23,6 +23,7 @@ namespace osu.Game.Beatmaps.Drawables
{ {
if (status == value) if (status == value)
return; return;
status = value; status = value;
Alpha = value == BeatmapSetOnlineStatus.None ? 0 : 1; Alpha = value == BeatmapSetOnlineStatus.None ? 0 : 1;

View File

@ -53,6 +53,7 @@ namespace osu.Game.Beatmaps.Drawables
if (rating < 3.75) return DifficultyRating.Hard; if (rating < 3.75) return DifficultyRating.Hard;
if (rating < 5.25) return DifficultyRating.Insane; if (rating < 5.25) return DifficultyRating.Insane;
if (rating < 6.75) return DifficultyRating.Expert; if (rating < 6.75) return DifficultyRating.Expert;
return DifficultyRating.ExpertPlus; return DifficultyRating.ExpertPlus;
} }

View File

@ -25,7 +25,8 @@ namespace osu.Game.Beatmaps.Drawables
protected override Drawable CreateDrawable(BeatmapInfo model) protected override Drawable CreateDrawable(BeatmapInfo model)
{ {
return new DelayedLoadUnloadWrapper(() => { return new DelayedLoadUnloadWrapper(() =>
{
Drawable drawable; Drawable drawable;
var localBeatmap = beatmaps.GetWorkingBeatmap(model); var localBeatmap = beatmaps.GetWorkingBeatmap(model);

View File

@ -13,12 +13,14 @@ namespace osu.Game.Beatmaps.Drawables
private Drawable displayedCover; private Drawable displayedCover;
private BeatmapSetInfo beatmapSet; private BeatmapSetInfo beatmapSet;
public BeatmapSetInfo BeatmapSet public BeatmapSetInfo BeatmapSet
{ {
get { return beatmapSet; } get { return beatmapSet; }
set set
{ {
if (value == beatmapSet) return; if (value == beatmapSet) return;
beatmapSet = value; beatmapSet = value;
if (IsLoaded) if (IsLoaded)
@ -27,12 +29,14 @@ namespace osu.Game.Beatmaps.Drawables
} }
private BeatmapSetCoverType coverType = BeatmapSetCoverType.Cover; private BeatmapSetCoverType coverType = BeatmapSetCoverType.Cover;
public BeatmapSetCoverType CoverType public BeatmapSetCoverType CoverType
{ {
get { return coverType; } get { return coverType; }
set set
{ {
if (value == coverType) return; if (value == coverType) return;
coverType = value; coverType = value;
if (IsLoaded) if (IsLoaded)

View File

@ -72,6 +72,7 @@ namespace osu.Game.Beatmaps.Formats
var index = line.AsSpan().IndexOf("//".AsSpan()); var index = line.AsSpan().IndexOf("//".AsSpan());
if (index > 0) if (index > 0)
return line.Substring(0, index); return line.Substring(0, index);
return line; return line;
} }
@ -115,6 +116,7 @@ namespace osu.Game.Beatmaps.Formats
else else
{ {
if (!(output is IHasCustomColours tHasCustomColours)) return; if (!(output is IHasCustomColours tHasCustomColours)) return;
tHasCustomColours.CustomColours[pair.Key] = colour; tHasCustomColours.CustomColours[pair.Key] = colour;
} }
} }

View File

@ -9,6 +9,7 @@ namespace osu.Game.Configuration
{ {
[Description("Never repeat")] [Description("Never repeat")]
RandomPermutation, RandomPermutation,
[Description("Random")] [Description("Random")]
Random Random
} }

View File

@ -8,8 +8,10 @@ namespace osu.Game.Configuration
public enum RankingType public enum RankingType
{ {
Local, Local,
[Description("Global")] [Description("Global")]
Top, Top,
[Description("Selected Mods")] [Description("Selected Mods")]
SelectedMod, SelectedMod,
Friends, Friends,

View File

@ -9,6 +9,7 @@ namespace osu.Game.Configuration
{ {
Off, Off,
Everything, Everything,
[Description("Excluding overlays")] [Description("Excluding overlays")]
ExcludeOverlays, ExcludeOverlays,
Gameplay, Gameplay,

View File

@ -9,6 +9,7 @@ namespace osu.Game.Configuration
{ {
[Description("JPG (web-friendly)")] [Description("JPG (web-friendly)")]
Jpg = 1, Jpg = 1,
[Description("PNG (lossless)")] [Description("PNG (lossless)")]
Png = 2 Png = 2
} }

View File

@ -9,8 +9,10 @@ namespace osu.Game.Configuration
{ {
[Description("Sequential")] [Description("Sequential")]
Sequential, Sequential,
[Description("Overlapping")] [Description("Overlapping")]
Overlapping, Overlapping,
[Description("Constant")] [Description("Constant")]
Constant Constant
} }

View File

@ -539,6 +539,7 @@ namespace osu.Game.Database
return new LegacyDirectoryArchiveReader(path); return new LegacyDirectoryArchiveReader(path);
if (File.Exists(path)) if (File.Exists(path))
return new LegacyFileArchiveReader(path); return new LegacyFileArchiveReader(path);
throw new InvalidFormatException($"{path} is not a valid archive"); throw new InvalidFormatException($"{path} is not a valid archive");
} }
} }

View File

@ -31,6 +31,7 @@ namespace osu.Game.Database
protected void Dispose(bool disposing) protected void Dispose(bool disposing)
{ {
if (isDisposed) return; if (isDisposed) return;
isDisposed = true; isDisposed = true;
try try

View File

@ -71,6 +71,7 @@ namespace osu.Game.Database
Refresh(ref item); Refresh(ref item);
if (item.DeletePending) return false; if (item.DeletePending) return false;
item.DeletePending = true; item.DeletePending = true;
} }
@ -89,6 +90,7 @@ namespace osu.Game.Database
Refresh(ref item, ConsumableItems); Refresh(ref item, ConsumableItems);
if (!item.DeletePending) return false; if (!item.DeletePending) return false;
item.DeletePending = false; item.DeletePending = false;
} }

View File

@ -110,10 +110,10 @@ namespace osu.Game.Graphics.Backgrounds
if (CreateNewTriangles) if (CreateNewTriangles)
addTriangles(false); addTriangles(false);
float adjustedAlpha = HideAlphaDiscrepancies ? float adjustedAlpha = HideAlphaDiscrepancies
// Cubically scale alpha to make it drop off more sharply. // Cubically scale alpha to make it drop off more sharply.
(float)Math.Pow(DrawColourInfo.Colour.AverageColour.Linear.A, 3) : ? (float)Math.Pow(DrawColourInfo.Colour.AverageColour.Linear.A, 3)
1; : 1;
float elapsedSeconds = (float)Time.Elapsed / 1000; float elapsedSeconds = (float)Time.Elapsed / 1000;
// Since position is relative, the velocity needs to scale inversely with DrawHeight. // Since position is relative, the velocity needs to scale inversely with DrawHeight.
@ -181,6 +181,7 @@ namespace osu.Game.Graphics.Backgrounds
protected override DrawNode CreateDrawNode() => new TrianglesDrawNode(); protected override DrawNode CreateDrawNode() => new TrianglesDrawNode();
private readonly TrianglesDrawNodeSharedData sharedData = new TrianglesDrawNodeSharedData(); private readonly TrianglesDrawNodeSharedData sharedData = new TrianglesDrawNodeSharedData();
protected override void ApplyDrawNode(DrawNode node) protected override void ApplyDrawNode(DrawNode node)
{ {
base.ApplyDrawNode(node); base.ApplyDrawNode(node);

View File

@ -96,6 +96,7 @@ namespace osu.Game.Graphics.Containers
} }
else else
State = Visibility.Hidden; State = Visibility.Hidden;
break; break;
case Visibility.Hidden: case Visibility.Hidden:
if (PlaySamplesOnStateChange) samplePopOut?.Play(); if (PlaySamplesOnStateChange) samplePopOut?.Play();

View File

@ -12,7 +12,8 @@ namespace osu.Game.Graphics.Containers
{ {
public class OsuTextFlowContainer : TextFlowContainer public class OsuTextFlowContainer : TextFlowContainer
{ {
public OsuTextFlowContainer(Action<SpriteText> defaultCreationParameters = null) : base(defaultCreationParameters) public OsuTextFlowContainer(Action<SpriteText> defaultCreationParameters = null)
: base(defaultCreationParameters)
{ {
} }

View File

@ -110,6 +110,7 @@ namespace osu.Game.Graphics.Containers
private float headerHeight, footerHeight; private float headerHeight, footerHeight;
private readonly MarginPadding originalSectionsMargin; private readonly MarginPadding originalSectionsMargin;
private void updateSectionsMargin() private void updateSectionsMargin()
{ {
if (!Children.Any()) return; if (!Children.Any()) return;
@ -142,6 +143,7 @@ namespace osu.Game.Graphics.Containers
public void ScrollToTop() => scrollContainer.ScrollTo(0); public void ScrollToTop() => scrollContainer.ScrollTo(0);
private float lastKnownScroll; private float lastKnownScroll;
protected override void UpdateAfterChildren() protected override void UpdateAfterChildren()
{ {
base.UpdateAfterChildren(); base.UpdateAfterChildren();

View File

@ -85,6 +85,7 @@ namespace osu.Game.Graphics.Cursor
dragRotationState = DragRotationState.DragStarted; dragRotationState = DragRotationState.DragStarted;
positionMouseDown = e.MousePosition; positionMouseDown = e.MousePosition;
} }
return base.OnMouseDown(e); return base.OnMouseDown(e);
} }
@ -102,6 +103,7 @@ namespace osu.Game.Graphics.Cursor
activeCursor.RotateTo(0, 600 * (1 + Math.Abs(activeCursor.Rotation / 720)), Easing.OutElasticHalf); activeCursor.RotateTo(0, 600 * (1 + Math.Abs(activeCursor.Rotation / 720)), Easing.OutElasticHalf);
dragRotationState = DragRotationState.NotDragging; dragRotationState = DragRotationState.NotDragging;
} }
return base.OnMouseUp(e); return base.OnMouseUp(e);
} }

View File

@ -43,6 +43,7 @@ namespace osu.Game.Graphics.Cursor
} }
private IProvideCursor currentTarget; private IProvideCursor currentTarget;
protected override void Update() protected override void Update()
{ {
base.Update(); base.Update();

View File

@ -17,7 +17,8 @@ namespace osu.Game.Graphics.Cursor
{ {
protected override ITooltip CreateTooltip() => new OsuTooltip(); protected override ITooltip CreateTooltip() => new OsuTooltip();
public OsuTooltipContainer(CursorContainer cursor) : base(cursor) public OsuTooltipContainer(CursorContainer cursor)
: base(cursor)
{ {
} }

View File

@ -21,6 +21,7 @@ namespace osu.Game.Graphics
{ {
if (date == value) if (date == value)
return; return;
date = value.ToLocalTime(); date = value.ToLocalTime();
if (LoadState >= LoadState.Ready) if (LoadState >= LoadState.Ready)

View File

@ -65,6 +65,7 @@ namespace osu.Game.Graphics
} }
private FontAwesome loadedIcon; private FontAwesome loadedIcon;
private void updateTexture() private void updateTexture()
{ {
var loadableIcon = icon; var loadableIcon = icon;
@ -104,6 +105,7 @@ namespace osu.Game.Graphics
} }
private bool shadow; private bool shadow;
public bool Shadow public bool Shadow
{ {
get { return shadow; } get { return shadow; }
@ -119,10 +121,7 @@ namespace osu.Game.Graphics
public FontAwesome Icon public FontAwesome Icon
{ {
get get { return icon; }
{
return icon;
}
set set
{ {

View File

@ -26,10 +26,7 @@ namespace osu.Game.Graphics.UserInterface
/// </summary> /// </summary>
public float Length public float Length
{ {
get get { return length; }
{
return length;
}
set set
{ {
length = MathHelper.Clamp(value, 0, 1); length = MathHelper.Clamp(value, 0, 1);
@ -39,35 +36,21 @@ namespace osu.Game.Graphics.UserInterface
public Color4 BackgroundColour public Color4 BackgroundColour
{ {
get get => background.Colour;
{ set => background.Colour = value;
return background.Colour;
}
set
{
background.Colour = value;
}
} }
public Color4 AccentColour public Color4 AccentColour
{ {
get get => bar.Colour;
{ set => bar.Colour = value;
return bar.Colour;
}
set
{
bar.Colour = value;
}
} }
private BarDirection direction = BarDirection.LeftToRight; private BarDirection direction = BarDirection.LeftToRight;
public BarDirection Direction public BarDirection Direction
{ {
get get { return direction; }
{
return direction;
}
set set
{ {
direction = value; direction = value;

View File

@ -17,6 +17,7 @@ namespace osu.Game.Graphics.UserInterface
public float? MaxValue { get; set; } public float? MaxValue { get; set; }
private BarDirection direction = BarDirection.BottomToTop; private BarDirection direction = BarDirection.BottomToTop;
public new BarDirection Direction public new BarDirection Direction
{ {
get get
@ -69,6 +70,7 @@ namespace osu.Game.Graphics.UserInterface
}); });
} }
} }
//I'm using ToList() here because Where() returns an Enumerable which can change it's elements afterwards //I'm using ToList() here because Where() returns an Enumerable which can change it's elements afterwards
RemoveRange(Children.Where((bar, index) => index >= value.Count()).ToList()); RemoveRange(Children.Where((bar, index) => index >= value.Count()).ToList());
} }

View File

@ -61,6 +61,7 @@ namespace osu.Game.Graphics.UserInterface
set set
{ {
if (value == state) return; if (value == state) return;
state = value; state = value;
const float transition_duration = 500; const float transition_duration = 500;
@ -80,7 +81,8 @@ namespace osu.Game.Graphics.UserInterface
} }
} }
public BreadcrumbTabItem(T value) : base(value) public BreadcrumbTabItem(T value)
: base(value)
{ {
Text.Font = Text.Font.With(size: 18); Text.Font = Text.Font.With(size: 18);
Text.Margin = new MarginPadding { Vertical = 8 }; Text.Margin = new MarginPadding { Vertical = 8 };

View File

@ -154,12 +154,10 @@ namespace osu.Game.Graphics.UserInterface
} }
private Color4 buttonColour; private Color4 buttonColour;
public Color4 ButtonColour public Color4 ButtonColour
{ {
get get { return buttonColour; }
{
return buttonColour;
}
set set
{ {
buttonColour = value; buttonColour = value;
@ -169,12 +167,10 @@ namespace osu.Game.Graphics.UserInterface
} }
private Color4 backgroundColour = OsuColour.Gray(34); private Color4 backgroundColour = OsuColour.Gray(34);
public Color4 BackgroundColour public Color4 BackgroundColour
{ {
get get { return backgroundColour; }
{
return backgroundColour;
}
set set
{ {
backgroundColour = value; backgroundColour = value;
@ -183,12 +179,10 @@ namespace osu.Game.Graphics.UserInterface
} }
private string text; private string text;
public string Text public string Text
{ {
get get { return text; }
{
return text;
}
set set
{ {
text = value; text = value;

View File

@ -17,7 +17,8 @@ namespace osu.Game.Graphics.UserInterface
{ {
private SampleChannel sampleClick; private SampleChannel sampleClick;
public HoverClickSounds(HoverSampleSet sampleSet = HoverSampleSet.Normal) : base(sampleSet) public HoverClickSounds(HoverSampleSet sampleSet = HoverSampleSet.Normal)
: base(sampleSet)
{ {
} }

View File

@ -45,8 +45,10 @@ namespace osu.Game.Graphics.UserInterface
{ {
[Description("")] [Description("")]
Loud, Loud,
[Description("-soft")] [Description("-soft")]
Normal, Normal,
[Description("-softer")] [Description("-softer")]
Soft Soft
} }

View File

@ -112,6 +112,7 @@ namespace osu.Game.Graphics.UserInterface
protected float GetYPosition(float value) protected float GetYPosition(float value)
{ {
if (ActualMaxValue == ActualMinValue) return 0; if (ActualMaxValue == ActualMinValue) return 0;
return (ActualMaxValue - value) / (ActualMaxValue - ActualMinValue); return (ActualMaxValue - value) / (ActualMaxValue - ActualMinValue);
} }
} }

View File

@ -72,6 +72,7 @@ namespace osu.Game.Graphics.UserInterface
} }
private bool glowing; private bool glowing;
public bool Glowing public bool Glowing
{ {
get { return glowing; } get { return glowing; }
@ -94,10 +95,7 @@ namespace osu.Game.Graphics.UserInterface
public bool Expanded public bool Expanded
{ {
set set { this.ResizeTo(new Vector2(value ? EXPANDED_SIZE : COLLAPSED_SIZE, 12), 500, Easing.OutQuint); }
{
this.ResizeTo(new Vector2(value ? EXPANDED_SIZE : COLLAPSED_SIZE, 12), 500, Easing.OutQuint);
}
} }
private readonly Bindable<bool> current = new Bindable<bool>(); private readonly Bindable<bool> current = new Bindable<bool>();
@ -116,6 +114,7 @@ namespace osu.Game.Graphics.UserInterface
} }
private Color4 accentColour; private Color4 accentColour;
public Color4 AccentColour public Color4 AccentColour
{ {
get { return accentColour; } get { return accentColour; }
@ -128,6 +127,7 @@ namespace osu.Game.Graphics.UserInterface
} }
private Color4 glowingAccentColour; private Color4 glowingAccentColour;
public Color4 GlowingAccentColour public Color4 GlowingAccentColour
{ {
get { return glowingAccentColour; } get { return glowingAccentColour; }
@ -140,6 +140,7 @@ namespace osu.Game.Graphics.UserInterface
} }
private Color4 glowColour; private Color4 glowColour;
public Color4 GlowColour public Color4 GlowColour
{ {
get { return glowColour; } get { return glowColour; }

View File

@ -17,6 +17,7 @@ namespace osu.Game.Graphics.UserInterface
public class OsuDropdown<T> : Dropdown<T>, IHasAccentColour public class OsuDropdown<T> : Dropdown<T>, IHasAccentColour
{ {
private Color4 accentColour; private Color4 accentColour;
public Color4 AccentColour public Color4 AccentColour
{ {
get { return accentColour; } get { return accentColour; }
@ -49,6 +50,7 @@ namespace osu.Game.Graphics.UserInterface
protected override DropdownMenu CreateMenu() => new OsuDropdownMenu(); protected override DropdownMenu CreateMenu() => new OsuDropdownMenu();
#region OsuDropdownMenu #region OsuDropdownMenu
protected class OsuDropdownMenu : DropdownMenu, IHasAccentColour protected class OsuDropdownMenu : DropdownMenu, IHasAccentColour
{ {
public override bool HandleNonPositionalInput => State == MenuState.Open; public override bool HandleNonPositionalInput => State == MenuState.Open;
@ -83,6 +85,7 @@ namespace osu.Game.Graphics.UserInterface
} }
private Color4 accentColour; private Color4 accentColour;
public Color4 AccentColour public Color4 AccentColour
{ {
get { return accentColour; } get { return accentColour; }
@ -97,12 +100,14 @@ namespace osu.Game.Graphics.UserInterface
protected override DrawableMenuItem CreateDrawableMenuItem(MenuItem item) => new DrawableOsuDropdownMenuItem(item) { AccentColour = accentColour }; protected override DrawableMenuItem CreateDrawableMenuItem(MenuItem item) => new DrawableOsuDropdownMenuItem(item) { AccentColour = accentColour };
#region DrawableOsuDropdownMenuItem #region DrawableOsuDropdownMenuItem
public class DrawableOsuDropdownMenuItem : DrawableDropdownMenuItem, IHasAccentColour public class DrawableOsuDropdownMenuItem : DrawableDropdownMenuItem, IHasAccentColour
{ {
// IsHovered is used // IsHovered is used
public override bool HandlePositionalInput => true; public override bool HandlePositionalInput => true;
private Color4? accentColour; private Color4? accentColour;
public Color4 AccentColour public Color4 AccentColour
{ {
get { return accentColour ?? nonAccentSelectedColour; } get { return accentColour ?? nonAccentSelectedColour; }
@ -194,13 +199,16 @@ namespace osu.Game.Graphics.UserInterface
} }
} }
} }
#endregion #endregion
} }
#endregion #endregion
public class OsuDropdownHeader : DropdownHeader, IHasAccentColour public class OsuDropdownHeader : DropdownHeader, IHasAccentColour
{ {
protected readonly SpriteText Text; protected readonly SpriteText Text;
protected override string Label protected override string Label
{ {
get { return Text.Text; } get { return Text.Text; }
@ -210,6 +218,7 @@ namespace osu.Game.Graphics.UserInterface
protected readonly SpriteIcon Icon; protected readonly SpriteIcon Icon;
private Color4 accentColour; private Color4 accentColour;
public virtual Color4 AccentColour public virtual Color4 AccentColour
{ {
get { return accentColour; } get { return accentColour; }

View File

@ -35,6 +35,7 @@ namespace osu.Game.Graphics.UserInterface
public virtual string TooltipText { get; private set; } public virtual string TooltipText { get; private set; }
private Color4 accentColour; private Color4 accentColour;
public Color4 AccentColour public Color4 AccentColour
{ {
get { return accentColour; } get { return accentColour; }
@ -79,10 +80,7 @@ namespace osu.Game.Graphics.UserInterface
new HoverClickSounds() new HoverClickSounds()
}; };
Current.DisabledChanged += disabled => Current.DisabledChanged += disabled => { Alpha = disabled ? 0.3f : 1; };
{
Alpha = disabled ? 0.3f : 1;
};
} }
[BackgroundDependencyLoader] [BackgroundDependencyLoader]

View File

@ -58,6 +58,7 @@ namespace osu.Game.Graphics.UserInterface
} }
private Color4 accentColour; private Color4 accentColour;
public Color4 AccentColour public Color4 AccentColour
{ {
get { return accentColour; } get { return accentColour; }
@ -101,6 +102,7 @@ namespace osu.Game.Graphics.UserInterface
protected readonly Box Bar; protected readonly Box Bar;
private Color4 accentColour; private Color4 accentColour;
public Color4 AccentColour public Color4 AccentColour
{ {
get { return accentColour; } get { return accentColour; }
@ -146,7 +148,8 @@ namespace osu.Game.Graphics.UserInterface
AccentColour = colours.Blue; AccentColour = colours.Blue;
} }
public OsuTabItem(T value) : base(value) public OsuTabItem(T value)
: base(value)
{ {
AutoSizeAxes = Axes.X; AutoSizeAxes = Axes.X;
RelativeSizeAxes = Axes.Y; RelativeSizeAxes = Axes.Y;
@ -224,10 +227,7 @@ namespace osu.Game.Graphics.UserInterface
{ {
public override Color4 AccentColour public override Color4 AccentColour
{ {
get get { return base.AccentColour; }
{
return base.AccentColour;
}
set set
{ {

View File

@ -24,6 +24,7 @@ namespace osu.Game.Graphics.UserInterface
private readonly SpriteIcon icon; private readonly SpriteIcon icon;
private Color4? accentColour; private Color4? accentColour;
public Color4 AccentColour public Color4 AccentColour
{ {
get { return accentColour.GetValueOrDefault(); } get { return accentColour.GetValueOrDefault(); }

View File

@ -32,7 +32,8 @@ namespace osu.Game.Graphics.UserInterface
protected readonly SpriteText Text; protected readonly SpriteText Text;
public PageTabItem(T value) : base(value) public PageTabItem(T value)
: base(value)
{ {
AutoSizeAxes = Axes.X; AutoSizeAxes = Axes.X;
RelativeSizeAxes = Axes.Y; RelativeSizeAxes = Axes.Y;

View File

@ -54,6 +54,7 @@ namespace osu.Game.Graphics.UserInterface
{ {
if (EqualityComparer<T>.Default.Equals(displayedCount, value)) if (EqualityComparer<T>.Default.Equals(displayedCount, value))
return; return;
displayedCount = value; displayedCount = value;
DisplayedCountSpriteText.Text = FormatCount(value); DisplayedCountSpriteText.Text = FormatCount(value);
} }

View File

@ -137,6 +137,7 @@ namespace osu.Game.Graphics.UserInterface
private class Star : Container private class Star : Container
{ {
public readonly SpriteIcon Icon; public readonly SpriteIcon Icon;
public Star() public Star()
{ {
Size = new Vector2(star_size); Size = new Vector2(star_size);

View File

@ -48,10 +48,7 @@ namespace osu.Game.Graphics.UserInterface
public override Anchor Origin public override Anchor Origin
{ {
get get { return base.Origin; }
{
return base.Origin;
}
set set
{ {
@ -155,18 +152,12 @@ namespace osu.Game.Graphics.UserInterface
public FontAwesome Icon public FontAwesome Icon
{ {
set set { bouncingIcon.Icon = value; }
{
bouncingIcon.Icon = value;
}
} }
public string Text public string Text
{ {
set set { text.Text = value; }
{
text.Text = value;
}
} }
public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => IconLayer.ReceivePositionalInputAt(screenSpacePos) || TextLayer.ReceivePositionalInputAt(screenSpacePos); public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => IconLayer.ReceivePositionalInputAt(screenSpacePos) || TextLayer.ReceivePositionalInputAt(screenSpacePos);
@ -217,7 +208,10 @@ namespace osu.Game.Graphics.UserInterface
private readonly SpriteIcon icon; private readonly SpriteIcon icon;
public FontAwesome Icon { set { icon.Icon = value; } } public FontAwesome Icon
{
set => icon.Icon = value;
}
public BouncingIcon() public BouncingIcon()
{ {

View File

@ -21,7 +21,8 @@ namespace osu.Game.IO
public new Storage Storage => base.Storage; public new Storage Storage => base.Storage;
public FileStore(IDatabaseContextFactory contextFactory, Storage storage) : base(contextFactory, storage.GetStorageForDirectory(@"files")) public FileStore(IDatabaseContextFactory contextFactory, Storage storage)
: base(contextFactory, storage.GetStorageForDirectory(@"files"))
{ {
Store = new StorageBackedResourceStore(Storage); Store = new StorageBackedResourceStore(Storage);
} }

View File

@ -39,6 +39,7 @@ namespace osu.Game.IO.Legacy
public override string ReadString() public override string ReadString()
{ {
if (ReadByte() == 0) return null; if (ReadByte() == 0) return null;
return base.ReadString(); return base.ReadString();
} }
@ -48,6 +49,7 @@ namespace osu.Game.IO.Legacy
int len = ReadInt32(); int len = ReadInt32();
if (len > 0) return ReadBytes(len); if (len > 0) return ReadBytes(len);
if (len < 0) return null; if (len < 0) return null;
return Array.Empty<byte>(); return Array.Empty<byte>();
} }
@ -57,6 +59,7 @@ namespace osu.Game.IO.Legacy
int len = ReadInt32(); int len = ReadInt32();
if (len > 0) return ReadChars(len); if (len > 0) return ReadChars(len);
if (len < 0) return null; if (len < 0) return null;
return Array.Empty<char>(); return Array.Empty<char>();
} }
@ -65,6 +68,7 @@ namespace osu.Game.IO.Legacy
{ {
long ticks = ReadInt64(); long ticks = ReadInt64();
if (ticks < 0) throw new IOException("Bad ticks count read!"); if (ticks < 0) throw new IOException("Bad ticks count read!");
return new DateTime(ticks, DateTimeKind.Utc); return new DateTime(ticks, DateTimeKind.Utc);
} }
@ -73,6 +77,7 @@ namespace osu.Game.IO.Legacy
{ {
int count = ReadInt32(); int count = ReadInt32();
if (count < 0) return null; if (count < 0) return null;
IList<T> d = new List<T>(count); IList<T> d = new List<T>(count);
SerializationReader sr = new SerializationReader(BaseStream); SerializationReader sr = new SerializationReader(BaseStream);
@ -88,6 +93,7 @@ namespace osu.Game.IO.Legacy
{ {
if (skipErrors) if (skipErrors)
continue; continue;
throw; throw;
} }
@ -102,6 +108,7 @@ namespace osu.Game.IO.Legacy
{ {
int count = ReadInt32(); int count = ReadInt32();
if (count < 0) return null; if (count < 0) return null;
IList<T> d = new List<T>(count); IList<T> d = new List<T>(count);
for (int i = 0; i < count; i++) d.Add((T)ReadObject()); for (int i = 0; i < count; i++) d.Add((T)ReadObject());
return d; return d;
@ -112,6 +119,7 @@ namespace osu.Game.IO.Legacy
{ {
int count = ReadInt32(); int count = ReadInt32();
if (count < 0) return null; if (count < 0) return null;
IDictionary<T, U> d = new Dictionary<T, U>(); IDictionary<T, U> d = new Dictionary<T, U>();
for (int i = 0; i < count; i++) d[(T)ReadObject()] = (U)ReadObject(); for (int i = 0; i < count; i++) d[(T)ReadObject()] = (U)ReadObject();
return d; return d;
@ -224,6 +232,7 @@ namespace osu.Game.IO.Legacy
genType = BindToType(assemblyName, typ); genType = BindToType(assemblyName, typ);
} }
} }
if (genType != null && tmpTypes.Count > 0) if (genType != null && tmpTypes.Count > 0)
{ {
return genType.MakeGenericType(tmpTypes.ToArray()); return genType.MakeGenericType(tmpTypes.ToArray());

View File

@ -8,6 +8,7 @@ using System.Runtime.Serialization;
using System.Runtime.Serialization.Formatters; using System.Runtime.Serialization.Formatters;
using System.Runtime.Serialization.Formatters.Binary; using System.Runtime.Serialization.Formatters.Binary;
using System.Text; using System.Text;
// ReSharper disable ConditionIsAlwaysTrueOrFalse (we're allowing nulls to be passed to the writer where the underlying class doesn't). // ReSharper disable ConditionIsAlwaysTrueOrFalse (we're allowing nulls to be passed to the writer where the underlying class doesn't).
// ReSharper disable HeuristicUnreachableCode // ReSharper disable HeuristicUnreachableCode

View File

@ -62,31 +62,41 @@ namespace osu.Game.Input.Bindings
{ {
[Description("Toggle chat overlay")] [Description("Toggle chat overlay")]
ToggleChat, ToggleChat,
[Description("Toggle social overlay")] [Description("Toggle social overlay")]
ToggleSocial, ToggleSocial,
[Description("Reset input settings")] [Description("Reset input settings")]
ResetInputSettings, ResetInputSettings,
[Description("Toggle toolbar")] [Description("Toggle toolbar")]
ToggleToolbar, ToggleToolbar,
[Description("Toggle settings")] [Description("Toggle settings")]
ToggleSettings, ToggleSettings,
[Description("Toggle osu!direct")] [Description("Toggle osu!direct")]
ToggleDirect, ToggleDirect,
[Description("Increase volume")] [Description("Increase volume")]
IncreaseVolume, IncreaseVolume,
[Description("Decrease volume")] [Description("Decrease volume")]
DecreaseVolume, DecreaseVolume,
[Description("Toggle mute")] [Description("Toggle mute")]
ToggleMute, ToggleMute,
// In-Game Keybindings // In-Game Keybindings
[Description("Skip cutscene")] [Description("Skip cutscene")]
SkipCutscene, SkipCutscene,
[Description("Quick retry (hold)")] [Description("Quick retry (hold)")]
QuickRetry, QuickRetry,
[Description("Take screenshot")] [Description("Take screenshot")]
TakeScreenshot, TakeScreenshot,
[Description("Toggle gameplay mouse buttons")] [Description("Toggle gameplay mouse buttons")]
ToggleGameplayMouseButtons, ToggleGameplayMouseButtons,

View File

@ -176,6 +176,7 @@ namespace osu.Game.Online.API
lock (queue) lock (queue)
{ {
if (queue.Count == 0) break; if (queue.Count == 0) break;
req = queue.Dequeue(); req = queue.Dequeue();
} }

View File

@ -121,7 +121,10 @@ namespace osu.Game.Online.API
} }
public delegate void APIFailureHandler(Exception e); public delegate void APIFailureHandler(Exception e);
public delegate void APISuccessHandler(); public delegate void APISuccessHandler();
public delegate void APIProgressHandler(long current, long total); public delegate void APIProgressHandler(long current, long total);
public delegate void APISuccessHandler<in T>(T content); public delegate void APISuccessHandler<in T>(T content);
} }

Some files were not shown because too many files have changed in this diff Show More