From 3849b1164436d227f2418a645d062c96711934e5 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 12 Oct 2023 19:48:45 +0900 Subject: [PATCH 1/7] Fix "Hard Rock" mod affecting CS/AR in osu!mania Closes https://github.com/ppy/osu/issues/25090. Not sure if there are other exceptions we should account for here. --- osu.Game.Rulesets.Catch/Mods/CatchModHardRock.cs | 9 +++++++++ osu.Game.Rulesets.Osu/Mods/OsuModHardRock.cs | 9 +++++++++ osu.Game.Rulesets.Taiko/Mods/TaikoModHardRock.cs | 3 +++ osu.Game/Rulesets/Mods/ModHardRock.cs | 9 ++++----- 4 files changed, 25 insertions(+), 5 deletions(-) diff --git a/osu.Game.Rulesets.Catch/Mods/CatchModHardRock.cs b/osu.Game.Rulesets.Catch/Mods/CatchModHardRock.cs index 93eadcc13e..62fded0980 100644 --- a/osu.Game.Rulesets.Catch/Mods/CatchModHardRock.cs +++ b/osu.Game.Rulesets.Catch/Mods/CatchModHardRock.cs @@ -1,6 +1,7 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. +using System; using osu.Game.Rulesets.Mods; using osu.Game.Beatmaps; using osu.Game.Rulesets.Catch.Beatmaps; @@ -16,5 +17,13 @@ namespace osu.Game.Rulesets.Catch.Mods var catchProcessor = (CatchBeatmapProcessor)beatmapProcessor; catchProcessor.HardRockOffsets = true; } + + public override void ApplyToDifficulty(BeatmapDifficulty difficulty) + { + base.ApplyToDifficulty(difficulty); + + difficulty.CircleSize = Math.Min(difficulty.CircleSize * 1.3f, 10.0f); // CS uses a custom 1.3 ratio. + difficulty.ApproachRate = Math.Min(difficulty.ApproachRate * ADJUST_RATIO, 10.0f); + } } } diff --git a/osu.Game.Rulesets.Osu/Mods/OsuModHardRock.cs b/osu.Game.Rulesets.Osu/Mods/OsuModHardRock.cs index 19d4a1bf83..d24597eeed 100644 --- a/osu.Game.Rulesets.Osu/Mods/OsuModHardRock.cs +++ b/osu.Game.Rulesets.Osu/Mods/OsuModHardRock.cs @@ -3,6 +3,7 @@ using System; using System.Linq; +using osu.Game.Beatmaps; using osu.Game.Rulesets.Mods; using osu.Game.Rulesets.Objects; using osu.Game.Rulesets.Osu.Objects; @@ -22,5 +23,13 @@ namespace osu.Game.Rulesets.Osu.Mods OsuHitObjectGenerationUtils.ReflectVerticallyAlongPlayfield(osuObject); } + + public override void ApplyToDifficulty(BeatmapDifficulty difficulty) + { + base.ApplyToDifficulty(difficulty); + + difficulty.CircleSize = Math.Min(difficulty.CircleSize * 1.3f, 10.0f); // CS uses a custom 1.3 ratio. + difficulty.ApproachRate = Math.Min(difficulty.ApproachRate * ADJUST_RATIO, 10.0f); + } } } diff --git a/osu.Game.Rulesets.Taiko/Mods/TaikoModHardRock.cs b/osu.Game.Rulesets.Taiko/Mods/TaikoModHardRock.cs index ba41175461..37a630c8ad 100644 --- a/osu.Game.Rulesets.Taiko/Mods/TaikoModHardRock.cs +++ b/osu.Game.Rulesets.Taiko/Mods/TaikoModHardRock.cs @@ -1,6 +1,7 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. +using System; using osu.Game.Beatmaps; using osu.Game.Rulesets.Mods; @@ -23,7 +24,9 @@ namespace osu.Game.Rulesets.Taiko.Mods public override void ApplyToDifficulty(BeatmapDifficulty difficulty) { base.ApplyToDifficulty(difficulty); + difficulty.SliderMultiplier *= slider_multiplier; + difficulty.ApproachRate = Math.Min(difficulty.ApproachRate * ADJUST_RATIO, 10.0f); } } } diff --git a/osu.Game/Rulesets/Mods/ModHardRock.cs b/osu.Game/Rulesets/Mods/ModHardRock.cs index 2886e59c54..4b2d1d050e 100644 --- a/osu.Game/Rulesets/Mods/ModHardRock.cs +++ b/osu.Game/Rulesets/Mods/ModHardRock.cs @@ -18,17 +18,16 @@ namespace osu.Game.Rulesets.Mods public override LocalisableString Description => "Everything just got a bit harder..."; public override Type[] IncompatibleMods => new[] { typeof(ModEasy), typeof(ModDifficultyAdjust) }; + protected const float ADJUST_RATIO = 1.4f; + public void ReadFromDifficulty(IBeatmapDifficultyInfo difficulty) { } public virtual void ApplyToDifficulty(BeatmapDifficulty difficulty) { - const float ratio = 1.4f; - difficulty.CircleSize = Math.Min(difficulty.CircleSize * 1.3f, 10.0f); // CS uses a custom 1.3 ratio. - difficulty.ApproachRate = Math.Min(difficulty.ApproachRate * ratio, 10.0f); - difficulty.DrainRate = Math.Min(difficulty.DrainRate * ratio, 10.0f); - difficulty.OverallDifficulty = Math.Min(difficulty.OverallDifficulty * ratio, 10.0f); + difficulty.DrainRate = Math.Min(difficulty.DrainRate * ADJUST_RATIO, 10.0f); + difficulty.OverallDifficulty = Math.Min(difficulty.OverallDifficulty * ADJUST_RATIO, 10.0f); } } } From 17df2fdf0104d8433be92f48384e783a32fcd03c Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 13 Oct 2023 15:42:49 +0900 Subject: [PATCH 2/7] Restrict `followpoint` size See https://github.com/ppy/osu/issues/24940#issuecomment-1760980461. --- .../Skinning/Legacy/OsuLegacySkinTransformer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Osu/Skinning/Legacy/OsuLegacySkinTransformer.cs b/osu.Game.Rulesets.Osu/Skinning/Legacy/OsuLegacySkinTransformer.cs index 88a4e17120..f06cad7061 100644 --- a/osu.Game.Rulesets.Osu/Skinning/Legacy/OsuLegacySkinTransformer.cs +++ b/osu.Game.Rulesets.Osu/Skinning/Legacy/OsuLegacySkinTransformer.cs @@ -46,7 +46,7 @@ namespace osu.Game.Rulesets.Osu.Skinning.Legacy switch (osuComponent.Component) { case OsuSkinComponents.FollowPoint: - return this.GetAnimation("followpoint", true, true, true, startAtCurrentTime: false); + return this.GetAnimation("followpoint", true, true, true, startAtCurrentTime: false, maxSize: new Vector2(OsuHitObject.OBJECT_RADIUS * 2, OsuHitObject.OBJECT_RADIUS)); case OsuSkinComponents.SliderScorePoint: return this.GetAnimation("sliderscorepoint", false, false); From 0b64852181f219f05529d90d6c0c08807c81fa80 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 13 Oct 2023 15:43:18 +0900 Subject: [PATCH 3/7] Limit `sliderscorepoint` to hitcicle dimensions You'd never use anything above this unless crazy. --- .../Skinning/Legacy/OsuLegacySkinTransformer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Osu/Skinning/Legacy/OsuLegacySkinTransformer.cs b/osu.Game.Rulesets.Osu/Skinning/Legacy/OsuLegacySkinTransformer.cs index f06cad7061..3002cbe0ae 100644 --- a/osu.Game.Rulesets.Osu/Skinning/Legacy/OsuLegacySkinTransformer.cs +++ b/osu.Game.Rulesets.Osu/Skinning/Legacy/OsuLegacySkinTransformer.cs @@ -49,7 +49,7 @@ namespace osu.Game.Rulesets.Osu.Skinning.Legacy return this.GetAnimation("followpoint", true, true, true, startAtCurrentTime: false, maxSize: new Vector2(OsuHitObject.OBJECT_RADIUS * 2, OsuHitObject.OBJECT_RADIUS)); case OsuSkinComponents.SliderScorePoint: - return this.GetAnimation("sliderscorepoint", false, false); + return this.GetAnimation("sliderscorepoint", false, false, maxSize: OsuHitObject.OBJECT_DIMENSIONS); case OsuSkinComponents.SliderFollowCircle: var followCircleContent = this.GetAnimation("sliderfollowcircle", true, true, true, maxSize: MAX_FOLLOW_CIRCLE_AREA_SIZE); From a88779e5880f9a02b442ace50faf23c9a6bd4491 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Fri, 13 Oct 2023 13:10:04 +0200 Subject: [PATCH 4/7] Use dimmed placeholder text instead of empty box on cleared bindings --- .../Sections/Input/KeyBindingRow_KeyButton.cs | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/osu.Game/Overlays/Settings/Sections/Input/KeyBindingRow_KeyButton.cs b/osu.Game/Overlays/Settings/Sections/Input/KeyBindingRow_KeyButton.cs index cf26300fb6..53d0f50605 100644 --- a/osu.Game/Overlays/Settings/Sections/Input/KeyBindingRow_KeyButton.cs +++ b/osu.Game/Overlays/Settings/Sections/Input/KeyBindingRow_KeyButton.cs @@ -12,11 +12,13 @@ using osu.Framework.Graphics.Shapes; using osu.Framework.Input; using osu.Framework.Input.Bindings; using osu.Framework.Input.Events; +using osu.Framework.Localisation; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; using osu.Game.Graphics.UserInterface; using osu.Game.Input; using osu.Game.Input.Bindings; +using osu.Game.Localisation; using osuTK.Graphics; namespace osu.Game.Overlays.Settings.Sections.Input @@ -153,7 +155,20 @@ namespace osu.Game.Overlays.Settings.Sections.Input { Scheduler.AddOnce(updateText); - void updateText() => Text.Text = keyCombinationProvider.GetReadableString(KeyBinding.Value.KeyCombination); + void updateText() + { + LocalisableString keyCombinationString = keyCombinationProvider.GetReadableString(KeyBinding.Value.KeyCombination); + float alpha = 1; + + if (LocalisableString.IsNullOrEmpty(keyCombinationString)) + { + keyCombinationString = InputSettingsStrings.ActionHasNoKeyBinding; + alpha = 0.4f; + } + + Text.Text = keyCombinationString; + Text.Alpha = alpha; + } } protected override void Dispose(bool isDisposing) From af89d69fc4d405a6d02d6fb442c9d57e8f5045d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Fri, 13 Oct 2023 13:16:24 +0200 Subject: [PATCH 5/7] Fix dangerous buttons using different shades of pink --- osu.Game.Tournament/Screens/Editors/TournamentEditorScreen.cs | 2 +- osu.Game/Graphics/OsuColour.cs | 2 ++ osu.Game/Graphics/UserInterface/DangerousRoundedButton.cs | 2 +- osu.Game/Overlays/FirstRunSetup/ScreenBehaviour.cs | 2 +- osu.Game/Overlays/Settings/DangerousSettingsButton.cs | 2 +- .../Settings/Sections/Input/KeyBindingConflictPopover.cs | 2 +- 6 files changed, 7 insertions(+), 5 deletions(-) diff --git a/osu.Game.Tournament/Screens/Editors/TournamentEditorScreen.cs b/osu.Game.Tournament/Screens/Editors/TournamentEditorScreen.cs index 9dd028fa79..aa3718150c 100644 --- a/osu.Game.Tournament/Screens/Editors/TournamentEditorScreen.cs +++ b/osu.Game.Tournament/Screens/Editors/TournamentEditorScreen.cs @@ -82,7 +82,7 @@ namespace osu.Game.Tournament.Screens.Editors new TourneyButton { RelativeSizeAxes = Axes.X, - BackgroundColour = colours.Pink3, + BackgroundColour = colours.DangerousButtonColour, Text = "Clear all", Action = () => { diff --git a/osu.Game/Graphics/OsuColour.cs b/osu.Game/Graphics/OsuColour.cs index d0e07a9e66..75d313d98c 100644 --- a/osu.Game/Graphics/OsuColour.cs +++ b/osu.Game/Graphics/OsuColour.cs @@ -397,5 +397,7 @@ namespace osu.Game.Graphics public Color4 SpotlightColour => Green2; public Color4 FeaturedArtistColour => Blue2; + + public Color4 DangerousButtonColour => Pink3; } } diff --git a/osu.Game/Graphics/UserInterface/DangerousRoundedButton.cs b/osu.Game/Graphics/UserInterface/DangerousRoundedButton.cs index b237dd9b71..39ef7924b9 100644 --- a/osu.Game/Graphics/UserInterface/DangerousRoundedButton.cs +++ b/osu.Game/Graphics/UserInterface/DangerousRoundedButton.cs @@ -11,7 +11,7 @@ namespace osu.Game.Graphics.UserInterface [BackgroundDependencyLoader] private void load(OsuColour colours) { - BackgroundColour = colours.PinkDark; + BackgroundColour = colours.DangerousButtonColour; } } } diff --git a/osu.Game/Overlays/FirstRunSetup/ScreenBehaviour.cs b/osu.Game/Overlays/FirstRunSetup/ScreenBehaviour.cs index 95af8ec0f3..31a56c9748 100644 --- a/osu.Game/Overlays/FirstRunSetup/ScreenBehaviour.cs +++ b/osu.Game/Overlays/FirstRunSetup/ScreenBehaviour.cs @@ -65,7 +65,7 @@ namespace osu.Game.Overlays.FirstRunSetup { Anchor = Anchor.TopRight, Origin = Anchor.TopRight, - BackgroundColour = colours.Pink3, + BackgroundColour = colours.DangerousButtonColour, Text = FirstRunSetupOverlayStrings.ClassicDefaults, RelativeSizeAxes = Axes.X, Action = applyClassic diff --git a/osu.Game/Overlays/Settings/DangerousSettingsButton.cs b/osu.Game/Overlays/Settings/DangerousSettingsButton.cs index 42b042ae75..9a9d40cada 100644 --- a/osu.Game/Overlays/Settings/DangerousSettingsButton.cs +++ b/osu.Game/Overlays/Settings/DangerousSettingsButton.cs @@ -14,7 +14,7 @@ namespace osu.Game.Overlays.Settings [BackgroundDependencyLoader] private void load(OsuColour colours) { - BackgroundColour = colours.Pink3; + BackgroundColour = colours.DangerousButtonColour; } } } diff --git a/osu.Game/Overlays/Settings/Sections/Input/KeyBindingConflictPopover.cs b/osu.Game/Overlays/Settings/Sections/Input/KeyBindingConflictPopover.cs index 610325e412..15061857e1 100644 --- a/osu.Game/Overlays/Settings/Sections/Input/KeyBindingConflictPopover.cs +++ b/osu.Game/Overlays/Settings/Sections/Input/KeyBindingConflictPopover.cs @@ -90,7 +90,7 @@ namespace osu.Game.Overlays.Settings.Sections.Input applyNewButton = new HoverableRoundedButton { Text = InputSettingsStrings.ApplyNewBinding, - BackgroundColour = colours.Pink3, + BackgroundColour = colours.DangerousButtonColour, RelativeSizeAxes = Axes.X, Width = 0.48f, Anchor = Anchor.CentreRight, From d656306692f34dda17b163712b931828d276253a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Fri, 13 Oct 2023 14:05:43 +0200 Subject: [PATCH 6/7] Remove approach rate adjustment from `TaikoModHardRock` Approach rate does nothing in taiko. --- osu.Game.Rulesets.Taiko/Mods/TaikoModHardRock.cs | 3 --- 1 file changed, 3 deletions(-) diff --git a/osu.Game.Rulesets.Taiko/Mods/TaikoModHardRock.cs b/osu.Game.Rulesets.Taiko/Mods/TaikoModHardRock.cs index 37a630c8ad..ba41175461 100644 --- a/osu.Game.Rulesets.Taiko/Mods/TaikoModHardRock.cs +++ b/osu.Game.Rulesets.Taiko/Mods/TaikoModHardRock.cs @@ -1,7 +1,6 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. -using System; using osu.Game.Beatmaps; using osu.Game.Rulesets.Mods; @@ -24,9 +23,7 @@ namespace osu.Game.Rulesets.Taiko.Mods public override void ApplyToDifficulty(BeatmapDifficulty difficulty) { base.ApplyToDifficulty(difficulty); - difficulty.SliderMultiplier *= slider_multiplier; - difficulty.ApproachRate = Math.Min(difficulty.ApproachRate * ADJUST_RATIO, 10.0f); } } } From 9b474b656d40f3b452d5c981ee78461ac2f83cea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Fri, 13 Oct 2023 15:03:41 +0200 Subject: [PATCH 7/7] Fix key binding panel test failures from introducing placeholder text Whoops. --- .../Visual/Settings/TestSceneKeyBindingPanel.cs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/osu.Game.Tests/Visual/Settings/TestSceneKeyBindingPanel.cs b/osu.Game.Tests/Visual/Settings/TestSceneKeyBindingPanel.cs index fcbb16bef6..1c4e89e1a2 100644 --- a/osu.Game.Tests/Visual/Settings/TestSceneKeyBindingPanel.cs +++ b/osu.Game.Tests/Visual/Settings/TestSceneKeyBindingPanel.cs @@ -11,6 +11,7 @@ using osu.Framework.Threading; using osu.Game.Graphics.Sprites; using osu.Game.Graphics.UserInterface; using osu.Game.Graphics.UserInterfaceV2; +using osu.Game.Localisation; using osu.Game.Overlays; using osu.Game.Overlays.Settings; using osu.Game.Overlays.Settings.Sections.Input; @@ -157,7 +158,9 @@ namespace osu.Game.Tests.Visual.Settings clickClearButton(); - AddAssert("first binding cleared", () => string.IsNullOrEmpty(multiBindingRow.ChildrenOfType().First().Text.Text.ToString())); + AddAssert("first binding cleared", + () => multiBindingRow.ChildrenOfType().First().Text.Text, + () => Is.EqualTo(InputSettingsStrings.ActionHasNoKeyBinding)); AddStep("click second binding", () => { @@ -169,7 +172,9 @@ namespace osu.Game.Tests.Visual.Settings clickClearButton(); - AddAssert("second binding cleared", () => string.IsNullOrEmpty(multiBindingRow.ChildrenOfType().ElementAt(1).Text.Text.ToString())); + AddAssert("second binding cleared", + () => multiBindingRow.ChildrenOfType().ElementAt(1).Text.Text, + () => Is.EqualTo(InputSettingsStrings.ActionHasNoKeyBinding)); void clickClearButton() { @@ -327,7 +332,7 @@ namespace osu.Game.Tests.Visual.Settings KeyBindingConflictPopover popover = null; AddUntilStep("wait for popover", () => popover = panel.ChildrenOfType().SingleOrDefault(), () => Is.Not.Null); AddStep("click second button", () => popover.ChildrenOfType().ElementAt(1).TriggerClick()); - checkBinding("Left (centre)", string.Empty); + checkBinding("Left (centre)", InputSettingsStrings.ActionHasNoKeyBinding.ToString()); checkBinding("Left (rim)", "M1"); } @@ -360,7 +365,7 @@ namespace osu.Game.Tests.Visual.Settings AddUntilStep("wait for popover", () => popover = panel.ChildrenOfType().SingleOrDefault(), () => Is.Not.Null); AddStep("click second button", () => popover.ChildrenOfType().ElementAt(1).TriggerClick()); checkBinding("Left (centre)", "M1"); - checkBinding("Left (rim)", string.Empty); + checkBinding("Left (rim)", InputSettingsStrings.ActionHasNoKeyBinding.ToString()); } [Test]