mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 16:29:58 +09:00
Merge remote-tracking branch 'origin/master' into fix-new-inspections
# Conflicts: # osu.Game.Rulesets.Catch/Judgements/CatchDropletJudgement.cs # osu.Game.Rulesets.Catch/Judgements/CatchJudgement.cs # osu.Game.Rulesets.Mania/Scoring/ManiaScoreProcessor.cs # osu.Game.Rulesets.Osu/Replays/OsuAutoGenerator.cs # osu.Game.Rulesets.Osu/UI/Cursor/CursorTrail.cs # osu.Game.Tests/Visual/SongSelect/TestCaseBeatmapScoresContainer.cs # osu.Game/Graphics/OsuFont.cs # osu.Game/Online/API/Requests/Responses/APILegacyScoreInfo.cs # osu.Game/Overlays/Profile/Header/BadgeContainer.cs # osu.Game/Overlays/Profile/ProfileHeader.cs # osu.Game/Screens/Select/PlaySongSelect.cs # osu.Game/Skinning/LegacySkinDecoder.cs
This commit is contained in:
@ -11,7 +11,6 @@ using osu.Game.Rulesets.Objects;
|
||||
using osu.Game.Rulesets.Objects.Drawables;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Framework.Graphics.Cursor;
|
||||
@ -82,7 +81,8 @@ namespace osu.Game.Rulesets.UI
|
||||
/// <summary>
|
||||
/// The mods which are to be applied.
|
||||
/// </summary>
|
||||
private readonly IEnumerable<Mod> mods;
|
||||
[Cached(typeof(IReadOnlyList<Mod>))]
|
||||
private readonly IReadOnlyList<Mod> mods;
|
||||
|
||||
private FrameStabilityContainer frameStabilityContainer;
|
||||
|
||||
@ -93,16 +93,19 @@ namespace osu.Game.Rulesets.UI
|
||||
/// </summary>
|
||||
/// <param name="ruleset">The ruleset being represented.</param>
|
||||
/// <param name="workingBeatmap">The beatmap to create the hit renderer for.</param>
|
||||
protected DrawableRuleset(Ruleset ruleset, WorkingBeatmap workingBeatmap)
|
||||
/// <param name="mods">The <see cref="Mod"/>s to apply.</param>
|
||||
protected DrawableRuleset(Ruleset ruleset, WorkingBeatmap workingBeatmap, IReadOnlyList<Mod> mods)
|
||||
: base(ruleset)
|
||||
{
|
||||
Debug.Assert(workingBeatmap != null, "DrawableRuleset initialized with a null beatmap.");
|
||||
if (workingBeatmap == null)
|
||||
throw new ArgumentException("Beatmap cannot be null.", nameof(workingBeatmap));
|
||||
|
||||
this.mods = mods.ToArray();
|
||||
|
||||
RelativeSizeAxes = Axes.Both;
|
||||
|
||||
Beatmap = (Beatmap<TObject>)workingBeatmap.GetPlayableBeatmap(ruleset.RulesetInfo);
|
||||
Beatmap = (Beatmap<TObject>)workingBeatmap.GetPlayableBeatmap(ruleset.RulesetInfo, mods);
|
||||
|
||||
mods = workingBeatmap.Mods.Value;
|
||||
applyBeatmapMods(mods);
|
||||
|
||||
KeyBindingInputManager = CreateInputManager();
|
||||
@ -151,6 +154,13 @@ namespace osu.Game.Rulesets.UI
|
||||
Overlays = new Container { RelativeSizeAxes = Axes.Both }
|
||||
};
|
||||
|
||||
if ((ResumeOverlay = CreateResumeOverlay()) != null)
|
||||
{
|
||||
AddInternal(CreateInputManager()
|
||||
.WithChild(CreatePlayfieldAdjustmentContainer()
|
||||
.WithChild(ResumeOverlay)));
|
||||
}
|
||||
|
||||
applyRulesetMods(mods, config);
|
||||
|
||||
loadObjects();
|
||||
@ -170,7 +180,21 @@ namespace osu.Game.Rulesets.UI
|
||||
mod.ApplyToDrawableHitObjects(Playfield.HitObjectContainer.Objects);
|
||||
}
|
||||
|
||||
public override void RequestResume(Action continueResume) => continueResume();
|
||||
public override void RequestResume(Action continueResume)
|
||||
{
|
||||
if (ResumeOverlay != null && (Cursor == null || (Cursor.LastFrameState == Visibility.Visible && Contains(Cursor.ActiveCursor.ScreenSpaceDrawQuad.Centre))))
|
||||
{
|
||||
ResumeOverlay.GameplayCursor = Cursor;
|
||||
ResumeOverlay.ResumeAction = continueResume;
|
||||
ResumeOverlay.Show();
|
||||
}
|
||||
else
|
||||
continueResume();
|
||||
}
|
||||
|
||||
public ResumeOverlay ResumeOverlay { get; private set; }
|
||||
|
||||
protected virtual ResumeOverlay CreateResumeOverlay() => null;
|
||||
|
||||
/// <summary>
|
||||
/// Creates and adds the visual representation of a <see cref="TObject"/> to this <see cref="DrawableRuleset{TObject}"/>.
|
||||
@ -203,6 +227,12 @@ namespace osu.Game.Rulesets.UI
|
||||
|
||||
if (replayInputManager.ReplayInputHandler != null)
|
||||
replayInputManager.ReplayInputHandler.GamefieldToScreenSpace = Playfield.GamefieldToScreenSpace;
|
||||
|
||||
if (!ProvidingUserCursor)
|
||||
{
|
||||
// The cursor is hidden by default (see Playfield.load()), but should be shown when there's a replay
|
||||
Playfield.Cursor?.Show();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -235,7 +265,7 @@ namespace osu.Game.Rulesets.UI
|
||||
/// Applies the active mods to the Beatmap.
|
||||
/// </summary>
|
||||
/// <param name="mods"></param>
|
||||
private void applyBeatmapMods(IEnumerable<Mod> mods)
|
||||
private void applyBeatmapMods(IReadOnlyList<Mod> mods)
|
||||
{
|
||||
if (mods == null)
|
||||
return;
|
||||
@ -247,8 +277,9 @@ namespace osu.Game.Rulesets.UI
|
||||
/// <summary>
|
||||
/// Applies the active mods to this DrawableRuleset.
|
||||
/// </summary>
|
||||
/// <param name="mods"></param>
|
||||
private void applyRulesetMods(IEnumerable<Mod> mods, OsuConfigManager config)
|
||||
/// <param name="mods">The <see cref="Mod"/>s to apply.</param>
|
||||
/// <param name="config">The <see cref="OsuConfigManager"/> to apply.</param>
|
||||
private void applyRulesetMods(IReadOnlyList<Mod> mods, OsuConfigManager config)
|
||||
{
|
||||
if (mods == null)
|
||||
return;
|
||||
|
Reference in New Issue
Block a user