From 5e0763ae33c65105ef38a38cddc833abc921854d Mon Sep 17 00:00:00 2001 From: MK56 <74463310+mk56-spn@users.noreply.github.com> Date: Thu, 25 Nov 2021 10:24:00 +0100 Subject: [PATCH 1/7] Expand the functionality of Approach different --- osu.Game.Rulesets.Osu/Mods/OsuModApproachDifferent.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Osu/Mods/OsuModApproachDifferent.cs b/osu.Game.Rulesets.Osu/Mods/OsuModApproachDifferent.cs index d832411104..d3a01e5def 100644 --- a/osu.Game.Rulesets.Osu/Mods/OsuModApproachDifferent.cs +++ b/osu.Game.Rulesets.Osu/Mods/OsuModApproachDifferent.cs @@ -26,7 +26,7 @@ namespace osu.Game.Rulesets.Osu.Mods public BindableFloat Scale { get; } = new BindableFloat(4) { Precision = 0.1f, - MinValue = 2, + MinValue = 1.5f, MaxValue = 10, }; @@ -58,6 +58,9 @@ namespace osu.Game.Rulesets.Osu.Mods case AnimationStyle.Accelerate1: return Easing.In; + case AnimationStyle.Linear: + return Easing.None; + case AnimationStyle.Accelerate2: return Easing.InCubic; @@ -86,6 +89,7 @@ namespace osu.Game.Rulesets.Osu.Mods public enum AnimationStyle { + Linear, Gravity, InOut1, InOut2, From 5e56122d650f78c1a69e9890b608aa4d9021c446 Mon Sep 17 00:00:00 2001 From: MK-56 Date: Fri, 26 Nov 2021 09:48:38 +0100 Subject: [PATCH 2/7] Linear approach type moved per peppys request --- osu.Game.Rulesets.Osu/Mods/OsuModApproachDifferent.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Osu/Mods/OsuModApproachDifferent.cs b/osu.Game.Rulesets.Osu/Mods/OsuModApproachDifferent.cs index d3a01e5def..ae5ca0d679 100644 --- a/osu.Game.Rulesets.Osu/Mods/OsuModApproachDifferent.cs +++ b/osu.Game.Rulesets.Osu/Mods/OsuModApproachDifferent.cs @@ -89,7 +89,6 @@ namespace osu.Game.Rulesets.Osu.Mods public enum AnimationStyle { - Linear, Gravity, InOut1, InOut2, @@ -99,6 +98,7 @@ namespace osu.Game.Rulesets.Osu.Mods Decelerate1, Decelerate2, Decelerate3, + Linear, } } } From 0df97744ad8425e7b62dd8ea305a07310d921066 Mon Sep 17 00:00:00 2001 From: mk-56 Date: Sat, 27 Nov 2021 13:34:09 +0100 Subject: [PATCH 3/7] Moved linear to a better place. i decided to go with leaving it under gravity, its plenty visible and fine there, since the public enum list self orders I wasn't sure about how i could set a default that wasn't the topmost option --- osu.Game.Rulesets.Osu/Mods/OsuModApproachDifferent.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Mods/OsuModApproachDifferent.cs b/osu.Game.Rulesets.Osu/Mods/OsuModApproachDifferent.cs index ae5ca0d679..6aeb378c69 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; @@ -90,6 +90,7 @@ namespace osu.Game.Rulesets.Osu.Mods public enum AnimationStyle { Gravity, + Linear, InOut1, InOut2, Accelerate1, @@ -98,7 +99,6 @@ namespace osu.Game.Rulesets.Osu.Mods Decelerate1, Decelerate2, Decelerate3, - Linear, } } } From 1ae41118cd611d4965272a3272035f2c307acc7a Mon Sep 17 00:00:00 2001 From: mk-56 Date: Sat, 27 Nov 2021 22:59:09 +0100 Subject: [PATCH 4/7] Added gravity as a default. --- osu.Game.Rulesets.Osu/Mods/OsuModApproachDifferent.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Mods/OsuModApproachDifferent.cs b/osu.Game.Rulesets.Osu/Mods/OsuModApproachDifferent.cs index 6aeb378c69..db74790221 100644 --- a/osu.Game.Rulesets.Osu/Mods/OsuModApproachDifferent.cs +++ b/osu.Game.Rulesets.Osu/Mods/OsuModApproachDifferent.cs @@ -31,7 +31,7 @@ namespace osu.Game.Rulesets.Osu.Mods }; [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) { @@ -89,8 +89,8 @@ namespace osu.Game.Rulesets.Osu.Mods public enum AnimationStyle { - Gravity, Linear, + Gravity, InOut1, InOut2, Accelerate1, From 93b5aec23ec00b85b75a4aebcc22dfc40d68750d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Sun, 28 Nov 2021 15:00:40 +0100 Subject: [PATCH 5/7] Fix realm migration failures when upgrading from old versions * `RealmRulesetSetting` was added in 2021.916.0. * `RealmKeyBinding` was added in 2021.703.0. Attempting to upgrade from older releases than the above would cause migrations up to schema versions 10 and 11 to fail. --- osu.Game/Database/RealmContextFactory.cs | 6 ++++++ 1 file changed, 6 insertions(+) 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(); From aba9ed624a408d7b0b28e45796d6dd1e096b977f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Sun, 28 Nov 2021 15:16:33 +0100 Subject: [PATCH 6/7] Remove unnecessary whitespace --- osu.Game.Rulesets.Osu/Mods/OsuModApproachDifferent.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Osu/Mods/OsuModApproachDifferent.cs b/osu.Game.Rulesets.Osu/Mods/OsuModApproachDifferent.cs index db74790221..d784320d22 100644 --- a/osu.Game.Rulesets.Osu/Mods/OsuModApproachDifferent.cs +++ b/osu.Game.Rulesets.Osu/Mods/OsuModApproachDifferent.cs @@ -90,7 +90,7 @@ namespace osu.Game.Rulesets.Osu.Mods public enum AnimationStyle { Linear, - Gravity, + Gravity, InOut1, InOut2, Accelerate1, From 5001412a0dada04c25400ebeb8676e5d927f1f9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Sun, 28 Nov 2021 15:19:12 +0100 Subject: [PATCH 7/7] Reorder easing mapping to match enum order and throw on unknown animation style --- .../Mods/OsuModApproachDifferent.cs | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Mods/OsuModApproachDifferent.cs b/osu.Game.Rulesets.Osu/Mods/OsuModApproachDifferent.cs index d784320d22..8b323eefa6 100644 --- a/osu.Game.Rulesets.Osu/Mods/OsuModApproachDifferent.cs +++ b/osu.Game.Rulesets.Osu/Mods/OsuModApproachDifferent.cs @@ -52,24 +52,27 @@ 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; - case AnimationStyle.Linear: - return Easing.None; - case AnimationStyle.Accelerate2: return Easing.InCubic; case AnimationStyle.Accelerate3: return Easing.InQuint; - case AnimationStyle.Gravity: - return Easing.InBack; - case AnimationStyle.Decelerate1: return Easing.Out; @@ -79,11 +82,8 @@ 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"); } }