mirror of
https://github.com/ppy/osu.git
synced 2024-12-13 08:32:57 +08:00
Merge remote-tracking branch 'upstream/master' into fix-spritetext-usage
This commit is contained in:
commit
b85189f855
@ -55,6 +55,6 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="ppy.osu.Game.Resources" Version="2019.1010.0" />
|
||||
<PackageReference Include="ppy.osu.Framework.Android" Version="2019.1121.0" />
|
||||
<PackageReference Include="ppy.osu.Framework.Android" Version="2019.1122.0" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
@ -55,7 +55,7 @@ namespace osu.Game.Rulesets.Catch.Difficulty
|
||||
// Longer maps are worth more
|
||||
float lengthBonus =
|
||||
0.95f + 0.4f * Math.Min(1.0f, numTotalHits / 3000.0f) +
|
||||
(numTotalHits > 3000 ? (float)Math.Log10(numTotalHits / 3000.0f) * 0.5f : 0.0f);
|
||||
(numTotalHits > 3000 ? MathF.Log10(numTotalHits / 3000.0f) * 0.5f : 0.0f);
|
||||
|
||||
// Longer maps are worth more
|
||||
value *= lengthBonus;
|
||||
|
@ -99,8 +99,8 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable
|
||||
const float small_pulp = large_pulp_3 / 2;
|
||||
|
||||
Vector2 positionAt(float angle, float distance) => new Vector2(
|
||||
distance * (float)Math.Sin(angle * Math.PI / 180),
|
||||
distance * (float)Math.Cos(angle * Math.PI / 180));
|
||||
distance * MathF.Sin(angle * MathF.PI / 180),
|
||||
distance * MathF.Cos(angle * MathF.PI / 180));
|
||||
|
||||
switch (representation)
|
||||
{
|
||||
|
@ -73,7 +73,7 @@ namespace osu.Game.Rulesets.Mania.Beatmaps
|
||||
{
|
||||
BeatmapDifficulty difficulty = original.BeatmapInfo.BaseDifficulty;
|
||||
|
||||
int seed = (int)Math.Round(difficulty.DrainRate + difficulty.CircleSize) * 20 + (int)(difficulty.OverallDifficulty * 41.2) + (int)Math.Round(difficulty.ApproachRate);
|
||||
int seed = (int)MathF.Round(difficulty.DrainRate + difficulty.CircleSize) * 20 + (int)(difficulty.OverallDifficulty * 41.2) + (int)MathF.Round(difficulty.ApproachRate);
|
||||
Random = new FastRandom(seed);
|
||||
|
||||
return base.ConvertBeatmap(original);
|
||||
|
@ -53,11 +53,11 @@ namespace osu.Game.Rulesets.Mania.Beatmaps.Patterns.Legacy
|
||||
if (allowSpecial && TotalColumns == 8)
|
||||
{
|
||||
const float local_x_divisor = 512f / 7;
|
||||
return Math.Clamp((int)Math.Floor(position / local_x_divisor), 0, 6) + 1;
|
||||
return Math.Clamp((int)MathF.Floor(position / local_x_divisor), 0, 6) + 1;
|
||||
}
|
||||
|
||||
float localXDivisor = 512f / TotalColumns;
|
||||
return Math.Clamp((int)Math.Floor(position / localXDivisor), 0, TotalColumns - 1);
|
||||
return Math.Clamp((int)MathF.Floor(position / localXDivisor), 0, TotalColumns - 1);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -17,7 +17,9 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.HitCircles.Components
|
||||
Origin = Anchor.Centre;
|
||||
|
||||
Size = new Vector2(OsuHitObject.OBJECT_RADIUS * 2);
|
||||
|
||||
CornerRadius = Size.X / 2;
|
||||
CornerExponent = 2;
|
||||
|
||||
InternalChild = new RingPiece();
|
||||
}
|
||||
|
@ -33,7 +33,7 @@ namespace osu.Game.Rulesets.Osu.Mods
|
||||
float appearDistance = (float)(hitObject.TimePreempt - hitObject.TimeFadeIn) / 2;
|
||||
|
||||
Vector2 originalPosition = drawable.Position;
|
||||
Vector2 appearOffset = new Vector2((float)Math.Cos(theta), (float)Math.Sin(theta)) * appearDistance;
|
||||
Vector2 appearOffset = new Vector2(MathF.Cos(theta), MathF.Sin(theta)) * appearDistance;
|
||||
|
||||
//the - 1 and + 1 prevents the hit objects to appear in the wrong position.
|
||||
double appearTime = hitObject.StartTime - hitObject.TimePreempt - 1;
|
||||
|
@ -25,11 +25,10 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Connections
|
||||
{
|
||||
Origin = Anchor.Centre;
|
||||
|
||||
Child = new SkinnableDrawable(new OsuSkinComponent(OsuSkinComponents.FollowPoint), _ => new Container
|
||||
Child = new SkinnableDrawable(new OsuSkinComponent(OsuSkinComponents.FollowPoint), _ => new CircularContainer
|
||||
{
|
||||
Masking = true,
|
||||
AutoSizeAxes = Axes.Both,
|
||||
CornerRadius = width / 2,
|
||||
EdgeEffect = new EdgeEffectParameters
|
||||
{
|
||||
Type = EdgeEffectType.Glow,
|
||||
|
@ -120,7 +120,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
||||
break;
|
||||
}
|
||||
|
||||
float aimRotation = MathHelper.RadiansToDegrees((float)Math.Atan2(aimRotationVector.Y - Position.Y, aimRotationVector.X - Position.X));
|
||||
float aimRotation = MathHelper.RadiansToDegrees(MathF.Atan2(aimRotationVector.Y - Position.Y, aimRotationVector.X - Position.X));
|
||||
while (Math.Abs(aimRotation - Rotation) > 180)
|
||||
aimRotation += aimRotation < Rotation ? 360 : -360;
|
||||
|
||||
|
@ -16,7 +16,9 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
|
||||
{
|
||||
Size = new Vector2(OsuHitObject.OBJECT_RADIUS * 2);
|
||||
Masking = true;
|
||||
|
||||
CornerRadius = Size.X / 2;
|
||||
CornerExponent = 2;
|
||||
|
||||
Anchor = Anchor.Centre;
|
||||
Origin = Anchor.Centre;
|
||||
|
@ -18,10 +18,9 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
|
||||
Anchor = Anchor.Centre;
|
||||
Origin = Anchor.Centre;
|
||||
|
||||
InternalChild = new Container
|
||||
InternalChild = new CircularContainer
|
||||
{
|
||||
Masking = true,
|
||||
CornerRadius = Size.X / 2,
|
||||
BorderThickness = 10,
|
||||
BorderColour = Color4.White,
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
|
@ -20,9 +20,9 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
|
||||
Anchor = Anchor.Centre;
|
||||
RelativeSizeAxes = Axes.Both;
|
||||
|
||||
const int count = 18;
|
||||
const float count = 18;
|
||||
|
||||
for (int i = 0; i < count; i++)
|
||||
for (float i = 0; i < count; i++)
|
||||
{
|
||||
Add(new Container
|
||||
{
|
||||
@ -40,10 +40,10 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
|
||||
Size = new Vector2(60, 10),
|
||||
Origin = Anchor.Centre,
|
||||
Position = new Vector2(
|
||||
0.5f + (float)Math.Sin((float)i / count * 2 * MathHelper.Pi) / 2 * 0.86f,
|
||||
0.5f + (float)Math.Cos((float)i / count * 2 * MathHelper.Pi) / 2 * 0.86f
|
||||
0.5f + MathF.Sin(i / count * 2 * MathF.PI) / 2 * 0.86f,
|
||||
0.5f + MathF.Cos(i / count * 2 * MathF.PI) / 2 * 0.86f
|
||||
),
|
||||
Rotation = -(float)i / count * 360 + 90,
|
||||
Rotation = -i / count * 360 + 90,
|
||||
Children = new[]
|
||||
{
|
||||
new Box
|
||||
|
@ -185,14 +185,14 @@ namespace osu.Game.Rulesets.Osu.Replays
|
||||
{
|
||||
Vector2 spinCentreOffset = SPINNER_CENTRE - prevPos;
|
||||
float distFromCentre = spinCentreOffset.Length;
|
||||
float distToTangentPoint = (float)Math.Sqrt(distFromCentre * distFromCentre - SPIN_RADIUS * SPIN_RADIUS);
|
||||
float distToTangentPoint = MathF.Sqrt(distFromCentre * distFromCentre - SPIN_RADIUS * SPIN_RADIUS);
|
||||
|
||||
if (distFromCentre > SPIN_RADIUS)
|
||||
{
|
||||
// Previous cursor position was outside spin circle, set startPosition to the tangent point.
|
||||
|
||||
// Angle between centre offset and tangent point offset.
|
||||
float angle = (float)Math.Asin(SPIN_RADIUS / distFromCentre);
|
||||
float angle = MathF.Asin(SPIN_RADIUS / distFromCentre);
|
||||
|
||||
if (angle > 0)
|
||||
{
|
||||
@ -204,8 +204,8 @@ namespace osu.Game.Rulesets.Osu.Replays
|
||||
}
|
||||
|
||||
// Rotate by angle so it's parallel to tangent line
|
||||
spinCentreOffset.X = spinCentreOffset.X * (float)Math.Cos(angle) - spinCentreOffset.Y * (float)Math.Sin(angle);
|
||||
spinCentreOffset.Y = spinCentreOffset.X * (float)Math.Sin(angle) + spinCentreOffset.Y * (float)Math.Cos(angle);
|
||||
spinCentreOffset.X = spinCentreOffset.X * MathF.Cos(angle) - spinCentreOffset.Y * MathF.Sin(angle);
|
||||
spinCentreOffset.Y = spinCentreOffset.X * MathF.Sin(angle) + spinCentreOffset.Y * MathF.Cos(angle);
|
||||
|
||||
// Set length to distToTangentPoint
|
||||
spinCentreOffset.Normalize();
|
||||
@ -331,7 +331,7 @@ namespace osu.Game.Rulesets.Osu.Replays
|
||||
Vector2 difference = startPosition - SPINNER_CENTRE;
|
||||
|
||||
float radius = difference.Length;
|
||||
float angle = radius == 0 ? 0 : (float)Math.Atan2(difference.Y, difference.X);
|
||||
float angle = radius == 0 ? 0 : MathF.Atan2(difference.Y, difference.X);
|
||||
|
||||
double t;
|
||||
|
||||
|
@ -106,6 +106,7 @@ namespace osu.Game.Tournament.Components
|
||||
Width = main_width,
|
||||
Height = TournamentBeatmapPanel.HEIGHT,
|
||||
CornerRadius = TournamentBeatmapPanel.HEIGHT / 2,
|
||||
CornerExponent = 2,
|
||||
Children = new Drawable[]
|
||||
{
|
||||
new Box
|
||||
@ -126,6 +127,7 @@ namespace osu.Game.Tournament.Components
|
||||
{
|
||||
Masking = true,
|
||||
CornerRadius = TournamentBeatmapPanel.HEIGHT / 2,
|
||||
CornerExponent = 2,
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
|
@ -52,6 +52,7 @@ namespace osu.Game.Tournament.Components
|
||||
currentMatch.BindTo(ladder.CurrentMatch);
|
||||
|
||||
CornerRadius = HEIGHT / 2;
|
||||
CornerExponent = 2;
|
||||
Masking = true;
|
||||
|
||||
AddRangeInternal(new Drawable[]
|
||||
|
@ -57,7 +57,7 @@ namespace osu.Game.Tournament.Screens.Drawings.Components
|
||||
groups.Add(g);
|
||||
nextGroupName++;
|
||||
|
||||
if (i < (int)Math.Ceiling(numGroups / 2f))
|
||||
if (i < (int)MathF.Ceiling(numGroups / 2f))
|
||||
topGroups.Add(g);
|
||||
else
|
||||
bottomGroups.Add(g);
|
||||
|
@ -100,7 +100,7 @@ namespace osu.Game.Tournament.Screens.Gameplay.Components
|
||||
var diff = Math.Max(score1.Value, score2.Value) - Math.Min(score1.Value, score2.Value);
|
||||
|
||||
losingBar.ResizeWidthTo(0, 400, Easing.OutQuint);
|
||||
winningBar.ResizeWidthTo(Math.Min(0.4f, (float)Math.Pow(diff / 1500000f, 0.5) / 2), 400, Easing.OutQuint);
|
||||
winningBar.ResizeWidthTo(Math.Min(0.4f, MathF.Pow(diff / 1500000f, 0.5f) / 2), 400, Easing.OutQuint);
|
||||
}
|
||||
|
||||
protected override void Update()
|
||||
|
@ -202,7 +202,8 @@ namespace osu.Game.Tournament
|
||||
{
|
||||
foreach (var p in t.Players)
|
||||
{
|
||||
PopulateUser(p);
|
||||
if (p.Username == null || p.Statistics == null)
|
||||
PopulateUser(p);
|
||||
addedInfo = true;
|
||||
}
|
||||
}
|
||||
@ -243,7 +244,6 @@ namespace osu.Game.Tournament
|
||||
{
|
||||
user.Username = res.Username;
|
||||
user.Statistics = res.Statistics;
|
||||
user.Username = res.Username;
|
||||
user.Country = res.Country;
|
||||
user.Cover = res.Cover;
|
||||
|
||||
|
@ -111,7 +111,7 @@ namespace osu.Game.Graphics.Backgrounds
|
||||
|
||||
float adjustedAlpha = HideAlphaDiscrepancies
|
||||
// Cubically scale alpha to make it drop off more sharply.
|
||||
? (float)Math.Pow(DrawColourInfo.Colour.AverageColour.Linear.A, 3)
|
||||
? MathF.Pow(DrawColourInfo.Colour.AverageColour.Linear.A, 3)
|
||||
: 1;
|
||||
|
||||
float elapsedSeconds = (float)Time.Elapsed / 1000;
|
||||
|
@ -10,13 +10,11 @@ namespace osu.Game.Online.API.Requests
|
||||
{
|
||||
private readonly BeatmapInfo beatmap;
|
||||
|
||||
private string lookupString => beatmap.OnlineBeatmapID > 0 ? beatmap.OnlineBeatmapID.ToString() : $@"lookup?checksum={beatmap.MD5Hash}&filename={System.Uri.EscapeUriString(beatmap.Path)}";
|
||||
|
||||
public GetBeatmapRequest(BeatmapInfo beatmap)
|
||||
{
|
||||
this.beatmap = beatmap;
|
||||
}
|
||||
|
||||
protected override string Target => $@"beatmaps/{lookupString}";
|
||||
protected override string Target => $@"beatmaps/lookup?id={beatmap.OnlineBeatmapID}&checksum={beatmap.MD5Hash}&filename={System.Uri.EscapeUriString(beatmap.Path ?? string.Empty)}";
|
||||
}
|
||||
}
|
||||
|
46
osu.Game/Overlays/BeatmapSet/Scores/NoScoresPlaceholder.cs
Normal file
46
osu.Game/Overlays/BeatmapSet/Scores/NoScoresPlaceholder.cs
Normal file
@ -0,0 +1,46 @@
|
||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Game.Screens.Select.Leaderboards;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Game.Graphics.Sprites;
|
||||
|
||||
namespace osu.Game.Overlays.BeatmapSet.Scores
|
||||
{
|
||||
public class NoScoresPlaceholder : Container
|
||||
{
|
||||
private readonly SpriteText text;
|
||||
|
||||
public NoScoresPlaceholder()
|
||||
{
|
||||
AutoSizeAxes = Axes.Both;
|
||||
Child = text = new OsuSpriteText();
|
||||
}
|
||||
|
||||
public override void Show() => this.FadeIn(200, Easing.OutQuint);
|
||||
|
||||
public override void Hide() => this.FadeOut(200, Easing.OutQuint);
|
||||
|
||||
public void ShowWithScope(BeatmapLeaderboardScope scope)
|
||||
{
|
||||
Show();
|
||||
|
||||
switch (scope)
|
||||
{
|
||||
default:
|
||||
text.Text = @"No scores have been set yet. Maybe you can be the first!";
|
||||
break;
|
||||
|
||||
case BeatmapLeaderboardScope.Friend:
|
||||
text.Text = @"None of your friends have set a score on this map yet.";
|
||||
break;
|
||||
|
||||
case BeatmapLeaderboardScope.Country:
|
||||
text.Text = @"No one from your country has set a score on this map yet.";
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -13,6 +13,10 @@ using osu.Game.Online.API.Requests.Responses;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Online.API;
|
||||
using osu.Game.Online.API.Requests;
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Game.Rulesets;
|
||||
using osu.Game.Screens.Select.Leaderboards;
|
||||
using osu.Game.Users;
|
||||
|
||||
namespace osu.Game.Overlays.BeatmapSet.Scores
|
||||
{
|
||||
@ -20,32 +24,25 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
|
||||
{
|
||||
private const int spacing = 15;
|
||||
|
||||
public readonly Bindable<BeatmapInfo> Beatmap = new Bindable<BeatmapInfo>();
|
||||
private readonly Bindable<RulesetInfo> ruleset = new Bindable<RulesetInfo>();
|
||||
private readonly Bindable<BeatmapLeaderboardScope> scope = new Bindable<BeatmapLeaderboardScope>();
|
||||
private readonly Bindable<User> user = new Bindable<User>();
|
||||
|
||||
private readonly Box background;
|
||||
private readonly ScoreTable scoreTable;
|
||||
private readonly FillFlowContainer topScoresContainer;
|
||||
private readonly LoadingAnimation loadingAnimation;
|
||||
private readonly DimmedLoadingLayer loading;
|
||||
private readonly FillFlowContainer filterControls;
|
||||
private readonly LeaderboardModSelector modSelector;
|
||||
private readonly NoScoresPlaceholder noScoresPlaceholder;
|
||||
private readonly FillFlowContainer content;
|
||||
|
||||
[Resolved]
|
||||
private IAPIProvider api { get; set; }
|
||||
|
||||
private GetScoresRequest getScoresRequest;
|
||||
|
||||
private BeatmapInfo beatmap;
|
||||
|
||||
public BeatmapInfo Beatmap
|
||||
{
|
||||
get => beatmap;
|
||||
set
|
||||
{
|
||||
if (beatmap == value)
|
||||
return;
|
||||
|
||||
beatmap = value;
|
||||
|
||||
getScores(beatmap);
|
||||
}
|
||||
}
|
||||
|
||||
protected APILegacyScores Scores
|
||||
{
|
||||
set
|
||||
@ -85,7 +82,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
},
|
||||
new FillFlowContainer
|
||||
content = new FillFlowContainer
|
||||
{
|
||||
Anchor = Anchor.TopCentre,
|
||||
Origin = Anchor.TopCentre,
|
||||
@ -93,29 +90,79 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
|
||||
AutoSizeAxes = Axes.Y,
|
||||
Width = 0.95f,
|
||||
Direction = FillDirection.Vertical,
|
||||
Spacing = new Vector2(0, spacing),
|
||||
Margin = new MarginPadding { Vertical = spacing },
|
||||
Children = new Drawable[]
|
||||
{
|
||||
topScoresContainer = new FillFlowContainer
|
||||
{
|
||||
RelativeSizeAxes = Axes.X,
|
||||
AutoSizeAxes = Axes.Y,
|
||||
Direction = FillDirection.Vertical,
|
||||
Spacing = new Vector2(0, 5),
|
||||
},
|
||||
scoreTable = new ScoreTable
|
||||
filterControls = new FillFlowContainer
|
||||
{
|
||||
Anchor = Anchor.TopCentre,
|
||||
Origin = Anchor.TopCentre,
|
||||
AutoSizeAxes = Axes.Both,
|
||||
Direction = FillDirection.Vertical,
|
||||
Spacing = new Vector2(0, spacing),
|
||||
Children = new Drawable[]
|
||||
{
|
||||
new LeaderboardScopeSelector
|
||||
{
|
||||
Current = { BindTarget = scope }
|
||||
},
|
||||
modSelector = new LeaderboardModSelector
|
||||
{
|
||||
Ruleset = { BindTarget = ruleset }
|
||||
}
|
||||
}
|
||||
},
|
||||
new Container
|
||||
{
|
||||
AutoSizeAxes = Axes.Y,
|
||||
RelativeSizeAxes = Axes.X,
|
||||
Margin = new MarginPadding { Vertical = spacing },
|
||||
Children = new Drawable[]
|
||||
{
|
||||
noScoresPlaceholder = new NoScoresPlaceholder
|
||||
{
|
||||
Anchor = Anchor.TopCentre,
|
||||
Origin = Anchor.TopCentre,
|
||||
Alpha = 0,
|
||||
AlwaysPresent = true,
|
||||
Margin = new MarginPadding { Vertical = 10 }
|
||||
},
|
||||
new FillFlowContainer
|
||||
{
|
||||
RelativeSizeAxes = Axes.X,
|
||||
AutoSizeAxes = Axes.Y,
|
||||
Direction = FillDirection.Vertical,
|
||||
Spacing = new Vector2(0, spacing),
|
||||
Children = new Drawable[]
|
||||
{
|
||||
topScoresContainer = new FillFlowContainer
|
||||
{
|
||||
RelativeSizeAxes = Axes.X,
|
||||
AutoSizeAxes = Axes.Y,
|
||||
Direction = FillDirection.Vertical,
|
||||
Spacing = new Vector2(0, 5),
|
||||
},
|
||||
scoreTable = new ScoreTable
|
||||
{
|
||||
Anchor = Anchor.TopCentre,
|
||||
Origin = Anchor.TopCentre,
|
||||
}
|
||||
}
|
||||
},
|
||||
new Container
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Masking = true,
|
||||
CornerRadius = 10,
|
||||
Child = loading = new DimmedLoadingLayer(iconScale: 0.8f)
|
||||
{
|
||||
Alpha = 0,
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
loadingAnimation = new LoadingAnimation
|
||||
{
|
||||
Alpha = 0,
|
||||
Margin = new MarginPadding(20),
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
@ -123,25 +170,72 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
|
||||
private void load(OsuColour colours)
|
||||
{
|
||||
background.Colour = colours.Gray2;
|
||||
|
||||
user.BindTo(api.LocalUser);
|
||||
}
|
||||
|
||||
private void getScores(BeatmapInfo beatmap)
|
||||
protected override void LoadComplete()
|
||||
{
|
||||
base.LoadComplete();
|
||||
scope.BindValueChanged(_ => getScores());
|
||||
ruleset.BindValueChanged(_ => getScores());
|
||||
|
||||
modSelector.SelectedMods.ItemsAdded += _ => getScores();
|
||||
modSelector.SelectedMods.ItemsRemoved += _ => getScores();
|
||||
|
||||
Beatmap.BindValueChanged(onBeatmapChanged);
|
||||
user.BindValueChanged(onUserChanged, true);
|
||||
}
|
||||
|
||||
private void onBeatmapChanged(ValueChangedEvent<BeatmapInfo> beatmap)
|
||||
{
|
||||
var beatmapRuleset = beatmap.NewValue?.Ruleset;
|
||||
|
||||
if (ruleset.Value?.Equals(beatmapRuleset) ?? false)
|
||||
{
|
||||
modSelector.DeselectAll();
|
||||
ruleset.TriggerChange();
|
||||
}
|
||||
else
|
||||
ruleset.Value = beatmapRuleset;
|
||||
|
||||
scope.Value = BeatmapLeaderboardScope.Global;
|
||||
}
|
||||
|
||||
private void onUserChanged(ValueChangedEvent<User> user)
|
||||
{
|
||||
scope.Value = BeatmapLeaderboardScope.Global;
|
||||
modSelector.DeselectAll();
|
||||
filterControls.FadeTo(api.IsLoggedIn && api.LocalUser.Value.IsSupporter ? 1 : 0);
|
||||
}
|
||||
|
||||
private void getScores()
|
||||
{
|
||||
getScoresRequest?.Cancel();
|
||||
getScoresRequest = null;
|
||||
|
||||
Scores = null;
|
||||
noScoresPlaceholder.Hide();
|
||||
|
||||
if (beatmap?.OnlineBeatmapID.HasValue != true || beatmap.Status <= BeatmapSetOnlineStatus.Pending)
|
||||
if (Beatmap.Value?.OnlineBeatmapID.HasValue != true || Beatmap.Value.Status <= BeatmapSetOnlineStatus.Pending)
|
||||
{
|
||||
Scores = null;
|
||||
content.Hide();
|
||||
return;
|
||||
}
|
||||
|
||||
loadingAnimation.Show();
|
||||
getScoresRequest = new GetScoresRequest(beatmap, beatmap.Ruleset);
|
||||
content.Show();
|
||||
loading.Show();
|
||||
|
||||
getScoresRequest = new GetScoresRequest(Beatmap.Value, Beatmap.Value.Ruleset, scope.Value, modSelector.SelectedMods);
|
||||
getScoresRequest.Success += scores =>
|
||||
{
|
||||
loadingAnimation.Hide();
|
||||
loading.Hide();
|
||||
Scores = scores;
|
||||
|
||||
if (!scores.Scores.Any())
|
||||
noScoresPlaceholder.ShowWithScope(scope.Value);
|
||||
};
|
||||
|
||||
api.Queue(getScoresRequest);
|
||||
}
|
||||
}
|
||||
|
@ -37,7 +37,6 @@ namespace osu.Game.Overlays
|
||||
{
|
||||
OsuScrollContainer scroll;
|
||||
Info info;
|
||||
ScoresContainer scoreContainer;
|
||||
|
||||
Children = new Drawable[]
|
||||
{
|
||||
@ -59,7 +58,10 @@ namespace osu.Game.Overlays
|
||||
{
|
||||
Header = new Header(),
|
||||
info = new Info(),
|
||||
scoreContainer = new ScoresContainer(),
|
||||
new ScoresContainer
|
||||
{
|
||||
Beatmap = { BindTarget = Header.Picker.Beatmap }
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -71,7 +73,6 @@ namespace osu.Game.Overlays
|
||||
Header.Picker.Beatmap.ValueChanged += b =>
|
||||
{
|
||||
info.Beatmap = b.NewValue;
|
||||
scoreContainer.Beatmap = b.NewValue;
|
||||
|
||||
scroll.ScrollToStart();
|
||||
};
|
||||
|
@ -101,6 +101,7 @@ namespace osu.Game.Overlays.Comments
|
||||
Size = new Vector2(avatar_size),
|
||||
Masking = true,
|
||||
CornerRadius = avatar_size / 2f,
|
||||
CornerExponent = 2,
|
||||
},
|
||||
}
|
||||
},
|
||||
|
@ -390,7 +390,7 @@ namespace osu.Game.Overlays
|
||||
Vector2 change = e.MousePosition - e.MouseDownPosition;
|
||||
|
||||
// Diminish the drag distance as we go further to simulate "rubber band" feeling.
|
||||
change *= change.Length <= 0 ? 0 : (float)Math.Pow(change.Length, 0.7f) / change.Length;
|
||||
change *= change.Length <= 0 ? 0 : MathF.Pow(change.Length, 0.7f) / change.Length;
|
||||
|
||||
this.MoveTo(change);
|
||||
return true;
|
||||
|
@ -90,7 +90,7 @@ namespace osu.Game.Overlays.Profile.Header.Components
|
||||
placeholder.FadeOut(fade_duration, Easing.Out);
|
||||
|
||||
graph.DefaultValueCount = ranks.Length;
|
||||
graph.Values = ranks.Select(x => -(float)Math.Log(x.Value));
|
||||
graph.Values = ranks.Select(x => -MathF.Log(x.Value));
|
||||
}
|
||||
|
||||
graph.FadeTo(ranks.Length > 1 ? 1 : 0, fade_duration, Easing.Out);
|
||||
@ -187,7 +187,7 @@ namespace osu.Game.Overlays.Profile.Header.Components
|
||||
|
||||
public void HideBar() => bar.FadeOut(fade_duration);
|
||||
|
||||
private int calculateIndex(float mouseXPosition) => (int)Math.Round(mouseXPosition / DrawWidth * (DefaultValueCount - 1));
|
||||
private int calculateIndex(float mouseXPosition) => (int)MathF.Round(mouseXPosition / DrawWidth * (DefaultValueCount - 1));
|
||||
|
||||
private Vector2 calculateBallPosition(int index)
|
||||
{
|
||||
|
@ -24,7 +24,7 @@ namespace osu.Game.Overlays.Settings.Sections.Debug
|
||||
new SettingsCheckbox
|
||||
{
|
||||
LabelText = "Performance logging",
|
||||
Bindable = frameworkConfig.GetBindable<bool>(FrameworkSetting.PerformanceLogging)
|
||||
Bindable = config.GetBindable<bool>(DebugSetting.PerformanceLogging)
|
||||
},
|
||||
new SettingsCheckbox
|
||||
{
|
||||
|
@ -43,6 +43,7 @@ namespace osu.Game.Overlays.Volume
|
||||
{
|
||||
Content.BorderThickness = 3;
|
||||
Content.CornerRadius = HEIGHT / 2;
|
||||
Content.CornerExponent = 2;
|
||||
|
||||
Size = new Vector2(width, HEIGHT);
|
||||
|
||||
|
@ -20,6 +20,7 @@ namespace osu.Game.Screens.Edit.Components
|
||||
{
|
||||
base.Update();
|
||||
Content.CornerRadius = DrawHeight / 2f;
|
||||
Content.CornerExponent = 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -289,7 +289,7 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
||||
OnUserChange(Current.Value);
|
||||
}
|
||||
|
||||
private float getMappedPosition(float divisor) => (float)Math.Pow((divisor - 1) / (availableDivisors.Last() - 1), 0.90f);
|
||||
private float getMappedPosition(float divisor) => MathF.Pow((divisor - 1) / (availableDivisors.Last() - 1), 0.90f);
|
||||
|
||||
private class Tick : CompositeDrawable
|
||||
{
|
||||
|
@ -75,7 +75,7 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
||||
float distance = direction.Length;
|
||||
|
||||
float radius = DistanceSpacing;
|
||||
int radialCount = Math.Clamp((int)Math.Round(distance / radius), 1, MaxIntervals);
|
||||
int radialCount = Math.Clamp((int)MathF.Round(distance / radius), 1, MaxIntervals);
|
||||
|
||||
Vector2 normalisedDirection = direction * new Vector2(1f / distance);
|
||||
Vector2 snappedPosition = CentrePosition + normalisedDirection * radialCount * radius;
|
||||
|
@ -206,8 +206,8 @@ namespace osu.Game.Screens.Menu
|
||||
continue;
|
||||
|
||||
float rotation = MathHelper.DegreesToRadians(i / (float)bars_per_visualiser * 360 + j * 360 / visualiser_rounds);
|
||||
float rotationCos = (float)Math.Cos(rotation);
|
||||
float rotationSin = (float)Math.Sin(rotation);
|
||||
float rotationCos = MathF.Cos(rotation);
|
||||
float rotationSin = MathF.Sin(rotation);
|
||||
//taking the cos and sin to the 0..1 range
|
||||
var barPosition = new Vector2(rotationCos / 2 + 0.5f, rotationSin / 2 + 0.5f) * size;
|
||||
|
||||
|
@ -36,7 +36,9 @@ namespace osu.Game.Screens.Ranking
|
||||
Size = new Vector2(50);
|
||||
|
||||
Masking = true;
|
||||
|
||||
CornerRadius = 25;
|
||||
CornerExponent = 2;
|
||||
|
||||
activeColour = colours.PinkDarker;
|
||||
inactiveColour = OsuColour.Gray(0.8f);
|
||||
|
@ -670,8 +670,8 @@ namespace osu.Game.Screens.Select
|
||||
{
|
||||
// The radius of the circle the carousel moves on.
|
||||
const float circle_radius = 3;
|
||||
double discriminant = Math.Max(0, circle_radius * circle_radius - dist * dist);
|
||||
float x = (circle_radius - (float)Math.Sqrt(discriminant)) * halfHeight;
|
||||
float discriminant = MathF.Max(0, circle_radius * circle_radius - dist * dist);
|
||||
float x = (circle_radius - MathF.Sqrt(discriminant)) * halfHeight;
|
||||
|
||||
return 125 + x;
|
||||
}
|
||||
|
@ -34,7 +34,7 @@ namespace osu.Game.Screens.Select.Details
|
||||
if ((Beatmap?.Ruleset?.ID ?? 0) == 3)
|
||||
{
|
||||
firstValue.Title = "Key Amount";
|
||||
firstValue.Value = (int)Math.Round(Beatmap?.BaseDifficulty?.CircleSize ?? 0);
|
||||
firstValue.Value = (int)MathF.Round(Beatmap?.BaseDifficulty?.CircleSize ?? 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -31,6 +31,12 @@ namespace osu.Game.Users.Drawables
|
||||
set => base.CornerRadius = value;
|
||||
}
|
||||
|
||||
public new float CornerExponent
|
||||
{
|
||||
get => base.CornerExponent;
|
||||
set => base.CornerExponent = value;
|
||||
}
|
||||
|
||||
public new EdgeEffectParameters EdgeEffect
|
||||
{
|
||||
get => base.EdgeEffect;
|
||||
|
@ -21,7 +21,7 @@
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.2.6" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
|
||||
<PackageReference Include="ppy.osu.Game.Resources" Version="2019.1010.0" />
|
||||
<PackageReference Include="ppy.osu.Framework" Version="2019.1121.0" />
|
||||
<PackageReference Include="ppy.osu.Framework" Version="2019.1122.0" />
|
||||
<PackageReference Include="Sentry" Version="1.2.0" />
|
||||
<PackageReference Include="SharpCompress" Version="0.24.0" />
|
||||
<PackageReference Include="NUnit" Version="3.12.0" />
|
||||
|
@ -73,7 +73,7 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup Label="Package References">
|
||||
<PackageReference Include="ppy.osu.Game.Resources" Version="2019.1010.0" />
|
||||
<PackageReference Include="ppy.osu.Framework.iOS" Version="2019.1121.0" />
|
||||
<PackageReference Include="ppy.osu.Framework.iOS" Version="2019.1122.0" />
|
||||
</ItemGroup>
|
||||
<!-- Xamarin.iOS does not automatically handle transitive dependencies from NuGet packages. -->
|
||||
<ItemGroup Label="Transitive Dependencies">
|
||||
@ -81,11 +81,11 @@
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.2.6" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.2.6" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
|
||||
<PackageReference Include="ppy.osu.Framework" Version="2019.1112.0" />
|
||||
<PackageReference Include="ppy.osu.Framework" Version="2019.1122.0" />
|
||||
<PackageReference Include="SharpCompress" Version="0.24.0" />
|
||||
<PackageReference Include="NUnit" Version="3.12.0" />
|
||||
<PackageReference Include="SharpRaven" Version="2.4.0" />
|
||||
<PackageReference Include="System.ComponentModel.Annotations" Version="4.6.0" />
|
||||
<PackageReference Include="ppy.osu.Framework.NativeLibs" Version="2019.1112.0" ExcludeAssets="all" />
|
||||
<PackageReference Include="ppy.osu.Framework.NativeLibs" Version="2019.1104.0" ExcludeAssets="all" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
Loading…
Reference in New Issue
Block a user