diff --git a/Circle.Game.Tests/Visual/Objects/TestScenePlanet.cs b/Circle.Game.Tests/Visual/Objects/TestScenePlanet.cs index 5a44c5d..2b2bc29 100644 --- a/Circle.Game.Tests/Visual/Objects/TestScenePlanet.cs +++ b/Circle.Game.Tests/Visual/Objects/TestScenePlanet.cs @@ -1,5 +1,5 @@ -using Circle.Game.Rulesets.Objects; -using Circle.Game.Rulesets.Extensions; +using Circle.Game.Rulesets.Extensions; +using Circle.Game.Rulesets.Objects; using osu.Framework.Graphics; using osu.Framework.Graphics.Shapes; using osuTK.Graphics; diff --git a/Circle.Game/Configuration/CircleConfigManager.cs b/Circle.Game/Configuration/CircleConfigManager.cs index 2068b1c..cfeb37a 100644 --- a/Circle.Game/Configuration/CircleConfigManager.cs +++ b/Circle.Game/Configuration/CircleConfigManager.cs @@ -61,10 +61,10 @@ public override TrackedSettings CreateTrackedSettings() value: $"{blur}" ) ), - new TrackedSetting(CircleSetting.Parallax, papallax => new SettingDescription( - rawValue: papallax, + new TrackedSetting(CircleSetting.Parallax, parallax => new SettingDescription( + rawValue: parallax, name: "Parallax", - value: $"{papallax}" + value: $"{parallax}" ) ) }; diff --git a/Circle.Game/Graphics/Containers/ParallaxContainer.cs b/Circle.Game/Graphics/Containers/ParallaxContainer.cs index 61de1e5..9fe3244 100644 --- a/Circle.Game/Graphics/Containers/ParallaxContainer.cs +++ b/Circle.Game/Graphics/Containers/ParallaxContainer.cs @@ -21,7 +21,7 @@ public class ParallaxContainer : Container, IRequireHighFrequencyMousePosition private Bindable parallaxEnabled; - private const float parallax_duration = 100; + private const float parallax_duration = 1000; private bool firstUpdate = true; diff --git a/Circle.Game/Graphics/UserInterface/CircleButton.cs b/Circle.Game/Graphics/UserInterface/CircleButton.cs index 6ed5dba..239fde6 100644 --- a/Circle.Game/Graphics/UserInterface/CircleButton.cs +++ b/Circle.Game/Graphics/UserInterface/CircleButton.cs @@ -12,10 +12,12 @@ namespace Circle.Game.Graphics.UserInterface { public class CircleButton : ClickableContainer { - private readonly Box hover; + private readonly Box box; private Sample hoverSample; private Sample clickSample; + private readonly bool useBackground; + protected new Container Content; public new float CornerRadius @@ -26,6 +28,7 @@ public class CircleButton : ClickableContainer public CircleButton(bool useBackground = true) { + this.useBackground = useBackground; Child = Content = new Container { Anchor = Anchor.Centre, @@ -33,20 +36,10 @@ public CircleButton(bool useBackground = true) RelativeSizeAxes = Axes.Both, Masking = true, CornerRadius = 5, - Children = new Drawable[] + Child = box = new Box { - new Box - { - RelativeSizeAxes = Axes.Both, - Colour = Color4.Black.Opacity(0.4f), - Alpha = useBackground ? 1 : 0 - }, - hover = new Box - { - Colour = Color4.White, - RelativeSizeAxes = Axes.Both, - Alpha = 0 - } + RelativeSizeAxes = Axes.Both, + Colour = Color4.Black.Opacity(useBackground ? 0.4f : 0), } }; } @@ -62,7 +55,7 @@ private void load(AudioManager audio) protected override bool OnHover(HoverEvent e) { hoverSample?.Play(); - hover.FadeTo(0.25f, 250, Easing.OutQuint); + box.FadeColour(Color4.Gray.Opacity(0.4f), 250, Easing.OutQuint); return base.OnHover(e); } @@ -71,7 +64,7 @@ protected override void OnHoverLost(HoverLostEvent e) { base.OnHoverLost(e); - hover.FadeTo(0, 500, Easing.OutQuint); + box.FadeColour(Color4.Black.Opacity(useBackground ? 0.4f : 0), 500, Easing.OutQuint); } protected override bool OnMouseDown(MouseDownEvent e) diff --git a/Circle.Game/Graphics/UserInterface/CircleDirectorySelectorDirectory.cs b/Circle.Game/Graphics/UserInterface/CircleDirectorySelectorDirectory.cs index dfb1024..ec41cd8 100644 --- a/Circle.Game/Graphics/UserInterface/CircleDirectorySelectorDirectory.cs +++ b/Circle.Game/Graphics/UserInterface/CircleDirectorySelectorDirectory.cs @@ -13,8 +13,6 @@ namespace Circle.Game.Graphics.UserInterface { internal class CircleDirectorySelectorDirectory : DirectorySelectorDirectory { - private Box hover; - public CircleDirectorySelectorDirectory(DirectoryInfo directory, string displayName = null) : base(directory, displayName) { @@ -32,13 +30,6 @@ private void load() { new Background { - Depth = 2 - }, - hover = new Box - { - Colour = Color4.White, - RelativeSizeAxes = Axes.Both, - Alpha = 0, Depth = 1 } }); @@ -50,32 +41,34 @@ private void load() ? FontAwesome.Solid.Database : FontAwesome.Regular.Folder; - protected override bool OnHover(HoverEvent e) - { - hover.FadeTo(0.25f, 250, Easing.OutQuint); - - return base.OnHover(e); - } - - protected override void OnHoverLost(HoverLostEvent e) - { - base.OnHoverLost(e); - - hover.FadeTo(0, 500, Easing.OutQuint); - } - internal class Background : CompositeDrawable { + private Box box; + [BackgroundDependencyLoader] private void load() { RelativeSizeAxes = Axes.Both; - InternalChild = new Box + InternalChild = box = new Box { Colour = Color4.Black.Opacity(0.4f), RelativeSizeAxes = Axes.Both, }; } + + protected override bool OnHover(HoverEvent e) + { + box.FadeColour(Color4.Gray.Opacity(0.4f), 250, Easing.OutQuint); + + return base.OnHover(e); + } + + protected override void OnHoverLost(HoverLostEvent e) + { + base.OnHoverLost(e); + + box.FadeColour(Color4.Black.Opacity(0.4f), 250, Easing.OutQuint); + } } } } diff --git a/Circle.Game/Graphics/UserInterface/CircleDropdown.cs b/Circle.Game/Graphics/UserInterface/CircleDropdown.cs index a1c872e..c8285da 100644 --- a/Circle.Game/Graphics/UserInterface/CircleDropdown.cs +++ b/Circle.Game/Graphics/UserInterface/CircleDropdown.cs @@ -57,7 +57,7 @@ protected class CircleDropdownMenu : DropdownMenu private Sample? sampleOpen; private Sample? sampleClose; - // todo: this uses the same styling as OsuMenu. hopefully we can just use OsuMenu in the future with some refactoring + // todo: this uses the same styling as CircleMenu. hopefully we can just use CircleMenu in the future with some refactoring public CircleDropdownMenu() { CornerRadius = corner_radius; @@ -65,7 +65,7 @@ public CircleDropdownMenu() MaskingContainer.CornerRadius = corner_radius; Alpha = 0; - // todo: this uses the same styling as OsuMenu. hopefully we can just use OsuMenu in the future with some refactoring + // todo: this uses the same styling as CircleMenu. hopefully we can just use CircleMenu in the future with some refactoring ItemsContainer.Padding = new MarginPadding(5); } @@ -76,8 +76,8 @@ private void load(AudioManager audio) HoverColour = Color4.DeepSkyBlue.Opacity(0.6f); SelectionColour = Color4.DeepSkyBlue.Opacity(0.8f); - sampleOpen = audio.Samples.Get(@"overlay-pop-in"); - sampleClose = audio.Samples.Get(@"overlay-pop-out"); + sampleOpen = audio.Samples.Get(@"dropdown-open"); + sampleClose = audio.Samples.Get(@"dropdown-close"); } // todo: this shouldn't be required after https://github.com/ppy/osu-framework/issues/4519 is fixed. diff --git a/Circle.Game/Graphics/UserInterface/CircleFileSelector.cs b/Circle.Game/Graphics/UserInterface/CircleFileSelector.cs index e1961f2..22ceebb 100644 --- a/Circle.Game/Graphics/UserInterface/CircleFileSelector.cs +++ b/Circle.Game/Graphics/UserInterface/CircleFileSelector.cs @@ -3,11 +3,8 @@ using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.UserInterface; -using osu.Framework.Input.Events; -using osuTK.Graphics; namespace Circle.Game.Graphics.UserInterface { @@ -38,8 +35,6 @@ private void load() protected class CircleDirectoryListingFile : DirectoryListingFile { - private Box hover; - public CircleDirectoryListingFile(FileInfo file) : base(file) { @@ -57,32 +52,11 @@ private void load() { new CircleDirectorySelectorDirectory.Background { - Depth = 2 - }, - hover = new Box - { - Colour = Color4.White, - RelativeSizeAxes = Axes.Both, - Alpha = 0, Depth = 1 } }); } - protected override bool OnHover(HoverEvent e) - { - hover.FadeTo(0.25f, 250, Easing.OutQuint); - - return base.OnHover(e); - } - - protected override void OnHoverLost(HoverLostEvent e) - { - base.OnHoverLost(e); - - hover.FadeTo(0, 500, Easing.OutQuint); - } - protected override IconUsage? Icon { get diff --git a/Circle.Game/Rulesets/Objects/Planet.cs b/Circle.Game/Rulesets/Objects/Planet.cs index a87d4f4..35024ab 100644 --- a/Circle.Game/Rulesets/Objects/Planet.cs +++ b/Circle.Game/Rulesets/Objects/Planet.cs @@ -1,11 +1,11 @@ -using osu.Framework.Graphics; +using Circle.Game.Utils; +using osu.Framework.Allocation; +using osu.Framework.Bindables; +using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; -using Shape = osu.Framework.Graphics.Shapes; using osuTK; using osuTK.Graphics; -using osu.Framework.Bindables; -using Circle.Game.Utils; -using osu.Framework.Allocation; +using Shape = osu.Framework.Graphics.Shapes; namespace Circle.Game.Rulesets.Objects { diff --git a/Circle.Resources/Samples/button-click.wav b/Circle.Resources/Samples/button-click.wav index 8699158..b6902a7 100644 Binary files a/Circle.Resources/Samples/button-click.wav and b/Circle.Resources/Samples/button-click.wav differ diff --git a/Circle.Resources/Samples/button-hover.wav b/Circle.Resources/Samples/button-hover.wav index e27e6a6..1525113 100644 Binary files a/Circle.Resources/Samples/button-hover.wav and b/Circle.Resources/Samples/button-hover.wav differ diff --git a/Circle.Resources/Samples/dropdown-close.wav b/Circle.Resources/Samples/dropdown-close.wav new file mode 100644 index 0000000..787a8b7 Binary files /dev/null and b/Circle.Resources/Samples/dropdown-close.wav differ diff --git a/Circle.Resources/Samples/dropdown-open.wav b/Circle.Resources/Samples/dropdown-open.wav new file mode 100644 index 0000000..9c2d667 Binary files /dev/null and b/Circle.Resources/Samples/dropdown-open.wav differ