mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 08:52:55 +08:00
Remove counter sprite attributes for not being of any reasonable use
This commit is contained in:
parent
9d10658e3c
commit
8f1a71c6b1
@ -20,7 +20,6 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
{
|
{
|
||||||
Origin = Anchor.TopRight,
|
Origin = Anchor.TopRight,
|
||||||
Anchor = Anchor.TopRight,
|
Anchor = Anchor.TopRight,
|
||||||
TextSize = 40,
|
|
||||||
Margin = new MarginPadding(20),
|
Margin = new MarginPadding(20),
|
||||||
};
|
};
|
||||||
Add(score);
|
Add(score);
|
||||||
@ -30,7 +29,6 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
Origin = Anchor.BottomLeft,
|
Origin = Anchor.BottomLeft,
|
||||||
Anchor = Anchor.BottomLeft,
|
Anchor = Anchor.BottomLeft,
|
||||||
Margin = new MarginPadding(10),
|
Margin = new MarginPadding(10),
|
||||||
TextSize = 40,
|
|
||||||
};
|
};
|
||||||
Add(comboCounter);
|
Add(comboCounter);
|
||||||
|
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
using System;
|
using System;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
|
using osu.Framework.Graphics;
|
||||||
using osu.Game.Graphics.Sprites;
|
using osu.Game.Graphics.Sprites;
|
||||||
using osu.Game.Utils;
|
using osu.Game.Utils;
|
||||||
|
|
||||||
@ -28,7 +29,7 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(OsuColour colours) => AccentColour = colours.BlueLighter;
|
private void load(OsuColour colours) => Colour = colours.BlueLighter;
|
||||||
|
|
||||||
protected override string FormatCount(double count) => count.FormatAccuracy();
|
protected override string FormatCount(double count) => count.FormatAccuracy();
|
||||||
|
|
||||||
@ -38,11 +39,7 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected override OsuSpriteText CreateSpriteText()
|
protected override OsuSpriteText CreateSpriteText()
|
||||||
{
|
=> base.CreateSpriteText().With(s => s.Font = s.Font.With(size: 20f, fixedWidth: true));
|
||||||
var spriteText = base.CreateSpriteText();
|
|
||||||
spriteText.Font = spriteText.Font.With(fixedWidth: true);
|
|
||||||
return spriteText;
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void Increment(double amount)
|
public override void Increment(double amount)
|
||||||
{
|
{
|
||||||
|
@ -9,11 +9,10 @@ using System;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
using osuTK.Graphics;
|
|
||||||
|
|
||||||
namespace osu.Game.Graphics.UserInterface
|
namespace osu.Game.Graphics.UserInterface
|
||||||
{
|
{
|
||||||
public abstract class RollingCounter<T> : Container, IHasAccentColour
|
public abstract class RollingCounter<T> : Container
|
||||||
where T : struct, IEquatable<T>
|
where T : struct, IEquatable<T>
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -60,38 +59,6 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
|
|
||||||
public abstract void Increment(T amount);
|
public abstract void Increment(T amount);
|
||||||
|
|
||||||
private float textSize = 40f;
|
|
||||||
|
|
||||||
public float TextSize
|
|
||||||
{
|
|
||||||
get => displayedCountSpriteText?.Font.Size ?? textSize;
|
|
||||||
set
|
|
||||||
{
|
|
||||||
if (TextSize == value)
|
|
||||||
return;
|
|
||||||
|
|
||||||
textSize = value;
|
|
||||||
if (displayedCountSpriteText != null)
|
|
||||||
displayedCountSpriteText.Font = displayedCountSpriteText.Font.With(size: value);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private Color4 accentColour;
|
|
||||||
|
|
||||||
public Color4 AccentColour
|
|
||||||
{
|
|
||||||
get => displayedCountSpriteText?.Colour ?? accentColour;
|
|
||||||
set
|
|
||||||
{
|
|
||||||
if (AccentColour == value)
|
|
||||||
return;
|
|
||||||
|
|
||||||
accentColour = value;
|
|
||||||
if (displayedCountSpriteText != null)
|
|
||||||
displayedCountSpriteText.Colour = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Skeleton of a numeric counter which value rolls over time.
|
/// Skeleton of a numeric counter which value rolls over time.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -185,8 +152,7 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
|
|
||||||
protected virtual OsuSpriteText CreateSpriteText() => new OsuSpriteText
|
protected virtual OsuSpriteText CreateSpriteText() => new OsuSpriteText
|
||||||
{
|
{
|
||||||
Font = OsuFont.Numeric.With(size: textSize),
|
Font = OsuFont.Numeric.With(size: 40f),
|
||||||
Colour = accentColour,
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -29,7 +29,7 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(OsuColour colours) => AccentColour = colours.BlueLighter;
|
private void load(OsuColour colours) => Colour = colours.BlueLighter;
|
||||||
|
|
||||||
protected override double GetProportionalDuration(double currentValue, double newValue)
|
protected override double GetProportionalDuration(double currentValue, double newValue)
|
||||||
{
|
{
|
||||||
@ -50,11 +50,7 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected override OsuSpriteText CreateSpriteText()
|
protected override OsuSpriteText CreateSpriteText()
|
||||||
{
|
=> base.CreateSpriteText().With(s => s.Font = s.Font.With(fixedWidth: true));
|
||||||
var spriteText = base.CreateSpriteText();
|
|
||||||
spriteText.Font = spriteText.Font.With(fixedWidth: true);
|
|
||||||
return spriteText;
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void Increment(double amount)
|
public override void Increment(double amount)
|
||||||
{
|
{
|
||||||
|
@ -3,6 +3,8 @@
|
|||||||
|
|
||||||
using System;
|
using System;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
|
using osu.Framework.Graphics;
|
||||||
|
using osu.Game.Graphics.Sprites;
|
||||||
|
|
||||||
namespace osu.Game.Graphics.UserInterface
|
namespace osu.Game.Graphics.UserInterface
|
||||||
{
|
{
|
||||||
@ -19,7 +21,7 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(OsuColour colours) => AccentColour = colours.BlueLighter;
|
private void load(OsuColour colours) => Colour = colours.BlueLighter;
|
||||||
|
|
||||||
protected override string FormatCount(int count)
|
protected override string FormatCount(int count)
|
||||||
{
|
{
|
||||||
@ -35,5 +37,8 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
{
|
{
|
||||||
Current.Value += amount;
|
Current.Value += amount;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override OsuSpriteText CreateSpriteText()
|
||||||
|
=> base.CreateSpriteText().With(s => s.Font = s.Font.With(size: 20f));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -232,7 +232,6 @@ namespace osu.Game.Screens.Play
|
|||||||
|
|
||||||
protected virtual RollingCounter<double> CreateAccuracyCounter() => new PercentageCounter
|
protected virtual RollingCounter<double> CreateAccuracyCounter() => new PercentageCounter
|
||||||
{
|
{
|
||||||
TextSize = 20,
|
|
||||||
BypassAutoSizeAxes = Axes.X,
|
BypassAutoSizeAxes = Axes.X,
|
||||||
Anchor = Anchor.TopLeft,
|
Anchor = Anchor.TopLeft,
|
||||||
Origin = Anchor.TopRight,
|
Origin = Anchor.TopRight,
|
||||||
@ -241,14 +240,12 @@ namespace osu.Game.Screens.Play
|
|||||||
|
|
||||||
protected virtual ScoreCounter CreateScoreCounter() => new ScoreCounter(6)
|
protected virtual ScoreCounter CreateScoreCounter() => new ScoreCounter(6)
|
||||||
{
|
{
|
||||||
TextSize = 40,
|
|
||||||
Anchor = Anchor.TopCentre,
|
Anchor = Anchor.TopCentre,
|
||||||
Origin = Anchor.TopCentre,
|
Origin = Anchor.TopCentre,
|
||||||
};
|
};
|
||||||
|
|
||||||
protected virtual RollingCounter<int> CreateComboCounter() => new SimpleComboCounter
|
protected virtual RollingCounter<int> CreateComboCounter() => new SimpleComboCounter
|
||||||
{
|
{
|
||||||
TextSize = 20,
|
|
||||||
BypassAutoSizeAxes = Axes.X,
|
BypassAutoSizeAxes = Axes.X,
|
||||||
Anchor = Anchor.TopRight,
|
Anchor = Anchor.TopRight,
|
||||||
Origin = Anchor.TopLeft,
|
Origin = Anchor.TopLeft,
|
||||||
|
Loading…
Reference in New Issue
Block a user