mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 08:20:00 +09:00
Revert "Merge pull request #16889 from smoogipoo/remove-mod-multiplier"
This reverts commit252b945d3b
, reversing changes made toa1b39a96cf
.
This commit is contained in:
@ -6,11 +6,14 @@ using osu.Framework.Graphics;
|
||||
using osu.Game.Screens.Play.HUD;
|
||||
using osu.Game.Rulesets.Mods;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Extensions.Color4Extensions;
|
||||
using osu.Framework.Graphics.UserInterface;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Graphics.Sprites;
|
||||
using osuTK;
|
||||
using osuTK.Graphics;
|
||||
using osu.Game.Input.Bindings;
|
||||
|
||||
namespace osu.Game.Screens.Select
|
||||
@ -23,7 +26,10 @@ namespace osu.Game.Screens.Select
|
||||
set => modDisplay.Current = value;
|
||||
}
|
||||
|
||||
protected readonly OsuSpriteText MultiplierText;
|
||||
private readonly ModDisplay modDisplay;
|
||||
private Color4 lowMultiplierColour;
|
||||
private Color4 highMultiplierColour;
|
||||
|
||||
public FooterButtonMods()
|
||||
{
|
||||
@ -34,6 +40,12 @@ namespace osu.Game.Screens.Select
|
||||
Scale = new Vector2(0.8f),
|
||||
ExpansionMode = ExpansionMode.AlwaysContracted,
|
||||
});
|
||||
ButtonContentContainer.Add(MultiplierText = new OsuSpriteText
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
Font = OsuFont.GetFont(weight: FontWeight.Bold),
|
||||
});
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
@ -41,6 +53,8 @@ namespace osu.Game.Screens.Select
|
||||
{
|
||||
SelectedColour = colours.Yellow;
|
||||
DeselectedColour = SelectedColour.Opacity(0.5f);
|
||||
lowMultiplierColour = colours.Red;
|
||||
highMultiplierColour = colours.Green;
|
||||
Text = @"mods";
|
||||
Hotkey = GlobalAction.ToggleModSelection;
|
||||
}
|
||||
@ -54,6 +68,17 @@ namespace osu.Game.Screens.Select
|
||||
|
||||
private void updateMultiplierText()
|
||||
{
|
||||
double multiplier = Current.Value?.Aggregate(1.0, (current, mod) => current * mod.ScoreMultiplier) ?? 1;
|
||||
|
||||
MultiplierText.Text = multiplier.Equals(1.0) ? string.Empty : $"{multiplier:N2}x";
|
||||
|
||||
if (multiplier > 1.0)
|
||||
MultiplierText.FadeColour(highMultiplierColour, 200);
|
||||
else if (multiplier < 1.0)
|
||||
MultiplierText.FadeColour(lowMultiplierColour, 200);
|
||||
else
|
||||
MultiplierText.FadeColour(Color4.White, 200);
|
||||
|
||||
if (Current.Value?.Count > 0)
|
||||
modDisplay.FadeIn();
|
||||
else
|
||||
|
Reference in New Issue
Block a user