mirror of
https://github.com/ppy/osu.git
synced 2025-01-14 03:25:11 +08:00
Merge branch 'master' into decouple-legacy-score-info
This commit is contained in:
commit
19c5848e73
@ -1,5 +1,6 @@
|
|||||||
M:System.Object.Equals(System.Object,System.Object)~System.Boolean;Don't use object.Equals. Use IEquatable<T> or EqualityComparer<T>.Default instead.
|
M:System.Object.Equals(System.Object,System.Object)~System.Boolean;Don't use object.Equals. Use IEquatable<T> or EqualityComparer<T>.Default instead.
|
||||||
M:System.Object.Equals(System.Object)~System.Boolean;Don't use object.Equals. Use IEquatable<T> or EqualityComparer<T>.Default instead.
|
M:System.Object.Equals(System.Object)~System.Boolean;Don't use object.Equals. Use IEquatable<T> or EqualityComparer<T>.Default instead.
|
||||||
M:System.ValueType.Equals(System.Object)~System.Boolean;Don't use object.Equals(Fallbacks to ValueType). Use IEquatable<T> or EqualityComparer<T>.Default instead.
|
M:System.ValueType.Equals(System.Object)~System.Boolean;Don't use object.Equals(Fallbacks to ValueType). Use IEquatable<T> or EqualityComparer<T>.Default instead.
|
||||||
|
M:System.Nullable`1.Equals(System.Object)~System.Boolean;Use == instead.
|
||||||
T:System.IComparable;Don't use non-generic IComparable. Use generic version instead.
|
T:System.IComparable;Don't use non-generic IComparable. Use generic version instead.
|
||||||
M:osu.Framework.Graphics.Sprites.SpriteText.#ctor;Use OsuSpriteText.
|
M:osu.Framework.Graphics.Sprites.SpriteText.#ctor;Use OsuSpriteText.
|
||||||
|
@ -37,12 +37,12 @@ namespace osu.Game.Rulesets.Mania.Difficulty
|
|||||||
{
|
{
|
||||||
mods = Score.Mods;
|
mods = Score.Mods;
|
||||||
scaledScore = Score.TotalScore;
|
scaledScore = Score.TotalScore;
|
||||||
countPerfect = Convert.ToInt32(Score.Statistics[HitResult.Perfect]);
|
countPerfect = Score.Statistics[HitResult.Perfect];
|
||||||
countGreat = Convert.ToInt32(Score.Statistics[HitResult.Great]);
|
countGreat = Score.Statistics[HitResult.Great];
|
||||||
countGood = Convert.ToInt32(Score.Statistics[HitResult.Good]);
|
countGood = Score.Statistics[HitResult.Good];
|
||||||
countOk = Convert.ToInt32(Score.Statistics[HitResult.Ok]);
|
countOk = Score.Statistics[HitResult.Ok];
|
||||||
countMeh = Convert.ToInt32(Score.Statistics[HitResult.Meh]);
|
countMeh = Score.Statistics[HitResult.Meh];
|
||||||
countMiss = Convert.ToInt32(Score.Statistics[HitResult.Miss]);
|
countMiss = Score.Statistics[HitResult.Miss];
|
||||||
|
|
||||||
if (mods.Any(m => !m.Ranked))
|
if (mods.Any(m => !m.Ranked))
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -45,10 +45,10 @@ namespace osu.Game.Rulesets.Osu.Difficulty
|
|||||||
mods = Score.Mods;
|
mods = Score.Mods;
|
||||||
accuracy = Score.Accuracy;
|
accuracy = Score.Accuracy;
|
||||||
scoreMaxCombo = Score.MaxCombo;
|
scoreMaxCombo = Score.MaxCombo;
|
||||||
countGreat = Convert.ToInt32(Score.Statistics[HitResult.Great]);
|
countGreat = Score.Statistics[HitResult.Great];
|
||||||
countGood = Convert.ToInt32(Score.Statistics[HitResult.Good]);
|
countGood = Score.Statistics[HitResult.Good];
|
||||||
countMeh = Convert.ToInt32(Score.Statistics[HitResult.Meh]);
|
countMeh = Score.Statistics[HitResult.Meh];
|
||||||
countMiss = Convert.ToInt32(Score.Statistics[HitResult.Miss]);
|
countMiss = Score.Statistics[HitResult.Miss];
|
||||||
|
|
||||||
// Don't count scores made with supposedly unranked mods
|
// Don't count scores made with supposedly unranked mods
|
||||||
if (mods.Any(m => !m.Ranked))
|
if (mods.Any(m => !m.Ranked))
|
||||||
|
@ -31,10 +31,10 @@ namespace osu.Game.Rulesets.Taiko.Difficulty
|
|||||||
public override double Calculate(Dictionary<string, double> categoryDifficulty = null)
|
public override double Calculate(Dictionary<string, double> categoryDifficulty = null)
|
||||||
{
|
{
|
||||||
mods = Score.Mods;
|
mods = Score.Mods;
|
||||||
countGreat = Convert.ToInt32(Score.Statistics[HitResult.Great]);
|
countGreat = Score.Statistics[HitResult.Great];
|
||||||
countGood = Convert.ToInt32(Score.Statistics[HitResult.Good]);
|
countGood = Score.Statistics[HitResult.Good];
|
||||||
countMeh = Convert.ToInt32(Score.Statistics[HitResult.Meh]);
|
countMeh = Score.Statistics[HitResult.Meh];
|
||||||
countMiss = Convert.ToInt32(Score.Statistics[HitResult.Miss]);
|
countMiss = Score.Statistics[HitResult.Miss];
|
||||||
|
|
||||||
// Don't count scores made with supposedly unranked mods
|
// Don't count scores made with supposedly unranked mods
|
||||||
if (mods.Any(m => !m.Ranked))
|
if (mods.Any(m => !m.Ranked))
|
||||||
|
@ -209,9 +209,10 @@ namespace osu.Game.Tests.Visual.Background
|
|||||||
public void TransitionTest()
|
public void TransitionTest()
|
||||||
{
|
{
|
||||||
performFullSetup();
|
performFullSetup();
|
||||||
var results = new FadeAccessibleResults(new ScoreInfo { User = new User { Username = "osu!" } });
|
FadeAccessibleResults results = null;
|
||||||
AddStep("Transition to Results", () => player.Push(results));
|
AddStep("Transition to Results", () => player.Push(results =
|
||||||
AddUntilStep("Wait for results is current", results.IsCurrentScreen);
|
new FadeAccessibleResults(new ScoreInfo { User = new User { Username = "osu!" } })));
|
||||||
|
AddUntilStep("Wait for results is current", () => results.IsCurrentScreen());
|
||||||
waitForDim();
|
waitForDim();
|
||||||
AddAssert("Screen is undimmed, original background retained", () =>
|
AddAssert("Screen is undimmed, original background retained", () =>
|
||||||
songSelect.IsBackgroundUndimmed() && songSelect.IsBackgroundCurrent() && results.IsBlurCorrect());
|
songSelect.IsBackgroundUndimmed() && songSelect.IsBackgroundCurrent() && results.IsBlurCorrect());
|
||||||
|
@ -25,6 +25,6 @@ namespace osu.Game.Beatmaps.ControlPoints
|
|||||||
/// <returns>Whether equivalent.</returns>
|
/// <returns>Whether equivalent.</returns>
|
||||||
public abstract bool EquivalentTo(ControlPoint other);
|
public abstract bool EquivalentTo(ControlPoint other);
|
||||||
|
|
||||||
public bool Equals(ControlPoint other) => Time.Equals(other?.Time) && EquivalentTo(other);
|
public bool Equals(ControlPoint other) => Time == other?.Time && EquivalentTo(other);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -151,18 +151,18 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
private void updateTooltipText(T value)
|
private void updateTooltipText(T value)
|
||||||
{
|
{
|
||||||
if (CurrentNumber.IsInteger)
|
if (CurrentNumber.IsInteger)
|
||||||
TooltipText = ((int)Convert.ChangeType(value, typeof(int))).ToString("N0");
|
TooltipText = value.ToInt32(NumberFormatInfo.InvariantInfo).ToString("N0");
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
double floatValue = (double)Convert.ChangeType(value, typeof(double));
|
double floatValue = value.ToDouble(NumberFormatInfo.InvariantInfo);
|
||||||
double floatMinValue = (double)Convert.ChangeType(CurrentNumber.MinValue, typeof(double));
|
double floatMinValue = CurrentNumber.MinValue.ToDouble(NumberFormatInfo.InvariantInfo);
|
||||||
double floatMaxValue = (double)Convert.ChangeType(CurrentNumber.MaxValue, typeof(double));
|
double floatMaxValue = CurrentNumber.MaxValue.ToDouble(NumberFormatInfo.InvariantInfo);
|
||||||
|
|
||||||
if (floatMaxValue == 1 && floatMinValue >= -1)
|
if (floatMaxValue == 1 && floatMinValue >= -1)
|
||||||
TooltipText = floatValue.ToString("P0");
|
TooltipText = floatValue.ToString("P0");
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
var decimalPrecision = normalise((decimal)Convert.ChangeType(CurrentNumber.Precision, typeof(decimal)), max_decimal_digits);
|
var decimalPrecision = normalise(CurrentNumber.Precision.ToDecimal(NumberFormatInfo.InvariantInfo), max_decimal_digits);
|
||||||
|
|
||||||
// Find the number of significant digits (we could have less than 5 after normalize())
|
// Find the number of significant digits (we could have less than 5 after normalize())
|
||||||
var significantDigits = findPrecision(decimalPrecision);
|
var significantDigits = findPrecision(decimalPrecision);
|
||||||
|
@ -16,6 +16,7 @@ using osu.Game.Users;
|
|||||||
|
|
||||||
namespace osu.Game.Overlays.MedalSplash
|
namespace osu.Game.Overlays.MedalSplash
|
||||||
{
|
{
|
||||||
|
[LongRunningLoad]
|
||||||
public class DrawableMedal : Container, IStateful<DisplayState>
|
public class DrawableMedal : Container, IStateful<DisplayState>
|
||||||
{
|
{
|
||||||
private const float scale_when_unlocked = 0.76f;
|
private const float scale_when_unlocked = 0.76f;
|
||||||
|
@ -12,6 +12,7 @@ using osuTK;
|
|||||||
|
|
||||||
namespace osu.Game.Overlays.Profile.Header.Components
|
namespace osu.Game.Overlays.Profile.Header.Components
|
||||||
{
|
{
|
||||||
|
[LongRunningLoad]
|
||||||
public class DrawableBadge : CompositeDrawable, IHasTooltip
|
public class DrawableBadge : CompositeDrawable, IHasTooltip
|
||||||
{
|
{
|
||||||
public static readonly Vector2 DRAWABLE_BADGE_SIZE = new Vector2(86, 40);
|
public static readonly Vector2 DRAWABLE_BADGE_SIZE = new Vector2(86, 40);
|
||||||
|
@ -19,8 +19,8 @@ namespace osu.Game.Overlays.Profile.Sections
|
|||||||
private const int fade_duration = 200;
|
private const int fade_duration = 200;
|
||||||
|
|
||||||
private Box underscoreLine;
|
private Box underscoreLine;
|
||||||
private readonly Box coloredBackground;
|
private Box coloredBackground;
|
||||||
private readonly Container background;
|
private Container background;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A visual element displayed to the left of <see cref="LeftFlowContainer"/> content.
|
/// A visual element displayed to the left of <see cref="LeftFlowContainer"/> content.
|
||||||
@ -36,6 +36,19 @@ namespace osu.Game.Overlays.Profile.Sections
|
|||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.X;
|
RelativeSizeAxes = Axes.X;
|
||||||
Height = 60;
|
Height = 60;
|
||||||
|
|
||||||
|
Content = new Container
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
Anchor = Anchor.TopCentre,
|
||||||
|
Origin = Anchor.TopCentre,
|
||||||
|
Width = 0.97f,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
[BackgroundDependencyLoader(true)]
|
||||||
|
private void load(OsuColour colour)
|
||||||
|
{
|
||||||
InternalChildren = new Drawable[]
|
InternalChildren = new Drawable[]
|
||||||
{
|
{
|
||||||
background = new Container
|
background = new Container
|
||||||
@ -53,21 +66,7 @@ namespace osu.Game.Overlays.Profile.Sections
|
|||||||
},
|
},
|
||||||
Child = coloredBackground = new Box { RelativeSizeAxes = Axes.Both }
|
Child = coloredBackground = new Box { RelativeSizeAxes = Axes.Both }
|
||||||
},
|
},
|
||||||
Content = new Container
|
Content,
|
||||||
{
|
|
||||||
RelativeSizeAxes = Axes.Both,
|
|
||||||
Anchor = Anchor.TopCentre,
|
|
||||||
Origin = Anchor.TopCentre,
|
|
||||||
Width = 0.97f,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
[BackgroundDependencyLoader(true)]
|
|
||||||
private void load(OsuColour colour)
|
|
||||||
{
|
|
||||||
AddRange(new Drawable[]
|
|
||||||
{
|
|
||||||
underscoreLine = new Box
|
underscoreLine = new Box
|
||||||
{
|
{
|
||||||
Anchor = Anchor.BottomCentre,
|
Anchor = Anchor.BottomCentre,
|
||||||
@ -101,7 +100,7 @@ namespace osu.Game.Overlays.Profile.Sections
|
|||||||
Origin = Anchor.CentreRight,
|
Origin = Anchor.CentreRight,
|
||||||
Direction = FillDirection.Vertical,
|
Direction = FillDirection.Vertical,
|
||||||
},
|
},
|
||||||
});
|
};
|
||||||
|
|
||||||
coloredBackground.Colour = underscoreLine.Colour = colour.Gray4;
|
coloredBackground.Colour = underscoreLine.Colour = colour.Gray4;
|
||||||
}
|
}
|
||||||
|
@ -66,11 +66,14 @@ namespace osu.Game.Overlays.Profile.Sections.Recent
|
|||||||
};
|
};
|
||||||
|
|
||||||
case RecentActivityType.Achievement:
|
case RecentActivityType.Achievement:
|
||||||
return new MedalIcon(activity.Achievement.Slug)
|
return new DelayedLoadWrapper(new MedalIcon(activity.Achievement.Slug)
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
FillMode = FillMode.Fit,
|
||||||
|
})
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Y,
|
RelativeSizeAxes = Axes.Y,
|
||||||
Width = 60,
|
Width = 60,
|
||||||
FillMode = FillMode.Fit,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
@ -9,6 +9,7 @@ using osu.Framework.Graphics.Textures;
|
|||||||
|
|
||||||
namespace osu.Game.Overlays.Profile.Sections.Recent
|
namespace osu.Game.Overlays.Profile.Sections.Recent
|
||||||
{
|
{
|
||||||
|
[LongRunningLoad]
|
||||||
public class MedalIcon : Container
|
public class MedalIcon : Container
|
||||||
{
|
{
|
||||||
private readonly string slug;
|
private readonly string slug;
|
||||||
|
@ -273,14 +273,6 @@ namespace osu.Game.Rulesets.Objects
|
|||||||
return p0 + (p1 - p0) * (float)w;
|
return p0 + (p1 - p0) * (float)w;
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool Equals(SliderPath other)
|
public bool Equals(SliderPath other) => ControlPoints.SequenceEqual(other.ControlPoints) && ExpectedDistance == other.ExpectedDistance && Type == other.Type;
|
||||||
{
|
|
||||||
if (ControlPoints == null && other.ControlPoints != null)
|
|
||||||
return false;
|
|
||||||
if (other.ControlPoints == null && ControlPoints != null)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
return ControlPoints.SequenceEqual(other.ControlPoints) && ExpectedDistance.Equals(other.ExpectedDistance) && Type == other.Type;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -70,7 +70,10 @@ namespace osu.Game.Screens.Ranking.Pages
|
|||||||
Direction = FillDirection.Vertical,
|
Direction = FillDirection.Vertical,
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
new UserHeader(Score.User)
|
new DelayedLoadWrapper(new UserHeader(Score.User)
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
})
|
||||||
{
|
{
|
||||||
Anchor = Anchor.TopCentre,
|
Anchor = Anchor.TopCentre,
|
||||||
Origin = Anchor.TopCentre,
|
Origin = Anchor.TopCentre,
|
||||||
@ -370,6 +373,7 @@ namespace osu.Game.Screens.Ranking.Pages
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[LongRunningLoad]
|
||||||
private class UserHeader : Container
|
private class UserHeader : Container
|
||||||
{
|
{
|
||||||
private readonly User user;
|
private readonly User user;
|
||||||
|
@ -79,8 +79,8 @@ namespace osu.Game.Screens.Select
|
|||||||
public bool IsUpperInclusive;
|
public bool IsUpperInclusive;
|
||||||
|
|
||||||
public bool Equals(OptionalRange<T> other)
|
public bool Equals(OptionalRange<T> other)
|
||||||
=> Min.Equals(other.Min)
|
=> EqualityComparer<T?>.Default.Equals(Min, other.Min)
|
||||||
&& Max.Equals(other.Max)
|
&& EqualityComparer<T?>.Default.Equals(Max, other.Max)
|
||||||
&& IsLowerInclusive.Equals(other.IsLowerInclusive)
|
&& IsLowerInclusive.Equals(other.IsLowerInclusive)
|
||||||
&& IsUpperInclusive.Equals(other.IsUpperInclusive);
|
&& IsUpperInclusive.Equals(other.IsUpperInclusive);
|
||||||
}
|
}
|
||||||
|
@ -240,6 +240,6 @@ namespace osu.Game.Tests.Beatmaps
|
|||||||
set => Objects = value;
|
set => Objects = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual bool Equals(ConvertMapping<TConvertValue> other) => StartTime.Equals(other?.StartTime);
|
public virtual bool Equals(ConvertMapping<TConvertValue> other) => StartTime == other?.StartTime;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user