1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-16 00:22:58 +08:00

Use 0.99x or 1.01x

Signed-off-by: CaffeeLake <PascalCoffeeLake@gmail.com>
This commit is contained in:
CaffeeLake 2023-12-27 22:11:54 +09:00
parent 0fa4cd5dfe
commit bca0600482
2 changed files with 17 additions and 5 deletions

View File

@ -10,6 +10,7 @@ using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Graphics.UserInterface;
using osu.Framework.Localisation;
using osu.Framework.Utils;
using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
using osu.Game.Graphics.UserInterface;
@ -108,13 +109,13 @@ namespace osu.Game.Overlays.Mods
Current.BindValueChanged(e =>
{
if (e.NewValue > Current.Default)
if (Precision.DefinitelyBigger(e.NewValue, Current.Default))
{
MainBackground
.FadeColour(colours.ForModType(ModType.DifficultyIncrease), transition_duration, Easing.OutQuint);
counter.FadeColour(ColourProvider.Background5, transition_duration, Easing.OutQuint);
}
else if (e.NewValue < Current.Default)
else if (Precision.DefinitelyBigger(Current.Default, e.NewValue))
{
MainBackground
.FadeColour(colours.ForModType(ModType.DifficultyReduction), transition_duration, Easing.OutQuint);
@ -131,6 +132,11 @@ namespace osu.Game.Overlays.Mods
.FadeTo(0.15f, 60, Easing.OutQuint)
.Then().FadeOut(500, Easing.OutQuint);
if (Precision.DefinitelyBigger(1.0, Current.Value) && Current.Value >= 0.995)
Current.Value = 0.99;
if (Precision.DefinitelyBigger(Current.Value, 1.0) && Current.Value < 1.005)
Current.Value = 1.01;
const float move_amount = 4;
if (e.NewValue > e.OldValue)
counter.MoveToY(Math.Max(-move_amount * 2, counter.Y - move_amount)).Then().MoveToY(0, transition_duration * 2, Easing.OutQuint);

View File

@ -19,6 +19,7 @@ using osu.Game.Graphics.Sprites;
using osuTK;
using osuTK.Graphics;
using osu.Game.Input.Bindings;
using osu.Framework.Utils;
namespace osu.Game.Screens.Select
{
@ -88,11 +89,16 @@ namespace osu.Game.Screens.Select
{
double multiplier = Current.Value?.Aggregate(1.0, (current, mod) => current * mod.ScoreMultiplier) ?? 1;
if (Precision.DefinitelyBigger(1.0, multiplier) && multiplier >= 0.995)
MultiplierText.Text = $"{0.99:N2}x";
else if (Precision.DefinitelyBigger(multiplier, 1.0) && multiplier < 1.005)
MultiplierText.Text = $"{1.01:N2}x";
else
MultiplierText.Text = multiplier.Equals(1.0) ? string.Empty : $"{multiplier:N2}x";
if (multiplier > 1.0)
if (Precision.DefinitelyBigger(multiplier, 1.0))
MultiplierText.FadeColour(highMultiplierColour, 200);
else if (multiplier < 1.0)
else if (Precision.DefinitelyBigger(1.0, multiplier))
MultiplierText.FadeColour(lowMultiplierColour, 200);
else
MultiplierText.FadeColour(Color4.White, 200);