mirror of
https://github.com/ppy/osu.git
synced 2025-03-11 10:17:18 +08:00
Allow kiai/star-fountain SFX to be skinnable
This commit is contained in:
parent
479c73c1ac
commit
18aa168a00
@ -3,11 +3,12 @@
|
|||||||
|
|
||||||
using System;
|
using System;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Audio;
|
|
||||||
using osu.Framework.Audio.Sample;
|
using osu.Framework.Audio.Sample;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Utils;
|
using osu.Framework.Utils;
|
||||||
|
using osu.Game.Audio;
|
||||||
using osu.Game.Graphics.Containers;
|
using osu.Game.Graphics.Containers;
|
||||||
|
using osu.Game.Skinning;
|
||||||
|
|
||||||
namespace osu.Game.Screens.Menu
|
namespace osu.Game.Screens.Menu
|
||||||
{
|
{
|
||||||
@ -16,11 +17,14 @@ namespace osu.Game.Screens.Menu
|
|||||||
private StarFountain leftFountain = null!;
|
private StarFountain leftFountain = null!;
|
||||||
private StarFountain rightFountain = null!;
|
private StarFountain rightFountain = null!;
|
||||||
|
|
||||||
private Sample? sample;
|
[Resolved]
|
||||||
|
private ISkinSource skin { get; set; } = null!;
|
||||||
|
|
||||||
|
private ISample? sample;
|
||||||
private SampleChannel? sampleChannel;
|
private SampleChannel? sampleChannel;
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(AudioManager audio)
|
private void load()
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both;
|
RelativeSizeAxes = Axes.Both;
|
||||||
|
|
||||||
@ -40,7 +44,7 @@ namespace osu.Game.Screens.Menu
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
sample = audio.Samples.Get(@"Gameplay/fountain-shoot");
|
sample = skin.GetSample(new SampleInfo(@"Gameplay/fountain-shoot"));
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool isTriggered;
|
private bool isTriggered;
|
||||||
|
@ -3,14 +3,15 @@
|
|||||||
|
|
||||||
using System;
|
using System;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Audio;
|
|
||||||
using osu.Framework.Audio.Sample;
|
using osu.Framework.Audio.Sample;
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Utils;
|
using osu.Framework.Utils;
|
||||||
|
using osu.Game.Audio;
|
||||||
using osu.Game.Configuration;
|
using osu.Game.Configuration;
|
||||||
using osu.Game.Graphics.Containers;
|
using osu.Game.Graphics.Containers;
|
||||||
using osu.Game.Screens.Menu;
|
using osu.Game.Screens.Menu;
|
||||||
|
using osu.Game.Skinning;
|
||||||
|
|
||||||
namespace osu.Game.Screens.Play
|
namespace osu.Game.Screens.Play
|
||||||
{
|
{
|
||||||
@ -21,11 +22,14 @@ namespace osu.Game.Screens.Play
|
|||||||
|
|
||||||
private Bindable<bool> kiaiStarFountains = null!;
|
private Bindable<bool> kiaiStarFountains = null!;
|
||||||
|
|
||||||
private Sample? sample;
|
[Resolved]
|
||||||
|
private ISkinSource skin { get; set; } = null!;
|
||||||
|
|
||||||
|
private ISample? sample;
|
||||||
private SampleChannel? sampleChannel;
|
private SampleChannel? sampleChannel;
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(OsuConfigManager config, AudioManager audio)
|
private void load(OsuConfigManager config)
|
||||||
{
|
{
|
||||||
kiaiStarFountains = config.GetBindable<bool>(OsuSetting.StarFountains);
|
kiaiStarFountains = config.GetBindable<bool>(OsuSetting.StarFountains);
|
||||||
|
|
||||||
@ -47,7 +51,7 @@ namespace osu.Game.Screens.Play
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
sample = audio.Samples.Get(@"Gameplay/fountain-shoot");
|
sample = skin.GetSample(new SampleInfo(@"Gameplay/fountain-shoot"));
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool isTriggered;
|
private bool isTriggered;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user