mirror of
https://github.com/ppy/osu.git
synced 2025-01-08 21:03:20 +08:00
Add option to disable star fountain in gameplay
This commit is contained in:
parent
359cb71dd9
commit
df74a177ae
@ -3,8 +3,10 @@
|
|||||||
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
|
using osu.Framework.Bindables;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Utils;
|
using osu.Framework.Utils;
|
||||||
|
using osu.Game.Configuration;
|
||||||
using osu.Game.Screens.Menu;
|
using osu.Game.Screens.Menu;
|
||||||
using osu.Game.Screens.Play;
|
using osu.Game.Screens.Play;
|
||||||
|
|
||||||
@ -73,5 +75,57 @@ namespace osu.Game.Tests.Visual.Menus
|
|||||||
((StarFountain)Children[1]).Shoot(-1);
|
((StarFountain)Children[1]).Shoot(-1);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void TestGameplayKiaiStarToggle()
|
||||||
|
{
|
||||||
|
Bindable<bool> kiaiStarEffectsEnabled = null!;
|
||||||
|
|
||||||
|
AddStep("load configuration", () =>
|
||||||
|
{
|
||||||
|
var config = new OsuConfigManager(LocalStorage);
|
||||||
|
kiaiStarEffectsEnabled = config.GetBindable<bool>(OsuSetting.KiaiStarFountain);
|
||||||
|
});
|
||||||
|
|
||||||
|
AddStep("make fountains", () =>
|
||||||
|
{
|
||||||
|
Children = new Drawable[]
|
||||||
|
{
|
||||||
|
new KiaiGameplayFountains.GameplayStarFountain
|
||||||
|
{
|
||||||
|
Anchor = Anchor.BottomLeft,
|
||||||
|
Origin = Anchor.BottomLeft,
|
||||||
|
X = 75,
|
||||||
|
},
|
||||||
|
new KiaiGameplayFountains.GameplayStarFountain
|
||||||
|
{
|
||||||
|
Anchor = Anchor.BottomRight,
|
||||||
|
Origin = Anchor.BottomRight,
|
||||||
|
X = -75,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
AddStep("enable KiaiStarEffects", () => kiaiStarEffectsEnabled.Value = true);
|
||||||
|
AddRepeatStep("activate fountains (enabled)", () =>
|
||||||
|
{
|
||||||
|
((KiaiGameplayFountains.GameplayStarFountain)Children[0]).Shoot(1);
|
||||||
|
((KiaiGameplayFountains.GameplayStarFountain)Children[1]).Shoot(-1);
|
||||||
|
}, 100);
|
||||||
|
|
||||||
|
AddStep("disable KiaiStarEffects", () => kiaiStarEffectsEnabled.Value = false);
|
||||||
|
AddRepeatStep("attempt to activate fountains (disabled)", () =>
|
||||||
|
{
|
||||||
|
((KiaiGameplayFountains.GameplayStarFountain)Children[0]).Shoot(1);
|
||||||
|
((KiaiGameplayFountains.GameplayStarFountain)Children[1]).Shoot(-1);
|
||||||
|
}, 100);
|
||||||
|
|
||||||
|
AddStep("re-enable KiaiStarEffects", () => kiaiStarEffectsEnabled.Value = true);
|
||||||
|
AddRepeatStep("activate fountains (re-enabled)", () =>
|
||||||
|
{
|
||||||
|
((KiaiGameplayFountains.GameplayStarFountain)Children[0]).Shoot(1);
|
||||||
|
((KiaiGameplayFountains.GameplayStarFountain)Children[1]).Shoot(-1);
|
||||||
|
}, 100);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -138,6 +138,7 @@ namespace osu.Game.Configuration
|
|||||||
SetDefault(OsuSetting.LightenDuringBreaks, true);
|
SetDefault(OsuSetting.LightenDuringBreaks, true);
|
||||||
|
|
||||||
SetDefault(OsuSetting.HitLighting, true);
|
SetDefault(OsuSetting.HitLighting, true);
|
||||||
|
SetDefault(OsuSetting.KiaiStarFountain, true);
|
||||||
|
|
||||||
SetDefault(OsuSetting.HUDVisibilityMode, HUDVisibilityMode.Always);
|
SetDefault(OsuSetting.HUDVisibilityMode, HUDVisibilityMode.Always);
|
||||||
SetDefault(OsuSetting.ShowHealthDisplayWhenCantFail, true);
|
SetDefault(OsuSetting.ShowHealthDisplayWhenCantFail, true);
|
||||||
@ -414,6 +415,7 @@ namespace osu.Game.Configuration
|
|||||||
NotifyOnPrivateMessage,
|
NotifyOnPrivateMessage,
|
||||||
UIHoldActivationDelay,
|
UIHoldActivationDelay,
|
||||||
HitLighting,
|
HitLighting,
|
||||||
|
KiaiStarFountain,
|
||||||
MenuBackgroundSource,
|
MenuBackgroundSource,
|
||||||
GameplayDisableWinKey,
|
GameplayDisableWinKey,
|
||||||
SeasonalBackgroundMode,
|
SeasonalBackgroundMode,
|
||||||
|
@ -74,6 +74,11 @@ namespace osu.Game.Localisation
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public static LocalisableString FadePlayfieldWhenHealthLow => new TranslatableString(getKey(@"fade_playfield_when_health_low"), @"Fade playfield to red when health is low");
|
public static LocalisableString FadePlayfieldWhenHealthLow => new TranslatableString(getKey(@"fade_playfield_when_health_low"), @"Fade playfield to red when health is low");
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// "Star fountain during kiai time"
|
||||||
|
/// </summary>
|
||||||
|
public static LocalisableString KiaiStarFountain => new TranslatableString(getKey(@"star_fountain_during_kiai_time"), @"Star fountain during kiai time");
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// "Always show key overlay"
|
/// "Always show key overlay"
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -31,6 +31,11 @@ namespace osu.Game.Overlays.Settings.Sections.Gameplay
|
|||||||
LabelText = GraphicsSettingsStrings.HitLighting,
|
LabelText = GraphicsSettingsStrings.HitLighting,
|
||||||
Current = config.GetBindable<bool>(OsuSetting.HitLighting)
|
Current = config.GetBindable<bool>(OsuSetting.HitLighting)
|
||||||
},
|
},
|
||||||
|
new SettingsCheckbox
|
||||||
|
{
|
||||||
|
LabelText = GameplaySettingsStrings.KiaiStarFountain,
|
||||||
|
Current = config.GetBindable<bool>(OsuSetting.KiaiStarFountain)
|
||||||
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,8 +5,10 @@
|
|||||||
using System;
|
using System;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Audio.Track;
|
using osu.Framework.Audio.Track;
|
||||||
|
using osu.Framework.Bindables;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Utils;
|
using osu.Framework.Utils;
|
||||||
|
using osu.Game.Configuration;
|
||||||
using osu.Game.Beatmaps.ControlPoints;
|
using osu.Game.Beatmaps.ControlPoints;
|
||||||
using osu.Game.Graphics.Containers;
|
using osu.Game.Graphics.Containers;
|
||||||
using osu.Game.Screens.Menu;
|
using osu.Game.Screens.Menu;
|
||||||
@ -18,9 +20,13 @@ namespace osu.Game.Screens.Play
|
|||||||
private StarFountain leftFountain = null!;
|
private StarFountain leftFountain = null!;
|
||||||
private StarFountain rightFountain = null!;
|
private StarFountain rightFountain = null!;
|
||||||
|
|
||||||
|
private Bindable<bool> kiaiStarEffectsEnabled = null!;
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load()
|
private void load(OsuConfigManager config)
|
||||||
{
|
{
|
||||||
|
kiaiStarEffectsEnabled = config.GetBindable<bool>(OsuSetting.KiaiStarFountain);
|
||||||
|
|
||||||
RelativeSizeAxes = Axes.Both;
|
RelativeSizeAxes = Axes.Both;
|
||||||
|
|
||||||
Children = new[]
|
Children = new[]
|
||||||
@ -48,6 +54,12 @@ namespace osu.Game.Screens.Play
|
|||||||
{
|
{
|
||||||
base.OnNewBeat(beatIndex, timingPoint, effectPoint, amplitudes);
|
base.OnNewBeat(beatIndex, timingPoint, effectPoint, amplitudes);
|
||||||
|
|
||||||
|
if (!kiaiStarEffectsEnabled.Value)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (!kiaiStarEffectsEnabled.Value)
|
||||||
|
return;
|
||||||
|
|
||||||
if (effectPoint.KiaiMode && !isTriggered)
|
if (effectPoint.KiaiMode && !isTriggered)
|
||||||
{
|
{
|
||||||
bool isNearEffectPoint = Math.Abs(BeatSyncSource.Clock.CurrentTime - effectPoint.Time) < 500;
|
bool isNearEffectPoint = Math.Abs(BeatSyncSource.Clock.CurrentTime - effectPoint.Time) < 500;
|
||||||
@ -76,6 +88,8 @@ namespace osu.Game.Screens.Play
|
|||||||
{
|
{
|
||||||
protected override double ShootDuration => 400;
|
protected override double ShootDuration => 400;
|
||||||
|
|
||||||
|
private readonly Bindable<bool> kiaiStarEffectsEnabled = new Bindable<bool>();
|
||||||
|
|
||||||
public GameplayStarFountainSpewer()
|
public GameplayStarFountainSpewer()
|
||||||
: base(perSecond: 180)
|
: base(perSecond: 180)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user