mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 15:07:44 +08:00
Fix judgement processors provided to mods while not completely loaded
This commit is contained in:
parent
48b95ae250
commit
ac930b8918
@ -8,7 +8,7 @@ namespace osu.Game.Rulesets.Mods
|
||||
public interface IApplicableToHealthProcessor : IApplicableMod
|
||||
{
|
||||
/// <summary>
|
||||
/// Provide a <see cref="HealthProcessor"/> to a mod. Called once on initialisation of a play instance.
|
||||
/// Provides a ready <see cref="HealthProcessor"/> to a mod. Called once on initialisation of a play instance.
|
||||
/// </summary>
|
||||
void ApplyToHealthProcessor(HealthProcessor healthProcessor);
|
||||
}
|
||||
|
@ -12,7 +12,7 @@ namespace osu.Game.Rulesets.Mods
|
||||
public interface IApplicableToScoreProcessor : IApplicableMod
|
||||
{
|
||||
/// <summary>
|
||||
/// Provide a <see cref="ScoreProcessor"/> to a mod. Called once on initialisation of a play instance.
|
||||
/// Provides a loaded <see cref="ScoreProcessor"/> to a mod. Called once on initialisation of a play instance.
|
||||
/// </summary>
|
||||
void ApplyToScoreProcessor(ScoreProcessor scoreProcessor);
|
||||
|
||||
|
@ -297,11 +297,17 @@ namespace osu.Game.Screens.Play
|
||||
ScoreProcessor.HasCompleted.BindValueChanged(scoreCompletionChanged);
|
||||
HealthProcessor.Failed += onFail;
|
||||
|
||||
foreach (var mod in Mods.Value.OfType<IApplicableToScoreProcessor>())
|
||||
mod.ApplyToScoreProcessor(ScoreProcessor);
|
||||
ScoreProcessor.OnLoadComplete += _ =>
|
||||
{
|
||||
foreach (var mod in Mods.Value.OfType<IApplicableToScoreProcessor>())
|
||||
mod.ApplyToScoreProcessor(ScoreProcessor);
|
||||
};
|
||||
|
||||
foreach (var mod in Mods.Value.OfType<IApplicableToHealthProcessor>())
|
||||
mod.ApplyToHealthProcessor(HealthProcessor);
|
||||
HealthProcessor.OnLoadComplete += _ =>
|
||||
{
|
||||
foreach (var mod in Mods.Value.OfType<IApplicableToHealthProcessor>())
|
||||
mod.ApplyToHealthProcessor(HealthProcessor);
|
||||
};
|
||||
|
||||
IsBreakTime.BindTo(breakTracker.IsBreakTime);
|
||||
IsBreakTime.BindValueChanged(onBreakTimeChanged, true);
|
||||
|
Loading…
Reference in New Issue
Block a user