1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-08 06:36:05 +08:00

Add basic structural requirements for cursor ripples

This commit is contained in:
Dean Herbert 2023-04-29 16:05:45 +09:00
parent 119687cf6e
commit b39a9d816e
6 changed files with 39 additions and 0 deletions

View File

@ -22,6 +22,7 @@ namespace osu.Game.Rulesets.Osu.Configuration
SetDefault(OsuRulesetSetting.SnakingInSliders, true); SetDefault(OsuRulesetSetting.SnakingInSliders, true);
SetDefault(OsuRulesetSetting.SnakingOutSliders, true); SetDefault(OsuRulesetSetting.SnakingOutSliders, true);
SetDefault(OsuRulesetSetting.ShowCursorTrail, true); SetDefault(OsuRulesetSetting.ShowCursorTrail, true);
SetDefault(OsuRulesetSetting.ShowCursorRipples, false);
SetDefault(OsuRulesetSetting.PlayfieldBorderStyle, PlayfieldBorderStyle.None); SetDefault(OsuRulesetSetting.PlayfieldBorderStyle, PlayfieldBorderStyle.None);
} }
} }
@ -31,6 +32,7 @@ namespace osu.Game.Rulesets.Osu.Configuration
SnakingInSliders, SnakingInSliders,
SnakingOutSliders, SnakingOutSliders,
ShowCursorTrail, ShowCursorTrail,
ShowCursorRipples,
PlayfieldBorderStyle, PlayfieldBorderStyle,
} }
} }

View File

@ -100,6 +100,11 @@ namespace osu.Game.Rulesets.Osu.Skinning.Legacy
return null; return null;
case OsuSkinComponents.CursorRipple:
// TODO: resize texture to 0.5?? but that might break skins..
if (GetTexture("cursor-ripple") != null)
return this.GetAnimation("cursor-ripple", false, false);
case OsuSkinComponents.CursorParticles: case OsuSkinComponents.CursorParticles:
if (GetTexture("star2") != null) if (GetTexture("star2") != null)
return new LegacyCursorParticles(); return new LegacyCursorParticles();

View File

@ -0,0 +1,21 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Graphics.Containers;
using osu.Game.Rulesets.Osu.Configuration;
namespace osu.Game.Rulesets.Osu.UI.Cursor
{
public partial class CursorRippleVisualiser : CompositeDrawable
{
private readonly Bindable<bool> showRipples = new Bindable<bool>(true);
[BackgroundDependencyLoader(true)]
private void load(OsuRulesetConfigManager rulesetConfig)
{
rulesetConfig?.BindWith(OsuRulesetSetting.ShowCursorTrail, showRipples);
}
}
}

View File

@ -48,6 +48,7 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor
Children = new[] Children = new[]
{ {
cursorTrail = new SkinnableDrawable(new OsuSkinComponentLookup(OsuSkinComponents.CursorTrail), _ => new DefaultCursorTrail(), confineMode: ConfineMode.NoScaling), cursorTrail = new SkinnableDrawable(new OsuSkinComponentLookup(OsuSkinComponents.CursorTrail), _ => new DefaultCursorTrail(), confineMode: ConfineMode.NoScaling),
new SkinnableDrawable(new OsuSkinComponentLookup(OsuSkinComponents.CursorRipples), confineMode: ConfineMode.NoScaling),
new SkinnableDrawable(new OsuSkinComponentLookup(OsuSkinComponents.CursorParticles), confineMode: ConfineMode.NoScaling), new SkinnableDrawable(new OsuSkinComponentLookup(OsuSkinComponents.CursorParticles), confineMode: ConfineMode.NoScaling),
} }
}; };

View File

@ -43,6 +43,11 @@ namespace osu.Game.Rulesets.Osu.UI
LabelText = RulesetSettingsStrings.CursorTrail, LabelText = RulesetSettingsStrings.CursorTrail,
Current = config.GetBindable<bool>(OsuRulesetSetting.ShowCursorTrail) Current = config.GetBindable<bool>(OsuRulesetSetting.ShowCursorTrail)
}, },
new SettingsCheckbox
{
LabelText = RulesetSettingsStrings.CursorRipples,
Current = config.GetBindable<bool>(OsuRulesetSetting.ShowCursorRipples)
},
new SettingsEnumDropdown<PlayfieldBorderStyle> new SettingsEnumDropdown<PlayfieldBorderStyle>
{ {
LabelText = RulesetSettingsStrings.PlayfieldBorderStyle, LabelText = RulesetSettingsStrings.PlayfieldBorderStyle,

View File

@ -29,6 +29,11 @@ namespace osu.Game.Localisation
/// </summary> /// </summary>
public static LocalisableString CursorTrail => new TranslatableString(getKey(@"cursor_trail"), @"Cursor trail"); public static LocalisableString CursorTrail => new TranslatableString(getKey(@"cursor_trail"), @"Cursor trail");
/// <summary>
/// "Cursor ripples"
/// </summary>
public static LocalisableString CursorRipples => new TranslatableString(getKey(@"cursor_ripples"), @"Cursor ripples");
/// <summary> /// <summary>
/// "Playfield border style" /// "Playfield border style"
/// </summary> /// </summary>