1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-13 13:32:54 +08:00

Merge branch 'master' into export-log-archive

This commit is contained in:
Bartłomiej Dach 2023-12-13 11:08:33 +01:00
commit 084474ef79
No known key found for this signature in database
18 changed files with 70 additions and 47 deletions

View File

@ -787,7 +787,8 @@ namespace osu.Game.Tests.Visual.UserInterface
InputManager.MoveMouseTo(this.ChildrenOfType<ModPresetPanel>().Single(preset => preset.Preset.Value.Name == "Half Time 0.5x"));
InputManager.Click(MouseButton.Left);
});
AddAssert("difficulty multiplier display shows correct value", () => modSelectOverlay.ChildrenOfType<ScoreMultiplierDisplay>().Single().Current.Value, () => Is.EqualTo(0.5));
AddAssert("difficulty multiplier display shows correct value",
() => modSelectOverlay.ChildrenOfType<ScoreMultiplierDisplay>().Single().Current.Value, () => Is.EqualTo(0.1).Within(Precision.DOUBLE_EPSILON));
// this is highly unorthodox in a test, but because the `ModSettingChangeTracker` machinery heavily leans on events and object disposal and re-creation,
// it is instrumental in the reproduction of the failure scenario that this test is supposed to cover.
@ -796,7 +797,8 @@ namespace osu.Game.Tests.Visual.UserInterface
AddStep("open customisation area", () => modSelectOverlay.CustomisationButton!.TriggerClick());
AddStep("reset half time speed to default", () => modSelectOverlay.ChildrenOfType<ModSettingsArea>().Single()
.ChildrenOfType<RevertToDefaultButton<double>>().Single().TriggerClick());
AddUntilStep("difficulty multiplier display shows correct value", () => modSelectOverlay.ChildrenOfType<ScoreMultiplierDisplay>().Single().Current.Value, () => Is.EqualTo(0.7));
AddUntilStep("difficulty multiplier display shows correct value",
() => modSelectOverlay.ChildrenOfType<ScoreMultiplierDisplay>().Single().Current.Value, () => Is.EqualTo(0.3).Within(Precision.DOUBLE_EPSILON));
}
private void waitForColumnLoad() => AddUntilStep("all column content loaded", () =>

View File

@ -21,6 +21,10 @@ namespace osu.Game.Tournament.Models
public double StarRating { get; set; }
public int EndTimeObjectCount { get; set; }
public int TotalObjectCount { get; set; }
public IBeatmapMetadataInfo Metadata { get; set; } = new BeatmapMetadata();
public IBeatmapDifficultyInfo Difficulty { get; set; } = new BeatmapDifficulty();
@ -41,6 +45,8 @@ namespace osu.Game.Tournament.Models
Metadata = beatmap.Metadata;
Difficulty = beatmap.Difficulty;
Covers = beatmap.BeatmapSet?.Covers ?? new BeatmapSetOnlineCovers();
EndTimeObjectCount = beatmap.EndTimeObjectCount;
TotalObjectCount = beatmap.TotalObjectCount;
}
public bool Equals(IBeatmapInfo? other) => other is TournamentBeatmap b && this.MatchesOnlineID(b);

View File

@ -20,7 +20,6 @@ using osu.Game.Rulesets;
using osu.Game.Scoring;
using osu.Game.Scoring.Legacy;
using osu.Game.Screens.Play;
using Realms;
namespace osu.Game
{
@ -177,9 +176,13 @@ namespace osu.Game
{
Logger.Log("Querying for beatmaps with missing hitobject counts to reprocess...");
HashSet<Guid> beatmapIds = realmAccess.Run(r => new HashSet<Guid>(r.All<BeatmapInfo>()
.Filter($"{nameof(BeatmapInfo.Difficulty)}.{nameof(BeatmapDifficulty.TotalObjectCount)} == 0")
.AsEnumerable().Select(b => b.ID)));
HashSet<Guid> beatmapIds = new HashSet<Guid>();
realmAccess.Run(r =>
{
foreach (var b in r.All<BeatmapInfo>().Where(b => b.TotalObjectCount == 0))
beatmapIds.Add(b.ID);
});
Logger.Log($"Found {beatmapIds.Count} beatmaps which require reprocessing.");

View File

@ -21,9 +21,6 @@ namespace osu.Game.Beatmaps
public double SliderMultiplier { get; set; } = 1.4;
public double SliderTickRate { get; set; } = 1;
public int EndTimeObjectCount { get; set; }
public int TotalObjectCount { get; set; }
public BeatmapDifficulty()
{
}
@ -47,9 +44,6 @@ namespace osu.Game.Beatmaps
difficulty.SliderMultiplier = SliderMultiplier;
difficulty.SliderTickRate = SliderTickRate;
difficulty.EndTimeObjectCount = EndTimeObjectCount;
difficulty.TotalObjectCount = TotalObjectCount;
}
public virtual void CopyFrom(IBeatmapDifficultyInfo other)
@ -61,9 +55,6 @@ namespace osu.Game.Beatmaps
SliderMultiplier = other.SliderMultiplier;
SliderTickRate = other.SliderTickRate;
EndTimeObjectCount = other.EndTimeObjectCount;
TotalObjectCount = other.TotalObjectCount;
}
}
}

View File

@ -388,9 +388,7 @@ namespace osu.Game.Beatmaps
OverallDifficulty = decodedDifficulty.OverallDifficulty,
ApproachRate = decodedDifficulty.ApproachRate,
SliderMultiplier = decodedDifficulty.SliderMultiplier,
SliderTickRate = decodedDifficulty.SliderTickRate,
EndTimeObjectCount = decoded.HitObjects.Count(h => h is IHasDuration),
TotalObjectCount = decoded.HitObjects.Count
SliderTickRate = decodedDifficulty.SliderTickRate
};
var metadata = new BeatmapMetadata
@ -428,6 +426,8 @@ namespace osu.Game.Beatmaps
GridSize = decodedInfo.GridSize,
TimelineZoom = decodedInfo.TimelineZoom,
MD5Hash = memoryStream.ComputeMD5Hash(),
EndTimeObjectCount = decoded.HitObjects.Count(h => h is IHasDuration),
TotalObjectCount = decoded.HitObjects.Count
};
beatmaps.Add(beatmap);

View File

@ -120,6 +120,10 @@ namespace osu.Game.Beatmaps
[JsonIgnore]
public bool Hidden { get; set; }
public int EndTimeObjectCount { get; set; }
public int TotalObjectCount { get; set; }
/// <summary>
/// Reset any fetched online linking information (and history).
/// </summary>

View File

@ -91,8 +91,8 @@ namespace osu.Game.Beatmaps
var working = workingBeatmapCache.GetWorkingBeatmap(beatmapInfo);
var beatmap = working.Beatmap;
beatmapInfo.Difficulty.EndTimeObjectCount = beatmap.HitObjects.Count(h => h is IHasDuration);
beatmapInfo.Difficulty.TotalObjectCount = beatmap.HitObjects.Count;
beatmapInfo.EndTimeObjectCount = beatmap.HitObjects.Count(h => h is IHasDuration);
beatmapInfo.TotalObjectCount = beatmap.HitObjects.Count;
// And invalidate again afterwards as re-fetching the most up-to-date database metadata will be required.
workingBeatmapCache.Invalidate(beatmapInfo);

View File

@ -44,19 +44,6 @@ namespace osu.Game.Beatmaps
/// </summary>
double SliderTickRate { get; }
/// <summary>
/// The number of hitobjects in the beatmap with a distinct end time.
/// </summary>
/// <remarks>
/// Canonically, these are hitobjects are either sliders or spinners.
/// </remarks>
int EndTimeObjectCount { get; }
/// <summary>
/// The total number of hitobjects in the beatmap.
/// </summary>
int TotalObjectCount { get; }
/// <summary>
/// Maps a difficulty value [0, 10] to a two-piece linear range of values.
/// </summary>

View File

@ -61,5 +61,18 @@ namespace osu.Game.Beatmaps
/// The basic star rating for this beatmap (with no mods applied).
/// </summary>
double StarRating { get; }
/// <summary>
/// The number of hitobjects in the beatmap with a distinct end time.
/// </summary>
/// <remarks>
/// Canonically, these are hitobjects are either sliders or spinners.
/// </remarks>
int EndTimeObjectCount { get; }
/// <summary>
/// The total number of hitobjects in the beatmap.
/// </summary>
int TotalObjectCount { get; }
}
}

View File

@ -88,9 +88,9 @@ namespace osu.Game.Database
/// 34 2023-08-21 Add BackgroundReprocessingFailed flag to ScoreInfo to track upgrade failures.
/// 35 2023-10-16 Clear key combinations of keybindings that are assigned to more than one action in a given settings section.
/// 36 2023-10-26 Add LegacyOnlineID to ScoreInfo. Move osu_scores_*_high IDs stored in OnlineID to LegacyOnlineID. Reset anomalous OnlineIDs.
/// 37 2023-12-10 Add EndTimeObjectCount and TotalObjectCount to BeatmapDifficulty.
/// 38 2023-12-10 Add EndTimeObjectCount and TotalObjectCount to BeatmapInfo.
/// </summary>
private const int schema_version = 37;
private const int schema_version = 38;
/// <summary>
/// Lock object which is held during <see cref="BlockAllOperations"/> sections, blocking realm retrieval during blocking periods.

View File

@ -41,6 +41,10 @@ namespace osu.Game.Online.API.Requests.Responses
[JsonProperty(@"difficulty_rating")]
public double StarRating { get; set; }
public int EndTimeObjectCount => SliderCount + SpinnerCount;
public int TotalObjectCount => CircleCount + SliderCount + SpinnerCount;
[JsonProperty(@"drain")]
public float DrainRate { get; set; }
@ -108,9 +112,7 @@ namespace osu.Game.Online.API.Requests.Responses
DrainRate = DrainRate,
CircleSize = CircleSize,
ApproachRate = ApproachRate,
OverallDifficulty = OverallDifficulty,
EndTimeObjectCount = SliderCount + SpinnerCount,
TotalObjectCount = CircleCount + SliderCount + SpinnerCount
OverallDifficulty = OverallDifficulty
};
IBeatmapSetInfo? IBeatmapInfo.BeatmapSet => BeatmapSet;

View File

@ -12,7 +12,7 @@ namespace osu.Game.Rulesets.Mods
public override string Acronym => "CL";
public override double ScoreMultiplier => 1;
public override double ScoreMultiplier => 0.5;
public override IconUsage? Icon => FontAwesome.Solid.History;

View File

@ -13,7 +13,7 @@ namespace osu.Game.Rulesets.Mods
public override string Name => "Synesthesia";
public override string Acronym => "SY";
public override LocalisableString Description => "Colours hit objects based on the rhythm.";
public override double ScoreMultiplier => 1;
public override double ScoreMultiplier => 0.8;
public override ModType Type => ModType.Fun;
}
}

View File

@ -32,9 +32,9 @@ namespace osu.Game.Rulesets.Mods
value -= 1;
if (SpeedChange.Value >= 1)
value /= 5;
return 1 + value;
return 1 + value / 5;
else
return 0.6 + value;
}
}

View File

@ -62,8 +62,8 @@ namespace osu.Game.Rulesets.Scoring.Legacy
SourceRuleset = beatmapInfo.Ruleset,
CircleSize = beatmapInfo.Difficulty.CircleSize,
OverallDifficulty = beatmapInfo.Difficulty.OverallDifficulty,
EndTimeObjectCount = beatmapInfo.Difficulty.EndTimeObjectCount,
TotalObjectCount = beatmapInfo.Difficulty.TotalObjectCount
EndTimeObjectCount = beatmapInfo.EndTimeObjectCount,
TotalObjectCount = beatmapInfo.TotalObjectCount
};
}
}

View File

@ -17,6 +17,7 @@ namespace osu.Game.Screens.Play
/// Encapsulates gameplay timing logic and provides a <see cref="IGameplayClock"/> via DI for gameplay components to use.
/// </summary>
[Cached(typeof(IGameplayClock))]
[Cached(typeof(GameplayClockContainer))]
public partial class GameplayClockContainer : Container, IAdjustableClock, IGameplayClock
{
public IBindable<bool> IsPaused => isPaused;

View File

@ -485,7 +485,14 @@ namespace osu.Game.Screens.Play.HUD.HitErrorMeters
}
}
public override void Clear() => judgementsContainer.Clear();
public override void Clear()
{
foreach (var j in judgementsContainer)
{
j.ClearTransforms();
j.Expire();
}
}
public enum CentreMarkerStyles
{

View File

@ -63,7 +63,14 @@ namespace osu.Game.Screens.Play.HUD.HitErrorMeters
judgementsFlow.Push(GetColourForHitResult(judgement.Type));
}
public override void Clear() => judgementsFlow.Clear();
public override void Clear()
{
foreach (var j in judgementsFlow)
{
j.ClearTransforms();
j.Expire();
}
}
private partial class JudgementFlow : FillFlowContainer<HitErrorShape>
{