mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 20:22:55 +08:00
Merge pull request #13884 from peppy/remove-read-from-difficulty
Remove `IApplicableToDifficulty.ReadFromDifficulty`
This commit is contained in:
commit
4b4c341fb8
@ -525,16 +525,11 @@ namespace osu.Game
|
||||
private void beatmapChanged(ValueChangedEvent<WorkingBeatmap> beatmap)
|
||||
{
|
||||
beatmap.OldValue?.CancelAsyncLoad();
|
||||
|
||||
updateModDefaults();
|
||||
|
||||
beatmap.NewValue?.BeginAsyncLoad();
|
||||
}
|
||||
|
||||
private void modsChanged(ValueChangedEvent<IReadOnlyList<Mod>> mods)
|
||||
{
|
||||
updateModDefaults();
|
||||
|
||||
// a lease may be taken on the mods bindable, at which point we can't really ensure valid mods.
|
||||
if (SelectedMods.Disabled)
|
||||
return;
|
||||
@ -546,19 +541,6 @@ namespace osu.Game
|
||||
}
|
||||
}
|
||||
|
||||
private void updateModDefaults()
|
||||
{
|
||||
BeatmapDifficulty baseDifficulty = Beatmap.Value.BeatmapInfo.BaseDifficulty;
|
||||
|
||||
if (baseDifficulty != null && SelectedMods.Value.Any(m => m is IApplicableToDifficulty))
|
||||
{
|
||||
var adjustedDifficulty = baseDifficulty.Clone();
|
||||
|
||||
foreach (var mod in SelectedMods.Value.OfType<IApplicableToDifficulty>())
|
||||
mod.ReadFromDifficulty(adjustedDifficulty);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private PerformFromMenuRunner performFromMainMenuTask;
|
||||
|
@ -10,13 +10,6 @@ namespace osu.Game.Rulesets.Mods
|
||||
/// </summary>
|
||||
public interface IApplicableToDifficulty : IApplicableMod
|
||||
{
|
||||
/// <summary>
|
||||
/// Called when a beatmap is changed. Can be used to read default values.
|
||||
/// Any changes made will not be preserved.
|
||||
/// </summary>
|
||||
/// <param name="difficulty">The difficulty to read from.</param>
|
||||
void ReadFromDifficulty(BeatmapDifficulty difficulty);
|
||||
|
||||
/// <summary>
|
||||
/// Called post beatmap conversion. Can be used to apply changes to difficulty attributes.
|
||||
/// </summary>
|
||||
|
Loading…
Reference in New Issue
Block a user