Skip to content

Commit

Permalink
Add support for fc/af overlay sounds
Browse files Browse the repository at this point in the history
  • Loading branch information
flustix committed Aug 25, 2024
1 parent 353eee1 commit 6d13b27
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 1 deletion.
14 changes: 13 additions & 1 deletion fluXis.Game/Screens/Gameplay/Overlay/FullComboOverlay.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
using System;
using fluXis.Game.Graphics.Sprites;
using fluXis.Game.Graphics.UserInterface.Color;
using fluXis.Game.Skinning;
using fluXis.Game.Utils.Extensions;
using osu.Framework.Allocation;
using osu.Framework.Audio.Sample;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
Expand All @@ -17,12 +19,18 @@ public partial class FullComboOverlay : CompositeDrawable
private OutlinedSquare diamond;
private FluXisSpriteText text;

private Sample sampleFullCombo;
private Sample sampleAllFlawless;

[BackgroundDependencyLoader]
private void load()
private void load(SkinManager skins)
{
RelativeSizeAxes = Axes.Both;
Alpha = 0;

sampleFullCombo = skins.GetFullComboSample();
sampleAllFlawless = skins.GetAllFlawlessSample();

InternalChildren = new Drawable[]
{
background = new Box
Expand Down Expand Up @@ -68,10 +76,14 @@ public void Show(FullComboType type)

if (type == FullComboType.AllFlawless)
{
sampleAllFlawless?.Play();

diamond.ScaleTo(1, 1200, Easing.OutQuint)
.RotateTo(-45).RotateTo(45, 1200, Easing.OutQuint)
.BorderTo(0, 1200, Easing.OutQuint);
}
else
sampleFullCombo?.Play();

background.FadeTo(.4f, 400);
text.ScaleTo(1.2f, 1000, Easing.OutQuint);
Expand Down
2 changes: 2 additions & 0 deletions fluXis.Game/Skinning/Custom/CustomSkin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,8 @@ public Sample[] GetMissSamples()

public Sample GetFailSample() => samples.Get("Samples/Gameplay/fail");
public Sample GetRestartSample() => samples.Get("Samples/Gameplay/restart");
public Sample GetFullComboSample() => samples.Get("Samples/Gameplay/full-combo");
public Sample GetAllFlawlessSample() => samples.Get("Samples/Gameplay/all-flawless");

public void Dispose()
{
Expand Down
2 changes: 2 additions & 0 deletions fluXis.Game/Skinning/Default/DefaultSkin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ public Drawable GetReceptor(int lane, int keyCount, bool down)
public Sample[] GetMissSamples() => new[] { samples.Get("Gameplay/combobreak") };
public Sample GetFailSample() => samples.Get("Gameplay/fail");
public Sample GetRestartSample() => samples.Get("Gameplay/restart");
public Sample GetFullComboSample() => samples.Get("Gameplay/full-combo");
public Sample GetAllFlawlessSample() => samples.Get("Gameplay/all-flawless");

public void Dispose()
{
Expand Down
2 changes: 2 additions & 0 deletions fluXis.Game/Skinning/ISkin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,6 @@ public interface ISkin : IDisposable
public Sample[] GetMissSamples();
public Sample GetFailSample();
public Sample GetRestartSample();
public Sample GetFullComboSample();
public Sample GetAllFlawlessSample();
}
2 changes: 2 additions & 0 deletions fluXis.Game/Skinning/SkinManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -285,4 +285,6 @@ private ISkin loadSkin(string folder)
public Sample[] GetMissSamples() => currentSkin.GetMissSamples() ?? defaultSkin.GetMissSamples();
public Sample GetFailSample() => currentSkin.GetFailSample() ?? defaultSkin.GetFailSample();
public Sample GetRestartSample() => currentSkin.GetRestartSample() ?? defaultSkin.GetRestartSample();
public Sample GetFullComboSample() => currentSkin.GetFullComboSample() ?? defaultSkin.GetFullComboSample();
public Sample GetAllFlawlessSample() => currentSkin.GetAllFlawlessSample() ?? defaultSkin.GetAllFlawlessSample();
}

0 comments on commit 6d13b27

Please sign in to comment.