2 Commits

Author SHA1 Message Date
a9d7a9d5d5 score panel is now tinted, plus some other changes 2025-11-16 02:48:41 +03:00
f7069b1009 minor fixes for some mods 2025-11-16 02:47:38 +03:00
6 changed files with 31 additions and 10 deletions

View File

@@ -231,10 +231,12 @@ namespace osu.Game.Rulesets.Osu
};
case ModType.Special:
#if DEBUG
return new Mod[]
{
new OsuModRateAdjustConcrete(),
};
#endif
default:
return Array.Empty<Mod>();

View File

@@ -13,7 +13,7 @@ namespace osu.Game.Rulesets.Mods
public readonly string OriginalAcronym;
public override string Name => $"Unknown mod ({OriginalAcronym})";
public override string Acronym => $"{OriginalAcronym}??";
public override string Acronym => $"{OriginalAcronym}!";
public override LocalisableString Description => "This mod could not be resolved by the game.";
public override double ScoreMultiplier => 0;

View File

@@ -20,7 +20,7 @@ namespace osu.Game.Screens.Play.Break
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Font = OsuFont.Numeric.With(size: 33),
Font = OsuFont.TorusAlternate.With(size: 64, weight: FontWeight.SemiBold),
};
}

View File

@@ -41,7 +41,7 @@ namespace osu.Game.Screens.Play.HUD
AutoSizeAxes = Axes.Both;
InternalChildren = new Drawable[]
{
starRatingDisplay = new StarRatingDisplay(new StarDifficulty(0.00, 0))
starRatingDisplay = new StarRatingDisplay(new StarDifficulty(0.00, 0), animated: true)
};
}

View File

@@ -200,6 +200,8 @@ namespace osu.Game.Screens.Play
protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnlyDependencyContainer parent)
=> dependencies = new DependencyContainer(base.CreateChildDependencies(parent));
private OsuConfigManager config;
protected override void LoadComplete()
{
base.LoadComplete();
@@ -226,12 +228,13 @@ namespace osu.Game.Screens.Play
[BackgroundDependencyLoader(true)]
private void load(OsuConfigManager config, OsuGameBase game, CancellationToken cancellationToken)
{
this.config = config;
var gameplayMods = Mods.Value.Select(m => m.DeepClone()).ToArray();
if (gameplayMods.Any(m => m is UnknownMod))
{
Logger.Log("Gameplay was started with an unknown mod applied.", level: LogLevel.Important);
return;
// return;
}
if (Beatmap.Value is DummyWorkingBeatmap)
@@ -983,7 +986,8 @@ namespace osu.Game.Screens.Play
if (PauseOverlay.State.Value == Visibility.Visible)
PauseOverlay.Hide();
bool exitOnFail = GameplayState.Mods.OfType<IApplicableFailExit>().Any(m => m.ExitOnFail);
bool exitOnFail = GameplayState.Mods.OfType<IApplicableFailExit>().Any(m => m.ExitOnFail)
&& Score.ScoreInfo.User.Username == config.Get<string>(OsuSetting.Username); // TODO: do more concrete checks
if (exitOnFail)
{
// game.AttemptExit();

View File

@@ -7,6 +7,7 @@ using osu.Framework.Allocation;
using osu.Framework.Audio;
using osu.Framework.Bindables;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Extensions.ImageExtensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Audio;
using osu.Framework.Graphics.Colour;
@@ -14,12 +15,14 @@ using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Input.Events;
using osu.Framework.Utils;
using osu.Game.Graphics;
using osu.Game.Scoring;
using osu.Game.Screens.Ranking.Contracted;
using osu.Game.Screens.Ranking.Expanded;
using osu.Game.Users;
using osuTK;
using osuTK.Graphics;
using ZstdSharp.Unsafe;
namespace osu.Game.Screens.Ranking
{
@@ -96,6 +99,7 @@ namespace osu.Game.Screens.Ranking
[Resolved]
private OsuGameBase game { get; set; } = null!;
private OsuColour colour { get; set; } = null!;
private AudioContainer audioContent = null!;
@@ -124,12 +128,14 @@ namespace osu.Game.Screens.Ranking
}
[BackgroundDependencyLoader]
private void load(AudioManager audio)
private void load(AudioManager audio, OsuColour colour)
{
// ScorePanel doesn't include the top extruding area in its own size.
// Adding a manual offset here allows the expanded version to take on an "acceptable" vertical centre when at 100% UI scale.
const float vertical_fudge = 20;
this.colour = colour;
InternalChild = audioContent = new AudioContainer
{
Anchor = Anchor.Centre,
@@ -239,6 +245,15 @@ namespace osu.Game.Screens.Ranking
private void updateState()
{
ColourInfo getColour(ColourInfo info)
{
var ci = info.AverageColour;
var rank = (ColourInfo)OsuColour.ForRank(Score.Rank);
(float _, float _, float v) = Color4Extensions.ToHSV(ci);
(float rh, float rs, _) = Color4Extensions.ToHSV(rank);
return Color4Extensions.FromHSV(rh, rs * 0.2f, v);
}
topLayerContent?.FadeOut(content_fade_duration).Expire();
middleLayerContent?.FadeOut(content_fade_duration).Expire();
@@ -247,8 +262,8 @@ namespace osu.Game.Screens.Ranking
case PanelState.Expanded:
Size = new Vector2(EXPANDED_WIDTH, expanded_height);
topLayerBackground.FadeColour(expanded_top_layer_colour, RESIZE_DURATION, Easing.OutQuint);
middleLayerBackground.FadeColour(expanded_middle_layer_colour, RESIZE_DURATION, Easing.OutQuint);
topLayerBackground.FadeColour(getColour(expanded_top_layer_colour), RESIZE_DURATION, Easing.OutQuint);
middleLayerBackground.FadeColour(getColour(expanded_middle_layer_colour), RESIZE_DURATION, Easing.OutQuint);
bool firstLoad = topLayerContent == null;
topLayerContentContainer.Add(topLayerContent = new ExpandedPanelTopContent(Score.User, firstLoad) { Alpha = 0 });
@@ -261,8 +276,8 @@ namespace osu.Game.Screens.Ranking
case PanelState.Contracted:
Size = new Vector2(CONTRACTED_WIDTH, contracted_height);
topLayerBackground.FadeColour(contracted_top_layer_colour, RESIZE_DURATION, Easing.OutQuint);
middleLayerBackground.FadeColour(contracted_middle_layer_colour, RESIZE_DURATION, Easing.OutQuint);
topLayerBackground.FadeColour(getColour(contracted_top_layer_colour), RESIZE_DURATION, Easing.OutQuint);
middleLayerBackground.FadeColour(getColour(contracted_middle_layer_colour), RESIZE_DURATION, Easing.OutQuint);
topLayerContentContainer.Add(topLayerContent = new ContractedPanelTopContent
{