diff --git a/osu.Game.Rulesets.Osu/Mods/OsuModApproachDifferent.cs b/osu.Game.Rulesets.Osu/Mods/OsuModApproachDifferent.cs index d832411104..8b323eefa6 100644 --- a/osu.Game.Rulesets.Osu/Mods/OsuModApproachDifferent.cs +++ b/osu.Game.Rulesets.Osu/Mods/OsuModApproachDifferent.cs @@ -1,4 +1,4 @@ -// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using System; @@ -26,12 +26,12 @@ namespace osu.Game.Rulesets.Osu.Mods public BindableFloat Scale { get; } = new BindableFloat(4) { Precision = 0.1f, - MinValue = 2, + MinValue = 1.5f, MaxValue = 10, }; [SettingSource("Style", "Change the animation style of the approach circles.", 1)] - public Bindable Style { get; } = new Bindable(); + public Bindable Style { get; } = new Bindable(AnimationStyle.Gravity); public void ApplyToDrawableHitObject(DrawableHitObject drawable) { @@ -52,9 +52,18 @@ namespace osu.Game.Rulesets.Osu.Mods { switch (style) { - default: + case AnimationStyle.Linear: return Easing.None; + case AnimationStyle.Gravity: + return Easing.InBack; + + case AnimationStyle.InOut1: + return Easing.InOutCubic; + + case AnimationStyle.InOut2: + return Easing.InOutQuint; + case AnimationStyle.Accelerate1: return Easing.In; @@ -64,9 +73,6 @@ namespace osu.Game.Rulesets.Osu.Mods case AnimationStyle.Accelerate3: return Easing.InQuint; - case AnimationStyle.Gravity: - return Easing.InBack; - case AnimationStyle.Decelerate1: return Easing.Out; @@ -76,16 +82,14 @@ namespace osu.Game.Rulesets.Osu.Mods case AnimationStyle.Decelerate3: return Easing.OutQuint; - case AnimationStyle.InOut1: - return Easing.InOutCubic; - - case AnimationStyle.InOut2: - return Easing.InOutQuint; + default: + throw new ArgumentOutOfRangeException(nameof(style), style, @"Unsupported animation style"); } } public enum AnimationStyle { + Linear, Gravity, InOut1, InOut2, diff --git a/osu.Game/Database/RealmContextFactory.cs b/osu.Game/Database/RealmContextFactory.cs index 3c5dfeafe8..2bc77934a8 100644 --- a/osu.Game/Database/RealmContextFactory.cs +++ b/osu.Game/Database/RealmContextFactory.cs @@ -307,6 +307,9 @@ namespace osu.Game.Database case 10: string rulesetSettingClassName = getMappedOrOriginalName(typeof(RealmRulesetSetting)); + if (!migration.OldRealm.Schema.TryFindObjectSchema(rulesetSettingClassName, out _)) + return; + var oldSettings = migration.OldRealm.DynamicApi.All(rulesetSettingClassName); var newSettings = migration.NewRealm.All().ToList(); @@ -329,6 +332,9 @@ namespace osu.Game.Database case 11: string keyBindingClassName = getMappedOrOriginalName(typeof(RealmKeyBinding)); + if (!migration.OldRealm.Schema.TryFindObjectSchema(keyBindingClassName, out _)) + return; + var oldKeyBindings = migration.OldRealm.DynamicApi.All(keyBindingClassName); var newKeyBindings = migration.NewRealm.All().ToList();