mirror of
https://github.com/ppy/osu.git
synced 2025-02-21 00:12:59 +08:00
Some minor improvements.
This commit is contained in:
parent
8d16e1efa2
commit
863dc44c4d
@ -60,8 +60,8 @@ namespace osu.Game.Graphics.Backgrounds
|
||||
protected override void LoadComplete()
|
||||
{
|
||||
base.LoadComplete();
|
||||
for (int i = 0; i < aimTriangleCount; i++)
|
||||
addTriangle(true);
|
||||
|
||||
addTriangles(true);
|
||||
}
|
||||
|
||||
private int aimTriangleCount => (int)(DrawWidth * DrawHeight * 0.002f / (triangleScale * triangleScale) * SpawnRatio);
|
||||
@ -83,8 +83,8 @@ namespace osu.Game.Graphics.Backgrounds
|
||||
t.Expire();
|
||||
}
|
||||
|
||||
while (CreateNewTriangles && Children.Count() < aimTriangleCount)
|
||||
addTriangle(false);
|
||||
if (CreateNewTriangles)
|
||||
addTriangles(false);
|
||||
}
|
||||
|
||||
protected virtual Triangle CreateTriangle()
|
||||
@ -113,12 +113,16 @@ namespace osu.Game.Graphics.Backgrounds
|
||||
|
||||
protected virtual Color4 GetTriangleShade() => Interpolation.ValueAt(RNG.NextSingle(), ColourDark, ColourLight, 0, 1);
|
||||
|
||||
private void addTriangle(bool randomY)
|
||||
private void addTriangles(bool randomY)
|
||||
{
|
||||
var sprite = CreateTriangle();
|
||||
float triangleHeight = sprite.DrawHeight / DrawHeight;
|
||||
sprite.Position = new Vector2(RNG.NextSingle(), randomY ? RNG.NextSingle() * (1 + triangleHeight) - triangleHeight : 1);
|
||||
Add(sprite);
|
||||
int addCount = aimTriangleCount - Children.Count();
|
||||
for (int i = 0; i < addCount; i++)
|
||||
{
|
||||
var sprite = CreateTriangle();
|
||||
float triangleHeight = sprite.DrawHeight / DrawHeight;
|
||||
sprite.Position = new Vector2(RNG.NextSingle(), randomY ? RNG.NextSingle() * (1 + triangleHeight) - triangleHeight : 1);
|
||||
Add(sprite);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -155,7 +155,7 @@ namespace osu.Game.Overlays.Notifications
|
||||
|
||||
public void MarkAllRead()
|
||||
{
|
||||
notifications.Children.ForEach(n => n.Read = true);
|
||||
notifications?.Children.ForEach(n => n.Read = true);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user