1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-23 14:07:24 +08:00

Merge branch 'master' into lounge-redesign

This commit is contained in:
smoogipoo 2021-07-14 18:57:02 +09:00
commit 5d0b4abb9d
3 changed files with 3 additions and 28 deletions

View File

@ -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;

View File

@ -52,7 +52,7 @@ namespace osu.Game.Overlays
private Color4 getColour(float saturation, float lightness) => Color4.FromHsl(new Vector4(getBaseHue(colourScheme), saturation, lightness, 1));
// See https://github.com/ppy/osu-web/blob/4218c288292d7c810b619075471eaea8bbb8f9d8/app/helpers.php#L1463
// See https://github.com/ppy/osu-web/blob/5a536d217a21582aad999db50a981003d3ad5659/app/helpers.php#L1620-L1628
private static float getBaseHue(OverlayColourScheme colourScheme)
{
switch (colourScheme)
@ -67,13 +67,13 @@ namespace osu.Game.Overlays
return 333 / 360f;
case OverlayColourScheme.Orange:
return 46 / 360f;
return 45 / 360f;
case OverlayColourScheme.Lime:
return 90 / 360f;
case OverlayColourScheme.Green:
return 115 / 360f;
return 125 / 360f;
case OverlayColourScheme.Purple:
return 255 / 360f;

View File

@ -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>